|
|
## 一、环境信息
|
|
|
[水口口岸二桥货场AR全景可视化监管平台](http://192.168.20.15:8012/#/Home)
|
|
|
admin 123456
|
|
|
## 二、问题记录
|
|
|
|
|
|
1. 7+4 入境4缺少车底相机(192.168.33.99 Ip不存在)
|
|
|
2. 7+4 出境7缺少车道头相机(未激活)
|
|
|
3. 车辆通关计算不准确
|
|
|
4. 不要用AR提供的设备管理功能,设备操作必须使用权限系统
|
|
|
5. 相机有变动,IP和位置,需要重新配置起点、终点、沿途类型
|
|
|
6. 数据一致性问题:有验放没有车牌识别,有车牌识别没有验放
|
|
|
## 三、FAQ
|
|
|
### 3.1 如何添加关联相机
|
|
|
权限系统中增加关联回放设备id(acc_t_sb表主键)
|
|
|
![[Pasted image 20250627152148.png]]
|
|
|
## 四、常用SQL
|
|
|
1. 查询车牌识别、验放推送记录
|
|
|
```sql
|
|
|
select (case
|
|
|
when type = 1 then '车牌识别'
|
|
|
when type = '2' then '车辆验放'
|
|
|
when type = '3' then '登临检查' end) as type,
|
|
|
create_time,
|
|
|
device_name,
|
|
|
plate,
|
|
|
data
|
|
|
from ar_t_vehicle_data_receive_log
|
|
|
where plate = '12H02835'
|
|
|
order by create_time;
|
|
|
```
|
|
|
|
|
|
```sql
|
|
|
# 过滤车牌识别
|
|
|
select device_name, plate, create_time, data
|
|
|
from ar_t_vehicle_data_receive_log
|
|
|
where plate = '桂P13077'
|
|
|
and type = 1
|
|
|
and device_id is not null
|
|
|
and create_time>='2025-06-24'
|
|
|
order by create_time;
|
|
|
```
|
|
|
|
|
|
```sql
|
|
|
# 轨迹表
|
|
|
with io_record as (select * from ar_t_sleuth_io where vehicle_plate = '桂P13077'),
|
|
|
device as (select * from acc_t_sb)
|
|
|
select a.id,a.vehicle_io_id, a.vehicle_plate, a.snap_time, b.SBM, a.device_id
|
|
|
from io_record a
|
|
|
left join device b on a.device_id = b.id where a.snap_time>='2025-06-24'
|
|
|
order by a.snap_time,a.vehicle_io_id;
|
|
|
```
|
|
|
|
|
|
```sql
|
|
|
# 卡口验放
|
|
|
with release_record as (select * from ar_t_vehicle_io_release_detail where vehicle_plate = '桂KQ6619'),
|
|
|
device as (select * from acc_t_sb)
|
|
|
select a.sleuth_io_id, b.SBM, a.device_id, a.vehicle_plate, a.vehicle_pass_time
|
|
|
from release_record a
|
|
|
left join device b on a.device_id = b.ID
|
|
|
where a.vehicle_pass_time >= '2025-06-28'
|
|
|
order by a.vehicle_pass_time;
|
|
|
```
|
|
|
|
|
|
## 五、任务
|
|
|
|
|
|
一、同步验放数据 (完成)
|
|
|
1. 使用嵌入式debezium-engine同步验放表、通道表
|
|
|
2. 开发视图用于查询
|
|
|
|
|
|
二、修正车牌识别数据(有车牌识别没有验放数据、有验放数据没有车牌识别)
|
|
|
1. (有验放数据没有车牌识别)在接收到验放数据,校验是否有车牌识别,如果没有则通过验放数据构造一条车牌识别数据
|
|
|
2. (有车牌识别没有验放数据)无需处理
|
|
|
|
|
|
三、车辆通关状态查询重构
|
|
|
1. 根据步骤一实现的视图重构 *车辆通关状态查询* 模块逻辑(完成)
|
|
|
2. 修改现有查询接口(完成)
|
|
|
|
|
|
四、部署 hertzbeat(完成)
|
|
|
http://192.168.20.17:1157/
|
|
|
admin/Max@123456
|
|
|
|
|
|
五、实现GIS业务表、权限系统业务表定时备份 (完成)
|
|
|
192.168.20.17 /opt/db_backup.sh 输出到 /home/maxvison/backup
|
|
|
|
|
|
## 六、优化项
|
|
|
1. 3D地图打开相机视频改为弹窗,防止重复地图加载
|
|
|
前端反馈不好实现,已改为新开tab页
|
|
|
|
|
|
## 七、设计
|
|
|
|
|
|
### 7.1 合并验放数据
|
|
|
1. 通过验放数据构建视图
|
|
|
```sql
|
|
|
create view vw_release_t_channel_records as
|
|
|
select a.domestic_no as vehivle_plate,-- 车牌号
|
|
|
a.io_type,-- 进出口标识 I 进口 O 出口
|
|
|
a.channel_name,-- 通道名称
|
|
|
a.channel_tag,-- 通道标识(s,开始;e,结束;p,中间)
|
|
|
d.SBM as acc_camera_name,-- AR系统中的相机名称
|
|
|
DATE(a.in_time) as in_date,-- 入通道日期
|
|
|
DATE(a.out_time) as out_date,-- 出通道日期
|
|
|
a.in_time, -- 入通道时间
|
|
|
a.out_time,-- 出通道时间
|
|
|
TIMESTAMPDIFF(MINUTE, a.in_time, a.out_time) as time_diff_minute,-- 进出通道时间差(分钟)
|
|
|
b.customs_channel_no,-- 海关标识通道号
|
|
|
b.customs_area_id,-- 海关标识区域ID
|
|
|
a.bj_state,-- 边检放行状态 NN不开启,YP放行,CP查验,EP退车,TP应急放行
|
|
|
a.hg_state,-- 海关放行状态 NN不开启,YP放行,CP查验,EP退车,TP应急放行
|
|
|
a.weighbridge,-- 地磅(KG)
|
|
|
a.final_state,-- 最终状态 0抬杆放行,1退车,2人工抬杆
|
|
|
a.channel_no,-- 通道编号
|
|
|
b.guid as channel_id,-- 通道ID
|
|
|
a.channel_type,-- 通道类型
|
|
|
b.business_type as channel_business_type,-- 通道业务类型 1:一般贸易,2 边民互市,3核辐射测温;
|
|
|
c.camera_id,-- 相机ID
|
|
|
c.camera_name,-- 验放系统中的相机名称
|
|
|
c.camera_url -- RTSP 地址
|
|
|
from release_t_channel_records a
|
|
|
left join release_t_channel b on a.channel_no = b.channel_no
|
|
|
left join (select * from release_t_camera where camera_type = '5') c on b.guid = c.channel_id
|
|
|
left join acc_t_sb d on c.camera_id = d.ID;
|
|
|
```
|
|
|
2. 历史数据处理
|
|
|
按照车牌分组(26号以前数据有问题)
|
|
|
```sql
|
|
|
with release_record as (select *
|
|
|
from vw_release_t_channel_records
|
|
|
where in_date >= '2025-06-26'
|
|
|
order by in_date, in_time)
|
|
|
select *
|
|
|
from release_record
|
|
|
where vehivle_plate = '桂FB5077';
|
|
|
```
|
|
|
按照IO类型分组,分组之后再校验channel_tag,将数据合并,如下图所示可以将数据合并为3条
|
|
|
![[Pasted image 20250701085900.png]]
|
|
|
3. 新数据处理
|
|
|
方法一:定时任务,查询近3天未结束流程的数据,更新流程。有可能3天都断网,拿不到最新的数据。等回复后又过了3天的周期。或者每晚加一个定时任务进行全量构建
|
|
|
方法二:监听CDC任务的insert,然后更新通关流程
|
|
|
|
|
|
|
|
|
## 八、验放数据问题
|
|
|
vw_vehicle_io_release 表存在重复数据,需要解决下述问题
|
|
|
1. 通道表sys_channel
|
|
|
需要修改海关通道号,处理一对多问题
|
|
|
![[Pasted image 20250722145839.png]]
|
|
|
|
|
|
2. 相机表 sys_camera
|
|
|
type=5 存在一条通道有多个车牌识别相机情况
|
|
|
![[Pasted image 20250722145957.png]]
|
|
|
3. 验放记录
|
|
|
```sql
|
|
|
select * from channel_records where domestic_no='77C13988'
|
|
|
```
|
|
|
有些车没有入区记录,IO 类型不对
|
|
|
![[Pasted image 20250722150227.png]]
|
|
|
|