Not just TCP/UDP gateways. Based on Spring Boot 2.x technology, the complex docking of hardware interfaces is transformed into an easy-to-use interface and message push method. It has multiple capabilities such as device management, data analysis, and message push, and can be widely used in various vehicle supervision scenarios and application platform.

As the interface service of this gateway, bartender can provide strong support for the realization of vehicle networking supervision and ministry standard standards, and help the intelligentization and standardization of vehicle supervision.

bartender interface documentation


Software Architecture

Gateway Architecture of Light Vehicle Internet of Vehicles

Product Roadmap

Light vehicle network gateway circuit diagram

System Requirements

configuration item Specification
CPU memory 2-core 4G within 1w devices
hard disk 20G per 100 devices for 1 year
operating system Linux

Supported device types

Equipment type protocol
Conquest cable/OBD power connection equipment Conquest private agreement
Qiguo OBD Device Qiguo private agreement
Zero One OBD Device Zero One Private Protocol
Car hoist OBD equipment Car hoist private agreement
car easy control driving recorder JT808 ministry standard agreement
Hezheng driving recorder Hezheng private agreement
Xinyuanrun wireless equipment Xinyuanrun private agreement
ADAS equipment JT1078 ministry standard agreement

Supported alarm types

category Alarm item
The device comes with an alarm Battery removal alarm, illegal removal alarm, vibration alarm,
Risk location alarm, anti-hijacking alarm, cover opening alarm,
Displacement alarm, false base station alarm
Abnormal Driving Behavior – Fatigue/Talking/Smoking
Platform judgment alarm Overspeed alarm, alarm for entering sensitive area, alarm for exiting sensitive area,
Disconnected alarm, parking overtime alarm, separation alarm,
Out-of-province alarm, stay alarm in sensitive areas, timeout alarm for not entering commonly used areas,
In-situ fortification alarm, power fence alarm,
Alarm when exiting the electronic fence, alarm inside the fence, and overtime parking inside the fence


concept definition
message Hardware uplink data, such as positioning, heartbeat, alarm, OBD and other information.
server time The time when the platform receives the message.
positioning time The GPS positioning time in the message is the GPS positioning time obtained by the hardware using its own GPS module.
online/offline status The platform updates the device status to offline 10 minutes after receiving the last message from the hardware. It is online during message reporting.
Parking/driving status Speed ​​greater than 5 is regarded as driving, otherwise stop. Device speed is 0 when offline.
mileage According to the reported positioning points, it is sorted by GPS time, and the distance between the positioning points is accumulated.
stop point A period of time from the start of parking to driving is regarded as a stop point, and the stop time is at least 10 minutes.
track A route drawn by sorting historical positioning data by positioning time.
track segmentation Divide the trajectory into travel segments. By default, the separation condition is that the point spacing exceeds 10 meters, and the positioning time interval exceeds 15 minutes.

1. API authentication

When using it for the first time, we will provide the authentication information of the calling terminalclient_idandclient_secretcall the authentication interface to obtain credentialsaccess_tokenand then you can start using other business API interfaces.

Authentication interface POST /oauth/token

The token_type and access_token returned by this interface use' '(Space) After connection, carry the calling service interface in the request header.

request parameters

name Location type required illustrate
grant_type query string yes fixed parameters
client_id query string yes Client ID
client_secret query string yes client key

Successful return example

  "access_token": "this_is_an_example_access_token",
  "token_type": "bearer",
  "expires_in": 40528,
  "scope": "all",
  "jti": "483fb3cf-e63b-415d-93bd-bdd4f12a8213"

return result

status code status code meaning illustrate data model
200 OK success Inline

return data structure

name type required constraint Chinese name illustrate
» access_token string true none authentication token none
» token_type string true none Authentication type none
» expires_in integer true none After how many seconds the token expires none

2. Device access and message reception

After the system is built, if you use third-party hardware, you need to configure the hardware to the TCP (UDP) online port of the corresponding protocol. If you use our equipment, you can contact customer service for configuration. As shown in the figure, first add the device to ensure that the device is online. If you need to receive real-time location and alarm of the device, you need to enable event push.

Devices – add interface GET /devices/syn

Support batch adding of the same model, use default parameters to bypass authentication.

request parameters

name Location type required illustrate
clientId query string yes Client ID
categoryNo query string yes device model, long name
deviceNums query string yes Device number, separated by commas in batches

return result

status code status code meaning illustrate data model
200 OK success Inline

Device-batch start and stop push interface GET /devices/batch

If the enabled status is not specified when the device is imported, it will be enabled by default, and there is no need to enable it in batches. If the initial state of the specified device is disabled during import, you need to use this interface to control. When disabled, the positioning status and event information will not be pushed.

request parameters

name Location type required illustrate
devices query string yes Device numbers that need to be started and stopped, separated by commas when multiple
isEnable query string yes 0: enable 1: disable

return result

status code status code meaning illustrate data model
200 OK success Inline
  1. Verify that the device is online

Device location – operation and maintenance view device location status interface GET /opt/location

Operation and maintenance use query device latest positioning status, when the device number does not exist, it prompts “device number does not exist”

request parameters

name Location type required illustrate
deviceNum query string yes none

Successful return example

  "code": 200,
  "data": {
    "categoryNo": "DO90",
    "categoryNoShort": "DO90",
    "createTime": "2022-07-27 05:12:00",
    "deviceNum": "868120250375836",
    "direction": 28,
    "directionName": "东北",
    "gpsTime": "2022-07-26 16:14:49",
    "isMoving": 0,
    "latBd": 29.116056,
    "latGc": 29.109734,
    "lngBd": 119.654767,
    "lngGc": 119.648356,
    "locMode": 9,
    "satCount": 15,
    "speed": 0,
    "startTimeMovingStop": "2022-06-23 07:45:53",
    "startTimeOnOffLine": "2022-07-27 05:12:00",
    "wifiFlag": 1
  "message": "",
  "success": true

return result

status code status code meaning illustrate data model
200 OK success Inline

return data structure

name type required constraint Chinese name illustrate
» code integer true none none
» data object true none none
»» categoryNo string true none Equipment type none
»» categoryNoShort string true none Device Type Short Name none
»» createTime string true none creation time none
»» deviceNum string true none Device No none
»» direction integer true none direction none
»» directionName string true none direction description none
»» gpsTime string true none positioning time none
»» isMoving integer true none Driving: 1; Parking: 0 none
»» latBd number true none Baidu coordinate latitude none
»» latGc number true none Gaode coordinate latitude none
»» lngBd number true none Baidu coordinate longitude none
»» lngGc number true none Gaud coordinate longitude none
»» locMode integer true none Positioning method 0-GPS; 1-LBS single base station; 2-LBS multi-base station; 5-WIFI; 9-no positioning none
»» satCount integer true none Number of satellites Number of satellites none
»» speed integer true none speed none
»» startTimeMovingStop string true none Driving/stopping + start time year month day hour minute second none
»» startTimeOnOffLine string true none Online/offline start time year month day hour minute second none
»» wifiFlag integer true none Device Type 1: Wired none
» message string true none none
» success boolean true none none

The total number of online devices and the online number of each port

The port health status can be roughly judged according to the real-time online number of each port. When there are few vehicles at a certain port or most of the vehicles are parked at the current time, it is not enough to judge the port health status. You can refer to the following SQL query to query the online quantity.

FROM dd_new.position p;

SELECT p.TAG as '端口',
COUNT(*) AS '累计上线数量',
MAX(p.CREATE_TIME) AS '最新服务时间',
NOW() AS '当前时间',
IF(COUNT(p.ALM_OFFLINE = 0 AND (p.ISSLEEPING=0 OR p.ISSLEEPING IS NULL) OR NULL) < 100, '设备较少', '异常')) AS '端口健康' -- 该阈值需根据活跃车辆数进行调整
FROM dd_new.position p

Device does not go online

Location update callbackThe device data cannot be received, or there is no new data for more than 30 minutes.

Operation and maintenance suggestions:

  1. Confirm that the device is powered on and the vehicle is running normally.
  2. Confirm with your network operator that the IoT card is available.
  3. Avoid placing the vehicle in a location with poor signal such as an underground parking lot. Refer to the equipment manual, judge according to the indicator light, and confirm that the network signal is good and the GPS signal is good.

Inaccurate device positioning

There is a deviation between the vehicle’s location on the map and its actual location.

Operation and maintenance suggestions:

  1. Confirm that the vehicle is running normally, otherwise the device may be powered off.
  2. confirmLocation update callbackIt is normal to receive the data of the device. If there is no update, it is suspected that there is a problem that the device is not online.
  3. If the positioning identifier in the callback dataAV=Vindicating that the device cannot search for satellite signals, and GPS positioning fails. It is recommended to drive to a location with better signals.

#bartender #Homepage #Documents #Downloads #Light #Vehicle #Internet #Vehicles #Gateway #News Fast Delivery

Leave a Comment

Your email address will not be published. Required fields are marked *