CMSV6Help Center
/
839 DOCS · 211 VIDEOS中文

Database table field descriptions

Author yanghaiqingUpdated 2026-01-13 18:18:38Doc ID 24702,931 words · 13 min readView original ↗

1. Function description

Obtain the vehicle trajectory and the state information of the vehicle alarm from the database table.

2, Field Description

One. Status field of the alarm table

jt808_vehicle_alarm_xxxx Alarm Table: StatusStart- StatusEnd Parameter Description

Examples:
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21
Note: The above parameters are divided into array array with |, and the subscript starts from 0.
array[0] = 1; indicates state 1;
array[1] = 2; indicates state 2;
array[2] = 3; indicates state 3;
array[3] = 4; indicates state 4;
reference api interface:

array[4] = 5; Indicates speed; Unit: km/h, divided by 10 in use. 9999=999.9
array[5] = 6; indicates longitude;
If the device location is invalid, the value is 0.
For example: 113231258, the true value is 113.231258.
array[6] = 7; indicates latitude;
If the device location is invalid, the value is 0.
For example: 39231258, the true value is 39.231258.
array[7] = 8; indicates height;
array[8] = 9; indicates heading; direction: 0 degrees for true north, increasing clockwise, maximum 360 degrees.
array[9] = 10; indicates mileage; in meters.
array[10] = 11; Indicates the amount of oil; Unit: litres, divided by 100 in use. 9999=99.99
array[11] = 12; indicates the length of parking time; unit: seconds.
array[12] = 13; indicates temperature sensor 1;
array[13] = 14; indicates temperature sensor 2;
array[14] = 15; indicates temperature sensor 3;
array[15] = 16; indicates temperature sensor 4;
array[16] = 17; Indicates line id; Bus usage, line number
array[17] = 18; indicates direction; direction 0- up, 1- down
array[18] = 19; indicates station; bus usage, station sign 0- station 1- station yard
array[19] = 20; Indicates station status; Bus usage, station status 0- station 1- next station
array[20] = 21; indicates site index; bus usage, site index

#2. gps track table

jt808_vehicle_gps_xxx GPSData Fields

typedef struct _tagGPSVehicleGpsNew
{
GPSTime_S Time;
unsigned int uiSpeed:14; //Speed value KM/S 9999=999.9 range (0- 16384)
unsigned int uiYouLiang:18; //Oil Quantity Rise 9999=99.99 Range (0- 262100)
unsigned int uiLiCheng; //mileage km 9999=9.999
unsigned int uiHangXiang:9; //Ground heading,(0- 360) range (0- 512)
unsigned int uiMapType:3; //Map type 1 means GOOGLE,2 means Baidu, and 0 means invalid
unsigned int uiNetWorkType:4; // network type (3G class, WIFI, wired, 4G)
unsigned int uiTachographSpeed:14; //Speed value KM/S 9999=999.9 range (0- 16384) tachograph speed
// ttx protocol: when it is a person, it is resolved as battery power 0- 100, 90 = 90%
// unsigned int uiReserve:2; // Reserved bit 1
unsigned int uiLongGps : 2; //Long GPS, indicating that there are 72 bytes of data behind this structure. 0 bits are valid, indicating that libmdvrnet data is valid. 1 bit is valid, indicating that Gateway/database data is valid.
unsigned int uiStatus[4]; //Currently only used, every 1 state 0 bit indicates GPS positioning state (0 is invalid, 1 is valid)
short sTempSensor[4]; // Status of temperature sensor
int nJingDu; // longitude 4 byte integer part 9999999=9.999999
int nWeiDu; // latitude 4 byte integer part 9999999=9.999999
short nGaoDu; // Height, temporarily unused
unsigned short usSatellites:4; // Number of satellites, displayed when greater than 0, range 0- 12
unsigned short usReserve:8; // reserved field
unsigned short usExtraFlag:4; // additional information flag, the default is 0
Int nParkTime; // The parking time is valid in the stationary state.
GPSVehicleExtra_S Extra; // Consortium
} GPSVehicleGpsNew_S;
const int GPSVehicleGpsNew_LEN = sizeof(GPSVehicleGpsNew_S);
static_assert(72 == GPSVehicleGpsNew_LEN, "GPSVehicleGpsNew_S Length error");

typedef struct _tagGPSVehicleLongGps : public GPSVehicleGps_S
{
GPSTime_S RecvTime; // Receive GPS system time
unsigned int uiLongStatus; //Status bit 0 bit: compartment temperature 1 bit: IO status bit 2 bit: extended vehicle signal status 3 bit: analog quantity 4 bit: tire pressure
// 5 bits: active safety ADAS 6 bits: active safety DSM 7 bits: active safety BSD 8 bits: intense driving parameters 9 bits: intelligent detection (Shanghai)
// 10 bits: satellite positioning 11 bits: additional information of road network (current speed limit value of vehicles) 12 bits: additional information of road network (current road information)
// 13 bits: the new active safety status bit is valid 14 bits: (sub) oil tank 15 bits: water level 16 bits: the end alarm of active safety has been generated
// 17 bits: the status bit of the muck truck is valid 18 bits: today's mileage parameter is valid
short usCompartmentTemp; // cabin temperature (0x 06)
unsigned short usIOStatus; // IO status bit (0x2A)
unsigned int uiExtraStatus; // extended vehicle signal status bit (0x 25)
unsigned int uiAnalogQuantity; // analog (0x2B)

unsigned short usSafetyAlarm;
// Active safety alarm level 1 (+1000)
// Active safety alarm level 2 (+2000)
// Active safety alarm level 3 (+10000)
/* 0: forward collision alarm 1: lane departure alarm 2: vehicle distance approaching alarm 3: pedestrian collision alarm 4: frequent lane change alarm 5: road sign overrun alarm 6: obstacle alarm
7: curve speed warning 8: driving assistance function failure alarm 9: intersection rapid passing alarm 10: solid line lane change alarm 11: equipment failure reminder alarm 12: low speed front vehicle collision warning alarm level 1
13: road throwing 14: blacklist vehicle alarm 15: white list vehicle alarm 16: authorized overdue vehicle alarm 17: unauthorized vehicle alarm 18: pedestrian detection alarm in car aisle 19: blind area monitoring alarm
20: speed limit alarm 21: height limit alarm 22: width limit alarm 23: weight limit alarm
*/
// active safety dsm alarm status bit level 1 (+3000)
//active safety dsm alarm status bit level 2 (+4000)
//active safety dsm alarm status bit level 3 (+11000)
/* 0: fatigue driving alarm 1: receiving and calling alarm 2: smoking alarm 3: not looking ahead for a long time alarm 4: the system cannot work normally alarm 5: not wearing a seat belt alarm
6: no driver alarm detected 7: both hands off the steering wheel alarm 8: distracted driving alarm (su) 9: abnormal driver alarm (su) 10: abnormal driver IC card alarm (shan)
11: failure of sunglasses 12: failure alarm of driver behavior monitoring function 13: alarm of probe blocking 14: alarm of changing people driving 15: alarm of overtime driving
16: one- handed off the steering wheel alarm 17: drinking water alarm 18: driving for a long time 19: playing mobile phone 20: patrolling passenger safety belt 21: changing at night
22: normal alcohol test 23: incomplete alcohol test 24: drunk driving 25: drunk driving
*/
// active safety bsd alarm status bit (+5000)
/* 0: Left blind area alarm 1: Right blind area alarm 2: Rear approach alarm 3: Right blind area Level 1 alarm 4: Right blind area Level 2 alarm 5: Right blind area Level 3 alarm
6: Forward blind area alarm Level 1 alarm 7: Forward blind area alarm Level 2 alarm
*/
// Intense driving alarm (+6000)
/* 0: rapid acceleration alarm 1: rapid deceleration alarm 2: sharp turn alarm 3: idle speed alarm 4: abnormal flameout alarm 5: neutral coasting alarm 6: engine overrun alarm
7: rollover alarm
*/
// Intelligent Detection (Shanghai) Level 1 (+7000)
// Intelligent Detection (Shanghai) Level 2 (+8000)
/* 0: compartment overload alarm 1: passenger alarm outside the station 2: over- rated load alarm 3: over- road load alarm
*/
// Black Label Related Alarm (+9000)
/* 0: ID discrepancy alarm 1:IC card qualification card reading failure alarm 2: accident alarm 3: main memory abnormal alarm 4: backup memory abnormal alarm 5: satellite signal abnormal alarm
6: abnormal communication signal alarm 7: backup battery undervoltage alarm 8: backup battery failure alarm 9:IC card qualification certificate module failure alarm
*/

union
{
unsigned short usADASAlarmL2Reserved; // Reserved
unsigned short usWater;//Water level 9999=9999 litres (0- 65535)
};
union
{
//unsigned int uiDSMAlarmReserved;
struct
{
unsigned short usDSMAlarmL1Reserved; // Reserved
unsigned short usDSMAlarmL2Reserved; // Reserved
};
struct
{
unsigned int uiYouHaoHigh : 4; // tank 1 expansion, 4 bits higher
unsigned int uiYouHao2 : 22; //The fuel level of the auxiliary fuel tank rises 9999=99.99 range (0- 4194304)
unsigned int uiReserved : 6; // Reserved
};
};
// unsigned char ucBSDAlarmL1Reserved; // Reserved
// unsigned char ucBSDAlarmL2Reserved; // Reserved
unsigned short usTodayLiCheng; //Today's mileage is 0.1km (0- 65536)

union
{
struct
{
unsigned char ucLimitSpeedL; //When the additional information bit (11) of the road network is valid, the current speed limit value of the vehicle: unit: km/h
unsigned char ucLimitSpeedH; // road networkWhen the additional information bit (11) is valid, the current speed limit value of the vehicle: unit: km/h
};
unsigned short usLimitSpeed;
};

unsigned char ucSatellite; // satellite positioning
/* 0: over threshold speed alarm 1: over road speed limit alarm 2.(black mark) over speed alarm 3.(black mark) route deviation alarm 4.(black mark) no traffic section/area alarm
*/
unsigned char ucReserved_1 : 3; // Reserved
unsigned char ucDistractedDriving : 1; //distracted driving alarm level 2 (platform)
unsigned char ucReserved_2 : 4; // Reserved

// unsigned char ucReserved_3; // Reserved
unsigned char ucSatelliteContinue; // satellite positioning (continuous)
/* 0: over threshold speed alarm 1: over road speed limit alarm 2.(black mark) over speed alarm 3.(black mark) route deviation alarm 4.(black mark) no traffic section/area alarm
*/

unsigned char ucRoadType; // indicates the current road type when the road network additional information bit (12) is valid

union
{
struct // Note: 4- byte alignment, the first two parameters must be included [2020- 8- 21 ydl]
{
unsigned char ucRoadLimitSpeed; // When the additional information bit (12) of the road network is valid, it indicates the current road speed limit value.

unsigned char ucStatus5; // status bit (extended alarm bit based on uiStatus[4])
/* 0: dangerous driving behavior alarm 1:IO7 2:IO8 3: backup battery undervoltage alarm 4: backup battery failure alarm 5: backup memory failure alarm 6: sharp turn
*/

unsigned char ucTirePressure[30]; // tire pressure (0x 05)
};
struct // black label definition
{
unsigned short usHBNotUse; //Don't use, valid data, placeholder

short sAccelerationX; // acceleration, signed 0:X 1:Y 2:Z unit: 0.01g
short sAccelerationY; // acceleration, signed 0:X 1:Y 2:Z unit: 0.01g
short sAccelerationZ; // acceleration, signed 0:X 1:Y 2:Z unit: 0.01g

short sAngularVelocityX; // angular velocity 0:X 1:Y 2:Z unit: 0.1 °/s
short sAngularVelocityY; // angular velocity 0:X 1:Y 2:Z unit: 0.1 °/s
short sAngularVelocityZ; // angular velocity 0:X 1:Y 2:Z unit: 0.1 °/s

unsigned char ucAccelPedalStroke; //Accelerator pedal stroke value range 1~100, unit%
unsigned char ucBrakePedalStroke; // Brake pedal stroke value range 1~100, unit%

unsigned short usOBDSpeed; // OBD speed
unsigned short usOBDRpm; // engine speed unit RPM 0~16384

Short sOBDAngle; //Steering wheel angle The angle at which the steering wheel turns, clockwise is positive and counterclockwise is negative - 1024~1023
unsigned char ucOBDGear; //Gear state 0: neutral 01~09: gear 10: reverse gear 11: parking gear

unsigned char ucHBReserved[9]; // Reserved
};
struct // definition of muck truck
{
unsigned short usZtcNotUse; //Don't use, valid data, placeholder

unsigned char ucZtcTarpStatus; // status of muck carts tarpaulin
// 0: Invalid 1: Close 2: Open 3: Exception 4: Open incomplete 5: Close incomplete

unsigned char ucZtcLiftStatus; // lifting status of muck truck
// 0: invalid 1: flat 2: lift 3: abnormal

unsigned int uiZtcPlatformStatus; // muck truck (used by platform)
// bit0: tarpaulin state abnormal alarm bit1: lifting state abnormal alarm bit2: heavy no- load state abnormal alarm
// bit3: alarm bit4 for entering and leaving the electronic fence: unloading bit5 in the illegal area: the heavy vehicle driving compartment cover is not closed
// bit6: Ruiming Slag Truck Agreement

unsigned int uiZtcDeviceLinkStatus;// connection status of muck truck equipment
/*
0 1: connected, 0: tarpaulin detection device not connected
1 1: connected, 0: lifting detection device not connected
2 1: connected, 0: heavy no- load detection device not connected
3 (Ruiming) 1: connected, 0: ECU communication not connected
4 (Rui Ming) 1: connected, 0: not connected to audible and visual alarm
5 (Ruiming) 1: connected, 0: unconnected compartment door closure monitoring
6 1: Connected, 0: No authentication device connected
7 1: connected, 0: not connected to display external screen
8 1: connected, 0: not connected to display internal screen
9 1: Connected, 0: DSM not connected
10 1: connected, 0: BSD not connected
11 1: Connected, 0: ADAS not connected
12 1: connected, 0: the first camera is not connected
13 1: connected, 0: the second camera is not connected
14 1: connected, 0: third camera not connected
15 1: connected, 0: fourth camera not connected
16 1: connected, 0: fifth camera not connected
17 1: connected, 0: the sixth camera is not connected
18 1: connected, 0: seventh camera not connected
19 1: connected, 0: not connected relay input status 1: high level 0: low level
20 1: Connected, 0: Unconnected relay output status 1: High level 0: Low level
21- 31 Reserved
28 (Rui Ming) 1: Control Mode
30 (Rui Ming) 1: valid certificate
31 (Rui Ming) 1: with certificate
*/

unsigned int uiZtcAlarmStatus; // Illegal alarm status of muck truck
/*
0 Lift cheat, the flag will be maintained until it is removed
1 tarpaulin cheating, mark maintained until lifted
2 Empty and heavy cars cheat, the flag will be maintained until it is lifted
3 GPS cheating, the flag will be maintained until it is lifted
4 ECU cheat, the flag will be maintained until it is canceled
5 (sharp) speed cheating
6 (sharp) switch box cheating
7 (Rui Ming) GPS does not locate for a long time
5- 15 reserved
16 The speed line is cut and the alarm is given, and the sign is maintained until it is released.
17 (heavy vehicle) alarm for unsealed driving, and the sign is maintained until it is released
18 Illegal lifting, mark maintained until lifted
19 No license, mark maintained until lifted
20 The certificate is invalid, and the mark is maintained until it is released.
21 Smuggling, mark maintained until lifted
22 out of bounds, flag maintained until lifted
Reserved from 23 to 31
*/

unsigned char ucZtcLimitStatus; //Limiting status of muck truck Bit0: locking car Bit1: speed limit Bit2: lifting limit
unsigned char ucZtcEleFenceType; // electronic fence type 1: construction site; 2: restricted area; 3: elimination field; 4: speed limit circle; 5: parking lot; 6: route
unsigned char ucZtcEleFenceDirection; // electronic fence direction (0: in; 1: out)
unsigned char ucZtcMuckType; //(Ruiming) muck type 1: ordinary muck 2: sandstone 3: construction waste 4: shield soil
unsigned int uiZtcCarLockReason; //Reason for locking the muck car 0: unlocked car 1: locked car issued by the platform 8: authentication failed to lock the car
unsigned int uiZtcSpeedLimitReason; //Reason for speed limit of muck truck 0: no speed limit (maximum speed) 1: speed limit issued by platform 2:(heavy truck) top cover not sealed speed limit
// 3: Speed limit for heavy vehicles crossing the border 4: Speed limit for satellite signals being maliciously blocked 5: Speed limit for entering the construction site without a license
// 7:GNSS abnormal speed limit 9: lifting sensor failure or not connected speed limit 15:SIM card failure speed limit
// 16: Container Camera Failure or Not Connected Speed Limit 21: Regional Speed Limit 23: Heavy Vehicle Speed Limit Without Approval Certificate
unsigned int uiZtcLiftLimitReason; //Reason for limited lifting of muck truck 0: limited lifting 1: limited lifting issued by platform 2: limited lifting of heavy truck not in designated area (limited lifting in non- designated area)
// 3: Unlicensed access to the construction site 4: Unlicensed access to the disposal site
};
};

int nDriverID; // Driver ID

} GPSVehicleLongGps_S;
const int GPSVehicleLongGps_LEN = sizeof(GPSVehicleLongGps_S);

Parsing process:
A, first according to the GPSVehicleGpsNew_S structure to analyze, judge the uiLongGps variable, if uiLongGps = 1, then there are 72 bytes of content for the GPSVehicleLongGps_S data.
B, uiLongGps is 0, then this part of gps data has been parsed.

The following is an example of parsing code for JAVA

// Parse GPS track information
private void analyVehicleTrack(byte[] data, int offset, StandardDeviceTrack track) {
offset += 4;
int temp = ByteArrayUtils.byteArray2int(data, offset);
// Time
offset += 4;
// Speed value KM/S 9999=999.9 range (0- 16384)
track.setSpeed(temp & 0x00003FFF);
//oil volume rise 9999=99.99 range (0- 262100)
track.setYouLiang((temp>>14) & 0x0003FFFF);
// Mileage km 9999=9.999
temp = ByteArrayUtils.byteArray2int(data, offset);
offset += 4;
track.setLiCheng(temp);
// Ground heading,(0- 360) range (0- 512)
temp = ByteArrayUtils.byteArray2int(data, offset);
offset += 4;
track.setHuangXiang( temp & 0x01FF);
// Status 0 bit indicates GPS positioning status (0 is invalid, 1 is valid)
temp = ByteArrayUtils.byteArray2int(data, offset);
track.setStatus1(temp);
offset = 4;
analyVehicleStatus(temp,track);
// Status 2
temp = ByteArrayUtils.byteArray2int(data, offset);
track.setStatus2(temp);
offset = 4;
// Status 3
temp = ByteArrayUtils.byteArray2int(data, offset);
track.setStatus3(temp);
offset = 4;
// Status 4
temp = ByteArrayUtils.byteArray2int(data, offset);
track.setStatus4(temp);
offset = 4;
// Temperature sensor 1
short sTemp = ByteArrayUtils.byteArray2short(data, offset);
offset = 2;
track.setTempSensor1((int)sTemp);
// temperature sensor 2
sTemp = ByteArrayUtils.byteArray2short(data, offset);
offset = 2;
track.setTempSensor2((int)sTemp);
// temperature sensor 3
sTemp = ByteArrayUtils.byteArray2short(data, offset);
offset = 2;
track.setTempSensor3((int)sTemp);
// temperature sensor 4
sTemp = ByteArrayUtils.byteArray2short(data, offset);
offset = 2;
track.setTempSensor4((int)sTemp);
// longitude 4 byte integer part 9999999=9.999999
temp = ByteArrayUtils.byteArray2int(data, offset);
offset = 4;
track.setJingDu(temp);
//latitude 4 byte integer part 9999999=9.999999
temp = ByteArrayUtils.byteArray2int(data, offset);
offset = 4;
track.setWeiDu(temp);
// height 2 byte integer part 9999999=9.999999
temp = ByteArrayUtils.byteArray2short(data, offset);
offset = 2;
track.setGaoDu(temp);
//
temp = ByteArrayUtils.byteArray2short(data, offset);
offset = 2;
//Additional Information Flag Bit 0- Bus OBD 1- Video Department Mark 2- UAE School Bus
track.setExtraFlag((temp>>12)& 0x00000001);

// The parking time is valid in the stationary state.
temp = ByteArrayUtils.byteArray2int(data, offset);
offset = 4;
track.setParkTime(temp);


Reserved parameters
offset = 16;
}

Note: The data manually inserted into the database may fail to be parsed. It is recommended to use the data automatically written into the database for testing.

Source help.cmsv7.com
839 documents · 211 videos · docs.alwaycare.com