Explorar el Código

verison: 1.0.0

Your Name hace 2 años
commit
8558f6a72f
Se han modificado 83 ficheros con 1222 adiciones y 0 borrados
  1. 42 0
      .gitlab-ci.yml
  2. 7 0
      Dockerfile.gsd_cnstream
  3. 93 0
      README.md
  4. 30 0
      check_tacks/check_network.sh
  5. 10 0
      check_tacks/check_rinetd.sh
  6. 42 0
      check_tacks/check_rtsp.sh
  7. 89 0
      docker-compose.yml
  8. 7 0
      network/start_openvpn.sh
  9. BIN
      source/CNStream/bin/main
  10. 55 0
      source/CNStream/config/detection_config.json
  11. 56 0
      source/CNStream/config/detection_test.json
  12. 1 0
      source/CNStream/config/file.list_video_test
  13. 1 0
      source/CNStream/config/files.list_video_rtsp
  14. 23 0
      source/CNStream/configs/InfineFilter.json
  15. 28 0
      source/CNStream/configs/coco_pose_mlu220.json
  16. 28 0
      source/CNStream/configs/coco_pose_mlu270.json
  17. 12 0
      source/CNStream/configs/decode_config.json
  18. 12 0
      source/CNStream/configs/kafka.json
  19. 34 0
      source/CNStream/configs/license_plate_detection_and_recognition_mlu220.json
  20. 34 0
      source/CNStream/configs/license_plate_detection_and_recognition_mlu270.json
  21. 10 0
      source/CNStream/configs/locus.json
  22. 13 0
      source/CNStream/configs/object_tracking_mlu220.json
  23. 12 0
      source/CNStream/configs/object_tracking_mlu270.json
  24. 11 0
      source/CNStream/configs/osd_configs/osd_label_map.json
  25. 10 0
      source/CNStream/configs/osd_configs/osd_synset_words.json
  26. 17 0
      source/CNStream/configs/recorder.json
  27. 14 0
      source/CNStream/configs/resnet_classification_mlu220.json
  28. 15 0
      source/CNStream/configs/resnet_classification_mlu270.json
  29. 15 0
      source/CNStream/configs/sinker_configs/display.json
  30. 13 0
      source/CNStream/configs/sinker_configs/encode_jpeg.json
  31. 19 0
      source/CNStream/configs/sinker_configs/encode_video.json
  32. 12 0
      source/CNStream/configs/sinker_configs/kafka.json
  33. 17 0
      source/CNStream/configs/sinker_configs/rtsp.json
  34. 12 0
      source/CNStream/configs/udp.json
  35. 43 0
      source/CNStream/configs/vehicle_cts_mlu270.json
  36. 17 0
      source/CNStream/configs/yolov3_object_detection_mlu220.json
  37. 17 0
      source/CNStream/configs/yolov3_object_detection_mlu270.json
  38. 23 0
      source/CNStream/configs/yolov5_object_detection_mlu220.json
  39. 22 0
      source/CNStream/configs/yolov5_object_detection_mlu270.json
  40. 24 0
      source/CNStream/configs/yolov5_object_test.json
  41. 2 0
      source/CNStream/data/models/label_map_gsd.txt
  42. BIN
      source/CNStream/data/models/yolov5_4c4b_rgb_220.cambricon
  43. BIN
      source/CNStream/data/models/yolov5m_best6_b_b_insect_s3_int8_0828_4b_4c.cambricon
  44. BIN
      source/CNStream/data/videos/cars.mp4
  45. BIN
      source/CNStream/data/wqy_zenhei.ttf
  46. BIN
      source/CNStream/lib/libBasicUsageEnvironment.so
  47. BIN
      source/CNStream/lib/libBasicUsageEnvironment.so.1
  48. BIN
      source/CNStream/lib/libBasicUsageEnvironment.so.1.0.1
  49. BIN
      source/CNStream/lib/libUsageEnvironment.so
  50. BIN
      source/CNStream/lib/libUsageEnvironment.so.3
  51. BIN
      source/CNStream/lib/libUsageEnvironment.so.3.1.0
  52. BIN
      source/CNStream/lib/libcnis.so
  53. BIN
      source/CNStream/lib/libcnis.so.1
  54. BIN
      source/CNStream/lib/libcnis.so.1.0.0
  55. BIN
      source/CNStream/lib/libcnstream_core.so
  56. BIN
      source/CNStream/lib/libcnstream_core.so.6.1.0
  57. BIN
      source/CNStream/lib/libcnstream_va.so
  58. BIN
      source/CNStream/lib/libcnstream_va.so.6.1.0
  59. BIN
      source/CNStream/lib/libeasydk.so
  60. BIN
      source/CNStream/lib/libeasydk.so.2
  61. BIN
      source/CNStream/lib/libeasydk.so.2.6.0
  62. BIN
      source/CNStream/lib/libgroupsock.so
  63. BIN
      source/CNStream/lib/libgroupsock.so.8
  64. BIN
      source/CNStream/lib/libgroupsock.so.8.2.4
  65. BIN
      source/CNStream/lib/libliveMedia.so
  66. BIN
      source/CNStream/lib/libliveMedia.so.81
  67. BIN
      source/CNStream/lib/libliveMedia.so.81.0.5
  68. BIN
      source/CNStream/lib/libyuv.a
  69. 33 0
      source/CNStream/start_CNStream.sh
  70. BIN
      source/gsd/bin/gsd
  71. 37 0
      source/gsd/config/config.ini
  72. 74 0
      source/gsd/db/gsdDB.sql
  73. BIN
      source/gsd/lib/libgsd_core.so
  74. BIN
      source/gsd/lib/libgsd_modules.so
  75. BIN
      source/gsd/lib/libgsd_plugins.so
  76. 16 0
      source/gsd/run.sh
  77. 22 0
      start/start_System.sh
  78. 12 0
      stop/reboot_System.sh
  79. 12 0
      stop/stop_System.sh
  80. BIN
      tools/Pder
  81. 16 0
      tools/clean.sh
  82. 57 0
      tools/deploy.sh
  83. 1 0
      version

+ 42 - 0
.gitlab-ci.yml

@@ -0,0 +1,42 @@
+# This file is a template, and might need editing before it works on your project.
+# To contribute improvements to CI/CD templates, please follow the Development guide at:
+# https://docs.gitlab.com/ee/development/cicd/templates.html
+# This specific template is located at:
+# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
+
+# This is a sample GitLab CI/CD configuration file that should run without any modifications.
+# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts,
+# it uses echo commands to simulate the pipeline execution.
+#
+# A pipeline is composed of independent jobs that run scripts, grouped into stages.
+# Stages run in sequential order, but jobs within stages run in parallel.
+#
+# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
+
+stages:          # List of stages for jobs, and their order of execution
+  - Test
+  - Deploy
+
+Test-job:      # This job runs in the deploy stage.
+  stage: Test  # It only runs when *both* jobs in the test stage complete successfully.
+  script:
+    - echo "Testing application..."
+    - docker-compose up -d 
+    - echo "Application successfully Deployed."
+  tags:
+    - test
+  only:
+    - triggers
+
+    
+
+Deploy-job:
+  stage: Deploy
+  script:
+    - echo "Deploy application..."
+    - docker-compose up -d
+    - echo "Application successfully Deployed."
+  only:
+    - tags
+  tags:
+    - Deploy

+ 7 - 0
Dockerfile.gsd_cnstream

@@ -0,0 +1,7 @@
+ARG DOCKERIP
+
+FROM $DOCKERIP/gsd/gsd_cnstream:latest
+
+MAINTAINER "lishengyin"<lishengyin@sz-sunwin.com>
+
+COPY ./source/CNStream/lib/* /lib/

+ 93 - 0
README.md

@@ -0,0 +1,93 @@
+# GSD
+***
+
+机场驱鸟系统部署文件
+
+# Release Notes
+
+## gsd  (Version 3.5.3)
+**新增功能及功能变更**
+
+- 后处理端新增常规过滤器,功能为长期的同坐标物体,降低误识别
+- cnstream新增过滤器,功能为过滤指定ID,过滤夜晚发光误识别
+- 新增mysql数据库
+- 修复Kafka的接收bug、过滤器bug等已知bug。
+- 优化软件系统稳定
+- 完善各类数据的管理机制,避免数据长期堆积
+
+**废用功能**
+- 废除sqlite数据库依赖
+
+## gsd  (Version 3.4.0)
+
+**新增功能及功能变更**
+
+- 算法框架更新为CNStream(Version 6.2.0),增加yolov5识别算法的支持
+- 算法结果改为采用kafka进行统一管理,实现推理结果持久化管理,实现软件内部进程间解耦
+- 设备引入S/N码作为设备唯一标识
+- 新增加派尔云驱鸟设备控制协议
+- 新增zookeeper、kafka容器
+- 采用harbor + gitlab的部署方案,实现设备的内部软件版本管理,如版本记录、版本更新、版本回滚等功能
+- 软件配置文件采用spug云上统一管理
+- 新增InfineFilter模块,对夜间算法结果进行二次处理,降低夜间误识别率
+
+**废用功能**
+
+- 移除ModuleIPC内置模块
+
+
+## gsd (Version 2.4.0)
+
+**新增功能及功能变更**
+
+- 重新优化应用层程序逻辑
+
+- 算法框架更新为CNStream(Version 5.3.0),增加yolov4识别算法的支持
+
+- 优化算法程序,降低加速卡负载压力,降低发热量、提升夏日高温下算法程序稳定性。
+
+- 新增兰州机场驱鸟设备控制协议
+
+- 运维层面引入spug自动化运维框架,实现对上云设备的自动化监控、管理,增加自检任务,如遇异常,自动通过微信、钉钉等通知运维人员第一时间维护。
+
+
+
+## gsd (Version 2.2.0)
+
+**新增功能及功能变更**
+
+- 算法程序增加识别视频保存、追踪、轨迹模块
+- 系统部署引入docker容器化技术
+- 新增nginx容器,负责视频文件传输
+- 新增openvpn自检脚本,避免软件在网络波动情况下VPN异常断开
+
+
+## gsd  (Version 2.0.0)
+
+### 新增功能及功能变更
+
+- 舍弃ROS框架依赖,提高软件稳定性
+- 提高视频流的实时性
+- 优化算法程序稳定性
+- 新增铭航驱鸟主板2.0的控制协议
+
+### 废用功能
+
+- 舍弃ROS框架
+- 舍弃srs流媒体框架
+
+
+
+
+
+
+
+  
+
+
+
+
+
+
+
+

+ 30 - 0
check_tacks/check_network.sh

@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# 网络自检任务
+ip="10.8.0.1"
+
+source /etc/profile
+
+date="`date '+%Y-%m-%d %H:%M:%S'`"
+lost_rate=`ping -c 8 -w 8 $ip | grep 'packet loss' \
+| awk -F'packet loss' '{ print $1 }' \
+| awk '{ print $NF }' | sed 's/%//g'`
+
+if [ $lost_rate -eq 0 ]
+then
+	echo "network ok"
+elif [ $lost_rate -le 100 ]
+then
+	echo "network error"
+	echo "123456" | sudo -S killall openvpn
+	if [ ! -d "/opt/datas/log/network" ]; then
+		mkdir -p /opt/datas/log/network
+	fi
+	echo "network_error $date $ip" >>/opt/datas/log/network/network_error.log
+	echo "123456" | sudo -S service network-manager restart
+	sleep 4
+	cd /opt/GSD/network/
+	./start_openvpn.sh
+fi
+
+

+ 10 - 0
check_tacks/check_rinetd.sh

@@ -0,0 +1,10 @@
+#!/bin/sh
+count=`ps -fe |grep "rinetd" | grep -v "grep" | wc -l`
+if [ $count -lt 1 ]; then
+    rinetd -c /etc/rinetd.conf
+    echo "restart rinetd"
+    exit -1
+else
+    echo "yes"
+    exit 0
+fi

+ 42 - 0
check_tacks/check_rtsp.sh

@@ -0,0 +1,42 @@
+#!/bin/bash
+
+source /etc/profile
+
+# 网络摄像头自检
+ip="$rtspip"
+
+date="`date '+%Y-%m-%d %H:%M:%S'`"
+
+lost_rate=`ping -c 8 -w 8 $ip | grep 'packet loss' \
+| awk -F'packet loss' '{ print $1 }' \
+| awk '{ print $NF }' | sed 's/%//g'`
+
+if [ ! -d "/opt/datas/log/network" ]; then
+    mkdir -p /opt/datas/log/network
+fi
+
+if [ $lost_rate -eq 0 ]
+then
+    echo "rtsp ok"
+    ps -ef | grep "birdy" | grep -v "grep"
+    if [ $? -eq 1 ]
+    then
+        echo "Rtsp服务恢复,重启服务! $date" >> /opt/datas/log/network/check_rtsp.log
+        cd /opt/GSD/
+        docker-compose up -d
+    else
+	    echo "服务正常 $date" >> /opt/datas/log/network/check_rtsp.log
+    fi
+elif [ $lost_rate -le 100 ]
+then
+    echo "rtsp error"
+    ps -ef | grep "birdy" | grep -v "grep"
+    if [ $? -eq 1 ]
+    then
+        echo "rtsp服务异常,等待服务恢复 $date" >> /opt/datas/log/network/check_rtsp.log
+    else
+        cd /opt/GSD/
+        docker-compose stop
+        echo "rtsp摄像头异常,等待摄像头服务正常后重启服务! $date" >> /opt/datas/log/network/check_rtsp.log
+    fi
+fi

+ 89 - 0
docker-compose.yml

@@ -0,0 +1,89 @@
+version: '2'
+
+services:
+  cnstream:
+    image: $dockerio/gsd/gsd_cnstream:latest
+    volumes: 
+      - /tmp/.X11-unix:/tmp/.X11-unix
+      - /dev:/dev
+      - /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime
+      - /opt/datas/video:/home/GSD/video
+      - $PWD/source/CNStream/:/CNStream/
+      - /etc/gsd:/etc/gsd
+      - /opt/datas/log:/home/GSD/log
+    network_mode: "host"
+    privileged: true
+    tty: true
+    environment: 
+      - DISPLAY:$DISPLAY
+    ipc: "host"
+    pid: "host"
+    depends_on: 
+      - birdy
+    command: /bin/bash -c "sleep 15 && cp /CNStream/lib/* /usr/local/lib/ && cd /CNStream/ && ./start_CNStream.sh"
+
+  birdy:
+    image: $dockerio/gsd/gsd_birdy:latest
+    network_mode: "host"
+    privileged: true
+    tty: true
+    volumes:
+      - /tmp/.X11-unix:/tmp/.X11-unix
+      - /dev/:/dev
+      - $PWD/source/gsd/:/gsd
+      - /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime
+      - /etc/gsd:/etc/gsd
+      - /opt/datas/log:/home/GSD/log
+      - /opt/datas/video:/home/GSD/video
+      - /etc/docker/:/etc/docker/
+      - /etc/profile.d/:/etc/profile.d/
+    ipc: "host"
+    pid: "host"
+    depends_on:
+      - kafka1
+      - gsddb
+    command: /bin/bash -c "sleep 15 && cp /gsd/lib/* /usr/local/lib/ && cd /gsd && ./run.sh"
+
+  gsddb:
+    image: $dockerio/gsd/mysql:5.7
+    environment:
+      TZ: Asia/Shanghai
+      MYSQL_ROOT_PASSWORD: 'sunwin2022'
+    ports: 
+      - "3306:3306"
+    volumes:
+      - $PWD/source/gsd/db/:/docker-entrypoint-initdb.d
+      - /var/lib/mysql:/var/lib/mysql
+      
+  nginx:
+    image: $dockerio/gsd/gsd_nginx:latest
+    privileged: true
+    ports: 
+      - "80:80"
+    volumes: 
+      - /opt/datas/video:/home/GSD/video
+      - /opt/datas/log:/home/GSD/log
+
+  zoo1:
+    image: $dockerio/gsd/gsd_zookeeper:latest
+    restart: unless-stopped
+    hostname: zoo1
+    ports:
+      - "2181:2181"
+    # container_name: zookeeper
+    
+  # kafka version: 1.1.0
+  # scala version: 2.12
+  kafka1:
+    image: $dockerio/gsd/gsd_kafka:latest
+    ports:
+      - "9092:9092"
+    environment:
+      KAFKA_ADVERTISED_HOST_NAME: localhost
+      KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181"
+      KAFKA_BROKER_ID: 1
+      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
+      KAFKA_CREATE_TOPICS: "stream-in:1:1,stream-out:1:1"
+    depends_on:
+      - zoo1
+    # container_name: kafka

+ 7 - 0
network/start_openvpn.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+cd /etc/openvpn
+
+nohup echo "123456" | sudo -S openvpn client.ovpn &
+
+exit 0

BIN
source/CNStream/bin/main


+ 55 - 0
source/CNStream/config/detection_config.json

@@ -0,0 +1,55 @@
+{
+  "profiler_config" : {
+    "enable_profiling" : true,
+    "enable_tracing" : true
+  },
+
+  "subgraph:decode" : {
+    "config_path" : "../configs/decode_config.json",
+    "next_modules" : ["subgraph:object_detection"]
+  },
+
+  "subgraph:object_detection" : {
+    "config_path" : "../configs/yolov5_object_detection_mlu220.json",
+    "next_modules" : ["subgraph:object_InfineFilter"]
+  },
+
+  "subgraph:object_InfineFilter" : {
+    "config_path" : "../configs/InfineFilter.json",
+    "next_modules" : ["subgraph:udp"]
+  },
+
+  // "subgraph:object_tracking" : {
+  //   "config_path" : "../configs/object_tracking_mlu220.json",
+  //   "next_modules" : ["subgraph:udp"]
+  // },
+
+  "subgraph:udp" : {
+    "config_path" : "../configs/udp.json",
+    "next_modules" : ["subgraph:osd_label_map_coco"]
+  },
+
+  "subgraph:osd_label_map_coco" : {
+    "config_path" : "../configs/osd_configs/osd_label_map.json",
+    "next_modules" : ["subgraph:locus"]
+  },
+
+  "subgraph:locus" : {
+    "config_path" : "../configs/locus.json",
+    "next_modules" : ["subgraph:object_recorder"]
+  },
+
+  "subgraph:object_recorder" : {
+    "config_path" : "../configs/recorder.json",
+    "next_modules" : ["subgraph:kafka"]
+  },
+
+  "subgraph:kafka" : {
+    "config_path" : "../configs/kafka.json",
+    "next_modules" : ["subgraph:sinker"]
+  },
+
+  "subgraph:sinker" : {
+    "config_path" : "../configs/sinker_configs/rtsp.json"
+  }
+}

+ 56 - 0
source/CNStream/config/detection_test.json

@@ -0,0 +1,56 @@
+{
+    "profiler_config" : {
+      "enable_profiling" : true,
+      "enable_tracing" : false
+    },
+  
+    "subgraph:decode" : {
+      "config_path" : "../configs/decode_config.json",
+      "next_modules" : ["subgraph:object_detection"]
+    },
+  
+    "subgraph:object_detection" : {
+      "config_path" : "../configs/yolov5_object_test.json",
+      "next_modules" : ["subgraph:object_InfineFilter"]
+    },
+    
+    "subgraph:object_InfineFilter" : {
+      "config_path" : "../configs/InfineFilter.json",
+      "next_modules" : ["subgraph:object_tracking"]
+    },
+
+    "subgraph:object_tracking" : {
+      "config_path" : "../configs/object_tracking_mlu220.json",
+      "next_modules" : ["subgraph:udp"]
+    },
+  
+    "subgraph:udp" : {
+      "config_path" : "../configs/udp.json",
+      "next_modules" : ["subgraph:osd_label_map_coco"]
+    },
+  
+    "subgraph:osd_label_map_coco" : {
+      "config_path" : "../configs/osd_configs/osd_label_map.json",
+      "next_modules" : ["subgraph:locus"]
+    },
+  
+    "subgraph:locus" : {
+      "config_path" : "../configs/locus.json",
+      "next_modules" : ["subgraph:object_recorder"]
+    },
+  
+    "subgraph:object_recorder" : {
+      "config_path" : "../configs/recorder.json",
+      "next_modules" : ["subgraph:kafka"]
+    },
+  
+    "subgraph:kafka" : {
+      "config_path" : "../configs/kafka.json",
+      "next_modules" : ["subgraph:sinker"]
+    },
+  
+    "subgraph:sinker" : {
+      "config_path" : "../configs/sinker_configs/rtsp.json"
+    }
+  }
+  

+ 1 - 0
source/CNStream/config/file.list_video_test

@@ -0,0 +1 @@
+/CNStream/data/videos/cars.mp4

+ 1 - 0
source/CNStream/config/files.list_video_rtsp

@@ -0,0 +1 @@
+rtsp://admin:sunwin2021@192.168.1.130:554/h264/ch1/main/av_stream

+ 23 - 0
source/CNStream/configs/InfineFilter.json

@@ -0,0 +1,23 @@
+{
+    "InfineFilter" : {
+        "class_name" : "cnstream::InfineFilter",
+        "parallelism" : 1,
+        "max_input_queue_size" : 20,
+        "custom_params" : {
+            "labels" : {
+                "label":["0"]
+            },
+            "AlienLabels":{
+                "label":["2"]
+            },
+            "Proportion_th": 0.5,
+            "files": "/home/GSD/video/filter/",
+            "saveFilterResult" : "true",
+            "Night_Filter": "true",
+            "lock_period":{
+                "start": 20,
+                "end": 4
+            }
+        }
+    }
+}

+ 28 - 0
source/CNStream/configs/coco_pose_mlu220.json

@@ -0,0 +1,28 @@
+{
+  "body_pose" : {
+    "class_name" : "cnstream::Inferencer",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "next_modules" : ["pose_osd"],
+    "custom_params" : {
+      "model_path" : "../../../data/models/coco_pose_b4c4_bgra_mlu220.cambricon",
+      "func_name" : "subnet0",
+      "postproc_name" : "PostprocCOCOPose",
+      "model_input_pixel_format" : "BGRA32",
+      "keep_aspect_ratio" : true,
+      "data_order" : "NCHW",
+      "batching_timeout" : 100,
+      "device_id" : 0
+    }
+  },
+
+  "pose_osd" : {
+    "class_name" : "cns_openpose::PoseOsd",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "nkeypoints" : 18,  // coco has 18 keypoints, ignore background
+      "nlimbs" : 19  // coco has 19 limbs
+    }
+  }
+}

+ 28 - 0
source/CNStream/configs/coco_pose_mlu270.json

@@ -0,0 +1,28 @@
+{
+  "body_pose" : {
+    "class_name" : "cnstream::Inferencer",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "next_modules" : ["pose_osd"],
+    "custom_params" : {
+      "model_path" : "../../../data/models/coco_pose_b4c4_bgra_mlu270.cambricon",
+      "func_name" : "subnet0",
+      "postproc_name" : "PostprocCOCOPose",
+      "model_input_pixel_format" : "BGRA32",
+      "keep_aspect_ratio" : true,
+      "data_order" : "NCHW",
+      "batching_timeout" : 100,
+      "device_id" : 0
+    }
+  },
+
+  "pose_osd" : {
+    "class_name" : "cns_openpose::PoseOsd",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "nkeypoints" : 18,  // coco has 18 keypoints, ignore background
+      "nlimbs" : 19  // coco has 19 limbs
+    }
+  }
+}

+ 12 - 0
source/CNStream/configs/decode_config.json

@@ -0,0 +1,12 @@
+{
+  "source" : {
+    "class_name" : "cnstream::DataSource",
+    "custom_params" : {
+      "reuse_cndec_buf" : "true",
+      "output_type" : "mlu",
+      "decoder_type" : "mlu",
+      "output_buf_number" : 20,
+      "device_id" : 0
+    }
+  }
+}

+ 12 - 0
source/CNStream/configs/kafka.json

@@ -0,0 +1,12 @@
+{
+    "kafka_producer" : {
+        "class_name" : "cnstream::Kafka",
+        "parallelism" : 1,
+        "max_input_queue_size" : 20,
+        "custom_params" : {
+            "handler" : "DefaultKafkaHandler",
+            "topic" : "CnstreamData",
+            "brokers" : "localhost:9092"
+        }
+    }
+}

+ 34 - 0
source/CNStream/configs/license_plate_detection_and_recognition_mlu220.json

@@ -0,0 +1,34 @@
+{
+  "plate_detector" : {
+    "class_name" : "cnstream::Inferencer",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "next_modules" : ["plate_ocr"],
+    "custom_params" : {
+      "model_path" : "../../../data/models/mobilenet_ssd_plate_detection_b4c4_bgra_mlu220.cambricon",
+      "func_name" : "subnet0",
+      "object_infer" : true,
+      "obj_filter_name" : "VehicleFilter",
+      "postproc_name" : "PostprocMSSDPlateDetection",
+      "model_input_pixel_format" : "BGRA32",
+      "threshold" : 0.6,
+      "device_id" : 0
+    }
+  },
+
+  "plate_ocr" : {
+    "class_name" : "cnstream::Inferencer",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "model_path" : "../../../data/models/lprnet_b4c4_bgra_mlu220.cambricon",
+      "func_name" : "subnet0",
+      "object_infer" : true,
+      "obj_filter_name" : "PlateFilter",
+      "preproc_name" : "PreprocLprnet",
+      "postproc_name" : "PostprocLprnet",
+      "threshold" : 0.8,
+      "device_id" : 0
+    }
+  }
+}

+ 34 - 0
source/CNStream/configs/license_plate_detection_and_recognition_mlu270.json

@@ -0,0 +1,34 @@
+{
+  "plate_detector" : {
+    "class_name" : "cnstream::Inferencer",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "next_modules" : ["plate_ocr"],
+    "custom_params" : {
+      "model_path" : "../../../data/models/mobilenet_ssd_plate_detection_b4c4_bgra_mlu270.cambricon",
+      "func_name" : "subnet0",
+      "object_infer" : true,
+      "obj_filter_name" : "VehicleFilter",
+      "postproc_name" : "PostprocMSSDPlateDetection",
+      "model_input_pixel_format" : "BGRA32",
+      "threshold" : 0.6,
+      "device_id" : 0
+    }
+  },
+
+  "plate_ocr" : {
+    "class_name" : "cnstream::Inferencer",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "model_path" : "../../../data/models/lprnet_b4c4_bgra_mlu270.cambricon",
+      "func_name" : "subnet0",
+      "object_infer" : true,
+      "obj_filter_name" : "PlateFilter",
+      "preproc_name" : "PreprocLprnet",
+      "postproc_name" : "PostprocLprnet",
+      "threshold" : 0.8,
+      "device_id" : 0
+    }
+  }
+}

+ 10 - 0
source/CNStream/configs/locus.json

@@ -0,0 +1,10 @@
+{
+    "locus":{
+        "class_name": "cnstream::locus",
+        "parallelism" : 1,
+        "max_input_queue_size" : 20,
+        "show_perf_info" : true,
+        "custom_params" : {
+        }
+    }
+}

+ 13 - 0
source/CNStream/configs/object_tracking_mlu220.json

@@ -0,0 +1,13 @@
+{
+  "tracker" : {
+    "class_name" : "cnstream::Tracker",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "model_path" : "../data/models/feature_extract_for_tracker_b4c4_argb_mlu220.cambricon",
+      "max_cosine_distance": "0.06",
+      "track_name": "IoUMatch",
+      "device_id" : 0
+    }
+  }
+}

+ 12 - 0
source/CNStream/configs/object_tracking_mlu270.json

@@ -0,0 +1,12 @@
+{
+  "tracker" : {
+    "class_name" : "cnstream::Tracker",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "model_path" : "../../../data/models/feature_extract_for_tracker_b4c4_argb_mlu270.cambricon",
+      "max_cosine_distance": "0.06",
+      "device_id" : 0
+    }
+  }
+}

+ 11 - 0
source/CNStream/configs/osd_configs/osd_label_map.json

@@ -0,0 +1,11 @@
+{
+  "osd" : {
+    "class_name" : "cnstream::Osd",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "label_path" : "../../data/models/label_map_gsd.txt"
+    }
+  }
+}
+

+ 10 - 0
source/CNStream/configs/osd_configs/osd_synset_words.json

@@ -0,0 +1,10 @@
+{
+  "osd" : {
+    "class_name" : "cnstream::Osd",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "label_path" : "../../../../data/models/synset_words.txt" 
+    }
+  }
+}

+ 17 - 0
source/CNStream/configs/recorder.json

@@ -0,0 +1,17 @@
+{
+    "recorder":{
+        "class_name": "cnstream::Recorder",
+        "parallelism" : 1,
+        "max_input_queue_size" : 20,
+        "show_perf_info" : true,
+        "custom_params" : {
+          "dst_width": 960,
+          "dst_height": 540,
+          "frame_rate" : 20,
+          "videoMaxTime":120,
+          "cacheTime": 3,
+          "enc_type" : ".mp4",
+          "outputDir":"/home/GSD/video/"
+        }
+    }
+}

+ 14 - 0
source/CNStream/configs/resnet_classification_mlu220.json

@@ -0,0 +1,14 @@
+{
+  "classifier" : {
+    "class_name" : "cnstream::Inferencer",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "model_path" : "../../../data/models/resnet18_b4c4_bgra_mlu220.cambricon",
+      "func_name" : "subnet0",
+      "postproc_name" : "PostprocClassification",
+      "model_input_pixel_format" : "BGRA32",
+      "device_id" : 0
+    }
+  }
+}

+ 15 - 0
source/CNStream/configs/resnet_classification_mlu270.json

@@ -0,0 +1,15 @@
+{
+  "classifier" : {
+    "class_name" : "cnstream::Inferencer",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "model_path" : "../../../data/models/resnet50_b16c16_bgra_mlu270.cambricon",
+      "func_name" : "subnet0",
+      "postproc_name" : "PostprocClassification",
+      "batching_timeout" : 100,
+      "model_input_pixel_format" : "BGRA32",
+      "device_id" : 0
+    }
+  }
+}

+ 15 - 0
source/CNStream/configs/sinker_configs/display.json

@@ -0,0 +1,15 @@
+{
+  "displayer" : {
+    "class_name" : "cnstream::Displayer",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "window-width": 1280,
+      "window-height": 720,
+      "refresh-rate" : 25,
+      "max-channels" : 32,
+      "show" : true,
+      "full-screen" : false
+    }
+  }
+}

+ 13 - 0
source/CNStream/configs/sinker_configs/encode_jpeg.json

@@ -0,0 +1,13 @@
+{
+  "encode" : {
+    "class_name" : "cnstream::Encode",
+    "parallelism" : 1,
+    "max_input_queue_size" : 10,
+    "custom_params" : {
+      "encoder_type" : "cpu",
+      "input_frame" : "cpu",
+      "file_name" : "output/output.jpeg",
+      "device_id": 0
+    }
+  }
+}

+ 19 - 0
source/CNStream/configs/sinker_configs/encode_video.json

@@ -0,0 +1,19 @@
+{
+  "encode" : {
+    "class_name" : "cnstream::Encode",
+    "parallelism" : 1,
+    "max_input_queue_size" : 10,
+    "custom_params" : {
+      "frame_rate" : 20,
+      "encoder_type" : "ffmpeg",
+      "file_name" : "output/output.mp4",
+      "gop_size" : 40,
+      "kbit_rate" : 1000,
+      "view_mode" : "single",
+      "dst_width" : 960,
+      "dst_height": 540,
+      "color_mode" : "bgr",
+      "device_id": 0
+    }
+  }
+}

+ 12 - 0
source/CNStream/configs/sinker_configs/kafka.json

@@ -0,0 +1,12 @@
+{
+  "kafka_producer" : {
+    "class_name" : "cnstream::Kafka",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "handler" : "DefaultKafkaHandler",
+      "topic" : "CnstreamData",
+      "brokers" : "localhost:9092"
+    }
+  }
+}

+ 17 - 0
source/CNStream/configs/sinker_configs/rtsp.json

@@ -0,0 +1,17 @@
+{
+  "rtsp_sink" : {
+    "class_name" : "cnstream::RtspSink",
+    "parallelism" : 4,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "encoder_type" : "mlu",
+      "port" : 8554,
+      "device_id" : 0,
+      "dst_width" : 960,
+      "dst_height": 540
+      // "view_cols": 1,
+      // "view_rows": 2
+      //"bit_rate": 100000
+    }
+  }
+}

+ 12 - 0
source/CNStream/configs/udp.json

@@ -0,0 +1,12 @@
+{
+    "udp":{
+        "class_name": "cnstream::udp",
+        "parallelism" : 1,
+        "max_input_queue_size" : 20,
+        "show_perf_info" : true,
+        "custom_params" : {
+            "sendSockerIP": "127.0.0.1",
+            "sendPort": 7777
+        }
+    }
+}

+ 43 - 0
source/CNStream/configs/vehicle_cts_mlu270.json

@@ -0,0 +1,43 @@
+{
+  // vehicle color type sid recognization
+  "detector" : {
+    "class_name" : "cnstream::Inferencer",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "next_modules" : ["vehicle_cts"],
+    "custom_params" : {
+      "model_path" : "../../../data/models/resnet34_ssd_b16c16_mlu270.cambricon",
+      "func_name" : "subnet0",
+      "postproc_name" : "PostprocSsd",
+      "threshold" : 0.5,
+      "model_input_pixel_format" : "BGRA32",
+      "device_id" : 0
+    }
+  },
+
+  "vehicle_cts" : {
+    "class_name" : "cnstream::Inferencer",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "next_modules" : ["osd"],
+    "custom_params" : {
+      "model_path" : "../../../data/models/vehicle_cts_b4c4_bgra_mlu270.cambricon",
+      "func_name" : "subnet0",
+      "object_infer" : true,  // input with detection objects
+      "obj_filter_name" : "CarFilter",  // filter objects expect vehicles
+      "postproc_name" : "PostprocVehicleCts",
+      "model_input_pixel_format" : "BGRA32",
+      "device_id" : 0
+    }
+  },
+
+  "osd" : {
+    "class_name" : "cnstream::Osd",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "label_path" : "../../../data/models/label_voc.txt",
+      "attr_keys" : "COLOR, TYPE, TOWARDS"
+    }
+  }
+}

+ 17 - 0
source/CNStream/configs/yolov3_object_detection_mlu220.json

@@ -0,0 +1,17 @@
+{
+  "detector" : {
+    "class_name" : "cnstream::Inferencer",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "model_path" : "../../../data/models/gsd_yolov4_608_v1.cambricon",
+      "func_name" : "subnet0",
+      "postproc_name" : "PostprocYolov3",
+      "keep_aspect_ratio" : "true",
+      "threshold" : 0.5,
+      "model_input_pixel_format" : "ARGB32",
+      "batching_timeout" : 100,
+      "device_id" : 0
+    }
+  }
+}

+ 17 - 0
source/CNStream/configs/yolov3_object_detection_mlu270.json

@@ -0,0 +1,17 @@
+{
+  "detector" : {
+    "class_name" : "cnstream::Inferencer",
+    "parallelism" : 1,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "model_path" : "../../../data/models/yolov3_b4c4_argb_mlu270.cambricon",
+      "func_name" : "subnet0",
+      "postproc_name" : "PostprocYolov3",
+      "keep_aspect_ratio" : "true",
+      "threshold" : 0.5,
+      "model_input_pixel_format" : "ARGB32",
+      "batching_timeout" : 100,
+      "device_id" : 0
+    }
+  }
+}

+ 23 - 0
source/CNStream/configs/yolov5_object_detection_mlu220.json

@@ -0,0 +1,23 @@
+{
+  "detector" : {
+    "class_name" : "cnstream::Inferencer2",
+    "parallelism" : 2,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "model_path" : "../data/models/yolov5m_best6_b_b_insect_s3_int8_0828_4b_4c.cambricon",
+      "func_name" : "subnet0",
+      // Uncomment the following 2 lines to use cncv
+      // "preproc_name" : "CNCV",
+      // "normalize" : true,
+      "preproc_name" : "VideoPreprocYolov5",
+      "postproc_name" : "VideoPostprocYolov5",
+      "keep_aspect_ratio" : "true",
+      "model_input_pixel_format" : "RGB24",
+      "batching_timeout" : 50,
+      "threshold" : 0.5,
+      "infer_interval": 6,
+      "engine_num" : 2,
+      "device_id" : 0
+    }
+  }
+}

+ 22 - 0
source/CNStream/configs/yolov5_object_detection_mlu270.json

@@ -0,0 +1,22 @@
+{
+  "detector" : {
+    "class_name" : "cnstream::Inferencer2",
+    "parallelism" : 2,
+    "max_input_queue_size" : 20,
+    "custom_params" : {
+      "model_path" : "../data/models/yolov5_4c4b_rgb_270.cambricon",
+      "func_name" : "subnet0",
+      // Uncomment the following 2 lines to use cncv
+      //"preproc_name" : "CNCV",
+      //"normalize" : true,
+      "preproc_name" : "VideoPreprocYolov5",
+      "postproc_name" : "VideoPostprocYolov5",
+      "keep_aspect_ratio" : "true",
+      "model_input_pixel_format" : "RGB24",
+      "batching_timeout" : 100,
+      "threshold" : 0.6,
+      "engine_num" : 4,
+      "device_id" : 0
+    }
+  }
+}

+ 24 - 0
source/CNStream/configs/yolov5_object_test.json

@@ -0,0 +1,24 @@
+{
+    "detector" : {
+      "class_name" : "cnstream::Inferencer2",
+      "parallelism" : 2,
+      "max_input_queue_size" : 20,
+      "custom_params" : {
+        "model_path" : "../data/models/yolov5_4c4b_rgb_220.cambricon",
+        "func_name" : "subnet0",
+        // Uncomment the following 2 lines to use cncv
+        // "preproc_name" : "CNCV",
+        // "normalize" : true,
+        "preproc_name" : "VideoPreprocYolov5",
+        "postproc_name" : "VideoPostprocYolov5",
+        "keep_aspect_ratio" : "true",
+        "model_input_pixel_format" : "RGB24",
+        "batching_timeout" : 100,
+        "threshold" : 0.5,
+        "infer_interval": 6,
+        "engine_num" : 2,
+        "device_id" : 0
+      }
+    }
+  }
+  

+ 2 - 0
source/CNStream/data/models/label_map_gsd.txt

@@ -0,0 +1,2 @@
+bird
+plane

BIN
source/CNStream/data/models/yolov5_4c4b_rgb_220.cambricon


BIN
source/CNStream/data/models/yolov5m_best6_b_b_insect_s3_int8_0828_4b_4c.cambricon


BIN
source/CNStream/data/videos/cars.mp4


BIN
source/CNStream/data/wqy_zenhei.ttf


BIN
source/CNStream/lib/libBasicUsageEnvironment.so


BIN
source/CNStream/lib/libBasicUsageEnvironment.so.1


BIN
source/CNStream/lib/libBasicUsageEnvironment.so.1.0.1


BIN
source/CNStream/lib/libUsageEnvironment.so


BIN
source/CNStream/lib/libUsageEnvironment.so.3


BIN
source/CNStream/lib/libUsageEnvironment.so.3.1.0


BIN
source/CNStream/lib/libcnis.so


BIN
source/CNStream/lib/libcnis.so.1


BIN
source/CNStream/lib/libcnis.so.1.0.0


BIN
source/CNStream/lib/libcnstream_core.so


BIN
source/CNStream/lib/libcnstream_core.so.6.1.0


BIN
source/CNStream/lib/libcnstream_va.so


BIN
source/CNStream/lib/libcnstream_va.so.6.1.0


BIN
source/CNStream/lib/libeasydk.so


BIN
source/CNStream/lib/libeasydk.so.2


BIN
source/CNStream/lib/libeasydk.so.2.6.0


BIN
source/CNStream/lib/libgroupsock.so


BIN
source/CNStream/lib/libgroupsock.so.8


BIN
source/CNStream/lib/libgroupsock.so.8.2.4


BIN
source/CNStream/lib/libliveMedia.so


BIN
source/CNStream/lib/libliveMedia.so.81


BIN
source/CNStream/lib/libliveMedia.so.81.0.5


BIN
source/CNStream/lib/libyuv.a


+ 33 - 0
source/CNStream/start_CNStream.sh

@@ -0,0 +1,33 @@
+start_client() {
+$PWD/bin/main  \
+    --data_path /etc/gsd/files.list_video_rtsp \
+    --src_frame_rate -1   \
+    --perf_level 3 \
+    --wait_time 0 \
+    --loop=false \
+    --config_fname $PWD/config/detection_config.json \
+    --log_to_file=true
+}
+
+start_test() {
+$PWD/bin/main  \
+    --data_path $PWD/config/file.list_video_test \
+    --src_frame_rate -1   \
+    --perf_level -3 \
+    --wait_time 0 \
+    --loop=false \
+    --config_fname $PWD/config/detection_test.json \
+    --log_to_file=true
+}
+
+# 创建日志文件
+if [ ! -d "/home/GSD/log/cnstream" ]; then
+  mkdir -p /home/GSD/log/cnstream
+fi
+
+while true
+do
+	start_client
+	pkill main
+	sleep 3
+done

BIN
source/gsd/bin/gsd


+ 37 - 0
source/gsd/config/config.ini

@@ -0,0 +1,37 @@
+[web]
+wed_ip = 47.112.106.146
+wed_port = 84
+wed_idName = web
+
+[monitor]
+usr = addBirdWarning2
+pwd = sunwin20200507
+
+[expel]
+device_id = 4
+com_port = /dev/ttyUSB0
+baud = 115200
+
+[vpn]
+vpn_ip = 10.8.0.106  
+
+[Device]
+count = 4
+device_1 = 1
+device_2 = 2
+device_3 = 3
+device_4 = 4
+DeviceType = 0
+
+[Filter]
+sensitivity = 1
+interval = 2000
+TimeOut = 600000
+
+[Spug]
+Spug_IP=47.112.106.146 
+Spug_Port=9090
+
+[Mysql]
+mysql_IP=192.168.31.174
+mysql_port=13306

+ 74 - 0
source/gsd/db/gsdDB.sql

@@ -0,0 +1,74 @@
+/*
+ Navicat MySQL Data Transfer
+
+ Source Server         : apollo
+ Source Server Type    : MySQL
+ Source Server Version : 50738
+ Source Host           : 192.168.31.174:13306
+ Source Schema         : gsdDB
+
+ Target Server Type    : MySQL
+ Target Server Version : 50738
+ File Encoding         : 65001
+
+ Date: 13/05/2022 10:57:19
+*/
+# Create Database
+
+CREATE DATABASE IF NOT EXISTS gsdDB DEFAULT CHARACTER SET = utf8mb4;
+Use gsdDB;
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for DeviceList
+-- ----------------------------
+DROP TABLE IF EXISTS `DeviceList`;
+CREATE TABLE `DeviceList`  (
+  `Id` int(11) NOT NULL AUTO_INCREMENT,
+  `DeviceId` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
+  `DeviceToken` tinyint(255) NOT NULL,
+  `DeviceType` tinyint(255) NOT NULL,
+  `ServerIp` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
+  `ServerCname` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
+  `ServerCpwd` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
+  `UpdateTime` datetime(0) NOT NULL,
+  `ISDELETE` int(255) NOT NULL,
+  PRIMARY KEY (`Id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Table structure for HistoryVideo
+-- ----------------------------
+DROP TABLE IF EXISTS `HistoryVideo`;
+CREATE TABLE `HistoryVideo`  (
+  `Id` bigint(11) NOT NULL AUTO_INCREMENT,
+  `fileName` varchar(900) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
+  `UpdateTime` datetime(0) NOT NULL,
+  `ISDELETE` int(255) NOT NULL,
+  PRIMARY KEY (`Id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 35 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Table structure for InferData
+-- ----------------------------
+DROP TABLE IF EXISTS `InferData`;
+CREATE TABLE `InferData`  (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `ClassId` int(11) NOT NULL,
+  `Num` int(11) NOT NULL,
+  `Remark` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
+  `ImageBase64` longtext CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL,
+  `WarningTime` datetime(0) NOT NULL,
+  `VideoPath` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL,
+  `attr1` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL,
+  `attr2` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL,
+  `attr3` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL,
+  `Warn` tinyint(255) NOT NULL,
+  `uuid` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
+  `ISDELETE` int(11) NOT NULL,
+  PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 30 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
+
+SET FOREIGN_KEY_CHECKS = 1;

BIN
source/gsd/lib/libgsd_core.so


BIN
source/gsd/lib/libgsd_modules.so


BIN
source/gsd/lib/libgsd_plugins.so


+ 16 - 0
source/gsd/run.sh

@@ -0,0 +1,16 @@
+#!/bin/bash
+
+ 
+# 创建日志文件
+if [ ! -d "/home/GSD/log/birdy" ]; then
+  mkdir -p /home/GSD/log/birdy
+fi
+
+cd bin
+
+while true
+do
+	./gsd
+	sleep 2
+done
+

+ 22 - 0
start/start_System.sh

@@ -0,0 +1,22 @@
+#!/bin/bash
+
+source /etc/profile
+
+echo "start openvpn"
+
+cd /opt/GSD/network/
+./start_openvpn.sh
+sleep 5
+
+echo "start System"
+cd /opt/GSD/
+docker-compose up -d
+echo "123456" | sudo -S service cron start
+
+exit 0
+
+
+
+
+
+

+ 12 - 0
stop/reboot_System.sh

@@ -0,0 +1,12 @@
+#!/bin/bash
+
+source /etc/profile
+
+source /opt/GSD/stop/stop_Systeam.sh
+
+date="`date '+%Y-%m-%d %H:%M:%S'`"
+echo "restart System  $date" >> /opt/GSD/log/reboot.log
+
+sleep 10
+
+source /opt/GSD/start/start_System.sh

+ 12 - 0
stop/stop_System.sh

@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# 停止定时自检
+echo "123456" | sudo -S service cron stop
+
+# 停止openvpn
+echo "123456" | sudo -S killall openvpn
+
+# 停止系统应用
+cd /opt/GSD/
+
+docker-compose stop

BIN
tools/Pder


+ 16 - 0
tools/clean.sh

@@ -0,0 +1,16 @@
+###
+ # @Description: 
+ # @Version: 1.0
+ # @Autor: lishengyin
+ # @Date: 2022-03-03 14:10:59
+ # @LastEditors: Please set LastEditors
+ # @LastEditTime: 2022-03-18 15:27:50
+### 
+#!/bin/bash
+
+source /etc/profile
+docker rmi $dockerio/gsd/gsd_cnstream:latest
+docker rmi $dockerio/gsd/gsd_birdy:latest
+docker rmi $dockerio/gsd/gsd_nginx:latest
+docker rmi $dockerio/gsd/gsd_zookeeper:latest
+docker rmi $dockerio/gsd/gsd_kafka:latest

+ 57 - 0
tools/deploy.sh

@@ -0,0 +1,57 @@
+#!/bin/bash
+
+if [ `whoami` != 'root' ];then
+    echo 'please run as root'
+    exit 1
+fi
+
+if [[ ! -f "/etc/gsd/files.list_video_rtsp" ]]; then
+    cp $PWD/../source/CNStream/config/files.list_video_rtsp /etc/gsd/
+fi
+
+if [[ ! -f "/etc/gsd/config.ini" ]]; then
+    cp /opt/GSD/source/birdy/config/config.ini /etc/gsd/
+fi
+
+if [[ ! -f "/etc/profile.d/rtsp.sh" ]]; then
+    echo "export rtspip=\"192.168.1.130\"" > /etc/profile.d/rtsp.sh
+fi
+
+if [[ ! -f "/etc/profile.d/gsdProfile.sh" ]]; then
+    echo "export dockerio=\"10.8.0.113:8080\"" > /etc/profile.d/gsdProfile.sh
+fi
+
+read -p "是否为已部署的设备升级目录结构(yes/no, default is no):" FLASH_SELECT
+if [ -z "${FLASH_SELECT}" ];then
+    FLASH_SELECT="no"
+fi
+
+if [ "${FLASH_SELECT}" == "yes" ];then
+    echo "修改"
+    if [[ ! -d "/opt/datas/" ]]; then
+        mkdir -p /opt/datas/
+    fi
+
+    if [[ ! -d "/opt/datas/video" ]]; then
+        mkdir -p /opt/datas/video
+    fi
+
+    if [[ ! -d "/opt/GSD/video" ]]; then
+        if [[ ! -d "/home/sunwin/GSD/video" ]]; then
+            echo ""
+        else
+            echo "转移视频数据"
+            mv /home/sunwin/GSD/video/* /opt/datas/video/
+        fi
+    else
+        echo "转移视频数据"
+        mv /opt/GSD/video/* /opt/datas/video/
+    fi
+fi
+
+
+echo "Complete!"
+
+
+
+

+ 1 - 0
version

@@ -0,0 +1 @@
+version: 1.0.0