CN107426198A - A kind of method and system of communication - Google Patents

A kind of method and system of communication Download PDF

Info

Publication number
CN107426198A
CN107426198A CN201710541225.1A CN201710541225A CN107426198A CN 107426198 A CN107426198 A CN 107426198A CN 201710541225 A CN201710541225 A CN 201710541225A CN 107426198 A CN107426198 A CN 107426198A
Authority
CN
China
Prior art keywords
message
field
byte
header
flag
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710541225.1A
Other languages
Chinese (zh)
Inventor
陈建国
陈涛
孙占辉
苏国锋
袁宏永
周正青
刘艳峰
田超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Chen'an Mdt Infotech Ltd
Tsinghua University
Beijing Global Safety Technology Co Ltd
Original Assignee
Beijing Chen'an Mdt Infotech Ltd
Tsinghua University
Beijing Global Safety Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Chen'an Mdt Infotech Ltd, Tsinghua University, Beijing Global Safety Technology Co Ltd filed Critical Beijing Chen'an Mdt Infotech Ltd
Priority to CN201710541225.1A priority Critical patent/CN107426198A/en
Publication of CN107426198A publication Critical patent/CN107426198A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/03Protocol definition or specification 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/26Special purpose or proprietary protocols or architectures

Abstract

The embodiments of the invention provide a kind of method and system of communication, it is related to communication technical field, message is transmitted between client and server, by defines the composition form of message, compression transmission flow.This method includes user end to server and sends request message;The server receives the request message, and according to the request message, response message is returned to the client;The client receives the response message that the server returns;The composition of message includes starting flag, message header and message body, the beginning flag uses a byte representation, the message header includes type of message and message SN, the type of message is using 4 expressions before a byte, the message body includes start byte, message field, and the message field is represented by numerical value or numerical index.Technical scheme provided in an embodiment of the present invention is suitable for public transportation system, in the message transmitting procedure of client and public transport monitoring central server.

Description

A kind of method and system of communication
【Technical field】
The present invention relates to communication technical field, more particularly to a kind of method and system of communication.
【Background technology】
The passenger of bus is more and miscellaneous, belongs to the public place of densely populated place, it is therefore desirable to which the situation on bus is entered Row real-time management monitors, to ensure public place safety.Therewith, the management monitoring system of public transport is with the communication technology Progress and continue to develop.
At present, a kind of pattern be present in the management monitoring system of public transport, supervised by cell-phone customer terminal and public transport Communicated between control central server, to obtain the real time information in public transport, such as the warning message of passenger and GPS (Global Positioning System, global positioning system) information etc..In the prior art, cell-phone customer terminal with it is public TCP (Transmission Control (are based on by webscoket agreements between traffic surveillance and control center server Protocol, transmission control protocol) full-duplex communication agreement) connection, based on MQTT (Message Queuing Telemetry Transport, message queue remote measurement transmission) component forwarding information of increasing income communicated.The warning message of passenger And longitude and latitude in GPS, speed, direction are sent to server with the data type of character string.
In process of the present invention is realized, inventor has found that at least there are the following problems in the prior art:
Cell-phone customer terminal sends public transport with the data type of character string to public transport monitoring central server Real time information, byte is more, and data volume is big, causes the traffic demand in transmitting procedure big.
【The content of the invention】
In view of this, the embodiments of the invention provide a kind of method and system of communication, passed between client and server Defeated message, by defining the composition form of message, the data type of character string is replaced with into numeric type, client and server it Between transmit real-time messages byte it is few, data volume is small, and transmitting procedure traffic demand is small.
In a first aspect, the embodiment of the present invention provides a kind of method of communication, suitable for communication system, the communication system bag Client and server is included, methods described includes:
The client sends request message to the server;
The server returns to response message to the client;
The composition of message includes starting flag, message header and message body, and the beginning flag uses a table of bytes Show, the message header includes type of message and message SN, and the type of message is described using 4 expressions before a byte Message body includes start byte, message field, and the message field is represented by numerical value or numerical index;When the request message For registration message, log messages, logout message, unbind message or warning message when, the composition of the request message also includes school Test code.
Second aspect, the embodiment of the present invention provide a kind of method of communication, suitable for communication system, the communication system bag Client and server is included, methods described includes:
User end to server sends registration message;
The server returns to registration reply message to the client;
The composition of the registration message includes starting flag, message header, message body and check code;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0000;Message body includes start byte, disappeared Cease field;Start byte is 1, and message field is used to represent log-on message, and log-on message includes license plate number and cell-phone number and/or department Machine driver license number and/or vehicle driving license numbering, the data type of message field is STRING;
The composition of the registration reply message includes starting flag, message header and message body;Start flag, message header Beginning flag, message header with the registration message is consistent;Message body includes start byte, message field;Start byte is 0 When, message field is used to represent registration reply result, and registration reply result represents whether numerical index is with noting by numerical index Volume success and registration failure reason are corresponding, and the data type of message field is BYTE;When start byte is 1, message field is used In representing sign-on ID, the type of message field is WORD.
The third aspect, the embodiment of the present invention provide a kind of method of communication, suitable for communication system, the communication system bag Client and server is included, methods described includes:
User end to server sends log messages;
The server returns to the client and logs in response message;
The composition of the log messages includes starting flag, message header, message body and check code;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0001;Message body includes start byte, disappeared Cease field;Start byte is 0, and message field is used to represent log-on message, and log-on message includes license plate number and cell-phone number, message word The data type of section is STRING;
The composition for logging in response message includes starting flag, message header and message body;Start flag, message header Beginning flag, message header with the log messages is consistent;Message body includes start byte, message field;Start byte is 0 When, message field is used to represent to log in response result, logs in response result and represents whether numerical index is with stepping on by numerical index Record successfully and login failure reason is corresponding, the data type of message field is BYTE;When start byte is 1, message field is used In representing sign-on ID, the type of message field is WORD.
Fourth aspect, the embodiment of the present invention provide a kind of method of communication, suitable for communication system, the communication system bag Client and server is included, methods described includes:
User end to server sends logout message;
The server returns to the client and nullifies response message;
The composition of the logout message includes starting flag, message header, message body and check code;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0002;Message body includes start byte, disappeared Cease field;Start byte is 0, and message field is used to represent log-off message, and log-off message includes license plate number and cell-phone number, message word The data type of section is STRING;
The composition for nullifying response message includes starting flag, message header and message body;Start flag, message header Beginning flag, message header with the logout message is consistent;Message body includes start byte, message field;Start byte is 0, message field is used to represent to nullify response result, nullifies response result and represents whether numerical index is with noting by numerical index Sell successfully and nullify failure cause and correspond to, the data type of message field is BYTE.
5th aspect, the embodiment of the present invention provide a kind of method of communication, suitable for communication system, the communication system bag Client and server is included, methods described includes:
User end to server sends and unbinds message;
The server returns to the client and unbinds response message;
The composition for unbinding message includes starting flag, message header, message body and check code;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0003;Message body includes start byte, disappeared Cease field;Start byte is 0, and message field unbinds information for expression, and unbinding information includes license plate number and cell-phone number, message word The data type of section is STRING;
The composition for unbinding response message includes starting flag, message header and message body;Start flag, message header It is consistent with the beginning flag for unbinding message, message header;Message body includes start byte, message field;Start byte is 0, message field unbinds response result for expression, unbinds response result and is represented by numerical index, and whether numerical index is with solving It is corresponding to tie up successfully and unbind failure cause, the data type of message field is BYTE.
6th aspect, the embodiment of the present invention provide a kind of method of communication, suitable for communication system, the communication system bag Client and server is included, methods described includes:
User end to server sends heartbeat message;
The server returns to heartbeat response message to the client;
The composition of the heartbeat message includes starting flag, message header and message body;It is 01111111 to start flag; Message header includes type of message and message SN, type of message 0004;Message body includes start byte, message field;Rise Beginning byte is 0, and message field is used to represent heartbeat message, and heartbeat message includes sign-on ID, and the data type of message field is WORD;
The composition of the heartbeat response message includes starting flag, message header and message body;Start flag, message header Beginning flag, message header with the heartbeat message is consistent;Message body includes start byte, message field;Start byte is 0, message field be used for represent heartbeat response result, heartbeat response result is represented by numerical index, numerical index with whether the heart Jump successfully and heartbeat failure cause is corresponding, the data type of message field is BYTE.
7th aspect, the embodiment of the present invention provide a kind of method of communication, suitable for communication system, the communication system bag Client and server is included, methods described includes:
User end to server sends warning message;
The server returns to alarm response message to the client;
The composition of the warning message includes starting flag, message header, message body and check code;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0005;Message body includes start byte, disappeared Cease field;When start byte is 0, message field is used to represent sign-on ID, and the data type of message field is WORD;Banner word Save for 1 when, message field is used to represent warning message, and warning message includes license plate number, longitude, latitude, road speed, time Whether point, alarm keyword, global position system GPS information are effectively middle one or more, and the data type of message field is STRING;
The composition of the alarm response message includes starting flag, message header and message body;Start flag, message header Beginning flag, message header with the warning message is consistent;Message body includes start byte, message field;Start byte is 0, message field is used to represent alarm response result, and alarm response result represents whether numerical index is with reporting by numerical index Warn and successfully correspond to, the data type of message field is BYTE.
Eighth aspect, the embodiment of the present invention provide a kind of method of communication, suitable for communication system, the communication system bag Client and server is included, methods described includes:
User end to server sends global position system GPS message;
The server returns to GPS response messages to the client;
The composition of the GPS message includes starting flag, message header and message body;It is 01111111 to start flag; Message header includes type of message and message SN, type of message 0006;Message body includes start byte, message field;Rise When beginning byte is 0, message field is used to represent sign-on ID, and the data type of message field is WORD;When start byte is 1, Message field is used to represent GPS location information, GPS location information include license plate number, longitude, latitude, road speed, time point, One or more during whether GPS information is effective, the data type of message field is STRING;
The composition of the GPS response messages includes starting flag, message header and message body;Start flag, message header Beginning flag, message header with the GPS message is consistent;Message body includes start byte, message field;Start byte is 0, Message field is used to represent GPS location response result, and GPS location response result represents that numerical index is with being by numerical index No GPS location successfully corresponds to, and the data type of message field is BYTE.
9th aspect, the embodiment of the present invention provide a kind of method of communication, suitable for communication system, the communication system bag Client and server is included, methods described includes:
Server sends a notification message to client;
The client returns to notice response message to the server;
The composition of the notification message includes starting flag, message header and message body;It is 01111111 to start flag; Message header includes type of message and message SN, type of message 0007;Message body includes start byte, message field;Rise When beginning byte is 0, message field is used to represent sign-on ID, and the data type of message field is WORD;When start byte is 1, Message field is used to represent notification type, and notification type is represented by numerical index, numerical index and weather, traffic, maintenance, peace Entirely, announcement information is corresponding, and the data type of message field is BYTE;When start byte is 2, message field is used to represent notice letter The content of breath, the data type of message field is STRING;
The composition of the notice response message includes starting flag, message header and message body;Start flag, message header Beginning flag, message header with the notification message is consistent;Message body includes start byte, message field;Start byte is 0, message field is used to represent notice response result, and notice positioning response result represents that numerical index is with being by numerical index No to notify successfully to correspond to, the data type of message field is BYTE.
Tenth aspect, the embodiment of the present invention provide a kind of method of communication, suitable for communication system, the communication system bag Client and server is included, methods described includes:
Server is to client send configuration message;
The client returns to configuration response message to the server;
The composition of the configuration message includes starting flag, message header and message body;It is 01111111 to start flag; Message header includes type of message and message SN, type of message 0008;Message body includes start byte, message field;Rise When beginning byte is 0, message field is used to represent sign-on ID, and the data type of message field is WORD;When start byte is 1, Message field is used to represent Configuration Type, and Configuration Type is represented by numerical index, numerical index global position system GPS information Report duration corresponding, the data type of message field is BYTE;When start byte is 2, message field is used to represent Configuration Values, disappears The data type for ceasing field is STRING;
The composition of the configuration response message includes starting flag, message header and message body;Start flag, message header Beginning flag, message header with the log messages is consistent;Message body includes start byte, message field;Start byte is 0, message field is used to represent configuration response result, and configuration response result represents whether numerical index is with matching somebody with somebody by numerical index It is corresponding to be set to work(, the data type of message field is BYTE.
Tenth on the one hand, and the embodiment of the present invention provides a kind of communication system, and the communication system includes:
Client, for sending request message to server;
Server, for returning to response message to the client;
The composition of message includes starting flag, message header and message body, and the beginning flag uses a table of bytes Show, the message header includes type of message and message SN, and the type of message is described using 4 expressions before a byte Message body includes start byte, message field, and the message field is represented by numerical value or numerical index;When the request message For registration message, log messages, logout message, unbind message or warning message when, the composition of the request message also includes school Test code.
The embodiments of the invention provide a kind of method and system of communication, message is transmitted between client and server, is led to The composition form for defining message is crossed, is numerical value by the message field definition in message body, the data type of character string is replaced with Numeric type, transmission real-time messages byte is few between client and server, and data volume is small, and transmitting procedure traffic demand is small.
【Brief description of the drawings】
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by embodiment it is required use it is attached Figure is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for this area For those of ordinary skill, without having to pay creative labor, it can also be obtained according to these accompanying drawings other attached Figure.
Fig. 1 is a kind of method flow diagram of communication provided in an embodiment of the present invention;
Fig. 2 is the method flow diagram of another communication provided in an embodiment of the present invention;
Fig. 3 is the method flow diagram of another communication provided in an embodiment of the present invention;
Fig. 4 is the method flow diagram of another communication provided in an embodiment of the present invention;
Fig. 5 is a kind of composition frame chart of communication system provided in an embodiment of the present invention.
【Embodiment】
In order to be better understood from technical scheme, the embodiment of the present invention is retouched in detail below in conjunction with the accompanying drawings State.
It will be appreciated that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.Base Embodiment in the present invention, those of ordinary skill in the art obtained under the premise of creative work is not made it is all its Its embodiment, belongs to the scope of protection of the invention.
The term used in embodiments of the present invention is only merely for the purpose of description specific embodiment, and is not intended to be limiting The present invention." one kind ", " described " and "the" of singulative used in the embodiment of the present invention and appended claims It is also intended to including most forms, unless context clearly shows that other implications.
It will be appreciated that though it may describe transmitting element using term first, second in embodiments of the present invention, receive Unit, but should not necessarily be limited by these terms.These terms are only used for transmitting element or receiving unit being distinguished from each other out.For example, In the case of not departing from range of embodiment of the invention, the first transmitting element can also be referred to as the second transmitting element, similarly, the Two transmitting elements can also be referred to as the first transmitting element.
It should be appreciated that term "and/or" used herein is only a kind of incidence relation for describing affiliated partner, represent There may be three kinds of relations, for example, A and/or B, can be represented:Individualism A, while A and B be present, individualism B these three Situation.In addition, character "/" herein, it is a kind of relation of "or" to typically represent forward-backward correlation object.
Depending on linguistic context, word as used in this " if " can be construed to " ... when " or " when ... When " or " in response to determining " or " in response to detection ".Similarly, depending on linguistic context, phrase " if it is determined that " or " if detection (condition or event of statement) " can be construed to " when it is determined that when " or " in response to determine " or " when the detection (condition of statement Or event) when " or " in response to detecting (condition or event of statement) ".
The embodiments of the invention provide a kind of method of communication, suitable for the communication system of public transport, client with In the message transmitting procedure of public transport monitoring central server, as shown in figure 1, methods described includes:
101st, user end to server sends request message.
Wherein, the client refers to the personal electric communication equipment of driver and passenger in public transport, can be with Including but not limited to personal computer (Personal Computer, PC), personal digital assistant (Personal Digital Assistant, PDA), radio hand-held equipment, tablet personal computer (Tablet Computer), mobile phone, in real time to server pass Defeated message.
Wherein, the server refers to the server of public transport Surveillance center, for real-time reception and handles client Hold the message of transmission.
Wherein, the request message includes registration message, log messages, logout message, unbinds message, heartbeat message, report One or more in alert message, global position system GPS message, notice response message, configuration response message.
102nd, the server receives the request message.
The server receives the request message, and the request message is handled and identified, to return to response Message.
103rd, the server returns to response message to the client.
Wherein, the response message includes registration reply message, logs in response message, nullify response message, unbind response In message, heartbeat response message, alarm response message, global position system GPS response message, notification message or configuration message It is one or more.
104th, the client receives the response message that the server returns.
It should be noted that the data type of the request message, response message comprise at least BYTE, WORD, DWORD, One or more in STRING.Wherein, BYTE uses uses without symbol double word without the bit format of symbol single byte integer 8, WORD The bit format of integer 16 is saved, DWORD is used without the bit format of symbol nybble integer 32, and STRING is using UTF-8 codings, during no data It is empty.
It should be noted that the request message and the composition of response message include starting flag, message header and disappeared Cease body;The beginning flag uses a byte representation;The message header includes type of message and message SN, described to disappear Type is ceased using 4 expressions before a byte;The message body includes start byte, message field, and the message field passes through Numerical value or numerical index represent.
Further illustrate, when the request message be registration message, log messages, logout message, unbind message or During warning message, because these request messages are important, in order to ensure the correctness of transmission, the composition of the request message is also Including check code.And for other request messages, because considering the equilibrium of transmission traffic demand and message severities, school It is nonessential item to test code.
The embodiments of the invention provide a kind of method of communication, message is transmitted between client and server, passes through definition The composition form of message, is numerical value by the message field definition in message body, and the data type of character string is replaced with into numeric type, Transmission real-time messages byte is few between client and server, and data volume is small, and transmitting procedure traffic demand is small.
Furthermore, it is understood that with reference to preceding method flow, for the realization of the communication connection between client and server, sheet The alternatively possible implementation of inventive embodiments additionally provides following methods flow, performs before step 101, such as Fig. 2 It is shown, including:
105th, the client communicates to connect with the server according to specified protocol, and the specified protocol controls for transmission Agreement TCP.
It should be noted that in the prior art, between client and public transport monitoring central server according to Webscoket agreements (are based on TCP (Transmission Control Protocol, transmission control protocol) full-duplex communication Agreement) communication connection, and (Message Queuing Telemetry Transport, message queue remote measurement pass based on MQTT It is defeated) component forwarding information of increasing income communicated, and the byte that the necessary composition of message takes is more;And the embodiment of the present invention according to Transmission Control Protocol (Transmission Control Protocol, transmission control protocol) communicates to connect, and the necessary composition of message accounts for Byte is less.
Furthermore, it is understood that with reference to preceding method flow, in order to which the request message of identical message field is identified, and Its transmission times is recorded, the alternatively possible implementation of the embodiment of the present invention additionally provides following methods flow, After the client often sends a request message to the server, the message SN of the request message is incremented by one Secondary, message SN can recycle.
Furthermore, it is understood that with reference to preceding method flow, in order to which the transmission to request message is controlled and is managed, the present invention The alternatively possible implementation of embodiment additionally provides following methods flow, if continuous three times to described in the client Server can not receive response message after sending request message, then the client stops sending the request to the server Message.
The client often sends a request message to the server, if being at the appointed time not received by interval The response message that the server returns, then the message SN of the request message be incremented by one, the client continuously transmits After the request message of identical message field is without response three times, then stop sending.
Furthermore, it is understood that with reference to preceding method flow, in order to keep the communication connection between client and server, this hair The alternatively possible implementation of bright embodiment, for step 101, following methods flow is additionally provided, as shown in figure 3, bag Include:
1011st, the client periodically sends heartbeat message to the server, keeps logical with the server Letter connection.
The client periodically sends heartbeat message to the server, and the server receives the heartbeat and disappeared After breath, response is carried out, keeps the communication connection with the client.
Furthermore, it is understood that with reference to preceding method flow, in order to disconnect the communication connection of client and server, the present invention is real The alternatively possible implementation for applying example additionally provides following methods flow, performs after step 1011, as shown in figure 4, Including:
106th, the client sends heartbeat stopping message to the server, disconnects the communication link with the server Connect.
Wherein, shown heartbeat stops the instruction that message refers to disconnecting communication connection.
It should be noted that client and the separated communication connection of server, are not limited to send heartbeat stopping message one Kind implementation method.Sometimes non-active client disconnects the reason for communicating to connect with server and it could also be because certain time Interior client heartbeat message is not sent on server;Or the response of heartbeat message is not received in client certain time.
In order that the implementation process of technical solution of the present invention becomes apparent from specifically, it is respectively below based on the request message Registration message, log messages, logout message, unbind message, be heartbeat message, warning message, global position system GPS message, logical When knowing response message, configuration response message, specific embodiment is provided.
The embodiments of the invention provide a kind of method of communication, suitable for registration process, methods described includes:
Step 1, user end to server send registration message.
Wherein, the registration message is used for client registers account, completes the binding of cell-phone number and vehicle.
Step 2, the server return to registration reply message to the client.
It should be noted that if registration message three times is continuously transmitted in user end to server, at the appointed time in interval The registration reply message of client return can not be received, then stops sending registration message, that is, stops registration.
Wherein, the composition of the registration message includes starting flag, message header, message body and check code;Start to identify Position is 01111111;Message header includes type of message and message SN, type of message 0000;Message body includes banner word Section, message field;Start byte is 1, and message field is used to represent log-on message, and log-on message includes license plate number and cell-phone number And/or driver driving card numbering and/or vehicle driving license numbering, the data type of message field is STRING.
Wherein, the composition of the registration reply message includes starting flag, message header and message body;Beginning flag, The beginning flag of message header and the registration message, message header are consistent;Message body includes start byte, message field;Starting When byte is 0, message field is used to represent registration reply result, and registration reply result is represented by numerical index, numerical index Whether with succeeding in registration and registration failure reason is corresponding, the data type of message field is BYTE;When start byte is 1, disappear Breath field is used to represent sign-on ID, and the type of message field is WORD.
Wherein, it is illustrated for the numerical index of registration reply result, than if any 0,1,2,3,4,5 six numerical value Index, 0 it is corresponding succeed in registration, 1 is corresponding without license plate number (registration failure, failure cause is without the license plate number), and 2 is corresponding without cell-phone number, 3 Corresponding demonstrate,proved without driver driving is numbered, and 4 is corresponding registered without vehicle driving license numbering, 5 corresponding cell-phone numbers.
It should be noted that when succeeding in registration, the message field of registration reply message just has sign-on ID.
It should be noted that the beginning flag and type of message of registration message and registration reply message, start byte is not It is limited to the numerical value that the present embodiment provides, other numerical value can also be defined according to demand.
The embodiments of the invention provide a kind of method of communication, suitable for login process, methods described includes:
Step 1, user end to server send log messages.
Wherein, the log messages are used for client logon account, make account be in can send and receive message Wire state.
Step 2, the server return to the client logs in response message.
It should be noted that if log messages three times are continuously transmitted in user end to server, at the appointed time in interval The login response message of client return can not be received, then stops sending log messages, that is, stops logging in.
Wherein, the composition of the log messages includes starting flag, message header, message body and check code;Start to identify Position is 01111111;Message header includes type of message and message SN, type of message 0001;Message body includes banner word Section, message field;Start byte is 0, and message field is used to represent log-on message, and log-on message includes license plate number and cell-phone number, The data type of message field is STRING.
Wherein, the composition for logging in response message includes starting flag, message header and message body;Beginning flag, The beginning flag of message header and the log messages, message header are consistent;Message body includes start byte, message field;Starting When byte is 0, message field is used to represent to log in response result, logs in response result and is represented by numerical index, numerical index Whether with logining successfully and login failure reason is corresponding, the data type of message field is BYTE;When start byte is 1, disappear Breath field is used to represent sign-on ID, and the type of message field is WORD.
It should be noted that it is illustrated for the numerical index for logging in response result, than if any 0,1,2,3 four Numerical index, 0 correspondingly logins successfully, and 1 is corresponding corresponding without mobile phone without license plate number (registration failure, failure cause is without the license plate number), 2 Number, 3 is corresponding without binding information.
It should be noted that when logining successfully, the message field for logging in response message just has sign-on ID.
It should be noted that the beginning flag and type of message of log messages and login response message, start byte is not It is limited to the numerical value that the present embodiment provides, other numerical value can also be defined according to demand.
The embodiments of the invention provide a kind of method of communication, suitable for log off procedure, methods described includes:
Step 1, user end to server send logout message.
Wherein, the logout message closes account for client, is in account and does not send or receive the offline of message State.
Step 2, the server return to the client nullifies response message.
Wherein, the composition of the logout message includes starting flag, message header, message body and check code;Start to identify Position is 01111111;Message header includes type of message and message SN, type of message 0002;Message body includes banner word Section, message field;Start byte is 0, and message field is used to represent log-off message, and log-off message includes license plate number and cell-phone number, The data type of message field is STRING.
Wherein, the composition for nullifying response message includes starting flag, message header and message body;Beginning flag, The beginning flag of message header and the logout message, message header are consistent;Message body includes start byte, message field;Starting Byte is 0, message field be used for represent nullify response result, nullify response result represented by numerical index, numerical index with Whether cancellation succeeds and nullified failure cause correspondingly, and the data type of message field is BYTE.
Wherein, it is illustrated for nullifying the numerical index of response result, than if any 0,1,2,3 four numerical value rope Draw, 0 it is corresponding nullifies successfully, 1 it is corresponding (nullify and fail, failure cause is without the license plate number) without license plate number, 2 correspond to without cell-phone number, 3 pairs Should be without binding information.
It should be noted that the beginning flag and type of message of logout message and cancellation response message, start byte is not It is limited to the numerical value that the present embodiment provides, other numerical value can also be defined according to demand.
The embodiments of the invention provide a kind of method of communication, suitable for unbinding process, methods described includes:
Step 1, user end to server, which are sent, unbinds message.
Wherein, the message that unbinds unbinds account for client, releases the binding of cell-phone number and vehicle.
Step 2, the server return to the client unbinds response message.
Wherein, the composition for unbinding message includes starting flag, message header, message body and check code;Start to identify Position is 01111111;Message header includes type of message and message SN, type of message 0003;Message body includes banner word Section, message field;Start byte is 0, and message field unbinds information for expression, and unbinding information includes license plate number and cell-phone number, The data type of message field is STRING.
Wherein, the composition for unbinding response message includes starting flag, message header and message body;Beginning flag, Message header is consistent with the beginning flag for unbinding message, message header;Message body includes start byte, message field;Starting Byte is 0, and message field unbinds response result for expression, unbinds response result and is represented by numerical index, numerical index with It is corresponding whether to unbind successfully and unbind failure cause, the data type of message field is BYTE.
Wherein, it is illustrated for unbinding the numerical index of response result, than if any 0,1,2,3 four numerical value rope Draw, 0 it is corresponding unbind success, 1 is corresponding without license plate number (unbinding failure, failure cause is without the license plate number), and 2 is corresponding without cell-phone number, 3 pairs Should be without binding information.
It should be noted that unbinding message and unbinding the beginning flag and type of message of response message, start byte is not It is limited to the numerical value that the present embodiment provides, other numerical value can also be defined according to demand.
The embodiments of the invention provide a kind of method of communication, suitable for the communications connection procedure by heartbeat, the side Method includes:
Step 1, user end to server send heartbeat message.
Wherein, the heartbeat message is used for the communication connection for keeping client and server.
Step 2, the server return to heartbeat response message to the client.
Wherein, the composition of the heartbeat message includes starting flag, message header and message body;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0004;Message body includes start byte, disappeared Cease field;Start byte is 0, and message field is used to represent heartbeat message, and heartbeat message includes sign-on ID, the number of message field It is WORD according to type.
Wherein, the composition of the heartbeat response message includes starting flag, message header and message body;Beginning flag, The beginning flag of message header and the heartbeat message, message header are consistent;Message body includes start byte, message field;Starting Byte is 0, message field be used for represent heartbeat response result, heartbeat response result is represented by numerical index, numerical index with Whether heartbeat success and heartbeat failure cause it is corresponding, the data type of message field is BYTE.
Wherein, it is illustrated for the numerical index of heartbeat response result, than if any 0,1,2,3 four numerical value rope Draw, 0 corresponding heartbeat success, 1 is corresponding without license plate number (heartbeat fails, and failure cause is without the license plate number), and 2 is corresponding without cell-phone number, 3 pairs Should be without binding information.
It should be noted that the beginning flag and type of message of heartbeat message and heartbeat response message, start byte is not It is limited to the numerical value that the present embodiment provides, other numerical value can also be defined according to demand.
The embodiments of the invention provide a kind of method of communication, suitable for alarm procedure, methods described includes:
Step 1, user end to server send warning message.
Wherein, the warning message reports alert, such as passenger's dispute, fire, car for client to the server Misfortune etc..
Step 2, the server return to alarm response message to the client.
Wherein, the composition of the warning message includes starting flag, message header, message body and check code;Start to identify Position is 01111111;Message header includes type of message and message SN, type of message 0005;Message body includes banner word Section, message field;When start byte is 0, message field is used to represent sign-on ID, and the data type of message field is WORD; When start byte is 1, message field is used to represent warning message, warning message include license plate number, longitude, latitude, road speed, Whether time point, alarm keyword, global position system GPS information are effectively middle one or more, the data type of message field For STRING.
Wherein, the composition of the alarm response message includes starting flag, message header and message body;Beginning flag, The beginning flag of message header and the warning message, message header are consistent;Message body includes start byte, message field;Starting Byte is 0, message field be used for represent alarm response result, alarm response result represented by numerical index, numerical index with Whether alarm and successfully correspond to, the data type of message field is BYTE.
Wherein, it is illustrated for the numerical index for response result of alarming, than if any 0,1 two numerical index, 0 pair Should be alarmed success, 1 corresponding alarm failure.
It should be noted that the beginning flag and type of message of warning message and response message of alarming, start byte is not It is limited to the numerical value that the present embodiment provides, other numerical value can also be defined according to demand.
The embodiments of the invention provide a kind of method of communication, suitable for position fixing process, methods described includes:
Step 1, user end to server send global position system GPS message.
Wherein, the GPS message is used for the location information that user end to server reports vehicle, such as longitude and latitude, vehicle Speed, time etc..
Step 2, the server return to GPS response messages to the client.
Wherein, the composition of the GPS message includes starting flag, message header and message body;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0006;Message body includes start byte, disappeared Cease field;When start byte is 0, message field is used to represent sign-on ID, and the data type of message field is WORD;Banner word Save for 1 when, message field is used to represent GPS location information, GPS location information include license plate number, longitude, latitude, road speed, One or more during whether time point, GPS information are effective, the data type of message field is STRING.
Wherein, the composition of the GPS response messages includes starting flag, message header and message body;Start flag, disappear Beginning flag, the message header for ceasing head and the GPS message are consistent;Message body includes start byte, message field;Start byte For 0, message field is used to represent GPS location response result, and GPS location response result is represented by numerical index, numerical index With whether GPS location is successfully corresponding, the data type of message field is BYTE.
Wherein, it is illustrated for the numerical index of GPS location response result, than if any 0,1 two numerical index, 0 correspondingly positions successfully, 1 corresponding positioning failure.
It should be noted that the beginning flag and type of message of GPS message and GPS response messages, start byte is unlimited In the numerical value that the present embodiment provides, other numerical value can also be defined according to demand.
The embodiments of the invention provide a kind of method of communication, suitable for notification procedure, methods described includes:
Step 1, server send a notification message to client.
Wherein, the notification message client server issues the correlations such as weather, traffic, maintenance, safety, notice to client The information of content.
Step 2, the client return to notice response message to the server.
Wherein, the composition of the notification message includes starting flag, message header and message body;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0007;Message body includes start byte, disappeared Cease field;When start byte is 0, message field is used to represent sign-on ID, and the data type of message field is WORD;Banner word Save for 1 when, message field is used to represent notification type, and notification type is represented by numerical index, numerical index and weather, hands over Logical, maintenance, safety, announcement information are corresponding, and the data type of message field is BYTE;When start byte is 2, message field is used for The content of announcement information is represented, the data type of message field is STRING.
Wherein, the composition of the notice response message includes starting flag, message header and message body;Beginning flag, The beginning flag of message header and the notification message, message header are consistent;Message body includes start byte, message field;Starting Byte is 0, and message field is used to represent notice response result, and notice positioning response result is represented by numerical index, numerical value rope Draw with whether notifying successfully corresponding, the data type of message field is BYTE.
Wherein, for notifying the numerical index of response result to be illustrated, than if any 0,1 two numerical index, 0 pair Success, 1 corresponding notice failure should be notified.
It should be noted that the beginning flag and type of message of notification message and notice response message, start byte is not It is limited to the numerical value that the present embodiment provides, other numerical value can also be defined according to demand.
The embodiments of the invention provide a kind of method of communication, suitable for configuration process, methods described includes:
Step 1, server are to client send configuration message.
Wherein, the configuration message issues Configuration Type and Configuration Values for server to client, and Configuration Type is used for Global position system GPS information reporting duration is configured, Configuration Values are related to Configuration Type.
Step 2, the client return to configuration response message to the server.
Wherein, the composition of the configuration message includes starting flag, message header and message body;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0008;Message body includes start byte, disappeared Cease field;When start byte is 0, message field is used to represent sign-on ID, and the data type of message field is WORD;Banner word Save for 1 when, message field be used for represent Configuration Type, Configuration Type is represented by numerical index, numerical index global positioning system System GPS information reports duration corresponding, and the data type of message field is BYTE;When start byte is 2, message field is used to represent Configuration Values, the data type of message field is STRING.
Wherein, the composition of the configuration response message includes starting flag, message header and message body;Beginning flag, The beginning flag of message header and the log messages, message header are consistent;Message body includes start byte, message field;Starting Byte is 0, message field be used for represent configuration response result, configuration response result represented by numerical index, numerical index with Whether configuration successful is corresponding, and the data type of message field is BYTE.
Wherein, it is illustrated for configuring the numerical index of response result, than if any 0,1 two numerical index, 0 pair Answer configuration successful, 1 corresponding configuration failure.
It should be noted that the beginning flag and type of message of configuration message and configuration response message, start byte is not It is limited to the numerical value that the present embodiment provides, other numerical value can also be defined according to demand.
The embodiments of the invention provide a kind of communication system, suitable for above method flow, as shown in figure 5, the system Including:
Client 21, for sending request message to server.
Server 22, the response message returned for receiving the server.
The composition of message includes starting flag, message header and message body, and the beginning flag uses a table of bytes Show, the message header includes type of message and message SN, and the type of message is described using 4 expressions before a byte Message body includes start byte, message field, and the message field is represented by numerical value or numerical index;When the request message For registration message, log messages, logout message, unbind message or warning message when, the composition of the request message also includes school Test code.
Optionally, the client 21 is additionally operable to communicate to connect according to specified protocol with the server 22, the finger It is transmission control protocol TCP to determine agreement.
Optionally, the data type of message comprises at least the one or more in BYTE, WORD, DWORD, STRING, BYTE is used without the bit format of symbol single byte integer 8, and WORD uses uses nothing without the bit format of symbol double byte integer 16, DWORD The bit format of symbol nybble integer 32, STRING are encoded using UTF-8, are empty during no data.
The embodiments of the invention provide a kind of communication system, message is transmitted between client and server, is disappeared by definition The composition form of breath, is numerical value by the message field definition in message body, and the data type of character string is replaced with into numeric type, visitor Transmission real-time messages byte is few between family end and server, and data volume is small, and transmitting procedure traffic demand is small.
The embodiments of the invention provide a kind of communication system, and suitable for registering correlation technique flow, the system includes visitor Family end and server:
The client, for sending registration message to the server.
The server, for returning to registration reply message to the client.
The composition of the registration message includes starting flag, message header, message body and check code;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0000;Message body includes start byte, disappeared Cease field;Start byte is 1, and message field is used to represent log-on message, and log-on message includes license plate number and cell-phone number and/or department Machine driver license number and/or vehicle driving license numbering, the data type of message field is STRING.
The composition of the registration reply message includes starting flag, message header and message body;Start flag, message header Beginning flag, message header with the registration message is consistent;Message body includes start byte, message field;Start byte is 0 When, message field is used to represent registration reply result, and registration reply result represents whether numerical index is with noting by numerical index Volume success and registration failure reason are corresponding, and the data type of message field is BYTE;When start byte is 1, message field is used In representing sign-on ID, the type of message field is WORD.
The embodiments of the invention provide a kind of communication system, and suitable for logging in correlation technique flow, the system includes visitor Family end and server:
The client, for sending log messages to the server.
The server, response message is logged in for being returned to the client.
The composition of the log messages includes starting flag, message header, message body and check code;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0001;Message body includes start byte, disappeared Cease field;Start byte is 0, and message field is used to represent log-on message, and log-on message includes license plate number and cell-phone number, message word The data type of section is STRING.
The composition for logging in response message includes starting flag, message header and message body;Start flag, message header Beginning flag, message header with the log messages is consistent;Message body includes start byte, message field;Start byte is 0 When, message field is used to represent to log in response result, logs in response result and represents whether numerical index is with stepping on by numerical index Record successfully and login failure reason is corresponding, the data type of message field is BYTE;When start byte is 1, message field is used In representing sign-on ID, the type of message field is WORD.
The embodiments of the invention provide a kind of communication system, and suitable for nullifying correlation technique flow, the system includes visitor Family end and server:
The client, for sending logout message to the server.
The server, response message is nullified for being returned to the client.
The composition of the logout message includes starting flag, message header, message body and check code;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0002;Message body includes start byte, disappeared Cease field;Start byte is 0, and message field is used to represent log-off message, and log-off message includes license plate number and cell-phone number, message word The data type of section is STRING.
The composition for nullifying response message includes starting flag, message header and message body;Start flag, message header Beginning flag, message header with the logout message is consistent;Message body includes start byte, message field;Start byte is 0, message field is used to represent to nullify response result, nullifies response result and represents whether numerical index is with noting by numerical index Sell successfully and nullify failure cause and correspond to, the data type of message field is BYTE.
The embodiments of the invention provide a kind of communication system, and suitable for unbinding correlation technique flow, the system includes visitor Family end and server:
The client, message is unbinded for being sent to the server.
The server, response message is unbinded for being returned to the client.
The composition for unbinding message includes starting flag, message header, message body and check code;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0003;Message body includes start byte, disappeared Cease field;Start byte is 0, and message field unbinds information for expression, and unbinding information includes license plate number and cell-phone number, message word The data type of section is STRING.
The composition for unbinding response message includes starting flag, message header and message body;Start flag, message header It is consistent with the beginning flag for unbinding message, message header;Message body includes start byte, message field;Start byte is 0, message field unbinds response result for expression, unbinds response result and is represented by numerical index, and whether numerical index is with solving It is corresponding to tie up successfully and unbind failure cause, the data type of message field is BYTE.
The embodiments of the invention provide a kind of communication system, and suitable for heartbeat correlation technique flow, the system includes visitor Family end and server:
The client, for sending heartbeat message to the server.
The server, for returning to heartbeat response message to the client.
The composition of the heartbeat message includes starting flag, message header and message body;It is 01111111 to start flag; Message header includes type of message and message SN, type of message 0004;Message body includes start byte, message field;Rise Beginning byte is 0, and message field is used to represent heartbeat message, and heartbeat message includes sign-on ID, and the data type of message field is WORD。
The composition of the heartbeat response message includes starting flag, message header and message body;Start flag, message header Beginning flag, message header with the heartbeat message is consistent;Message body includes start byte, message field;Start byte is 0, message field be used for represent heartbeat response result, heartbeat response result is represented by numerical index, numerical index with whether the heart Jump successfully and heartbeat failure cause is corresponding, the data type of message field is BYTE.
The embodiments of the invention provide a kind of communication system, and suitable for correlation technique flow of alarming, the system includes visitor Family end and server:
The client, for sending warning message to the server.
The server, for returning to alarm response message to the client.
The composition of the warning message includes starting flag, message header, message body and check code;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0005;Message body includes start byte, disappeared Cease field;When start byte is 0, message field is used to represent sign-on ID, and the data type of message field is WORD;Banner word Save for 1 when, message field is used to represent warning message, and warning message includes license plate number, longitude, latitude, road speed, time Whether point, alarm keyword, global position system GPS information are effectively middle one or more, and the data type of message field is STRING。
The composition of the alarm response message includes starting flag, message header and message body;Start flag, message header Beginning flag, message header with the warning message is consistent;Message body includes start byte, message field;Start byte is 0, message field is used to represent alarm response result, and alarm response result represents whether numerical index is with reporting by numerical index Warn and successfully correspond to, the data type of message field is BYTE.
The embodiments of the invention provide a kind of communication system, and suitable for GPS location correlation technique flow, the system includes Client and server:
The client, for sending global position system GPS message to the server.
The server, for returning to GPS response messages to the client.
The composition of the GPS message includes starting flag, message header and message body;It is 01111111 to start flag; Message header includes type of message and message SN, type of message 0006;Message body includes start byte, message field;Rise When beginning byte is 0, message field is used to represent sign-on ID, and the data type of message field is WORD;When start byte is 1, Message field is used to represent GPS location information, GPS location information include license plate number, longitude, latitude, road speed, time point, One or more during whether GPS information is effective, the data type of message field is STRING.
The composition of the GPS response messages includes starting flag, message header and message body;Start flag, message header Beginning flag, message header with the GPS message is consistent;Message body includes start byte, message field;Start byte is 0, Message field is used to represent GPS location response result, and GPS location response result represents that numerical index is with being by numerical index No GPS location successfully corresponds to, and the data type of message field is BYTE.
The embodiments of the invention provide a kind of communication system, and suitable for notifying correlation technique flow, the system includes visitor Family end and server:
The server, for being sent a notification message to the client.
The client, for returning to notice response message to the server.
The composition of the notification message includes starting flag, message header and message body;It is 01111111 to start flag; Message header includes type of message and message SN, type of message 0007;Message body includes start byte, message field;Rise When beginning byte is 0, message field is used to represent sign-on ID, and the data type of message field is WORD;When start byte is 1, Message field is used to represent notification type, and notification type is represented by numerical index, numerical index and weather, traffic, maintenance, peace Entirely, announcement information is corresponding, and the data type of message field is BYTE;When start byte is 2, message field is used to represent notice letter The content of breath, the data type of message field is STRING.
The composition of the notice response message includes starting flag, message header and message body;Start flag, message header Beginning flag, message header with the notification message is consistent;Message body includes start byte, message field;Start byte is 0, message field is used to represent notice response result, and notice positioning response result represents that numerical index is with being by numerical index No to notify successfully to correspond to, the data type of message field is BYTE.
The embodiments of the invention provide a kind of communication system, and suitable for configuring correlation technique flow, the system includes visitor Family end and server:
The server, for the client send configuration message.
The client, for returning to configuration response message to the server.
The composition of the configuration message includes starting flag, message header and message body;It is 01111111 to start flag; Message header includes type of message and message SN, type of message 0008;Message body includes start byte, message field;Rise When beginning byte is 0, message field is used to represent sign-on ID, and the data type of message field is WORD;When start byte is 1, Message field is used to represent Configuration Type, and Configuration Type is represented by numerical index, numerical index global position system GPS information Report duration corresponding, the data type of message field is BYTE;When start byte is 2, message field is used to represent Configuration Values, disappears The data type for ceasing field is STRING.
The composition of the configuration response message includes starting flag, message header and message body;Start flag, message header Beginning flag, message header with the log messages is consistent;Message body includes start byte, message field;Start byte is 0, message field is used to represent configuration response result, and configuration response result represents whether numerical index is with matching somebody with somebody by numerical index It is corresponding to be set to work(, the data type of message field is BYTE.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, the corresponding process in preceding method embodiment is may be referred to, will not be repeated here.
In several embodiments provided by the present invention, it should be understood that disclosed system, apparatus and method can be with Realize by another way.For example, device embodiment described above is only schematical, for example, the unit Division, only a kind of division of logic function, can there is other dividing mode, for example, multiple units or group when actually realizing Part can combine or be desirably integrated into another system, or some features can be ignored, or not perform.It is another, it is shown Or the mutual coupling discussed or direct-coupling or communication connection can be by some interfaces, device or unit it is indirect Coupling or communication connection, can be electrical, mechanical or other forms.
The unit illustrated as separating component can be or may not be physically separate, show as unit The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list Member can both be realized in the form of hardware, can also be realized in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit realized in the form of SFU software functional unit, can be stored in one and computer-readable deposit In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are causing a computer It is each that device (can be personal computer, server, or network equipment etc.) or processor (Processor) perform the present invention The part steps of embodiment methods described.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (Read- Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disc or CD etc. it is various Can be with the medium of store program codes.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention God any modification, equivalent substitution and improvements done etc., should be included within the scope of protection of the invention with principle.

Claims (13)

  1. A kind of 1. method of communication, it is characterised in that suitable for communication system, the communication system includes client and service Device, methods described include:
    The client sends request message to the server;
    The server returns to response message to the client;
    The composition of message includes starting flag, message header and message body, and the beginning flag uses a byte representation, institute Stating message header includes type of message and message SN, and the type of message is using 4 expressions, the message body before a byte Including start byte, message field, the message field is represented by numerical value or numerical index;When the request message is registration Message, log messages, logout message, when unbinding message or warning message, the composition of the request message also includes check code.
  2. 2. according to the method for claim 1, it is characterised in that the user end to server send request message it Before, methods described also includes:
    The client communicates to connect with the server according to specified protocol, and the specified protocol is transmission control protocol TCP.
  3. 3. according to the method for claim 1, it is characterised in that the data type of message comprise at least BYTE, WORD, One or more in DWORD, STRING, BYTE uses to be used without symbol double word without the bit format of symbol single byte integer 8, WORD The bit format of integer 16 is saved, DWORD is used without the bit format of symbol nybble integer 32, and STRING is using UTF-8 codings, during no data It is empty.
  4. A kind of 4. method of communication, it is characterised in that suitable for communication system, the communication system includes client and service Device, methods described include:
    User end to server sends registration message;
    The server returns to registration reply message to the client;
    The composition of the registration message includes starting flag, message header, message body and check code;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0000;Message body includes start byte, disappeared Cease field;Start byte is 1, and message field is used to represent log-on message, and log-on message includes license plate number and cell-phone number and/or department Machine driver license number and/or vehicle driving license numbering, the data type of message field is STRING;
    The composition of the registration reply message includes starting flag, message header and message body;Start flag, message header and institute Beginning flag, the message header for stating registration message are consistent;Message body includes start byte, message field;When start byte is 0, Message field is used to represent registration reply result, and registration reply result represents whether numerical index is with registering by numerical index Success and registration failure reason are corresponding, and the data type of message field is BYTE;When start byte is 1, message field is used for Sign-on ID is represented, the type of message field is WORD.
  5. A kind of 5. method of communication, it is characterised in that suitable for communication system, the communication system includes client and service Device, methods described include:
    User end to server sends log messages;
    The server returns to the client and logs in response message;
    The composition of the log messages includes starting flag, message header, message body and check code;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0001;Message body includes start byte, disappeared Cease field;Start byte is 0, and message field is used to represent log-on message, and log-on message includes license plate number and cell-phone number, message word The data type of section is STRING;
    The composition for logging in response message includes starting flag, message header and message body;Start flag, message header and institute Beginning flag, the message header for stating log messages are consistent;Message body includes start byte, message field;When start byte is 0, Message field is used to represent to log in response result, logs in response result and represent whether numerical index is with logging in by numerical index Success and login failure reason are corresponding, and the data type of message field is BYTE;When start byte is 1, message field is used for Sign-on ID is represented, the type of message field is WORD.
  6. A kind of 6. method of communication, it is characterised in that suitable for communication system, the communication system includes client and service Device, methods described include:
    User end to server sends logout message;
    The server returns to the client and nullifies response message;
    The composition of the logout message includes starting flag, message header, message body and check code;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0002;Message body includes start byte, disappeared Cease field;Start byte is 0, and message field is used to represent log-off message, and log-off message includes license plate number and cell-phone number, message word The data type of section is STRING;
    The composition for nullifying response message includes starting flag, message header and message body;Start flag, message header and institute Beginning flag, the message header for stating logout message are consistent;Message body includes start byte, message field;Start byte is 0, is disappeared Cease field to be used to represent to nullify response result, nullify response result and represented by numerical index, whether numerical index is with nullifying into Work(and cancellation failure cause are corresponding, and the data type of message field is BYTE.
  7. A kind of 7. method of communication, it is characterised in that suitable for communication system, the communication system includes client and service Device, methods described include:
    User end to server sends and unbinds message;
    The server returns to the client and unbinds response message;
    The composition for unbinding message includes starting flag, message header, message body and check code;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0003;Message body includes start byte, disappeared Cease field;Start byte is 0, and message field unbinds information for expression, and unbinding information includes license plate number and cell-phone number, message word The data type of section is STRING;
    The composition for unbinding response message includes starting flag, message header and message body;Start flag, message header and institute It is consistent to state the beginning flag for unbinding message, message header;Message body includes start byte, message field;Start byte is 0, is disappeared Breath field unbinds response result for expression, unbinds response result and is represented by numerical index, and whether numerical index is with unbinding into Work(and unbind that failure cause is corresponding, and the data type of message field is BYTE.
  8. A kind of 8. method of communication, it is characterised in that suitable for communication system, the communication system includes client and service Device, methods described include:
    User end to server sends heartbeat message;
    The server returns to heartbeat response message to the client;
    The composition of the heartbeat message includes starting flag, message header and message body;It is 01111111 to start flag;Message Head includes type of message and message SN, type of message 0004;Message body includes start byte, message field;Banner word Save as 0, message field is used to represent heartbeat message, and heartbeat message includes sign-on ID, and the data type of message field is WORD;
    The composition of the heartbeat response message includes starting flag, message header and message body;Start flag, message header and institute Beginning flag, the message header for stating heartbeat message are consistent;Message body includes start byte, message field;Start byte is 0, is disappeared Breath field be used for represent heartbeat response result, heartbeat response result is represented by numerical index, numerical index with whether heartbeat into Work(and heartbeat failure cause are corresponding, and the data type of message field is BYTE.
  9. A kind of 9. method of communication, it is characterised in that suitable for communication system, the communication system includes client and service Device, methods described include:
    User end to server sends warning message;
    The server returns to alarm response message to the client;
    The composition of the warning message includes starting flag, message header, message body and check code;Starting flag is 01111111;Message header includes type of message and message SN, type of message 0005;Message body includes start byte, disappeared Cease field;When start byte is 0, message field is used to represent sign-on ID, and the data type of message field is WORD;Banner word Save for 1 when, message field is used to represent warning message, and warning message includes license plate number, longitude, latitude, road speed, time Whether point, alarm keyword, global position system GPS information are effectively middle one or more, and the data type of message field is STRING;
    The composition of the alarm response message includes starting flag, message header and message body;Start flag, message header and institute Beginning flag, the message header for stating warning message are consistent;Message body includes start byte, message field;Start byte is 0, is disappeared Cease field to be used to represent alarm response result, alarm response result represents whether numerical index is with alarming into by numerical index Work(is corresponding, and the data type of message field is BYTE.
  10. A kind of 10. method of communication, it is characterised in that suitable for communication system, the communication system includes client and service Device, methods described include:
    User end to server sends global position system GPS message;
    The server returns to GPS response messages to the client;
    The composition of the GPS message includes starting flag, message header and message body;It is 01111111 to start flag;Message Head includes type of message and message SN, type of message 0006;Message body includes start byte, message field;Banner word Save for 0 when, message field be used for represent sign-on ID, the data type of message field is WORD;When start byte is 1, message Field is used to represent GPS location information, and GPS location information includes license plate number, longitude, latitude, road speed, time point, GPS letters One or more during whether breath is effective, the data type of message field is STRING;
    The composition of the GPS response messages includes starting flag, message header and message body;Start flag, message header and institute Beginning flag, the message header for stating GPS message are consistent;Message body includes start byte, message field;Start byte is 0, message Field be used for represent GPS location response result, GPS location response result is represented by numerical index, numerical index with whether GPS Position and successfully correspond to, the data type of message field is BYTE.
  11. A kind of 11. method of communication, it is characterised in that suitable for communication system, the communication system includes client and service Device, methods described include:
    Server sends a notification message to client;
    The client returns to notice response message to the server;
    The composition of the notification message includes starting flag, message header and message body;It is 01111111 to start flag;Message Head includes type of message and message SN, type of message 0007;Message body includes start byte, message field;Banner word Save for 0 when, message field be used for represent sign-on ID, the data type of message field is WORD;When start byte is 1, message Field is used to represent notification type, and notification type is represented by numerical index, numerical index and weather, traffic, maintenance, safety, Announcement information is corresponding, and the data type of message field is BYTE;When start byte is 2, message field is used to represent announcement information Content, the data type of message field is STRING;
    The composition of the notice response message includes starting flag, message header and message body;Start flag, message header and institute Beginning flag, the message header for stating notification message are consistent;Message body includes start byte, message field;Start byte is 0, is disappeared Cease field to be used to represent notice response result, notice positioning response result represents whether numerical index is with leading to by numerical index Know and successfully correspond to, the data type of message field is BYTE.
  12. A kind of 12. method of communication, it is characterised in that suitable for communication system, the communication system includes client and service Device, methods described include:
    Server is to client send configuration message;
    The client returns to configuration response message to the server;
    The composition of the configuration message includes starting flag, message header and message body;It is 01111111 to start flag;Message Head includes type of message and message SN, type of message 0008;Message body includes start byte, message field;Banner word Save for 0 when, message field be used for represent sign-on ID, the data type of message field is WORD;When start byte is 1, message Field is used to represent Configuration Type, and Configuration Type is represented by numerical index, numerical index global position system GPS information reporting Duration is corresponding, and the data type of message field is BYTE;When start byte is 2, message field is used to represent Configuration Values, message word The data type of section is STRING;
    The composition of the configuration response message includes starting flag, message header and message body;Start flag, message header and institute Beginning flag, the message header for stating log messages are consistent;Message body includes start byte, message field;Start byte is 0, is disappeared Cease field to be used to represent configuration response result, configuration response result represents whether numerical index is with being configured to by numerical index Work(is corresponding, and the data type of message field is BYTE.
  13. 13. a kind of communication system, it is characterised in that the communication system includes:
    Client, for sending request message to server;
    Server, for returning to response message to the client;
    The composition of message includes starting flag, message header and message body, and the beginning flag uses a byte representation, institute Stating message header includes type of message and message SN, and the type of message is using 4 expressions, the message body before a byte Including start byte, message field, the message field is represented by numerical value or numerical index;When the request message is registration Message, log messages, logout message, when unbinding message or warning message, the composition of the request message also includes check code.
CN201710541225.1A 2017-07-05 2017-07-05 A kind of method and system of communication Pending CN107426198A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710541225.1A CN107426198A (en) 2017-07-05 2017-07-05 A kind of method and system of communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710541225.1A CN107426198A (en) 2017-07-05 2017-07-05 A kind of method and system of communication

Publications (1)

Publication Number Publication Date
CN107426198A true CN107426198A (en) 2017-12-01

Family

ID=60427096

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710541225.1A Pending CN107426198A (en) 2017-07-05 2017-07-05 A kind of method and system of communication

Country Status (1)

Country Link
CN (1) CN107426198A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108995614A (en) * 2018-09-29 2018-12-14 重庆西部汽车试验场管理有限公司 Information transferring method and information carrying means
CN109450989A (en) * 2018-10-19 2019-03-08 武汉斗鱼网络科技有限公司 A kind of method, apparatus, equipment and the medium of data transmission
CN108284805B (en) * 2017-12-18 2019-09-10 航天新长征大道科技有限公司 A kind of car-mounted terminal abnormal login processing method, server, car-mounted terminal
CN110474834A (en) * 2019-06-28 2019-11-19 深圳快胜时尚科技有限公司 A kind of method, electronic equipment and storage medium keeping instant messaging real-time
CN111083665A (en) * 2019-12-05 2020-04-28 上海旗旌科技有限公司 Dual-master control interactive communication method and device
CN113873523A (en) * 2020-06-15 2021-12-31 广州汽车集团股份有限公司 Method and device for removing vehicle binding relationship and related equipment
CN114979260A (en) * 2022-05-12 2022-08-30 深圳市绿联科技股份有限公司 Protocol-based communication method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101902412A (en) * 2010-06-28 2010-12-01 北京易华录信息技术股份有限公司 Traffic management data interacting method and message service system
CN103237293A (en) * 2012-11-19 2013-08-07 北京新岸线移动多媒体技术有限公司 Method and device for sending and receiving messages
US20170124866A1 (en) * 2015-11-03 2017-05-04 Adaptive Micro Systems, Llc Roadside Sign Controller and Dynamic Message Sign System

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101902412A (en) * 2010-06-28 2010-12-01 北京易华录信息技术股份有限公司 Traffic management data interacting method and message service system
CN103237293A (en) * 2012-11-19 2013-08-07 北京新岸线移动多媒体技术有限公司 Method and device for sending and receiving messages
CN103259835A (en) * 2012-11-19 2013-08-21 北京新岸线移动多媒体技术有限公司 On board unit accessing method system and device
CN103259837A (en) * 2012-11-19 2013-08-21 北京新岸线移动多媒体技术有限公司 Method, system and device for access of road side unit
CN103259836A (en) * 2012-11-19 2013-08-21 北京新岸线移动多媒体技术有限公司 Method and device for querying traffic information
US20170124866A1 (en) * 2015-11-03 2017-05-04 Adaptive Micro Systems, Llc Roadside Sign Controller and Dynamic Message Sign System

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108284805B (en) * 2017-12-18 2019-09-10 航天新长征大道科技有限公司 A kind of car-mounted terminal abnormal login processing method, server, car-mounted terminal
CN108995614A (en) * 2018-09-29 2018-12-14 重庆西部汽车试验场管理有限公司 Information transferring method and information carrying means
CN109450989A (en) * 2018-10-19 2019-03-08 武汉斗鱼网络科技有限公司 A kind of method, apparatus, equipment and the medium of data transmission
CN109450989B (en) * 2018-10-19 2021-09-07 武汉斗鱼网络科技有限公司 Data transmission method, device, equipment and medium
CN110474834A (en) * 2019-06-28 2019-11-19 深圳快胜时尚科技有限公司 A kind of method, electronic equipment and storage medium keeping instant messaging real-time
CN111083665A (en) * 2019-12-05 2020-04-28 上海旗旌科技有限公司 Dual-master control interactive communication method and device
CN111083665B (en) * 2019-12-05 2023-09-19 上海旗旌科技有限公司 Method and equipment for double-master control interactive communication
CN113873523A (en) * 2020-06-15 2021-12-31 广州汽车集团股份有限公司 Method and device for removing vehicle binding relationship and related equipment
CN114979260A (en) * 2022-05-12 2022-08-30 深圳市绿联科技股份有限公司 Protocol-based communication method and device, electronic equipment and storage medium
CN114979260B (en) * 2022-05-12 2023-09-15 深圳市绿联科技股份有限公司 Protocol-based communication method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107426198A (en) A kind of method and system of communication
US10686687B2 (en) Integrated personal safety and equipment monitoring system
US6798344B2 (en) Security alarm system and method with realtime streaming video
US11399095B2 (en) Apparatus and method for emergency dispatch
CN107680354A (en) Alarm processing method, alarm platform and storage medium
CN103794033B (en) Monitoring alarm method and device
WO2007127344B1 (en) Order processing apparatus and method
CN106470236B (en) Methods, devices and systems of calling a taxi based on mobile terminal
CN106993043B (en) Data communication system and method based on agency
CN107257993A (en) The disaster that positional information need not be collected notifies the method and its application system of service
CN105262792B (en) A kind of vehicle abnormality processing method and car-mounted terminal
CN109688105A (en) A kind of threat warning message generation method and system
US9576491B1 (en) School child tracking system
CN106411548A (en) Alarm information notification method and apparatus, and alarm information filtering device
US20220051548A1 (en) Apparatus, Systems and Methods For Providing Alarm and Sensor Data To Emergency Networks
CN109895815A (en) The operation data acquisition method and system of train
CN105897868A (en) Sharing processing method for position information, vehicle terminal, server and system
CN107944819A (en) Enterprise personnel management system based on computer and GPS technology
CN108989084A (en) Abnormal data monitoring method, apparatus and system
US9600996B2 (en) Devices and methods for providing mobile cellular beacons
CN108091127A (en) Haulage vehicle monitoring system
CN107665403A (en) Palm is alarmed and wisdom responding scheduling system and its application method
JP2004220560A5 (en)
CN105933217B (en) Message synchronization method and platform, network server and adaptive server
SE519649C2 (en) Monitoring of mobile devices

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20171201

RJ01 Rejection of invention patent application after publication