---
# System prepended metadata

title: VP Positioning Software Specification

---

# VP Positioning Software Specification

## 0. Global Configuration
### Offline Time
離線標準：長達１分鐘未收到訊號

### Synchronize Database Time
定位程式重取 Database 設定間隔：10分鐘

### Hostname
pigo.tw

## 1. Topic Naming Rule


### 1-1. Receiver Topic


#### Positioning

```
/$companyNameInitialism/$areaId
```

example:
```
/VP/1
```


#### Welcome

```
/$companyNameInitialism/$areaId/welcome
```

example:
```
/VP/1/welcome
```

### 1-2. Trigger Camera

#### Function: Emergency
```
/VP/camera/emergency
```

#### Function: Forbid

```
/VP/camera/forbid
```

### 1-3. Trigger Receiver

#### Function: Reboot
```
/VP/receiver/reboot
```

---

## 2. Positioning Log
### 2-1. Rule for add new record/ update record
當訊號來臨，定位判斷後，若：
* 無當前紀錄
* 定位至另一個 receiver

則新增一筆紀錄
否則更新原定位紀錄

---

## 3. Synchronize Database

### 3-1. Device

|頻率|內容|備註|
|-|-|-|
|1分鐘1次|定位結果|lastReceiverSettingId, lastTime, lastRSSI, batteryVolume|
|1分鐘1次|上一次訊號距今已超過**離線標準**的發信器|set lastReceiverId, lastDataTime to null|

### 3-2. Receiver

|頻率|內容|備註|
|-|-|-|
|1分鐘1次|定位結果|lastDataTime, lastHbTime|
|1分鐘1次|Heartbeat|Receiver心跳|

### 3-3. TagLog

|頻率|內容|備註|
|-|-|-|
|5分鐘1次|定位結果組合|employeeDeviceId, receiverSettingId, createTime|


---


## 4. Synchronize Backend Service

### 4-1. Positioning Change

內容：
|頻率|內容|備註|
|-|-|-|
|2秒1次|定位結果位置紀錄|地圖上人員換位置|

### 4-2. Offline Devices

|頻率|內容|備註|
|-|-|-|
|5秒1次|將上一次訊號距今已超過**離線標準**的發信器|離線人員從地圖移除|

### 4-3. Welcome Message

|頻率|內容|備註|
|-|-|-|
|1秒1次|welcome之訊號|將Welcome紀錄顯示在出缺勤頁面|

---

## 5. Extended Function Parameter

### 5-1. Duration

需判定在該位置超過一定時間才會觸發該機制

|功能|門檻|
|-|-|
|Emergency|1秒|
|Welcome|2秒|
|Forbid|3秒|

## 6. Website

### 6-1. Positioning Monitor
網址 https://positioningomnitor.vp.pigo.tw

### 6-2. Backstage
網址 https://backstage.vp.pigo.tw

