Disclosure of Invention
The embodiment of the invention aims to provide a vehicle networking communication method and system, which are used for realizing convenient and accurate request-response matching in vehicle networking communication.
In order to achieve the above object, an embodiment of the present invention provides a communication method in a car networking system, which is applied to a communication system in a car networking system, and the system includes: the vehicle-mounted communication terminal and the cloud platform are installed in an intelligent vehicle, and the method comprises the following steps:
the vehicle-mounted communication terminal sends an uplink message to the cloud platform, wherein the uplink message comprises a first message type identifier, a first request identifier, a first message matching field, a first request matching field and a first service message;
the cloud platform analyzes the uplink message to acquire the first message type identifier, the first request identifier, the first message matching field, the first request matching field and the first service message; and when the first message type identifier is a request confirmation identifier, sending a downlink response message to the intelligent networked vehicle, wherein the downlink response message comprises a confirmation identifier corresponding to the request confirmation identifier, a first response identifier corresponding to the first request identifier, a message matching field identical to the first message matching field, and a request matching field identical to the first request matching field.
Optionally, the method further includes:
the cloud platform sends a downlink message to the vehicle-mounted communication terminal, wherein the downlink message comprises a second message type identifier, a second request identifier, a second message matching field, a second request matching field and a second service message;
the vehicle-mounted communication terminal analyzes the downlink message to acquire a second message type identifier, a second request identifier, a second message matching field, a second request matching field and a second service message; and when the second message type identifier is a request acknowledgement identifier, sending an uplink response message to the cloud platform, wherein the uplink response message comprises an acknowledgement identifier corresponding to the request acknowledgement identifier, a second response identifier corresponding to the second request identifier, a message matching field identical to the second message matching field, and a request matching field identical to the second request matching field.
Optionally, the first service message includes:
attribute messages of vehicle components in a predefined vehicle object model, and event messages of vehicle components in the predefined vehicle object model, wherein each vehicle component corresponds to a function or component in the smart vehicle;
the second service message includes:
issuing a message aiming at the configuration data of each vehicle component in the vehicle object model, acquiring a message aiming at the attribute data of each vehicle component in the vehicle object model and acquiring a control message aiming at each vehicle component in the vehicle object model.
The embodiment of the invention also provides a vehicle networking communication method, which is applied to a vehicle networking communication system, and the system comprises: the vehicle-mounted communication terminal and the cloud platform are installed in an intelligent vehicle, and the method comprises the following steps:
the vehicle-mounted communication terminal sends an uplink message to the cloud platform, wherein the uplink message comprises a first message type identifier, a first request identifier, a first message matching field, a first request matching field and a first service message;
the cloud platform analyzes the uplink message to acquire the first message type identifier, the first request identifier, the first message matching field, the first request matching field and the first service message; when the first message type identifier is a request confirmation identifier, sending a first downlink response message to the intelligent networked vehicle, wherein the first downlink response message comprises a confirmation identifier corresponding to the request confirmation identifier and a message matching field identical to the first message matching field;
the cloud platform processes the first service message and sends a second downlink response message to the intelligent networked vehicle, wherein the second downlink response message comprises a second message type identifier, a second message matching field, a first response identifier corresponding to the first request identifier and a request matching field identical to the first request matching field;
and when the second message type identifier is a request acknowledgement identifier, the vehicle-mounted communication terminal sends an uplink acknowledgement message to the cloud platform, wherein the uplink acknowledgement message comprises an acknowledgement identifier corresponding to the request acknowledgement identifier and a message matching field identical to the second message matching field.
Optionally, the method further includes:
the cloud platform sends a downlink message to the vehicle-mounted communication terminal, wherein the downlink message comprises a third message type identifier, a second request identifier, a third message matching field, a second request matching field and a second service message;
the vehicle-mounted communication terminal analyzes the downlink message to acquire a third message type identifier, a second request identifier, a third message matching field, a second request matching field and a second service message; when the third message type identifier is a request acknowledgement identifier, sending a first uplink response message to the cloud platform, wherein the first uplink response message comprises an acknowledgement identifier corresponding to the request acknowledgement identifier and a message matching field identical to the third message matching field;
the vehicle-mounted communication terminal processes the second service message and sends a second uplink response message to the cloud platform, wherein the second uplink response message comprises a fourth message type identifier, a fourth message matching field, a second response identifier corresponding to the second request identifier and a request matching field identical to the second request matching field;
and when the fourth message type identifier is a request confirmation identifier, the cloud platform sends a downlink confirmation message to the vehicle-mounted communication terminal, wherein the downlink confirmation message comprises a confirmation identifier corresponding to the request confirmation identifier and a message matching field identical to the fourth message matching field.
Optionally, the method may be characterized in that,
the first service message includes: attribute messages of vehicle components in a predefined vehicle object model, and event messages of vehicle components in the predefined vehicle object model, wherein each vehicle component corresponds to a function or component in the smart vehicle;
the second service message includes: issuing a message aiming at the configuration data of each vehicle component in the vehicle object model, acquiring a message aiming at the attribute data of each vehicle component in the vehicle object model and acquiring a control message aiming at each vehicle component in the vehicle object model;
when the second service message is the configuration data issuing message or the control message,
the second uplink response message further includes attribute data of each vehicle component after the vehicle-mounted communication terminal processes the second service message.
Optionally, the cloud platform includes a message proxy server broker and a service processing server; the uplink message also comprises a message subject topic;
the sending of the uplink message to the cloud platform includes: and sending an uplink message to the browser so that the browser judges whether the message topic is matched with a target topic subscribed by the service processing server in advance, and if so, forwarding the uplink message to the service processing server.
Optionally, the message topic includes:
the service type of the vehicle-mounted communication equipment, the id of the vehicle-mounted communication equipment, the service type, the service name and/or the uplink and downlink communication identification.
Optionally, the sending the uplink message to the spoke includes:
based on a preset coding mode, coding the first message type identifier, the first request identifier, the first message matching field and the first request matching field into a message header, and coding the first service message into a message body;
encapsulating the message header and the message body into a message body payload in the self-defined MQTT message;
and sending the user-defined MQTT message to the browser based on an MQTT protocol.
In order to achieve the above object, an embodiment of the present invention further provides a communication system for internet of vehicles, where the system includes: the intelligent vehicle comprises a vehicle-mounted communication terminal and a cloud platform which are installed in the intelligent vehicle;
the vehicle-mounted communication terminal is used for sending an uplink message to the cloud platform, wherein the uplink message comprises a first message type identifier, a first request identifier, a first message matching field, a first request matching field and a first service message;
the cloud platform is used for analyzing the uplink message to acquire the first message type identifier, the first request identifier, the first message matching field, the first request matching field and the first service message; and when the first message type identifier is a request confirmation identifier, sending a downlink response message to the intelligent networked vehicle, wherein the downlink response message comprises a confirmation identifier corresponding to the request confirmation identifier, a first response identifier corresponding to the first request identifier, a message matching field identical to the first message matching field, and a request matching field identical to the first request matching field.
In order to achieve the above object, an embodiment of the present invention further provides a communication system for internet of vehicles, where the system includes: the intelligent vehicle comprises a vehicle-mounted communication terminal and a cloud platform which are installed in the intelligent vehicle;
the vehicle-mounted communication terminal is used for sending an uplink message to the cloud platform, wherein the uplink message comprises a first message type identifier, a first request identifier, a first message matching field, a first request matching field and a first service message;
the cloud platform is used for analyzing the uplink message to acquire the first message type identifier, the first request identifier, the first message matching field, the first request matching field and the first service message; when the first message type identifier is a request confirmation identifier, sending a first downlink response message to the intelligent networked vehicle, wherein the first downlink response message comprises a confirmation identifier corresponding to the request confirmation identifier and a message matching field identical to the first message matching field;
the cloud platform is further configured to send a second downlink response message to the intelligent networked vehicle after processing the first service message, where the second downlink response message includes a second message type identifier, a second message matching field, a first response identifier corresponding to the first request identifier, and a request matching field identical to the first request matching field;
and the vehicle-mounted communication terminal is further configured to send an uplink acknowledgement message to the cloud platform when the second message type identifier is a request acknowledgement identifier, where the uplink acknowledgement message includes an acknowledgement identifier corresponding to the request acknowledgement identifier and a message matching field identical to the second message matching field.
The embodiment of the invention has the following beneficial effects:
according to the communication method and the communication system of the Internet of vehicles, the initiation-response matching of communication is realized through the message type identification and the message matching field, the request-response matching of the service request is realized through the request identification, the response identification and the request matching field, and a corresponding request-response matching mode is not required to be defined by a user, so that the workload is reduced, and the matching accuracy of the request-response is improved.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the technical problems that extra workload is caused by a self-defined request-response matching mode in the vehicle networking communication and the self-defined request-response matching mode is possibly not complete, the embodiment of the invention provides a vehicle networking communication method and a vehicle networking communication system.
Firstly, a car networking communication system provided by an embodiment of the present invention is explained, referring to fig. 1, fig. 1 is a schematic structural diagram of the car networking communication system provided by the embodiment of the present invention; the system may include a cloud platform and an on-board communication terminal installed in a smart vehicle. The vehicle-mounted communication terminals can be multiple, and sim cards can be installed in the vehicle-mounted communication terminals to achieve wireless networking.
In the embodiment of the invention, the vehicle-mounted communication terminal can be used as a gateway for vehicle networking and can realize the collection, the cache and the forwarding of vehicle-related data. Accordingly, the cloud platform is responsible for storing and processing data sent by the vehicle-mounted communication terminal, and can send instructions to the vehicle-mounted communication terminal to control the vehicle.
The following description is made with reference to the accompanying drawings for a communication method of the internet of vehicles according to an embodiment of the present invention, and referring to fig. 2, fig. 2 is a schematic flow chart of the communication method of the internet of vehicles according to an embodiment of the present invention, where the method may be applied to the communication system of the internet of vehicles, and specifically may include the following steps:
s201: the vehicle-mounted communication terminal sends an uplink message to the cloud platform, wherein the uplink message comprises a first message type identifier, a first request identifier, a first message matching field, a first request matching field and a first service message.
S202: the cloud platform analyzes the uplink message and acquires a first message type identifier, a first request identifier, a first message matching field, a first request matching field and a first service message; and when the first message type identifier is a request confirmation identifier, sending a downlink response message to the intelligent networked vehicle, wherein the downlink response message comprises a confirmation identifier corresponding to the request confirmation identifier, a first response identifier corresponding to the first request identifier, a message matching field identical to the first message matching field and a request matching field identical to the first request matching field.
Specifically, in the embodiment of the present invention, when the vehicle-mounted communication terminal needs to report data to the cloud platform, an uplink message packet may be sent to the cloud platform, where the uplink message packet includes a first message type identifier, a first request identifier, a first message matching field, a first request matching field, and a first service message.
The cloud platform analyzes the uplink message and acquires a first message type identifier, a first request identifier, a first message matching field, a first request matching field and a first service message; and when the first message type identifier is a request confirmation identifier, sending a downlink response message to the intelligent networked vehicle, wherein the downlink response message comprises a confirmation identifier corresponding to the request confirmation identifier, a first response identifier corresponding to the first request identifier, a message matching field identical to the first message matching field and a request matching field identical to the first request matching field.
In the embodiment of the invention, the message type identifier, the request identifier, the message matching field and the request matching field all belong to a header part in the communication message and can be represented by a predefined specific field in the header. The service message belongs to the body part of the communication message, and the relevant description about the service message can be referred to below.
The message type identification may include: CON, NON and ACK, wherein CON is short for configurable and represents the requirement of acknowledgement, i.e. the message sending end needs the message receiving end to reply an acknowledgement message; the NON is short for NON-configurable, and represents that the confirmation identification is not required, namely the message sending end does not need the message receiving end to reply the confirmation message; ACK is short for acknowledgement, and represents an acknowledgement flag, which is used to acknowledge the CON message. The message type identifier may be represented by a header.type, for example, a certain message includes a header.type: CON, which indicates that the message is a message requiring acknowledgement.
In the embodiment of the present invention, the message matching field is used for matching the required acknowledgement identifier CON and the acknowledgement identifier ACK. Seq may be used to denote the message match field.
In the embodiment of the invention, the request and the response of the message can be represented by a header. Specifically, when the message does not contain a header.code, the message is a request message; when the message contains a header.code and the header.code is not equal to 0, indicating that the message is a response message; code:0 in the message, it means that the message is neither a request message nor a response message, but is only a null message.
In the embodiment of the invention, the request matching field is used for matching the request identification and the response identification. Session may be denoted with header.
For example, referring to fig. 3, fig. 3 is a first signaling interaction diagram of the car networking communication provided by the embodiment of the present invention; the vehicle-mounted communication terminal sends an uplink message to the cloud platform, wherein the type of the uplink message is CON, and the CON represents that the message type identifier is a request confirmation identifier; header, seq:0x01 in the uplink message, which means "0 x 01" is the character used for matching the required acknowledgement identifier CON and the acknowledgement identifier ACK in the uplink message; the uplink message does not contain a header.code, and the uplink message is a request message; session:0x1234, "0 x 1234" in the uplink message is the character used to match the request identity and the response identity in the uplink message.
After receiving the uplink message, the cloud platform analyzes the uplink message to obtain the information in the uplink message, and since the message type identifier in the uplink message is the confirmation request identifier CON, the cloud platform needs to send a downlink response message to the vehicle-mounted communication terminal. As shown in fig. 3, the header.type: ACK in the downlink response message corresponds to the header.type: CON in the uplink message, and the header.seq:0x01 in the downlink response message is the same as the message matching field in the uplink message; a header.code ═ 200 in the downlink response message indicates that the downlink response message is a response message, and a request matching field header.session:0x1234 in the downlink response message is the same as the request matching field in the uplink message, indicating that the downlink response message is a response message for the uplink message.
Therefore, the communication method of the Internet of vehicles provided by the embodiment of the invention can provide message response and request-matching response, and the request confirmation identifier and the confirmation identifier of the message are matched through the message matching field, so that the message initiator can confirm whether the message is received, and the request and the response of the message are matched through the request matching field, so that the message initiator can confirm whether the initiated request is responded. Therefore, a complete and reliable request-response matching mode in the vehicle networking communication is provided.
In the embodiment of the present invention, the cloud platform may also serve as an initiator of the request. Specifically, the cloud platform may send a downlink message to the vehicle-mounted communication terminal, where the downlink message includes a second message type identifier, a second request identifier, a second message matching field, a second request matching field, and a second service message.
The vehicle-mounted communication terminal analyzes the downlink message, acquires a second message type identifier, a second request identifier, a second message matching field, a second request matching field and a second service message, and sends an uplink response message to the cloud platform when the second message type identifier is a request confirmation identifier, wherein the uplink response message comprises a confirmation identifier corresponding to the request confirmation identifier, a second response identifier corresponding to the second request identifier, a message matching field identical to the second message matching field and a request matching field identical to the second request matching field.
For example, referring to fig. 4, fig. 4 is a second signaling interaction diagram of the car networking communication provided by the embodiment of the present invention; the cloud platform sends a downlink message to the vehicle-mounted communication terminal, wherein the message type identifier is CON, and the identification message type identifier is a request confirmation identifier; header, seq:0x01 in the downlink message, which means "0 x 01" is the character used for matching the required acknowledgement identifier CON and the acknowledgement identifier ACK in the downlink message; no header.code is contained in the downlink message, which indicates that the downlink message is a request message; session:0x1234, "0 x 1234" in the downlink message is the character used in the downlink message to match the request identity and the response identity.
After receiving the downlink message, the vehicle-mounted communication terminal analyzes the downlink message to obtain the information in the downlink message, and because the message type identifier in the downlink message is the request confirmation identifier CON, the vehicle-mounted communication terminal needs to send an uplink response message to the cloud platform. As shown in fig. 4, the header.type: ACK in the uplink response message corresponds to the header.type: CON in the downlink message, and the message matching field header.seq:0x01 in the uplink response message is the same as the message matching field in the downlink message; a header.code ═ 200 in the uplink response message indicates that the uplink response message is a response message, and a request matching field header.session:0x1234 in the uplink response message is the same as a request matching field in the downlink message, indicating that the uplink response message is a response message for the downlink message.
Therefore, according to the communication method of the Internet of vehicles provided by the embodiment of the invention, a service request can be initiated from the vehicle-mounted communication terminal or the cloud platform. And no matter the service request is initiated by the vehicle-mounted communication terminal or the cloud platform, a perfect and effective request-matching mechanism can be provided.
For convenience of description, in the embodiment of the present invention, a request initiating terminal represents one terminal that initiates a service request, and a request receiving terminal represents one terminal that receives the service request, for example, in the embodiment shown in fig. 3, a vehicle-mounted communication terminal is the request initiating terminal, and a cloud platform is the request receiving terminal; in the embodiment shown in fig. 4, the cloud platform is a request initiating terminal, and the vehicle-mounted communication terminal is a request receiving terminal.
In the embodiment of the invention, if the message sent by the request initiating terminal does not need to be confirmed, the message type identifier in the message sent by the request initiating terminal can be set as a NON-required confirmation identifier, namely, a header type NON, so that the request receiving terminal does not need to reply the confirmation message after receiving the message.
The message type identifier header, the message matching field header, the seq, the response identifier header, and the request matching field header, the session are all fields in a communication protocol defined in advance by the present invention, and all belong to the header part in the communication protocol.
In addition to the above fields, in the embodiment of the present invention, other fields are predefined for carrying other communication information. Specifically, referring to table 1 below, table 1 describes different fields, field types, and description information of the header portion and the body portion in the vehicle networking communication protocol defined in the embodiment of the present invention.
TABLE 1
Timestamp represents the timestamp of the message, and header ttl represents the expiration time of the message, for example.
In the embodiment of the invention, in order to facilitate the vehicle to access the Internet of vehicles cloud platform, a vehicle object model is further defined.
The vehicle object model is represented by a schema, and the vehicle-mounted communication terminal of one vehicle can correspond to one schema. Further, the vehicle object model is constituted by a plurality of vehicle components, wherein the respective vehicle components may be divided as needed, and each vehicle component may be represented by a component.
As one example, each vehicle component may correspond to a function or component in a smart vehicle.
In this embodiment of the present invention, one schema configuration file may include the following contents:
properties, i.e. attributes, represent some data that may change during operation. For example, assuming that a component is an engine, its possible attributes are speed, output power, torque, etc. These data all change as the vehicle is operated.
And the Service represents some services which can be executed by the vehicle, such as unlocking and unlocking of a vehicle door, opening and closing of an air conditioner and the like, and the Service is called to enable the cloud platform to remotely control the vehicle.
Event, which represents an Event that occurs to the vehicle, such as the vehicle being intruded, the vehicle being dragged, etc.
Profile, which can be further divided into configuration and label. The configuration is configuration information which is issued to the vehicle-mounted communication terminal by the cloud platform and configured according to different components; while label is some static property that does not normally change, such as vehicle equipment weight, power rating, etc.
In the embodiment of the invention, the service message can be transmitted based on the definition of the vehicle object model.
As an example, if the vehicle-mounted communication terminal of a certain vehicle is defined as an object model schema, the schema includes two vehicle component components, namely a "body" and an "engine", respectively, and the vehicle component engine may include properties, services, files and events related to the engine.
The schema can be expressed as follows:
"vehicle":
“properties”:
"vehicle body";
"Engine";
“properties”:
"Power";
"Torque";
"blocked state";
"rotational speed";
“service”:
"remote inhibited startup";
"blocked state";
“profile”:
“label”:
"maximum power";
“configuration”:
"automatic start and stop";
“events”:
"over-high rotational speed";
in the embodiment of the invention, the information fields contained in each component in the vehicle object model can be predefined, so that the multiplexing and the expansion are convenient. For example, properties, services, profile and events included in the vehicle component "engine" in the above example may be predefined, and for a vehicle-mounted communication terminal newly connected to the internet of vehicles, even if the vehicle configurations are different, the defined information fields may be directly used to transmit messages, so that the vehicle can conveniently connect to the internet of vehicles cloud platform.
The vehicle object model defined by the embodiment of the invention is formed by combining a plurality of components, so that the vehicle object model can be customized according to the configuration of the vehicle. For example, vehicle a contains 8 components, then the vehicle object model defined for vehicle a may include 8 components; the vehicle B comprises 10 components, and the vehicle object model defined for the vehicle B can comprise 10 components, each component is predefined, and the vehicle component modularization is realized, so that the reuse of the vehicle component is facilitated, the object model of each vehicle can be conveniently determined, and the vehicle can be conveniently accessed to a network.
Furthermore, since the vehicle object model defined by the embodiment of the present invention is composed of a plurality of components, it is possible to allow data to be transmitted in component form, for example, only data related to the engine of the vehicle. Compared with the existing mode of full data collection and full data transmission for the whole vehicle, the method can greatly reduce the data collection flow and reduce the consumption of communication resources.
Based on the definition of the vehicle object model, in the embodiment of the present invention, the first service message included in the uplink message sent by the vehicle-mounted communication terminal to the cloud platform may include: attribute messages of vehicle components in a predefined vehicle object model, and event messages of vehicle components in a predefined vehicle object model.
The attribute information of each vehicle component may include data such as a door closed state, an engine speed, an engine power, and an engine torque, which may be reported periodically or in a triggered manner, for example, when the door is unlocked, the door state is reported to the cloud platform.
The event message may include that the vehicle is invaded, the vehicle is dragged, and the like, and the event message is reported in a triggered manner, for example, when the vehicle-mounted communication terminal detects that the vehicle is invaded, the event message that the vehicle is invaded is sent to the cloud platform.
Based on the definition of the vehicle object model, in the embodiment of the present invention, the second service message included in the downlink message sent by the cloud platform to the vehicle-mounted communication terminal may include: the method comprises the steps of issuing messages according to configuration data of each vehicle component in a vehicle object model, acquiring messages according to attribute data of each vehicle component in the vehicle object model and controlling messages according to each vehicle component in the vehicle object model.
The configuration data issuing message is carried in the configuration field, that is, the cloud platform can issue the configuration data to the vehicle-mounted communication terminal, so that the vehicle-mounted communication terminal executes a corresponding function according to the configuration data.
When the cloud platform wants to acquire the attribute information of each vehicle component of the vehicle-mounted communication terminal, the cloud platform can send an attribute data acquisition message to the vehicle-mounted communication terminal, for example, when the cloud platform wants to acquire the current door state, the engine speed and the like of the vehicle-mounted communication terminal, the cloud platform can send the attribute data acquisition message to the vehicle-mounted communication terminal.
When the cloud platform wishes to call a service provided by the in-vehicle communication terminal to control the vehicle, a control message, such as remote unlocking, remote control of an air conditioner, or the like, may be sent to the in-vehicle communication terminal.
In an embodiment of the present invention, after receiving the request, the receiving end may first reply a message with an ACK identifier, indicating that the message has been received, then process the request, and initiate an acknowledgement after the processing is completed, where the acknowledgement may include a processing result and may be carried on a CON or NON message.
Referring to fig. 5, fig. 5 is another schematic flow chart of a communication method of the internet of vehicles according to an embodiment of the present invention, where the method includes the following steps:
s501: the method comprises the steps that a vehicle-mounted communication terminal sends an uplink message to a cloud platform, wherein the uplink message comprises a first message type identifier, a first request identifier, a first message matching field, a first request matching field and a first service message;
s502: the cloud platform analyzes the uplink message and acquires a first message type identifier, a first request identifier, a first message matching field, a first request matching field and a first service message; when the first message type identifier is a request confirmation identifier, sending a first downlink response message to the intelligent networked vehicle, wherein the first downlink response message comprises a confirmation identifier corresponding to the request confirmation identifier and a message matching field identical to the first message matching field;
s503: the cloud platform processes the first service message and sends a second downlink response message to the intelligent networked vehicle, wherein the second downlink response message comprises a second message type identifier, a second message matching field, a first response identifier corresponding to the first request identifier and a request matching field identical to the first request matching field;
s504: and when the second message type identifier is a request confirmation identifier, the vehicle-mounted communication terminal sends an uplink confirmation message to the cloud platform, wherein the uplink confirmation message comprises a confirmation identifier corresponding to the request confirmation identifier and a message matching field identical to the second message matching field.
For example, referring to fig. 6, fig. 6 is a third signaling interaction diagram of the car networking communication provided by the embodiment of the present invention. As shown in fig. 6, the vehicle-mounted communication terminal sends an uplink message to the cloud platform, where the type of the uplink message is "CON", and indicates that the message type identifier is the confirmation request identifier; header, seq:0x01 in the uplink message, which means "0 x 01" is the character used for matching the required acknowledgement identifier CON and the acknowledgement identifier ACK in the uplink message; the uplink message does not contain a header.code, and the uplink message is a request message; session:128 in the uplink message, indicating that "128" is a character used to match the request identifier and the response identifier in the uplink message.
After receiving the uplink message, the cloud platform analyzes the uplink message to obtain the information in the uplink message, and since the message type identifier in the uplink message is the confirmation request identifier CON, the cloud platform needs to send a downlink response message to the vehicle-mounted communication terminal.
As shown in fig. 6, the cloud platform may first send a first downlink response message to the vehicle-mounted communication terminal, where the header.type: ACK in the first downlink response message corresponds to the header.type: CON in the uplink message, and the message matching field header.seq:0x01 in the first downlink response message is the same as the message matching field in the uplink message; code ═ 0 in the first downlink response message indicates that the first downlink message is an empty message and does not respond to the request in the uplink message.
The cloud platform processes the first service message after sending the first downlink response message, and initiates a second downlink response message to the vehicle-mounted communication terminal after processing the first service message, wherein a header.code of the second downlink response message is 200, which indicates that the second downlink response message is a response message, and a header.session of a request matching field in the second downlink response message is 128, which is the same as a request matching field in the uplink message, and indicates that the second downlink response message is a response message for the uplink message. In addition, the response is carried on a new CON message, and the header.type: CON in the second downlink response message is as follows: xxxx, which represents a result of the cloud platform processing the first business message.
After the vehicle-mounted communication terminal receives the second downlink response message, because the second downlink response message is a CON message, it needs to reply an uplink acknowledgement message, header.type: ACK, and a message matching field header.seq:0x02 is the same as the message matching field in the second downlink response message, which indicates that the uplink acknowledgement message is an acknowledgement message for the second downlink response message. Code in the uplink acknowledgement message is 0, which indicates that the uplink acknowledgement message is neither a request message nor a response message, but is an empty message, and is only used for acknowledging the second downlink response message.
Correspondingly, in an embodiment of the present invention, after receiving the request message sent by the cloud platform, the vehicle-mounted communication terminal may also reply a message with an ACK identifier to indicate that the message is received, then process the request, and initiate a response actively after the processing is completed, where the response may include a processing result and is carried on a CON or NON message.
Specifically, the cloud platform sends a downlink message to the vehicle-mounted communication terminal, wherein the downlink message comprises a third message type identifier, a second request identifier, a third message matching field, a second request matching field and a second service message;
the vehicle-mounted communication terminal analyzes the downlink message and acquires a third message type identifier, a second request identifier, a third message matching field, a second request matching field and a second service message; when the third message type identifier is a request confirmation identifier, sending a first uplink response message to the cloud platform, wherein the first uplink response message comprises a confirmation identifier corresponding to the request confirmation identifier and a message matching field identical to the third message matching field;
after processing the second service message, the vehicle-mounted communication terminal sends a second uplink response message to the cloud platform, wherein the second uplink response message comprises a fourth message type identifier, a fourth message matching field, a second response identifier corresponding to the second request identifier and a request matching field identical to the second request matching field;
and when the fourth message type identifier is a confirmation request identifier, the cloud platform sends a downlink confirmation message to the vehicle-mounted communication terminal, wherein the downlink confirmation message comprises a confirmation identifier corresponding to the confirmation request identifier and a message matching field identical to the fourth message matching field.
For example, referring to fig. 7, fig. 7 is a fourth signaling interaction diagram of the car networking communication provided by the embodiment of the present invention. As shown in fig. 7, the cloud platform sends a downlink message to the vehicle-mounted communication terminal, where the header.type in the downlink message is CON, which indicates that the message type identifier is the request confirmation identifier; header, seq:0x03 in the downlink message, which means "0 x 03" is the character used for matching the required acknowledgement identifier CON and the acknowledgement identifier ACK in the downlink message; no header.code is contained in the downlink message, which indicates that the downlink message is a request message; session:129 in the downlink message, indicating that "129" is a character used for matching the request identifier and the response identifier in the downlink message.
After receiving the downlink message, the vehicle-mounted communication terminal analyzes the downlink message to obtain the information in the downlink message, and because the message type identifier in the downlink message is the request confirmation identifier CON, the vehicle-mounted communication terminal needs to send an uplink response message to the cloud platform.
As shown in fig. 7, the vehicle-mounted communication terminal may first send a first uplink response message to the cloud platform, where the header.type: ACK in the first uplink response message corresponds to the header.type: CON in the downlink message, and a message matching field header.seq:0x03 in the first uplink response message is the same as a message matching field in the downlink message; code ═ 0 in the first uplink response message indicates that the first uplink message is a null message and does not respond to the request in the downlink message.
After the vehicle-mounted communication terminal sends the first uplink response message, the vehicle-mounted communication terminal processes the second service message and initiates a second uplink response message to the vehicle-mounted communication terminal, wherein the second uplink response message header.code is 200, which indicates that the message is a response message, and the request matching field header.session:129 in the second uplink response message is the same as the request matching field in the downlink message, which indicates that the second uplink response message is a response message for the downlink message. In addition, the response is borne on a new CON message, and the header.type: CON in the second uplink response message is as follows: xxxx, xxxx represents a result of the vehicle-mounted communication terminal processing the second service message.
After the cloud platform receives the second uplink response message, because the second uplink response message is a CON message, it needs to reply a downlink acknowledgement message, header.type: ACK, and the message matching field header.seq:0x04 is the same as the message matching field in the second uplink response message, which indicates that the downlink acknowledgement message is an acknowledgement message for the second uplink response message. Code in the downlink acknowledgement message is 0, which indicates that the downlink acknowledgement message is neither a request message nor a response message, but is an empty message, and is only used for acknowledging the second uplink response message.
Therefore, the request-response matching mechanism in the vehicle networking communication defined in the embodiment of the invention can allow the request receiving end to reply the confirmation message first and then process the request. That is, after the request receiving end receives the request message, if it takes a long time to process the message, it may reply a confirmation message to the request initiating end first, indicating that the message has been received, and then the request initiating end can also know that the other party has received the message. After the request receiving end processes the service request, it can initiate a response message actively, the response message carries the processing result of the service request, the response message can be carried on the CON message or the NON message, and the request matching field in the response message is the same as the request matching field in the request message sent by the request sending end, so as to implement the request-response matching.
However, none of the existing internet of vehicles communication is based on the published and mature request and response design of MQTT. If a simple request and confirmation mechanism is used, when the time for processing the message by the request receiving end is long and no response message is fed back later, the request sending end considers that the communication is wrong, and the request receiving end may retransmit the request message for multiple times, which easily causes communication congestion of the Internet of vehicles. Therefore, the vehicle networking communication mode which allows the request receiving end to reply the confirmation message and then process the service request provided by the embodiment of the invention is more complete and reliable compared with the existing vehicle networking communication.
In the embodiment of the invention, in the vehicle networking communication process of allowing the request receiving end to reply the confirmation message firstly and then processing the service request, the first service message can also comprise the attribute message of each vehicle component in the predefined vehicle object model and the event message of each vehicle component in the predefined vehicle object model; the second service message may also include a configuration data issue message for each vehicle component in the vehicle object model, an attribute data acquisition message for each vehicle component in the vehicle object model, and a control message for each vehicle component in the vehicle object model, which are not described in detail.
In addition, if the second service message is a configuration data delivery message or a control message, after the vehicle-mounted communication terminal processes the second service message, the uplink response message may be allowed to piggyback the attribute data of part of the vehicle components after processing the second service message. The reason is that after the vehicle performs the remote operation, the attribute data of the vehicle central subassembly is changed, and the changed attributes can be transmitted to the cloud platform in a reply message, so that the communication overhead is reduced as much as possible. For example, if the control message is to close a vehicle door, the vehicle-mounted communication terminal may include state information that the vehicle door is closed in a response message fed back to the cloud platform after closing the vehicle door according to the control message.
Based on the consideration of reducing the communication overhead, when the first service message is an event message, the vehicle-mounted communication terminal sends an uplink message to the cloud platform, and the uplink message may also piggyback the attribute data of the part assembly. The reason is that after the vehicle sends a certain event, the attribute data of the vehicle central subassembly is changed correspondingly, and the changed attributes can be transmitted to the cloud platform in an uplink message.
Since a request receiver may receive multiple request messages over a period of time, causing the request messages to form a request queue at the request receiver, in one embodiment of the invention, the request messages may be allowed to be deferred for processing. Specifically, after receiving the request message, the request receiving end may first reply a confirmation message to the request initiating end. If there are other request services to be processed in the current request queue, the request receiving end can temporarily hold the currently received request message, process the other request services to be processed in the request queue according to the sequence of the request messages in the queue, and feed back a response message to the request initiating end corresponding to the request service after completing one request service each time.
As an example, referring to fig. 8, fig. 8 is a fifth signaling interaction diagram of car networking communication provided in the embodiment of the present invention. As shown in fig. 8, the vehicle-mounted communication terminal sends an uplink message to the cloud platform, where the type of the uplink message is "CON", and indicates that the message type identifier is the confirmation request identifier; header, seq:0x01 in the uplink message, which means "0 x 01" is the character used for matching the required acknowledgement identifier CON and the acknowledgement identifier ACK in the uplink message; the uplink message does not contain a header.code, and the uplink message is a request message; session:128 in the uplink message, indicating that "128" is a character used to match the request identifier and the response identifier in the uplink message.
After receiving the uplink message, the cloud platform analyzes the uplink message to obtain the information in the uplink message, and since the message type identifier in the uplink message is the confirmation request identifier CON, the cloud platform needs to send a downlink response message to the vehicle-mounted communication terminal.
As shown in fig. 8, the cloud platform may first send a first downlink response message to the vehicle-mounted communication terminal, where the header.type: ACK in the first downlink response message corresponds to the header.type: CON in the uplink message, and the message matching field header.seq:0x01 in the first downlink response message is the same as the message matching field in the uplink message; code ═ 0 in the first downlink response message indicates that the first downlink message is an empty message and does not respond to the request in the uplink message.
After sending the first downlink response message, the cloud platform temporarily puts the first service message, starts to process the request service to be processed in the current queue, and feeds back the response message to the request initiating end corresponding to the request service after completing one request service each time. After processing all the request services in the queue before the first service message, the cloud platform starts to process the first service message, and initiates a second downlink response message to the vehicle-mounted communication terminal after processing the first service message, wherein the second downlink response message header.code is 200, which indicates that the message is a response message, and the request matching field header.session:128 in the second downlink response message is the same as the request matching field in the uplink message, which indicates that the second downlink response message is a response message for the uplink message. In addition, the response is carried on a new CON message, and the header.type: CON in the second downlink response message is as follows: xxxx, which represents a result of the cloud platform processing the first business message.
After the vehicle-mounted communication terminal receives the second downlink response message, because the second downlink response message is a CON message, it needs to reply an uplink acknowledgement message, header.type: ACK, and a message matching field header.seq:0x02 is the same as the message matching field in the second downlink response message, which indicates that the uplink acknowledgement message is an acknowledgement message for the second downlink response message. Code in the uplink acknowledgement message is 0, which indicates that the uplink acknowledgement message is neither a request message nor a response message, but is an empty message, and is only used for acknowledging the second downlink response message.
Therefore, in the embodiment of the invention, if the request receiving end receives more service requests in a short time and the service requests form a queue, the newly received request message can be allowed to be processed in a delayed way, so that the service requests in the queue can be processed in time, and perfect and reliable vehicle networking communication is realized.
In an embodiment of the present invention, the communication between the vehicle-mounted communication terminal and the cloud platform may be based on an existing MQTT communication protocol.
Specifically, the cloud platform may include a message proxy server brooker and a business processing server. The person skilled in the art can understand that the MQTT communication protocol is a communication protocol based on a publish/subscribe type, the message proxy server broker is used as a transfer server of the message, and is respectively connected with the vehicle-mounted communication terminal and the service processing server, and when detecting that the message topic is matched with a target topic pre-subscribed by the vehicle-mounted communication terminal or the service processing server, the message is forwarded to the vehicle-mounted communication terminal or the service processing server.
In the embodiment of the invention, the uplink message sent by the vehicle-mounted communication terminal to the cloud platform can contain a message theme, and the step of sending the uplink message by the vehicle-mounted communication terminal to the cloud platform is substantially that the vehicle-mounted communication terminal sends the uplink message to the browser. The browser judges whether the message topic is matched with a target topic subscribed by the service processing server in advance, and if the message topic is matched with the target topic, the uplink message is forwarded to the service processing server.
Correspondingly, the downlink message sent by the cloud platform to the vehicle-mounted communication terminal may also include a message theme, and the step of sending the downlink message by the cloud platform to the vehicle-mounted communication terminal is substantially that the service processing server sends the downlink message to the broker. The browser judges whether the message topic is matched with a target topic subscribed by the vehicle-mounted communication terminal in advance, and if the message topic is matched with the target topic, the downlink message is forwarded to the vehicle-mounted communication terminal.
In this embodiment of the present invention, the message topic may include: vehicle-mounted communication device type, vehicle-mounted communication device Id, service type, service name, and/or uplink and downlink communication identifier, i.e., Topic $ { namespace }/$ { deviceType }/$ { device Id }/$ { function }/$ { Id }/$/dir }.
namespace represents a service name, such as a Telematics Service (TSP) service, a telematics device type deviceType may be Tbox or IHU, a device Id represents a unique Id of a device, a service type function represents that a protocol message carries an attribute, a service, an event, or a profile, and the values are "profiles", "service", "event", and "profile", respectively. And { id } represents service id or event id, which is only needed when the value of $ { function } is service and event, and $ { dir } represents uplink and downlink communication identifiers, which can also be understood as the direction of a communication message, that is, down from cloud to end, and up from end to cloud.
For example, the cloud platform issues a request to execute a remote engine start prohibition command to the vehicle-mounted communication terminal, and the deviceid of the vehicle-mounted tbox is 9921345678, then the corresponding message topic may be: TSP/Tbox/9921345678/service/vehicle.
In the embodiment of the invention, the required communication foundation between the intelligent networked vehicle and the vehicle networking cloud platform is realized through the defined vehicle object model and the request-response matching mode in the vehicle networking communication. On the basis, the communication content can be coded by adopting a specific coding mode and carried in a self-defined MQTT message.
Specifically, referring to fig. 9, the uplink message sent by the vehicle-mounted communication terminal to the cloud platform may be a custom MQTT message, and the step of sending the uplink message to the broker may include the following refining steps:
s901: and based on a preset coding mode, coding the first message type identifier, the first request identifier, the first message matching field and the first request matching field into a message header, and coding the first service message into a message body.
In this embodiment of the present invention, an asn1 encoding manner may be adopted to encode field information for matching a request-response as a message header, and specifically, the field information may include a first message type identifier, a first request identifier, a first message matching field, a first request matching field, and other field information of the header portion in table 1. The service message is encoded as a message body. As above, the service message follows the vehicle object model described above, and may include attribute information of each component of the vehicle, event information of each component of the vehicle, and the like.
S902: and encapsulating the message header and the message body into a message body payload in the self-defined MQTT message.
Those skilled in the art can understand that the existing MQTT communication message includes a message topic and a message body payload, and in the embodiment of the present invention, both the message header and the message body may be encapsulated in the message body payload in the custom MQTT message.
S903: and sending a self-defined MQTT message to the browser based on the MQTT protocol.
In the embodiment of the invention, the message form obtained by the assembly and encapsulation is the MQTT communication message, so that the user-defined MQTT message can be sent to the broker based on the existing MQTT protocol.
The broker forwards a user-defined MQTT message to the service processing server, the service processing server analyzes the user-defined MQTT message after receiving the user-defined MQTT message, obtains coded data of a message header and a message body from payload in the user-defined MQTT message, and decodes the message header and the message body respectively to obtain corresponding fields. The message type identifier, the request identifier, the message matching field, the request matching field and other information can be obtained from the message header, so that whether a confirmation message needs to be replied or not can be known. From the message body, specific vehicle data may be obtained, such as:
vehicle:
engine:
power:100
torque:200
blockStatus:0
the vehicle data includes data for engine components, including values for power, torque, and block state 3 attributes.
In the embodiment of the invention, the communication message between the vehicle-mounted communication terminal and the cloud platform can adopt the encoding and decoding mode, the packaging mode and the transmission mode of the user-defined MQTT message.
Therefore, in the embodiment of the invention, the fields for request-response matching and the specific vehicle model data can be loaded in MQTT communication, and compared with the traditional vehicle networking communication based on MQTT, the invention additionally provides a complete and reliable request-response matching mechanism without the need of self-defining a request-response matching mode by a user. In addition, the vehicle object model defined in the embodiment of the invention allows vehicle data to be transmitted in the form of vehicle components, which facilitates the reuse of the vehicle components and thus facilitates the access of different vehicles to the network. And the data of the part is allowed to be transmitted, and compared with the mode of full transmission of the data of the whole vehicle, the data acquisition flow is greatly reduced.
Based on the same inventive concept, the embodiment of the invention also provides a vehicle networking communication system, which comprises: the vehicle-mounted communication terminal and the cloud platform are installed in the intelligent vehicle.
The vehicle-mounted communication terminal is used for sending an uplink message to the cloud platform, wherein the uplink message comprises a first message type identifier, a first request identifier, a first message matching field, a first request matching field and a first service message;
the cloud platform is used for analyzing the uplink message and acquiring a first message type identifier, a first request identifier, a first message matching field, a first request matching field and a first service message; and when the first message type identifier is a request confirmation identifier, sending a downlink response message to the intelligent networked vehicle, wherein the downlink response message comprises a confirmation identifier corresponding to the request confirmation identifier, a first response identifier corresponding to the first request identifier, a message matching field identical to the first message matching field and a request matching field identical to the first request matching field.
Therefore, the communication system of the internet of vehicles provided by the embodiment of the invention can provide message response and request-matching response, and the request confirmation identifier and the confirmation identifier of the message are matched through the message matching field, so that the message initiator can confirm whether the message is received, and the request and the response of the message are matched through the request matching field, so that the message initiator can confirm whether the initiated request is responded. Therefore, a complete and reliable request-response matching mode in the vehicle networking communication is provided.
In an embodiment of the present invention, the vehicle-mounted communication terminal is configured to send an uplink message to the cloud platform, where the uplink message includes a first message type identifier, a first request identifier, a first message matching field, a first request matching field, and a first service message;
the cloud platform is used for analyzing the uplink message and acquiring a first message type identifier, a first request identifier, a first message matching field, a first request matching field and a first service message; when the first message type identifier is a request confirmation identifier, sending a first downlink response message to the intelligent networked vehicle, wherein the first downlink response message comprises a confirmation identifier corresponding to the request confirmation identifier and a message matching field identical to the first message matching field;
the cloud platform is further used for sending a second downlink response message to the intelligent networked vehicle after the first service message is processed, wherein the second downlink response message comprises a second message type identifier, a second message matching field, a first response identifier corresponding to the first request identifier and a request matching field identical to the first request matching field;
and the vehicle-mounted communication terminal is further used for sending an uplink confirmation message to the cloud platform when the second message type identifier is the confirmation-required identifier, wherein the uplink confirmation message comprises a confirmation identifier corresponding to the confirmation-required identifier and a message matching field identical to the second message matching field.
Therefore, the vehicle networking communication system provided by the embodiment of the invention can allow the request receiving end to reply the confirmation message first and then process the request. That is, after the request receiving end receives the request message, if it takes a long time to process the message, it may reply a confirmation message to the request initiating end first, indicating that the message has been received, and then the request initiating end can also know that the other party has received the message. After the request receiving end processes the service request, it can initiate a response message actively, the response message carries the processing result of the service request, the response message can be carried on the CON message or the NON message, and the request matching field in the response message is the same as the request matching field in the request message sent by the request sending end, so as to implement the request-response matching.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the embodiment of the communication system of the internet of vehicles, since it is basically similar to the embodiment of the communication method of the internet of vehicles, the description is simple, and the relevant points can be referred to the partial description of the embodiment of the communication method of the internet of vehicles.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.