CN110213018B - Data communication method and device of vehicle-mounted bus and vehicle - Google Patents

Data communication method and device of vehicle-mounted bus and vehicle Download PDF

Info

Publication number
CN110213018B
CN110213018B CN201910384383.XA CN201910384383A CN110213018B CN 110213018 B CN110213018 B CN 110213018B CN 201910384383 A CN201910384383 A CN 201910384383A CN 110213018 B CN110213018 B CN 110213018B
Authority
CN
China
Prior art keywords
value
data
cyclic redundancy
redundancy check
message
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.)
Active
Application number
CN201910384383.XA
Other languages
Chinese (zh)
Other versions
CN110213018A (en
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.)
BAIC Motor Co Ltd
Original Assignee
BAIC Motor 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 BAIC Motor Co Ltd filed Critical BAIC Motor Co Ltd
Priority to CN201910384383.XA priority Critical patent/CN110213018B/en
Publication of CN110213018A publication Critical patent/CN110213018A/en
Application granted granted Critical
Publication of CN110213018B publication Critical patent/CN110213018B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L2001/0092Error control systems characterised by the topology of the transmission link
    • H04L2001/0094Bus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40241Flexray
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40267Bus for use in transportation systems
    • H04L2012/40273Bus for use in transportation systems the transportation system being a vehicle

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention provides a data communication method and device of a vehicle-mounted bus and a vehicle, wherein the data communication method comprises the following steps: a sending end sends a message, the message comprises application data and control domain data, the control domain data comprises a message count value and/or a sending end cyclic redundancy check value, the message count value is added with 1 before the message is sent, the sending end cyclic redundancy check value is obtained by calculation according to the application data and a data identification value pre-stored by the sending end, and the data identification value is used for uniquely identifying the message; the receiving end receives the message, judges the continuity of the data communication according to the message counting value, calculates the cyclic redundancy check value of the receiving end according to the application data and the data identification value pre-stored by the receiving end, and judges the encryption and integrity of the data communication according to the cyclic redundancy check value of the sending end and the cyclic redundancy check value of the receiving end. The data communication method, the data communication device and the vehicle of the vehicle-mounted bus can ensure the continuity, the integrity and the encryption of end-to-end data communication.

Description

Data communication method and device of vehicle-mounted bus and vehicle
Technical Field
The invention relates to the technical field of communication, in particular to a data communication method and device of a vehicle-mounted bus and a vehicle.
Background
In the process of information exchange between a sending end and a receiving end of a vehicle-mounted Electronic Control Unit (ECU), because factors such as software, hardware, environment and the like have various error risks, taking CAN bus communication as an example, errors that may occur include repeated message reception, message loss, error addressing, delay and the like, and continuity, integrity and encryption of end-to-end data communication cannot be guaranteed.
Disclosure of Invention
The present invention is directed to solving, at least in part, one of the technical problems in the related art.
Therefore, a first objective of the present invention is to provide a data communication method for a vehicle bus, where a message sent by a sending end includes application data and control domain data, the control domain data includes a message count value and/or a sending end cyclic redundancy check value, a receiving end determines continuity of data communication according to the message count value, calculates a receiving end cyclic redundancy check value according to the application data and a data identification value pre-stored by the receiving end, determines confidentiality and integrity of the data communication according to the sending end cyclic redundancy check value and the receiving end cyclic redundancy check value, and can ensure continuity, integrity and confidentiality of end-to-end data communication.
A second object of the present invention is to provide a data communication device of a vehicle bus.
A third object of the invention is to propose a vehicle.
In order to achieve the above object, a first embodiment of the present invention provides a data communication method for a vehicle bus, including:
a sending end sends a message, wherein the message comprises application data and control domain data, the control domain data comprises a message count value and/or a sending end cyclic redundancy check value, the message count value is added with 1 before the message is sent, the sending end cyclic redundancy check value is obtained by calculation according to the application data and a data identification value prestored by the sending end, and the data identification value is used for uniquely identifying the message;
and the receiving end receives the message, judges the continuity of data communication according to the message counting value, calculates a receiving end cyclic redundancy check value according to the application data and the data identification value prestored by the receiving end, and judges the encryption and integrity of the data communication according to the transmitting end cyclic redundancy check value and the receiving end cyclic redundancy check value.
According to the data communication method of the vehicle-mounted bus, the sending end sends the message, the message comprises application data and control domain data, the control domain data comprises a message counting value and/or a sending end cyclic redundancy check value, the message counting value is added with 1 before the message is sent, the sending end cyclic redundancy check value is obtained through calculation according to the application data and a data identification value stored in the sending end in advance, and the data identification value is used for uniquely identifying the message; the receiving end receives the message, judges the continuity of the data communication according to the message counting value, calculates the cyclic redundancy check value of the receiving end according to the application data and the data identification value pre-stored by the receiving end, judges the encryption and integrity of the data communication according to the cyclic redundancy check value of the sending end and the cyclic redundancy check value of the receiving end, and can ensure the continuity, integrity and encryption of the end-to-end data communication.
According to an embodiment of the present invention, the determining the continuity of data communication according to the packet count value includes: calculating the difference value between the message count value and the message count value of the last received message; if the difference value is equal to 0, judging that the message is repeatedly received; if the difference value is equal to 1, judging that the message is successfully received according to a normal sequence; if the difference is greater than 1 and equal to or smaller than a preset difference threshold value, judging that the message is lost; if the difference value is larger than the difference value threshold value, the message sending sequence is judged to have serious errors.
According to an embodiment of the present invention, the determining the encryption and integrity of data communication according to the cyclic redundancy check value of the transmitting end and the cyclic redundancy check value of the receiving end includes: and if the cyclic redundancy check value of the sending end is the same as the cyclic redundancy check value of the receiving end, judging that the data communication encryption and integrity check are successful.
According to an embodiment of the present invention, calculating the cyclic redundancy check value of the transmitting end or the cyclic redundancy check value of the receiving end according to the application data and the data identification value includes: and calculating to obtain the cyclic redundancy check value of the sending end or the cyclic redundancy check value of the receiving end by adopting a CRC8-SAE1850 algorithm according to the application data and the data identification value.
According to an embodiment of the present invention, calculating the cyclic redundancy check value of the transmitting end or the cyclic redundancy check value of the receiving end according to the application data and the data identification value includes: calculating to obtain a first cyclic redundancy check value according to the data identification value and a preset initial value; modifying the initial value to the first cyclic redundancy check value; calculating to obtain a second cyclic redundancy check value according to the application data and the modified initial value; and performing exclusive-or negation processing on the second cyclic redundancy check value according to a preset final exclusive-or value to obtain the cyclic redundancy check value of the sending end or the cyclic redundancy check value of the receiving end.
According to an embodiment of the present invention, the data communication method further includes: if the length of the application data is greater than 1 byte, the low byte data is in front of the application data, and the high byte data is behind the application data; and if the length of the application data is equal to or less than 1 byte, the application data is placed in 1 byte with the upper data at the front and the lower data at the back.
According to an embodiment of the present invention, the data communication method further includes: and when the cyclic redundancy check value of the sending end or the cyclic redundancy check value of the receiving end is calculated, uniformly filling the positions of the null bytes in the application data into preset values.
According to one embodiment of the invention, the onboard bus comprises any one of the following buses: a Controller Area Network (CAN) bus, a FlexRay bus and an Ethernet.
In order to achieve the above object, a second embodiment of the present invention provides a data communication device of a vehicle-mounted bus, including:
the system comprises a sending end and a receiving end, wherein the sending end is used for sending a message, the message comprises application data and control domain data, the control domain data comprises a message counting value and/or a sending end cyclic redundancy check value, the message counting value is added with 1 before the message is sent, the sending end cyclic redundancy check value is obtained by calculation according to the application data and a data identification value prestored by the sending end, and the data identification value is used for uniquely identifying the message;
and the receiving terminal is used for receiving the message, judging the continuity of data communication according to the message counting value, calculating to obtain a receiving terminal cyclic redundancy check value according to the application data and the data identification value pre-stored by the receiving terminal, and judging the encryption and integrity of the data communication according to the transmitting terminal cyclic redundancy check value and the receiving terminal cyclic redundancy check value.
According to the data communication device of the vehicle-mounted bus, a sending end sends a message, the message comprises application data and control domain data, the control domain data comprises a message counting value and/or a sending end cyclic redundancy check value, the message counting value is added with 1 before the message is sent, the sending end cyclic redundancy check value is obtained through calculation according to the application data and a data identification value stored in advance by the sending end, and the data identification value is used for uniquely identifying the message; the receiving end receives the message, judges the continuity of data communication according to the message counting value, calculates the cyclic redundancy check value of the receiving end according to the application data and the data identification value pre-stored by the receiving end, judges the encryption and integrity of the data communication according to the cyclic redundancy check value of the sending end and the cyclic redundancy check value of the receiving end, and can ensure the continuity, integrity and encryption of the end-to-end data communication.
In order to achieve the above object, a third aspect of the present invention provides a vehicle, including: the data communication device of the vehicle-mounted bus according to the embodiment of the second aspect of the invention.
Drawings
FIG. 1 is a flow chart of a method of data communication for an on-board bus according to one embodiment of the present invention;
FIG. 2 is a message data format including application data and control domain data;
FIG. 3 is a flow chart of a method of data communication of an on-board bus according to another embodiment of the present invention;
FIG. 4 is a flow chart of a method of data communication of an on-board bus according to another embodiment of the present invention;
FIG. 5 is a block diagram of a data communication device of a vehicle bus according to one embodiment of the present invention;
fig. 6 is a structural diagram of a vehicle according to one embodiment of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The following describes a data communication method and apparatus for a vehicle bus, and a vehicle according to an embodiment of the present invention with reference to the drawings.
Fig. 1 is a flowchart of a data communication method of an on-vehicle bus according to an embodiment of the present invention, as shown in fig. 1, the data communication method including:
s101, a sending end sends a message, the message comprises application data and control domain data, the control domain data comprises a message count value Counter and/or a sending end cyclic redundancy check value CRC, the message count value Counter is added with 1 before the message is sent, the sending end cyclic redundancy check value CRC is obtained through calculation according to the application data and a data identification value DataID stored in the sending end in advance, and the data identification value DataID is used for uniquely identifying the message.
In the embodiment of the invention, the data identification value DataID can be locally stored in advance at the sending end, is used for uniquely identifying the message, and can be 8 bits (bit). The sending end sends a message, the format of the message data is shown in fig. 2, the message data includes application data and control domain data, the application data is pre-protection data, the control domain data includes a message count value Counter and/or a sending end cyclic redundancy check value CRC, the length of the message count value Counter can be 4 bits, the range is 0-15, and the sending end cyclic redundancy check value CRC can be calculated according to the application data and a data identification value DataID pre-stored by the sending end. Before the sending end sends the message, the message count value Counter is added with 1.
S102, the receiving end receives the message, judges the continuity of the data communication according to the message count value Counter, obtains a receiving end cyclic redundancy check value CRC1 according to the application data and the data identification value DataID pre-stored by the receiving end, and judges the encryption and the integrity of the data communication according to the sending end cyclic redundancy check value CRC and the receiving end cyclic redundancy check value CRC 1.
In the embodiment of the invention, the data identification value DataID can be locally pre-stored at the receiving end, is used for uniquely identifying the message and can be 8 bits in length. The receiving end receives the message, judges the continuity of the data communication according to the message count value Counter, calculates according to the application data and the data identification value DataID pre-stored by the receiving end to obtain a receiving end cyclic redundancy check value CRC1, and judges the encryption and integrity of the data communication according to the transmitting end cyclic redundancy check value CRC and the receiving end cyclic redundancy check value CRC 1.
As a feasible implementation manner, the vehicle-mounted bus in the embodiment of the present invention may include any one of a controller area network CAN bus, a FlexRay bus, and an Ethernet, and matching of different vehicle-mounted buses may be implemented by modifying a calculation method of a cyclic redundancy check value at a transmitting end or a cyclic redundancy check value at a receiving end, a message count value Counter, and a bit number of a data identification value DataID.
According to the data communication method of the vehicle-mounted bus, a sending end sends a message, the message comprises application data and control domain data, the control domain data comprises a message counting value and/or a sending end cyclic redundancy check value, the message counting value is added with 1 before the message is sent, the sending end cyclic redundancy check value is obtained through calculation according to the application data and a data identification value stored in advance by the sending end, and the data identification value is used for uniquely identifying the message; the receiving end receives the message, judges the continuity of data communication according to the message counting value, calculates the cyclic redundancy check value of the receiving end according to the application data and the data identification value pre-stored by the receiving end, judges the encryption and integrity of the data communication according to the cyclic redundancy check value of the sending end and the cyclic redundancy check value of the receiving end, and can ensure the continuity, integrity and encryption of the end-to-end data communication.
Further, as shown in fig. 3, fig. 3 is a flowchart of a data communication method of a vehicle-mounted bus according to another embodiment of the present invention, and the step of "determining continuity of data communication according to a message count value" in the embodiment S102 may specifically include:
s201, calculate the difference Δ Counter between the packet Counter value Counter and the packet Counter value Counter0 of the packet received last time.
In the embodiment of the present invention, a difference Δ Counter between the message Counter value Counter and the message Counter value Counter0 of the message received last time is calculated as Counter-Counter 0.
And S202, if the difference value delta Counter is equal to 0, judging that the message is repeatedly received.
In the embodiment of the present invention, if Δ Counter is equal to 0, the packet count value Counter is the same as the packet count value Counter0 of the packet received last time, and it is determined that the packet is received repeatedly.
And S203, if the difference value delta Counter is equal to 1, judging that the message is successfully received according to the normal sequence.
In the embodiment of the present invention, if Δ Counter is 1, the receiving end receives the packet this time and receives the packet last time continuously, and it is determined that the packet is successfully received according to the normal sequence.
And S204, if the difference value Delta Counter is greater than 1 and equal to or smaller than a preset difference value threshold value Max Delta Counter, judging that the message is lost.
In the embodiment of the invention, a difference threshold value Max delta Counter can be preset, and the Max delta Counter can be a critical value of a message sending sequence with serious errors. If the delta Counter is more than 1 and less than the Max delta Counter, the message is judged to be lost.
And S205, if the difference value Delta Counter is greater than the difference value threshold value Max Delta Counter, judging that the error of the message sending sequence is serious.
In the embodiment of the invention, if the delta Counter is larger than the Max delta Counter, the error of the message sending sequence is judged to be serious.
According to the data communication method of the vehicle-mounted bus, provided by the embodiment of the invention, whether the messages are continuous or not can be judged according to the difference value between the message count value and the message count value of the message received last time.
Further, in the step S102 in the embodiment shown in fig. 1, "determining the confidentiality and integrity of data communication according to the cyclic redundancy check value CRC of the sending end and the cyclic redundancy check value CRC1 of the receiving end" may specifically include:
and if the cyclic redundancy check value CRC of the sending end is the same as the cyclic redundancy check value CRC1 of the receiving end, judging that the data communication encryption and integrity check are successful.
In the embodiment of the invention, the same cyclic redundancy check value can be calculated for the same message data only if the sending end and the receiving end have the same data identification DataID aiming at a certain message. If the cyclic redundancy check value CRC of the sending end is the same as the cyclic redundancy check value CRC1 of the receiving end, the success of the data communication encryption and integrity check is judged; and if the cyclic redundancy check value CRC of the sending end is different from the cyclic redundancy check value CRC1 of the receiving end, judging that the data communication encryption and integrity check are unsuccessful.
According to the data communication method of the vehicle-mounted bus, provided by the embodiment of the invention, whether the encryption and integrity check of the data communication is successful can be judged by comparing whether the cyclic redundancy check value of the sending end is the same as the cyclic redundancy check value of the receiving end.
Further, in the embodiment shown in fig. 1, "calculating to obtain the cyclic redundancy check value at the transmitting end or the cyclic redundancy check value at the receiving end according to the application data and the data identification value" may specifically include:
and calculating to obtain a cyclic redundancy check value CRC of the transmitting end or a cyclic redundancy check value CRC1 of the receiving end by adopting a CRC8-SAE1850 algorithm according to the application data and the data identification value DataID.
In the embodiment of the invention, a Cyclic Redundancy Check (CRC) value 1 of a sending end or a Cyclic Redundancy Check (CRC) value 1 of a receiving end is calculated by adopting a CRC8-SAE1850 algorithm according to application data and a data identification value DataID, and in order to ensure the operation consistency of the sending end and the receiving end on communication data, the positions of null bytes in the application data can be uniformly filled with preset values, and the preset values can be specifically 0 xFF.
Specifically, the calculation method may be as shown in fig. 4, and includes:
s301, calculating according to the data identification value DataID and a preset initial value to obtain a first cyclic redundancy check value.
In the embodiment of the present invention, the first cyclic redundancy check value is calculated according to the data identification value DataID and a preset initial value, where the preset initial value may be 0 xFF.
S302, the initial value is modified into a first cyclic redundancy check value.
In the embodiment of the invention, the initial value is modified into the first cyclic redundancy check value calculated in the step S301.
And S303, calculating to obtain a second cyclic redundancy check value according to the application data and the modified initial value.
In the embodiment of the invention, the second cyclic redundancy check value is calculated according to the application data and the initial value modified in the step S302.
And S304, performing exclusive OR and negation processing on the second cyclic redundancy check value according to the preset final exclusive OR value to obtain a cyclic redundancy check value CRC of the sending end or a cyclic redundancy check value CRC1 of the receiving end.
In the embodiment of the present invention, the second cyclic redundancy check value is subjected to exclusive or negation according to a preset final exclusive or value to obtain a cyclic redundancy check value CRC of the sending end or a cyclic redundancy check value CRC of the receiving end 1, where the preset final exclusive or value may be specifically 0 xFF.
In the embodiment of the present invention, the prototype of the CRC interface function used for calculating the cyclic redundancy check value is:
Crc_CalculateCRC8(
const uint8*DataPtr,
uint32 Length,
uint8 StartValue8,
booleanIsFirstCall);
it should be noted that, in the embodiment of the present invention, two calls of the CRC function (i.e., calculating the first CRC value and the second CRC value) are performed, and the parameter of the IsFirstCall is FALSE, that is, the CRC function performs an exclusive or negation on the actually-incoming initial value, for example, when calculating the CRC value of the DataID, the actually-incoming initial value is 0xFF, and before the inner loop calculation of the CRC function, the initial value is 0xFF ^0xFF ═ 0x 00.
According to the data communication method of the vehicle-mounted bus, provided by the embodiment of the invention, the CRC8-SAE1850 algorithm is adopted according to the application data and the data identification value DataID, and the cyclic redundancy check value CRC of the sending end or the cyclic redundancy check value CRC1 of the receiving end can be accurately and effectively calculated.
Further, to ensure the consistency of the operation of the sending end and the receiving end on the communication data, on the basis of the embodiment shown in fig. 1, the method may further include:
if the length of the application data is larger than 1 byte, the low byte data is in front of the application data, and the high byte data is behind the application data; if the application data length is equal to or less than 1 byte, the application data is placed in 1 byte with the upper data preceding and the lower data succeeding.
In the embodiment of the invention, the length of the application data is firstly obtained, if the length of the application data is more than 1 byte, the low byte data is in front, the high byte data is in back, and an Intel format is adopted; if the length of the application data is equal to or less than 1 byte, the application data is placed in 1 byte, the high-order data is in front of the application data, and the low-order data is behind the application data, that is, the application data is arranged by using the Most Significant Bit (MSB).
According to the data communication method of the vehicle-mounted bus, provided by the embodiment of the invention, the data are arranged according to the application data length, so that the operation consistency of the sending end and the receiving end on the communication data can be ensured.
Fig. 5 is a structural diagram of a data communication apparatus of a vehicle-mounted bus according to an embodiment of the present invention, as shown in fig. 5, the data communication apparatus including:
a sending end 21, configured to send a message, where the message includes application data and control domain data, the control domain data includes a message count value and/or a sending end cyclic redundancy check value, the message count value is added by 1 before sending the message, the sending end cyclic redundancy check value is calculated according to the application data and a data identification value pre-stored by the sending end, and the data identification value is used for uniquely identifying the message;
and the receiving end 22 is used for receiving the message, judging the continuity of the data communication according to the message counting value, calculating a receiving end cyclic redundancy check value according to the application data and the data identification value prestored by the receiving end, and judging the encryption and integrity of the data communication according to the transmitting end cyclic redundancy check value and the receiving end cyclic redundancy check value.
It should be noted that the foregoing explanation of the data communication method of the vehicle-mounted bus also applies to the data communication device of the vehicle-mounted bus of this embodiment, and details are not repeated here.
According to the data communication device of the vehicle-mounted bus, a sending end sends a message, the message comprises application data and control domain data, the control domain data comprises a message counting value and/or a sending end cyclic redundancy check value, the message counting value is added with 1 before the message is sent, the sending end cyclic redundancy check value is obtained through calculation according to the application data and a data identification value stored in advance by the sending end, and the data identification value is used for uniquely identifying the message; the receiving end receives the message, judges the continuity of data communication according to the message counting value, calculates the cyclic redundancy check value of the receiving end according to the application data and the data identification value pre-stored by the receiving end, judges the encryption and integrity of the data communication according to the cyclic redundancy check value of the sending end and the cyclic redundancy check value of the receiving end, and can ensure the continuity, integrity and encryption of the end-to-end data communication.
To implement the above embodiment, the present invention also proposes a vehicle 30, as shown in fig. 6, including: the data communication device 31 of the on-vehicle bus shown in the above embodiment.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (9)

1. A data communication method of a vehicle-mounted bus is characterized by comprising the following steps:
a sending end sends a message, wherein the message comprises application data and control domain data, the control domain data comprises a message count value and/or a sending end cyclic redundancy check value, the message count value is added with 1 before the message is sent, the sending end cyclic redundancy check value is obtained by calculation according to the application data and a data identification value prestored by the sending end, and the data identification value is used for uniquely identifying the message;
the receiving end receives the message, judges the continuity of data communication according to the message counting value, calculates a receiving end cyclic redundancy check value according to the application data and a data identification value pre-stored by the receiving end, and judges the encryption and integrity of the data communication according to the transmitting end cyclic redundancy check value and the receiving end cyclic redundancy check value;
the judging the encryption and integrity of the data communication according to the cyclic redundancy check value of the sending end and the cyclic redundancy check value of the receiving end comprises the following steps:
and if the cyclic redundancy check value of the sending end is the same as the cyclic redundancy check value of the receiving end, judging that the data communication encryption and integrity check are successful.
2. The data communication method according to claim 1, wherein said determining the continuity of the data communication according to the packet count value comprises:
calculating the difference value between the message count value and the message count value of the last received message;
if the difference value is equal to 0, judging that the message is received repeatedly;
if the difference value is equal to 1, judging that the message is successfully received according to a normal sequence;
if the difference value is larger than 1 and equal to or smaller than a preset difference value threshold value, judging that the message is lost;
and if the difference is larger than the difference threshold, judging that the message sending sequence has serious errors.
3. The data communication method according to claim 1, wherein calculating the sender cyclic redundancy check value or the receiver cyclic redundancy check value according to the application data and the data identification value comprises:
and calculating to obtain the cyclic redundancy check value of the sending end or the cyclic redundancy check value of the receiving end by adopting a CRC8-SAE1850 algorithm according to the application data and the data identification value.
4. The data communication method according to claim 3, wherein calculating the sender cyclic redundancy check value or the receiver cyclic redundancy check value according to the application data and the data identification value comprises:
calculating according to the data identification value and a preset initial value to obtain a first cyclic redundancy check value;
modifying the initial value to the first cyclic redundancy check value;
calculating to obtain a second cyclic redundancy check value according to the application data and the modified initial value;
and performing exclusive-or negation processing on the second cyclic redundancy check value according to a preset final exclusive-or value to obtain the cyclic redundancy check value of the sending end or the cyclic redundancy check value of the receiving end.
5. The data communication method according to claim 1, further comprising:
if the application data length is larger than 1 byte, the low byte data is in front of the high byte data;
and if the length of the application data is equal to or less than 1 byte, the application data is placed in 1 byte, and the high-order data is before and the low-order data is after.
6. The data communication method according to claim 1, further comprising:
and when the cyclic redundancy check value of the sending end or the cyclic redundancy check value of the receiving end is calculated, uniformly filling the positions of the null bytes in the application data into preset values.
7. The data communication method according to claim 1, wherein the in-vehicle bus includes any one of:
controller area network CAN bus, FlexRay bus and Ethernet.
8. A data communication apparatus of a vehicle-mounted bus, comprising:
the system comprises a sending end and a receiving end, wherein the sending end is used for sending a message, the message comprises application data and control domain data, the control domain data comprises a message count value and/or a sending end cyclic redundancy check value, the message count value is added with 1 before the message is sent, the sending end cyclic redundancy check value is obtained by calculation according to the application data and a data identification value pre-stored by the sending end, and the data identification value is used for uniquely identifying the message;
and the receiving terminal is used for receiving the message, judging the continuity of data communication according to the message counting value, calculating to obtain a receiving terminal cyclic redundancy check value according to the application data and the data identification value prestored by the receiving terminal, and judging the encryption and integrity of the data communication according to the transmitting terminal cyclic redundancy check value and the receiving terminal cyclic redundancy check value.
9. A vehicle, characterized by comprising: the data communication device of the vehicle bus according to claim 8.
CN201910384383.XA 2019-05-09 2019-05-09 Data communication method and device of vehicle-mounted bus and vehicle Active CN110213018B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910384383.XA CN110213018B (en) 2019-05-09 2019-05-09 Data communication method and device of vehicle-mounted bus and vehicle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910384383.XA CN110213018B (en) 2019-05-09 2019-05-09 Data communication method and device of vehicle-mounted bus and vehicle

Publications (2)

Publication Number Publication Date
CN110213018A CN110213018A (en) 2019-09-06
CN110213018B true CN110213018B (en) 2022-07-15

Family

ID=67785636

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910384383.XA Active CN110213018B (en) 2019-05-09 2019-05-09 Data communication method and device of vehicle-mounted bus and vehicle

Country Status (1)

Country Link
CN (1) CN110213018B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111865901A (en) * 2020-06-03 2020-10-30 一汽奔腾轿车有限公司 Information encryption transmission method based on CAN bus
CN112947371B (en) * 2021-02-05 2022-08-19 北京经纬恒润科技股份有限公司 Simulation test method and device for test message and simulation test equipment
CN113064047B (en) * 2021-03-05 2024-03-08 万向一二三股份公司 Testing device and testing method for end-to-end protection between electronic control units
CN114780969A (en) * 2021-11-29 2022-07-22 一汽奔腾轿车有限公司 Information encryption and decryption method in automobile remote communication
CN114448565B (en) * 2021-12-30 2024-06-21 北京奕斯伟计算技术股份有限公司 Cyclic redundancy check calculation method, cyclic redundancy check calculation device, electronic equipment and storage medium
CN114928465B (en) * 2022-03-22 2023-08-29 广州汽车集团股份有限公司 Message verification method, device, vehicle and storage medium
CN115410285A (en) * 2022-07-15 2022-11-29 广西添亿友科技有限公司 Vehicle entering and exiting high-speed processing method, high-speed terminal and cloud server

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1022879A1 (en) * 1993-02-15 2000-07-26 Honda Giken Kogyo Kabushiki Kaisha Data transmission method and system therefor
CN103514128A (en) * 2012-06-15 2014-01-15 广州汽车集团股份有限公司 Method and device for bus signal transmission and receiving
CN103856288A (en) * 2012-12-04 2014-06-11 北汽福田汽车股份有限公司 CAN communication signal verification and transmission method and system for automobile
CN104954374A (en) * 2015-06-15 2015-09-30 上海网车科技有限公司 IOV (Internet of Vehicles) communication protocol design method
CN105721268A (en) * 2016-01-29 2016-06-29 北京汽车研究总院有限公司 Method and device for sending controller area network (CAN) bus message
CN108011708A (en) * 2016-10-28 2018-05-08 长城汽车股份有限公司 The controller and vehicle of message encryption method, vehicle based on automobile bus
CN108494725A (en) * 2018-01-30 2018-09-04 惠州市德赛西威汽车电子股份有限公司 A kind of encryption communication method of vehicle-mounted CAN bus message
CN109274636A (en) * 2017-07-18 2019-01-25 比亚迪股份有限公司 Data safe transmission method and its device, system, train

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1022879A1 (en) * 1993-02-15 2000-07-26 Honda Giken Kogyo Kabushiki Kaisha Data transmission method and system therefor
CN103514128A (en) * 2012-06-15 2014-01-15 广州汽车集团股份有限公司 Method and device for bus signal transmission and receiving
CN103856288A (en) * 2012-12-04 2014-06-11 北汽福田汽车股份有限公司 CAN communication signal verification and transmission method and system for automobile
CN104954374A (en) * 2015-06-15 2015-09-30 上海网车科技有限公司 IOV (Internet of Vehicles) communication protocol design method
CN105721268A (en) * 2016-01-29 2016-06-29 北京汽车研究总院有限公司 Method and device for sending controller area network (CAN) bus message
CN108011708A (en) * 2016-10-28 2018-05-08 长城汽车股份有限公司 The controller and vehicle of message encryption method, vehicle based on automobile bus
CN109274636A (en) * 2017-07-18 2019-01-25 比亚迪股份有限公司 Data safe transmission method and its device, system, train
CN108494725A (en) * 2018-01-30 2018-09-04 惠州市德赛西威汽车电子股份有限公司 A kind of encryption communication method of vehicle-mounted CAN bus message

Also Published As

Publication number Publication date
CN110213018A (en) 2019-09-06

Similar Documents

Publication Publication Date Title
CN110213018B (en) Data communication method and device of vehicle-mounted bus and vehicle
CN110460573B (en) ECU security upgrade management system and method applied to automobile
CN106992879B (en) Method for calculating load rate of CAN bus
US8499155B2 (en) Adaptive certificate distribution mechanism in vehicular networks using variable inter-certificate refresh period
JP2020519090A (en) Uplink data decompression and compression method and apparatus
US20110238987A1 (en) Adaptive certificate distribution mechanism in vehicular networks using forward error correcting codes
WO2013128317A1 (en) Anti-replay counter measures
US9894081B2 (en) Method and device for avoiding manipulation of a data transmission
CN111949288A (en) Intelligent element remote upgrading method and system based on vehicle-mounted Ethernet
CN110380842B (en) CAN bus message signature method, device and system suitable for intelligent network-connected automobile
CN112003773A (en) End-to-end checking method and system for CAN bus safety data
CN112347022B (en) Security module for CAN nodes
KR101734505B1 (en) Method and apparatus for detecting attack in vehicle network
WO2021065068A1 (en) Detection device, vehicle, detection method, and detection program
CN106911428B (en) Information transmission method and device
WO2020246145A1 (en) Electronic control device and communication system
KR101334017B1 (en) Apparatus of checking a validity of message on network for a vehicle and method of thereof
WO2020199724A1 (en) Data processing method, server and device
CN113632419A (en) Device and method for generating and authenticating at least one data packet to be transmitted in a BUs system (BU), in particular of a motor vehicle
CN112602287B (en) CAN communication method, equipment and system
Wu et al. Design and implementation of CAN data compression algorithm
CN104272625B (en) Communication apparatus and communication method
KR101952117B1 (en) Can communication method and apparatus for vehicle
CN109560983B (en) Data communication method and device for vehicle network
CN110995612B (en) Message processing method, system and communication equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant