1. 程式人生 > 其它 >智慧工地支撐平臺工地一張圖線上管控平臺

智慧工地支撐平臺工地一張圖線上管控平臺

一、專案背景

  工地一張圖線上管控平臺(也稱“智慧工地”)是指綜合運用移動應用、物聯網計算和大資料等技術,圍繞人員、機械、物料、環境等關鍵要素,建立資訊智慧採集、管理高效協同、資料科學分析、過程智慧預測的施工現場多立體化資訊模型,打通從一線操作到過程監管的資料鏈條,形成“端+雲+大資料”的業務體系,降低施工現場管理成本,逐步實現智慧的綠色和生態建造。智慧工地將更多人工智慧、感測技術、虛擬現實等高科技技術植入到建築、機械、人員穿戴設施、場地進出關卡口等各類物體中,實現勞務實名制一卡通子系統、塔吊執行監控子系統、大體積混凝土無線測溫子系統、變形監測子系統(包括高支模監測及深基坑監測)、環境監控子系統、生活區用電監控子系統、箱變狀態線上監測子系統、安防監控子系統、精確定位子系統、VR質量安全模擬培訓子系統,並接入一個監控中心———數字化工地管理平臺進行統一管理,能夠降低運營成本,節省人力投入,減少安全隱患,規範施工管理,有效緩解專案施工現場勞務、裝置、材料、安全、環境等方面的管理難題。

    二、平臺總計架構

  數字化工地綜合管控平臺體系結構設計,從根本上決定了系統所能提供的業務服務的規模和水平。本平臺採用了在J2EE三層體系結構基礎上,結合構建的面向業務的五層體系結構,分別為:前端展示層、API介面層(閘道器)、業務應用系統、服務中心、基礎設施(資料儲存、執行環境)如下圖所示:

  第一層為前端展示層,即應用層。用於顯示資料和接收使用者輸入的資料,為使用者提供一種互動式操作的介面,其中包括B/S架構的Web客戶端、移動客戶端、以及外接的第三方系統。開發C/S架構可以採用多種語言,包括Java、C++、C#、Dephi等;開發B/S架構的語言,包括PHP、Asp.NET、JAVA等;移動客戶端開發主流的是基於Andriod或IOS作業系統。通過對安全管理具體業務的歸納、抽象,生成的各種應用模組,通過這些模組的組織完成業務邏輯,將最後的邏輯運算結果在表現層進行視覺化。

  第二層為API介面層,即閘道器。它是系統的統一入口,外部通過統一的API閘道器接入業務服務,同時處理一些非業務功能,如監控,負載均衡,流量控制,身份認證等。

  第三層為業務應用系統,即業務層。呈現給使用者專業化、個性化的具體業務流程和工具,是智慧化的最終體現,是業務智慧的最終表現形式。具體採用的是將平臺基於Spring-boot釋出的restful服務或者是JavaEE+Tomcat釋出的Servlet的通用服務構成具體業務的服務鏈,實現定製化。如:工地視訊監控業務,需要構建視訊子服務+視訊瀏覽子服務+預警子服務的服務鏈。

  第四層為服務中心,是軟體平臺系統的核心。針對具體的問題對資料進行操作,採用高效能的應用伺服器中介軟體、各種智慧引擎和系統管理工具,為業務層提供基礎服務、管理策略和方法工具。同時按照所提供的服務來管理、組織和排程裝置和資訊資源。在平臺中包含了服務註冊與服務管理以及構建服務鏈功能,對於具體的業務需求,實現主動的服務聚焦。如:門禁服務和人員服務,可針對門禁制定各種身份認證的策略。服務中心還提供資料訪問服務,對原始資料(資料庫或者文字檔案等存放資料的形式)的操作層,為業務層或前端展示層提供資料服務。主要實現對資料的增刪改查,實現從工地現場獲得的多源資料與底層資料庫的互動。

  第五層為基礎設施層,包括資料儲存和執行環境。為上面各層提供通用的技術能力,為應用層傳遞訊息,為服務中心層提供持久化機制,為使用者介面層繪製螢幕元件等等。Web應用系統中基礎設施包含了資料持久化服務,中介軟體服務(資料庫,Redis,HBASE等等)以及第三方服務等。


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title data-i18n="resources.title_dynamicPlot"></title>
<style type="text/css">
        body {
            margin: 0;
            overflow: hidden;
            background: #fff;
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
        }

        #map {
            position: absolute;
            left: 250px;
            right: 0px;
            height: 100%;
        }

        #menuPlotting {
            position: absolute;
            top: 20%;
            z-index: 99999999999;
            border-radius: 4px;
            padding-top: 2px;
            left: 265px;
            color: #000000;
            background-color: #fff;
        }

        #menu {
            float: left;
            background: #ffffff;
            width: 250px;
            height: 100%;
        }
    </style>
</head>
<body>
<div id="menu">
<div class="easyui-panel" style="position:absolute;top:0px;bottom:0px;left:0px;right:0px;padding:5px; width: 100%;">
<div class="easyui-tabs" style="width: 100%;height: 100%">
<div id="plotPanel" data-i18n="[title]resources.text_drawPanel" style="overflow: hidden"></div>
<div id="stylePanel" data-i18n="[title]resources.text_attributePanel"></div>
</div>
</div>
</div>
<div id="map">
<div id="menuPlotting" class="sticklr" style="left: 1%;color:rgb(0,0,0);background-color: #fff;">
<li>
<a class="glyphicon plotting-glyphicon-draw-deactivate notArrow" data-i18n="[title]resources.text_cancelDraw" onclick="PlottingDrawCancel()"></a>
</li>
<li>
<a class="glyphicon plotting-glyphicon-draw-removeAll notArrow" data-i18n="[title]resources.text_input_value_clear"></a>
<ul>
<li><input type="button" data-i18n="[value]resources.btn_deleteMarker" onclick="deleteSymbol()" style="width:70px;height: 25px ;margin:0 auto;"/> </li>
<li><input type="button" data-i18n="[value]resources.btn_clearLayers" onclick="PlottingClear()" style="width: 70px;height: 25px ;margin:0 auto;"/></li>
</ul>
</li>
<li>
<a class="glyphicon glyphicon-pencil notArrow" data-i18n="[title]resources.text_editor"></a>
<ul>
<li><input type="button" data-i18n="[value]resources.btn_copy" onclick="copySymbol()" style="width:70px;height: 25px ;margin:0 auto;"/> </li>
<li><input type="button" data-i18n="[value]resources.btn_cut" onclick="cutSymbol()" style="width: 70px;height: 25px ;margin:0 auto;"/></li>
<li><input type="button" data-i18n="[value]resources.btn_paste" onclick="pasteSymbol()" style="width: 70px;height: 25px ;margin:0 auto;"/></li>
</ul>
</li>
<li>
<a class="glyphicon glyphicon-plus notArrow" data-i18n="[title]resources.text_addLayer" onclick="addPlottingLayer()"></a>
</li>
<li>
<a class="glyphicon plotting-lyphicon-save-simulationMap" data-i18n="[title]resources.text_situationMapOperation"></a>
<ul>
<li><input type="button" data-i18n="[value]resources.btn_saveSimulationMap" onclick="saveSimulationMap()" style="width:70px;height: 25px ;margin:0 auto;"/> </li>
<li><input type="button" data-i18n="[value]resources.btn_loadSimulationMap" onclick="loadSimulationMap()" style="width: 70px;height: 25px ;margin:0 auto;"/></li>
</ul>
</li>
<li>
<a class="glyphicon glyphicon-edit notArrow" data-i18n="[title]resources.text_editMarker"></a>
<ul>
<li><input type="button" data-i18n="[value]resources.btn_editRectangle" onclick="editCircusRetangle()" style="width:85px;height: 25px ;margin:0 auto;"/> </li>
<li><input type="button" data-i18n="[value]resources.btn_editNode" onclick="editContorPoints()" style="width:70px;height: 25px ;margin:0 auto;"/> </li>
<li><input type="button" data-i18n="[value]resources.btn_addNode" onclick="addControlPoints()" style="width: 70px;height: 25px ;margin:0 auto;"/></li>
</ul>
</li>
<li>
<a class="glyphicon glyphicon-lock notArrow" data-i18n="[title]resources.text_aboutMode"></a>
<ul>
<li><input type="button" data-i18n="[value]resources.btn_lockSwitch" onclick="setPlottingLayerIsLocked()" style="width:85px;height: 25px ;margin:0 auto;"/> </li>
<li><input type="button" data-i18n="[value]resources.btn_editSwitch" onclick="setPlottingLayerIsEdit()" style="width:85px;height: 25px ;margin:0 auto;"/> </li>
<li><input type="button" data-i18n="[value]resources.btn_selectSwitch" onclick="setPlottingLayerIsSelected()" style="width:85px;height: 25px ;margin:0 auto;"/> </li>
</ul>
</li>
<li>
<a class="glyphicon glyphicon-check notArrow" data-i18n="[title]resources.text_multiselect" onclick="multiSelectModel()"></a>
</li>
<li>
<a class="glyphicon glyphicon-align-justify notArrow" data-i18n="[title]resources.text_multiselectAlign"></a>
<ul>
<li><input type="button" data-i18n="[value]resources.btn_leftAlignment" onclick="setSymbolAlighLeft()" style="width:70px;height: 25px ;margin:0 auto;"/> </li>
<li><input type="button" data-i18n="[value]resources.btn_rightAlignment" onclick="setSymbolAlighRight()" style="width: 70px;height: 25px ;margin:0 auto;"/></li>
<li><input type="button" data-i18n="[value]resources.btn_topAlignment" onclick="setSymbolAlighUp()" style="width:70px;height: 25px ;margin:0 auto;"/> </li>
<li><input type="button" data-i18n="[value]resources.btn_bottomAlignment" onclick="setSymbolAlighDown()" style="width:70px;height: 25px ;margin:0 auto;"/> </li>
<li><input type="button" data-i18n="[value]resources.btn_verticalCenter" onclick="setSymbolAlighVerticalcenter()" style="width:70px;height: 25px ;margin:0 auto;"/> </li>
<li><input type="button" data-i18n="[value]resources.btn_horizontalCenter" onclick="setSymbolAlighHorizontalcenter()" style="width:70px;height: 25px ;margin:0 auto;"/> </li>
</ul>
</li>
<li>
<a class="glyphicon glyphicon-adjust notArrow" data-i18n="[title]resources.text_avoid"></a>
<ul>
<li><input type="button" data-i18n="[value]resources.btn_avoidEdit" onclick="drawAvoidRegion()" style="width:80px;height: 25px ;margin:0 auto;"/> </li>
<li><input type="button" data-i18n="[value]resources.btn_cancelAvoidEdit" onclick="doneAvoidEdit()" style="width:80px;height: 25px ;margin:0 auto;"/> </li>
<li><input type="button" data-i18n="[value]resources.btn_deleteAvoid" onclick="deleteAvoidEdit()" style="width:80px;height: 25px ;margin:0 auto;"/> </li>
</ul>
</li>
<li>
<a class="glyphicon glyphicon-gift notArrow" data-i18n="[title]resources.text_createGroup"></a>
<ul>
<li><input type="button" data-i18n="[value]resources.btn_group" onclick="createGroupObjects()" style="width:70px;height: 25px ;margin:0 auto;"/> </li>
<li><input type="button" data-i18n="[value]resources.btn_flags" onclick="createDrawFlags()" style="width:70px;height: 25px ;margin:0 auto;"/> </li>
<li><input type="button" data-i18n="[value]resources.btn_unbundling" onclick="testUnGroupObject()" style="width:70px;height: 25px ;margin:0 auto;"/> </li>
</ul>
</li>
<li>
<a class="glyphicon glyphicon-arrow-left notArrow" data-i18n="[title]resources.btn_undo" onclick="undo()"></a>
</li>
<li>
<a class="glyphicon glyphicon-arrow-right notArrow" data-i18n="[title]resources.btn_redo" onclick="redo()"></a>
</li>
<li>
<a class="glyphicon glyphicon-th-large notArrow" data-i18n="[title]resources.text_symbolEqualSize"></a>
<ul>
<li><input type="button" data-i18n="[value]resources.btn_symbolEqualWidth" onclick="setSymbolEqualWidth()" style="width:70px;height: 25px ;margin:0 auto;"> </input> </li>
<li><input type="button" data-i18n="[value]resources.btn_symbolEqualHeight" onclick="setSymbolEqualHeight()" style="width: 70px;height: 25px ;margin:0 auto;"> </input></li>
<li><input type="button" data-i18n="[value]resources.btn_symbolEqualWidthHeight" onclick="setSymbolEqualWidthHeight()" style="width:70px;height: 25px ;margin:0 auto;"> </input> </li>
</ul>
</li>
<li>
<a class="glyphicon glyphicon-th" data-i18n="[title]resources.text_symbolDistribution"></a>
<ul>
<li><input type="button" data-i18n="[value]resources.btn_symbolLevelDistribution" onclick="setSymbolLevelDistribution()" style="width:70px;height: 25px ;margin:0 auto;"> </input> </li>
<li><input type="button" data-i18n="[value]resources.btn_symbolVerticalDistribution" onclick="setSymbolVerticalDistribution()" style="width: 70px;height: 25px ;margin:0 auto;"> </input></li>
</ul>
</li>
</div>
</div>
<script type="text/javascript" include="bootstrap,responsive,sticklr" src="../js/include-web.js"></script>
<script type="text/javascript" exclude="iclient-classic" include="iclient8c-plot,bevInclude,PlottingPanel" src="../../dist/classic/include-classic.js"></script>
<script>var map, plottingLayer, layer;
    var plotPanel, stylePanel;
    var host = window.isLocal ? window.server : "https://iserver.supermap.io";
    var mapurl = host + "/iserver/services/map-china400/rest/maps/China_4326";
    var serverUrl = host + "/iserver/services/plot-jingyong/rest/plot/";
    var plotting;
    var sitDataLayers;
    var drawGraphicObjects = [];
    var plottingEdit;
    init();

    function init() {
        Bev.Theme.set("bev-base");

        map = new SuperMap.Map("map", {
            controls: [
                new SuperMap.Control.LayerSwitcher(),
                new SuperMap.Control.ScaleLine(),
                new SuperMap.Control.Zoom(),
                new SuperMap.Control.Navigation({
                    dragPanOptions: {
                        enableKinetic: true
                    }
                })]
        });
        layer = new SuperMap.Layer.TiledDynamicRESTLayer("World", mapurl, {
            transparent: true,
            cacheEnabled: true
        }, {maxResolution: "auto"});
        layer.events.on({"layerInitialized": addLayer});

        //總控類
        plotting = SuperMap.Plotting.getInstance(map, serverUrl);

        plotting.getSitDataManager().events.on({"openSmlFileCompleted": success});

        plottingLayer = new SuperMap.Layer.PlottingLayer("標繪圖層", serverUrl);

        //空間分析服務地址:目前使用的是伺服器預設空間分析地址,可更換成實際使用的空間分析服務地址
        //plottingLayer.spatialAnalystUrl = host + "/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst";

        plottingLayer.style = {
            fillColor: "#66cccc",
            fillOpacity: 0.4,
            strokeColor: "#66cccc",
            strokeOpacity: 1,
            strokeWidth: 3,
            pointRadius: 6
        };

        //態勢標繪編輯
        plottingEdit = new SuperMap.Control.PlottingEdit();
        //plottingEdits.push(plottingEdit);

        // 繪製標號;
        var drawGraphicObject = new SuperMap.Control.DrawFeature(plottingLayer, SuperMap.Handler.GraphicObject);
        drawGraphicObjects.push(drawGraphicObject);

        //新增態勢標繪控制元件
        map.addControls([plottingEdit, drawGraphicObject]);
    }

    function addLayer() {
        map.addLayers([layer, plottingLayer]);
        map.setCenter(new SuperMap.LonLat(104, 35), 3);

        //建立標繪面板
        plotPanel = new SuperMap.Plotting.PlotPanel("plotPanel", serverUrl, map);
        plotPanel.events.on({"initializeCompleted": initializeCompleted});
        plotPanel.initializeAsync();

        //建立屬性面板
        stylePanel = new SuperMap.Plotting.StylePanel("stylePanel");
        stylePanel.addEditLayer(plottingLayer);
    }

    function initializeCompleted(evt) {
        if (drawGraphicObjects.length > 0) {
            plotPanel.setDrawFeature(drawGraphicObjects[0]);
        }

        plotting.getSymbolLibManager().cacheSymbolLib(100);
    }

    //取消標繪與編輯
    function plottingAllDeactivate() {
        for (var i = 0; i < drawGraphicObjects.length; i++) {
            drawGraphicObjects[i].deactivate();
        }
        plottingEdit.deactivate();
    }

    //清空繪製
    function PlottingClear() {

        plottingAllDeactivate();

        for (var i = 0; i < map.layers.length; i++) {
            if (map.layers[i].CLASS_NAME === "SuperMap.Layer.PlottingLayer") {
                map.layers[i].removeAllFeatures();
            }
        }
    }

    //刪除選中標號
    function deleteSymbol() {
        plottingEdit.deleteSelectFeature();
    }

    //取消標繪,啟用標繪編輯控制元件
    function PlottingDrawCancel() {
        plottingAllDeactivate();

        plottingEdit.activate();

    }

    //複製
    function copySymbol() {
        plotting.getEditor().copy();
    }

    //剪下
    function cutSymbol() {
        plotting.getEditor().cut();
    }

    //貼上
    function pasteSymbol() {
        plotting.getEditor().paste();
    }

    //新增圖層
    function addPlottingLayer() {
        PlottingDrawCancel();
        var newPlottingLayer = new SuperMap.Layer.PlottingLayer(getNewPlottingLayerName(), serverUrl);
        newPlottingLayer.style = {
            fillColor: "#66cccc",
            fillOpacity: 0.4,
            strokeColor: "#66cccc",
            strokeOpacity: 1,
            strokeWidth: 3,
            pointRadius: 6
        };

        //newPlottingLayer.spatialAnalystUrl = host + "/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst";

        var drawGraphicObject = new SuperMap.Control.DrawFeature(newPlottingLayer, SuperMap.Handler.GraphicObject);
        drawGraphicObjects.push(drawGraphicObject);

        //將新建立的圖層新增到屬性面板中
        stylePanel.addEditLayer(newPlottingLayer);

        //將標繪控制代碼賦給標繪面板
        plotPanel.setDrawFeature(drawGraphicObject);

        map.addControls([drawGraphicObject]);
        map.addLayers([newPlottingLayer]);
    }

    //儲存態勢圖
    function saveSimulationMap() {
        plottingAllDeactivate();
        plotting.getSitDataManager().saveAsSmlFile("situationMap");
    }

    function loadSimulationMap() {
        {
            plotting.getSitDataManager().openSmlFileOnServer("situationMap");
        }

    }

    function success() {
        var sitDataLayers = plotting.getSitDataManager().getSitDataLayers();
        plottingLayer = sitDataLayers[0];
        drawGraphicObjects = [];
        for (var i = 0; i < sitDataLayers.length; i++) {
            drawGraphicObjects.push(sitDataLayers[i].drawGraphicObject);
            stylePanel.addEditLayer(sitDataLayers[i]);
        }
        plotPanel.setDrawFeature(drawGraphicObjects[0]);
    }

    function getNewPlottingLayerName() {
        var layerCount = map.layers.length;
        var layerName = "新建標繪圖層";

        var bExist = true;
        while (bExist) {
            bExist = false;
            var tempLayerName = layerName + layerCount;

            for (var i = 0; i < map.layers.length; i++) {
                var layer = map.layers[i];
                if (null == layer) {
                    continue;
                }

                if (tempLayerName === layer.name) {
                    bExist = true;
                }
            }

            if (!bExist) {
                layerName = tempLayerName;
            }
            layerCount++;
        }

        return layerName;
    }

    function editCircusRetangle() {
        plottingEdit.setEditMode(SuperMap.Plot.EditMode.EDITCIRCUMRECTANGLE);
    }

    function editContorPoints() {
        plottingEdit.setEditMode(SuperMap.Plot.EditMode.EDITCONTROLPOINT);
    }

    function addControlPoints() {
        plottingEdit.setEditMode(SuperMap.Plot.EditMode.ADDCONTROLPOINT);
    }

    //切換多選模式
    function multiSelectModel() {
        plottingEdit.multiSelect();
    }

    //多選對齊--左對齊
    function setSymbolAlighLeft() {
        plottingEdit.align(SuperMap.Plot.AlignType.LEFT);
    }

    //多選對齊--右對齊
    function setSymbolAlighRight() {
        plottingEdit.align(SuperMap.Plot.AlignType.RIGHT);
    }

    //多選對齊--上對齊
    function setSymbolAlighUp() {
        plottingEdit.align(SuperMap.Plot.AlignType.UP);
    }

    //多選對齊--下對齊
    function setSymbolAlighDown() {
        plottingEdit.align(SuperMap.Plot.AlignType.DOWN);
    }

    //多選對齊--豎直居中對齊
    function setSymbolAlighVerticalcenter() {
        plottingEdit.align(SuperMap.Plot.AlignType.VERTICALCENTER);
    }

    //多選對齊--水平居中對齊
    function setSymbolAlighHorizontalcenter() {
        plottingEdit.align(SuperMap.Plot.AlignType.HORIZONTALCENTER);
    }

    //切換圖層是否鎖定
    function setPlottingLayerIsLocked() {
        if (plottingLayer.getLocked() === true) {
            plottingLayer.setLocked(false);
        } else {
            plottingLayer.setLocked(true);
        }
    }

    //切換圖層是否可編輯模式
    function setPlottingLayerIsEdit() {
        if (plottingLayer.getEditable() === true) {
            plottingLayer.setEditable(false);
        } else {
            plottingLayer.setEditable(true);
        }
    }

    //切換圖層是否可選擇模式
    function setPlottingLayerIsSelected() {
        if (plottingLayer.getSelected() === true) {
            plottingLayer.setSelected(false);
        } else {
            plottingLayer.setSelected(true);
        }
    }

    //繪製避讓區域
    function drawAvoidRegion() {
        plottingEdit.avoidEdit(true);
    }

    //退出避讓編輯
    function doneAvoidEdit() {
        plottingEdit.avoidEdit(false);
    }

    //刪除避讓編輯
    function deleteAvoidEdit() {
        plottingEdit.removeAllAvoidRegion();
    }

    //建立組合物件
    function createGroupObjects() {
        var features = plottingEdit.features;
        if (features.length >= 2) {
            plottingLayer.createGroupObject(features);
        }

    }

    //建立多旗
    function createDrawFlags() {
        var features = plottingEdit.features;
        if (features.length >= 2) {
            plottingLayer.createFlags(features);
        }
    }

    //解綁組合物件
    function testUnGroupObject() {
        var features = plottingEdit.features;
        for (var i = features.length - 1; i >= 0; i--) {
            if (features[i].geometry instanceof SuperMap.Geometry.GroupObject) {
                plottingLayer.unGroupObject(features[i].geometry.uuid);
            }

        }
    }

    function undo(){
        plotting.getTransManager().undo();
    }

    function redo(){
        plotting.getTransManager().redo();
    }
    //等大
    //等寬
    function setSymbolEqualWidth(){
        plottingEdit.equalLarge(SuperMap.Plot.EqualLargeType.WIDTH);
    }
    //等高
    function setSymbolEqualHeight(){
        plottingEdit.equalLarge(SuperMap.Plot.EqualLargeType.HEIGHT);
    }
    //等寬高
    function setSymbolEqualWidthHeight(){
        plottingEdit.equalLarge(SuperMap.Plot.EqualLargeType.SAME);
    }

    //均勻分佈
    //橫向均勻分佈
    function setSymbolLevelDistribution(){
        plottingEdit.uniformDistribution(SuperMap.Plot.UniformDistributionType.LEVEL);
    }

    //縱向均勻分佈
    function setSymbolVerticalDistribution(){
        plottingEdit.uniformDistribution(SuperMap.Plot.UniformDistributionType.VERTICAL);
    }

    document.onmouseup = function (evt) {
        var evt = evt || window.event;
        if (evt.button === 2) {
            PlottingDrawCancel();
            return false;
        }
        evt.stopPropagation();
    }
</script>
</body>
</html>