Analysis and Processing of Signals in Vehicle GPS Positioning Monitoring System

introduction

This article refers to the address: http://

As the role of automobiles in daily production and life becomes more and more prominent, how to achieve effective command, coordinated control and management of various types of vehicles has become an important issue facing the transportation and safety management departments. In order to meet the needs of improving transportation efficiency and safety, the research on vehicle positioning monitoring system is becoming more and more urgent.

The vehicle GPS positioning monitoring system is a software technology developed by GSM global digital cellular mobile communication technology and GIS geographic information technology, GPS global satellite positioning technology and computer network technology. It receives the satellite signal through a GPS receiver (ie, the vehicle-mounted device) installed on the vehicle, and the communication controller of the monitoring center extracts the required position, speed and time information from the signal output by the GPS receiver, and combines information such as the vehicle identity. The datagram is formed and then sent to the control center through the wireless channel; the primary station of the control center receives the data sent by the substation, and the processing and receiving information is directly sent to each in-vehicle device through the short message. Finally, the specific data and status of the vehicle are displayed on the electronic map of the monitoring center.

This paper discusses the method of extracting the required position, velocity and time information from the signal output by the receiver, and the implementation process of sending the command set after the central processing of the information.

Communication protocol for GPS vehicle-mounted devices

The communication method between the in-vehicle device and the monitoring center is carried out by the center sending commands and the in-vehicle device answering. Therefore, the analysis and processing of the GPS signals of the in-vehicle device must be based on the communication protocol between the in-vehicle GPS receiver and the monitoring center. The following is part of the GPS in-vehicle communication protocol.

In-vehicle machine return information general information:
*XX,YYYYYYYYYY,V1,HHMMSS,S,latitude,D,longitu de,G,speed,direction,DDMMYY,vehicle_status#
Confirmation information:
*XX,YYYYYYYYYY,V4,CMD,hhmmss,HHMMSS,S,latitu de,D,longitude,G,speed,direction,DDM MYY,vecicle_status#
The method of distinguishing between general information and confirmation information is to see whether "V4" is included in the information transmitted from the in-vehicle device. The method for judging whether the returned information is valid is to see whether "HQ (manufacturer name)" is included in the return message.

Where: '*' indicates the command header; 'XX' indicates the manufacturer name; ',' indicates the separator; 'YYYYYYYYYY' indicates the in-vehicle serial number; 'CMD' indicates the confirmed center command; 'hhmmss' indicates the confirmed command Time value in 'HHMMSS' indicates on-board time; 'S' indicates data valid bit; 'latitude' indicates latitude; 'D' indicates latitude flag; 'longitude' indicates longitude; 'G' indicates longitude flag; 'speed' Indicates speed; 'direction' indicates azimuth; 'DDMMYY' indicates day/month/year; 'vehicle_status' indicates vehicle status.

There are two ways to return the GPS information to the on-board computer. One is to return the most recent valid GPS information; the other is to return the latest GPS information.

The center sends the command structure and command set

The center sends the command structure: *XX, YYYYYYYYYY, CMD, HHMMSS, PARA1, PARA2,...#
It must be written in this format when the authoring center sends instructions. The seven central send commands are listed below.
Positioning monitoring command D1: This command requires the in-vehicle machine to return the count position information at intervals of interval.
Automatic monitoring setting command S17: This command completes the setting of the automatic monitoring parameters.
Parameter setting instruction S12: This instruction is only used for the switching control of the S17 command.
Set the monitoring center SMS number S2: The vehicle will send a confirmation message to the new monitoring center immediately after receiving the command.
The call setting command S13: bit_0 of phone_flag is allowed to be played, and when bit1=0, it is allowed to answer.
Clear alarm command R7: The vehicle will clear all alarm information after receiving the command.
Cold start command R1: The vehicle will receive a cold start reset after receiving the command, and all state parameters are cleared.

Design and implementation of communication software

The communication between the GPS signal and the monitoring center is roughly divided into two steps: First, the GPS receiver (ie, the vehicle-mounted device) receives the satellite signal, and the communication controller of the monitoring center extracts the required position and speed from the signal output by the GPS receiver. Data information such as time and time; second, the monitoring center sends the analyzed data information to each in-vehicle device by means of a short message. Specific steps are as follows:
Function IsValidMsg(Str: String): Boolean;{determine whether the message is valid}
Function IsConfgMsg(Str: String): Boolean; {Differentiate general information and confirmation information}
Procedure ResoleGprsV(RecvGprs: String);{Process Acceptance Information}
Procedure ResoleGprsV1(RecvGprs: String);{Processing general information (V1)}
Procedure ResoleGprsV4(RecvGprs: String); {Process Confirmation Information (V4)}
Function Direc(sr: String): String;{vehicle direction}
Function HexCng(Rhex: String): String;{ Convert hexadecimal numbers to binary numbers}
Function HandleCarStatus(ArrBin: array of String): String;{Processing Vehicle Status}
Function ChangeTel(sTel: String): String;{}
Function StrToHex(sStr: String): String;
Procedure SendSms(Tel, Other: String; iCmdID, iSendType: Integer;
CarID: String = ''){Center Send Command Set}

It is judged whether the returned information is valid from the GPS signal received by the in-vehicle device, and if it is invalid, it is directly discarded. If it is valid, it is confirmed whether it is general information or determined information, and then the processing general information or the determination information is received.

The basis for distinguishing between general information and confirmation information is whether the parameter string contains "V4".
Result := False; {initial return result}
Result := pos('V4', Str) > 0;{If str contains "V4", it returns true, otherwise false}
The basis for determining whether to return valid information is whether the parameter string contains "*HQ".
Result := False; {initial return result}
Result := pos('*HQ',Str) > 0;{If str contains " *HQ", it returns true, otherwise false}
The general information is marked V1. The parameters included in the general information of the vehicle return are the vehicle serial number, mobile phone number, license plate number, time, latitude and longitude, speed, bearing, and date.
/ / Get the car serial number (the same method can get the mobile phone number, license plate number, time)
sCarNo := copy(RecvGprs, iPos + 4, 10);
/ / Get latitude (the same method can get longitude)
sLatitude := copy(RecvGprs, iPos + 3, 9);
sLatitude := FloatToStr( StrToFloat(copy(sLatitude, 1, 2)) +StrToFloat(copy(sLatitude, 3, 7)) / 60 );
/ / Get south latitude and north latitude (the same method can get things)
iPos := pos(',S,', RecvGprs); {find", S, "in the position of RecvGprs}
If iPos > 0 then; {If RecvGprs contains ', S, ', execute the following statement}
sNS := 'Southern latitude'
Else begin
iPos := pos(',N,', RecvGprs); {Find ", N,"
In the location of RecvGprs}
sNS :='North latitude';
End;
/ / Get speed, bearing, date
sSpeed ​​:= copy(RecvGprs, iPos + 3, 6); {Get Speed}
sDirection := copy(RecvGprs, iPos + 10, 3);{Get azimuth}
sDate := copy(RecvGprs, iPos + 14, 6); {Get Date}
If Pos('.', sSpeed) <= 0 then{determine whether sSpeed ​​contains '.', if it contains, execute the following statement}
Begin
sSpeed ​​:= copy(RecvGprs, iPos + 3, 3); {Get speed}
sDirection := copy(RecvGprs, iPos + 7, 3); {Get Direction}
sDate := copy(RecvGprs, iPos + 11, 6); {Get Date}
End;
/ / Data conversion
sSpeed ​​:= FormatFloat('0.00' ,StrToFloat(sSpeed) * 1.852);{Travel speed conversion}
sSceond := copy(sTime, 5, 2); {time conversion}
If StrToInt(sSceond) < 60 then{time conversion ('YYYY-MM-DD HH:MM:SS' is expressed as: year, month, day, hour, minute, and second}
sDate := FormatDateTime('YYYY-MM-DD HH:MM:SS', IncHour(StrToDateTime('20' +copy(sDate, 5, 2) + '-' + copy(sDate, 3, 2) + '- ' + copy(sDate, 1, 2) +' ' + copy(sTime, 1, 2) + ':' + copy(sTime, 3, 2) + ':'+ copy(sTime, 5, 2)), 8))
Else begin
sDate := FormatDateTime('YYYY-MM-DD HH:MM:SS', IncHour(StrToDateTime('20' +
Copy(sDate, 5, 2) + '-' + copy(sDate, 3, 2) + '-' + copy(sDate, 1, 2) +' ' + copy(sTime, 1, 2) + ':' + copy(sTime, 3, 2) + ':'+ '00'), 8));
sDate := FormatDateTime('YYYY-MM-DD HH:MM:SS',
IncMinute(StrToDateTime(sDate), + 1));
End;

The sign of the confirmation message is V4. The confirmation message of the vehicle return includes the vehicle's driving direction and vehicle status.

The position information obtained in the general information is converted from the character type to the integer data, and the driving direction of the vehicle is determined according to the range of the data, which is less than 22.5 or greater than 337.5 is the north direction, greater than 22.5 is less than 67.5 for the northeast direction, and greater than 67.5 is less than 112.5. For the direction of the east, and so on, confirm the direction of travel of the vehicle.

The state of the vehicle obtained in the general information is processed, converted from a character type to a binary number string, each bit of the binary data is stored in an array, and each bit corresponds to a vehicle state in Table 1.

/ / Get the vehicle status
iPos := Pos('#', RecvGprs);
sCarStatus := copy(RecvGprs, iPos - 8, 8)
/ / Convert to a binary string
sBin := '';
For I := 1 to 8 do
sBin := sBin + HexCng(copy(sCarStatus, I, 1));
/ / Put each bit of binary data into an array
For I := 0 to 31 do
ArrBin[I] := copy(sBin, I + 1, 1);
sCarStatuText := HandleCarStatus(ArrBin);{vehicle status}
The monitoring center sends different commands according to the information content returned by each in-vehicle device. The command to send commands must be written in strict accordance with the format specified by the central command set. Some of the commands are listed below:
//This command requires the in-vehicle to return the sCount positioning information with sInterval as the time interval.
sRightStr := '*HQ,0000000000,D1,' + sTime + ',' +sInterval + ',' + sCount + '#'
//The vehicle will clear all alarm information after receiving this command.
sRightStr := '*HQ,0000000000,R7,' + sTime + '#';
If Application.MessageBox(PChar('Really want to unlock the vehicle ['+CarID+']?), 'Prompt', MB_YESNO + MB_DEFBUTTON2) = IDNO then Exit;
The CarID here refers to the serial number of the in-vehicle device.
//When the car-mounted machine receives this command, it will start the fuel cut-off.
sRightStr := '*HQ,0000000000,S20,' + sTime + ',1,3,10,3,5,5#';
If Application.MessageBox(PChar('Really power off the vehicle ['+CarID+']?'), 'Prompt', MB_YESNO + MB_DEFBUTTON2) = IDNO then Exit;

Conclusion

At present, the vehicle GPS positioning monitoring system has been used by various transportation companies in taxis, buses and large fleets. The software technology has achieved the monitoring and scheduling management of vehicle position and status.

With the expansion of the GPS application field, the functions of the system of the vehicle GPS navigation and positioning monitoring software will continue to increase and improve with the requirements of navigation and communication. The GPS in-vehicle communication protocol will be upgraded according to the function upgrade of the GPS in-vehicle product, adding new commands, and the corresponding software system will also add new instructions. The design of the system will be easy for these upgrades and maintenance work.

Frontal Loading Washing Machine

Frontal Loading Washing Machine,Automatic Washing Machine,Fully Automatic Washing Machine

Single Door Refrigerator Co., Ltd. , http://www.cn-homeappliance.com