Communication method and device of vehicle, vehicle, electronic equipment and storage medium

By using the unique identifier of the message to be sent in vehicle communication to determine the encryption key, the system performance problem caused by the complexity of key management is solved, and more efficient and secure encrypted communication is achieved.

CN119544200APending Publication Date: 2025-02-28CHINA FAW CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411545070.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

During the encrypted communication process of the vehicle, complex key management leads to degradation of vehicle system performance.

Method used

By obtaining the unique identifier carried in the message to be sent, determining the encryption key based on the identifier, encrypting the message content, and determining the decryption key in the receiving device using the same unique identifier.

Benefits of technology

It reduces the complexity of key management, reduces the consumption of in-vehicle resources, improves the efficiency and security of encrypted communications, and avoids the reduction of system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544200A_ABST
    Figure CN119544200A_ABST
Patent Text Reader

Abstract

The invention discloses a vehicle communication method and device, a vehicle, electronic equipment and a storage medium, and relates to the technical field of communication. The method comprises the steps that a unique identifier carried in a message to be sent is acquired, and the unique identifier is used for uniquely identifying a communication mode of the message to be sent; determining an encryption key of the message to be sent based on the unique identifier; encrypting message content carried in the to-be-sent message based on the encryption key to obtain an encrypted message; and sending the encrypted message to a receiving device in the vehicle based on the communication mode. According to the invention, the technical problem that the vehicle system performance is reduced due to complex key management in the encryption communication process of the vehicle is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a vehicle communication method, device, vehicle, electronic equipment and storage medium. Background Art

[0002] The Ethernet communication protocol is usually used for communication between electronic systems inside the car. Due to the development of automotive electronics and the increase in the complexity of vehicle functions, the amount of data transmitted in the vehicle Ethernet has increased significantly. This data may contain sensitive information such as vehicle positioning and driver personal information. If it is not encrypted, this data can be easily illegally intercepted during transmission, resulting in privacy leakage.

[0003] Current encryption schemes usually use E2E encryption methods, but there are problems such as complex key management, time-consuming encryption and decryption, and a significant impact on system performance.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] Embodiments of the present invention provide a vehicle communication method, device, vehicle, electronic device and storage medium to at least solve the technical problem that during the encrypted communication process of the vehicle, complex key management leads to reduced vehicle system performance.

[0006] According to one aspect of an embodiment of the present invention, a vehicle communication method is provided, which is applied to a sending device inside the vehicle, including: obtaining a unique identifier carried in a message to be sent, wherein the unique identifier is used to uniquely identify a communication mode of the message to be sent; determining an encryption key for the message to be sent based on the unique identifier; encrypting the message content carried in the message to be sent based on the encryption key to obtain an encrypted message; and sending the encrypted message to a receiving device inside the vehicle based on the communication mode.

[0007] In one implementation of the present application, determining an encryption key of a message to be sent based on a unique identifier includes: processing the unique identifier using a preset algorithm to obtain the encryption key.

[0008] In one implementation of the present application, a unique identifier is processed using a preset algorithm to obtain an encryption key, including: obtaining a timestamp of the current time; and using a hash function to process the unique identifier and the timestamp to obtain the encryption key.

[0009] In one implementation of the present application, encrypting the message content based on an encryption key to obtain an encrypted message includes: converting the message content into a binary format message; and encrypting the binary format message using a symmetric encryption algorithm based on the encryption key to obtain an encrypted message.

[0010] In one embodiment of the present application, based on an encryption key, a message in a binary format is encrypted using a symmetric encryption algorithm to obtain an encrypted message, including: performing a preprocessing operation on the message in the binary format to obtain a preprocessed message; based on the encryption key, the preprocessed message is encrypted using a symmetric encryption algorithm to obtain an encrypted message.

[0011] In one implementation of the present application, a preprocessing operation is performed on a binary format message to obtain a preprocessed message, including at least one of the following: performing a data obfuscation operation on the binary format message to obtain a preprocessed message; performing a data compression operation on the binary format message to obtain a preprocessed message.

[0012] In one implementation of the present application, based on an encryption key, a message in a binary format is encrypted using a symmetric encryption algorithm to obtain an encrypted message, including: performing an XOR operation on the encryption key and the message in the binary format to obtain the encrypted message.

[0013] According to one aspect of an embodiment of the present invention, a vehicle communication method is provided, which is applied to a receiving device inside the vehicle, including: receiving an encrypted message sent from a sending device inside the vehicle; obtaining a unique identifier carried in the encrypted message; determining a decryption key for the encrypted message based on the unique identifier; and decrypting the message content carried in the encrypted message based on the decryption key to obtain the original message content.

[0014] In one embodiment of the present application, a receiving device includes: a receiving module for receiving an encrypted message from a sending device inside a vehicle; an acquisition module for acquiring a unique identifier carried in the encrypted message; a determination module for determining a decryption key of the encrypted message based on the unique identifier, wherein the decryption key is the same as the encryption key; and a decryption module for decrypting the encrypted message using the decryption key to obtain the message content of the encrypted message.

[0015] According to one aspect of an embodiment of the present invention, a vehicle communication device is provided, which is applied to a sending device inside the vehicle, and the device includes: an acquisition module, used to obtain a unique identifier carried in a message to be sent, wherein the unique identifier is used to uniquely identify a communication mode of the message to be sent; a determination module, used to determine an encryption key for the message to be sent based on the unique identifier; an encryption module, used to encrypt the message content carried in the message to be sent based on the encryption key to obtain an encrypted message; and a sending module, used to send the encrypted message to a receiving device inside the vehicle based on the communication mode.

[0016] According to one aspect of an embodiment of the present invention, a vehicle communication device is provided, which is applied to a receiving device inside the vehicle, and the device includes: a receiving module, used to receive an encrypted message from a sending device inside the vehicle; an acquisition module, used to obtain a unique identifier carried in the encrypted message; a determination module, used to determine a decryption key for the encrypted message based on the unique identifier; and a decryption module, used to decrypt the encrypted message using the decryption key to obtain the message content carried in the message to be sent.

[0017] According to one aspect of an embodiment of the present invention, a vehicle is provided, comprising: a sending device, used to obtain a unique identifier carried in a message to be sent, determine an encryption key for the message to be sent based on the unique identifier, encrypt the message content carried in the message to be sent based on the encryption key to obtain an encrypted message, and send the encrypted message based on a communication mode of the message to be sent, wherein the unique identifier is used to uniquely identify the communication mode; a receiving device, used to obtain a unique identifier carried in a received encrypted message, determine a decryption key for the encrypted message based on the unique identifier, decrypt the message content carried in the encrypted message based on the decryption key to obtain the message content carried in the message to be sent.

[0018] According to one aspect of an embodiment of the present invention, there is provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the above-mentioned vehicle communication method is executed when the program is running.

[0019] According to one aspect of an embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium including a stored executable program, wherein when the executable program is executed, the device where the storage medium is located is controlled to execute the above-mentioned vehicle communication method.

[0020] According to one aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the computer program implements the above-mentioned vehicle communication method.

[0021] In an embodiment of the present invention, a unique identifier carried in a message to be sent is obtained; an encryption key for the message to be sent is determined based on the unique identifier; the message content carried in the message to be sent is encrypted based on the encryption key to obtain an encrypted message; and the encrypted message is sent to a receiving device inside the vehicle based on the communication mode. It is easy to notice that the unique identifier carried in the message to be sent is obtained as a key basis, and the message content carried in the message to be sent is encrypted using an encryption key determined based on the unique identifier. Since the receiving device can also obtain the unique identifier in the encrypted message and then determine the key, this method reduces the complexity of key management. While ensuring the security of the message content, it achieves the purpose of reducing the complexity of key management and reduces the consumption of resources in the vehicle, thereby achieving the technical effect of reducing the impact on the performance of the vehicle system, and thus solving the technical problem that the complex key management leads to reduced performance of the vehicle system during the encrypted communication process of the vehicle. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0023] Figure 1 is a flow chart of a vehicle communication method according to an embodiment of the present invention;

[0024] Figure 2 is a schematic diagram of an optional SOME / IP message structure according to an embodiment of the present invention;

[0025] Figure 3 is a flow chart of a vehicle communication method according to an embodiment of the present invention;

[0026] Figure 4 is a schematic diagram of a communication device for a vehicle according to an embodiment of the present invention;

[0027] Figure 5 is a schematic diagram of a communication device for a vehicle according to an embodiment of the present invention;

[0028] Figure 6 is a schematic diagram of a vehicle according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] Example 1

[0032] According to an embodiment of the present invention, an embodiment of a vehicle communication method is provided, and the vehicle communication method is applied to a sending device inside the vehicle. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and, although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0033] Figure 1 is a flow chart of a vehicle communication method according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:

[0034] Step S102, obtaining a unique identifier carried in the message to be sent, wherein the unique identifier is used to uniquely identify the communication mode of the message to be sent.

[0035] The message to be sent in the above steps is a message located in a sending device in the car and is ready to be sent to a receiving device in the car. It can be a SOME / IP (Scalable Service-Oriented Middleware over Internet Protocol) message, a CAN (Controller Area Network) message, a LIN (Local Interconnect Network) message, etc., but is not limited to these.

[0036] The unique identifier in the above steps is a string of characters in the message to be sent, which is used to characterize the communication mode of the message of this type. For example, if the message to be sent is a SOME / IP message, the unique identifier is the Message Id (Message Identifier) ​​in the SOME / IP message.

[0037] The communication mode in the above steps is the communication method or protocol adopted when sending the message to be sent during the communication process, and can be determined according to the unique identifier in the message to be sent.

[0038] In an optional embodiment, the type of the message to be sent is determined, and the position and number of bits of the unique identifier in the message to be sent are determined according to the structure of the message of the type. The unique identifier is usually located in the header of the message to be sent, and the unique identifier can be obtained from the header of the message to be sent according to the position and number of bits of the unique identifier in the message to be sent.

[0039] For example, taking the message to be sent as a SOME / IP message, Figure 2 is a schematic diagram of an optional SOME / IP message structure according to an embodiment of the present invention, such as Figure 2As shown, the contents of the SOME / IP message protocol header include: message identifier, length, request ID, protocol version, interface version, message type, and return code. Among them, the message identifier occupies 32 bits, the length occupies 32 bits, the request ID occupies 32 bits, the protocol version occupies 8 bits, the interface version occupies 8 bits, the message type occupies 8 bits, and the return code occupies 8 bits. The protocol header is the part containing the basic information of the SOME / IP message, and usually does not contain the substantial message content. The substantial message content is in the data load part. Since the amount of message content carried by each SOME / IP message is not fixed, the length of the data load is variable. In the SOME / IP message, the message identifier is a unique identifier that uniquely identifies the communication mode of the SOME / IP message. Therefore, the first 32 bits of the SOME / IP message are taken as the unique identifier.

[0040] Step S104: determining an encryption key for the message to be sent based on the unique identifier.

[0041] The encryption key in the above steps is a key used to encrypt the message to be sent.

[0042] In an optional embodiment, only the sender and receiver of the message will pay attention to the unique identifier, so the unique identifier is used as one of the bases of the key. The unique identifier can be directly used as the encryption key. This operation method is simple and can increase the encryption speed, thereby ensuring the real-time communication in the vehicle. The unique identifier can also be encrypted twice by a calculation method agreed upon by the sending device and the receiving device, and the result of the secondary encryption is used as the encryption key, which can improve the security of encrypting the message to be sent.

[0043] Step S106: Encrypt the message content carried in the message to be sent based on the encryption key to obtain an encrypted message.

[0044] The message content in the above steps is the substantial communication content in the message to be sent. For example, when the message to be sent is a SOME / IP message, the message content is the Pay load part in the SOME / IP message.

[0045] The encrypted message in the above steps is a message obtained by encrypting the message content using an encryption key. The encrypted message can improve the security of in-vehicle communication.

[0046] In an optional embodiment, the message content carried in the to-be-sent message can be extracted, and then the message content is encrypted by an encryption algorithm using an encryption key, wherein the encryption algorithm can be an AES (Advanced Encryption Standard) algorithm, a DSA (Digital Signature Algor ithm) algorithm, or an XOR operation, but is not limited thereto. The encrypted message content is spliced ​​with the header of the to-be-sent message containing the unique identifier to obtain an encrypted message. The receiving device can also receive the unique identifier, thereby determining the decryption key based on the unique identifier.

[0047] Exemplarily, when the message to be sent is a SOME / IP message, the Payload part in the SOME / IP message is encrypted using an encryption key, and then the encrypted Payload part is rejoined with the synchronization of the SOME / IP message to obtain an encrypted message.

[0048] Step S108, sending the encrypted message to a receiving device inside the vehicle based on the communication mode.

[0049] The receiving device in the above steps is a device inside the vehicle for receiving and decrypting encrypted messages, and may be an in-vehicle communication module, an in-vehicle entertainment system, etc., but is not limited thereto.

[0050] In an optional embodiment, the message type is determined based on a unique identifier in the encrypted message, thereby determining a communication mode for the message of that type, and the encrypted message is sent to a receiving device inside the vehicle based on the communication mode.

[0051] Exemplarily, a unique identifier is extracted from the encrypted message. If the message type is determined to be a SOME / IP message based on the value of the unique identifier, it can be determined that the SOME / IP protocol is used to send the encrypted message, and the encrypted message is sent to a receiving device inside the vehicle via the SOME / IP protocol.

[0052] In an embodiment of the present invention, a unique identifier carried in a message to be sent is obtained; an encryption key for the message to be sent is determined based on the unique identifier; the message content carried in the message to be sent is encrypted based on the encryption key to obtain an encrypted message; and the encrypted message is sent to a receiving device inside the vehicle based on the communication mode. It is easy to notice that the unique identifier carried in the message to be sent is obtained as a key basis, and the message content carried in the message to be sent is encrypted using an encryption key determined based on the unique identifier. Since the receiving device can also obtain the unique identifier in the encrypted message and then determine the key, this method reduces the complexity of key management. While ensuring the security of the message content, it achieves the purpose of reducing the complexity of key management and reduces the consumption of resources in the vehicle, thereby achieving the technical effect of reducing the impact on the performance of the vehicle system, and thus solving the technical problem that the complex key management leads to reduced performance of the vehicle system during the encrypted communication process of the vehicle.

[0053] In one implementation of the present application, determining an encryption key of a message to be sent based on a unique identifier includes: processing the unique identifier using a preset algorithm to obtain the encryption key.

[0054] The preset algorithm in the above steps is a pre-set encryption algorithm, which can be preset according to the actual application situation, and the content of the preset algorithm is not specifically limited here. The preset algorithm can be a hash function, or a symmetric encryption algorithm such as the AES algorithm, the DES (Data Encryption Standard) algorithm, or an asymmetric encryption algorithm such as the DSA algorithm, but is not limited thereto.

[0055] In an optional embodiment, taking the preset algorithm as a hash function as an example, a suitable hash function is selected, the unique identifier is used as input, a hash value is calculated by the hash function, and the processed hash value is used as an encryption key in the encryption algorithm.

[0056] In another optional embodiment, taking the preset algorithm as DES as an example, when the binary form of the unique identifier is less than 64 bits, the unique identifier is padded to make the padded unique identifier.

[0057] In one implementation of the present application, a unique identifier is processed using a preset algorithm to obtain an encryption key, including: obtaining a timestamp of the current time; and using a hash function to process the unique identifier and the timestamp to obtain the encryption key.

[0058] The timestamp in the above steps is an identifier of a specific moment, usually a number or a string. The timestamp can be applied to the encryption algorithm to increase the randomness of the encryption algorithm, making the encryption result more unpredictable to increase security.

[0059] The hash function in the above steps is a function that converts input data of any length into output data of a fixed length, and can be used for encryption processing.

[0060] In an optional embodiment, the unique identifier can be encrypted twice by an agreed calculation method as an encryption key to improve security. Specifically, the current time of the system can be obtained using a built-in function or library function in a programming language, and the current time can be converted into a timestamp format. The timestamp format can be a Unix (an operating system) timestamp. When the timestamp format is a Unix timestamp, the process of converting the current time into a timestamp format is as follows:

[0061] Timestamp = (current time - Epoch time) / time unit;

[0062] The Epoch time is the starting time of the Unix system, usually 0:0:0 on January 1, 1970, in seconds or milliseconds.

[0063] After obtaining the timestamp, the unique identifier and timestamp are processed using a hash function. Specifically, the unique identifier and timestamp are concatenated into a string, and then the concatenated string is input into the hash function, which is encrypted by the hash function to obtain an encryption key. In this way, the encryption key generated by combining the unique identifier and timestamp can be used to encrypt the message to be sent to obtain an encrypted message, thereby improving the security and uniqueness of the encrypted message and ensuring the security and integrity of the message content in the encrypted message during transmission.

[0064] In one implementation of the present application, encrypting the message content based on an encryption key to obtain an encrypted message includes: converting the message content into a binary format message; and encrypting the binary format message using a symmetric encryption algorithm based on the encryption key to obtain an encrypted message.

[0065] The symmetric encryption algorithm in the above steps is an algorithm that uses the same key for the encryption process and the decryption process, and may be a DES algorithm, an AES algorithm, or a 3DES (Triple Data Encryption Standard) algorithm, but is not limited thereto.

[0066] In an optional embodiment, the message content is converted into a binary format message by binary coding, and each character in the message content corresponds to a binary code of a fixed length. Then a symmetric encryption algorithm is selected, and the symmetric encryption algorithm can be an AES algorithm, a DES algorithm, or a 3DES algorithm, but is not limited thereto. The binary format message to be encrypted and the encryption key are used as inputs of the symmetric encryption algorithm, and the binary format message is encrypted by the symmetric encryption algorithm to generate an encrypted message.

[0067] For internal communication in the vehicle, SOME / IP communication is usually used, and the signal form involved in data transmission is often end-to-end. The network topology is relatively simple, so symmetric encryption is used to simplify key management. Since the encryption key and decryption key are the same, and the encryption key can be determined based on the unique identifier, the receiving device can determine the decryption key based on the unique identifier of the received encrypted message, avoiding the problem of the receiving device being unable to decrypt the message due to the loss of the private key.

[0068] In one embodiment of the present application, based on an encryption key, a message in a binary format is encrypted using a symmetric encryption algorithm to obtain an encrypted message, including: performing a preprocessing operation on the message in the binary format to obtain a preprocessed message; based on the encryption key, the preprocessed message is encrypted using a symmetric encryption algorithm to obtain an encrypted message.

[0069] The preprocessing operation in the above steps is to perform a series of operations or transformations on the original data before encrypting or otherwise processing the data. The purpose of preprocessing the binary message is to increase the security and integrity of the encrypted message, or to improve the transmission efficiency of the encrypted message in the in-vehicle communication. The preprocessing operation can be a data obfuscation operation, a data compression operation, or a data verification operation, but is not limited thereto.

[0070] In an optional embodiment, before encrypting the message, a data verification preprocessing operation can be performed on the binary format message. Specifically, a CRC (Cyc l ic Redundancy Check) algorithm can be selected as the data verification algorithm, but it is not limited to this. A checksum algorithm can also be selected as the data verification algorithm. The CRC calculation is performed on the binary format message to generate a CRC value, and the CRC value is added to the binary format message to obtain a preprocessed message.

[0071] The encryption key and the pre-processed message are input into the symmetric encryption algorithm, and the pre-processed message is encrypted by the symmetric encryption algorithm to obtain the encrypted message. After sending and receiving the message, the receiver can use the same key and symmetric encryption algorithm to decrypt the encrypted message and recalculate the CRC value to verify the integrity of the encrypted message. The combination of data verification and encryption operations can ensure the security and integrity of the encrypted message during transmission and processing.

[0072] In one implementation of the present application, a preprocessing operation is performed on a binary format message to obtain a preprocessed message, including at least one of the following: performing a data obfuscation operation on the binary format message to obtain a preprocessed message; performing a data compression operation on the binary format message to obtain a preprocessed message.

[0073] The data obfuscation operation in the above steps is to perform a series of transformations or processing on the data corresponding to the message content in the binary format message, so that the message content becomes parsable, thereby increasing the security of the message content. Common data obfuscation operations include data replacement, data scrambling, data inversion, etc., but are not limited to these.

[0074] The data compression operation in the above steps is to convert the data corresponding to the message content in the binary format message into a more compact representation by using a compression algorithm to save storage space and transmission bandwidth, thereby improving the transmission efficiency of the encrypted message.

[0075] In an optional embodiment, when performing a data obfuscation operation on a binary format message, a data obfuscation algorithm may be determined, such as data replacement, data inversion, etc., and data replacement is used as an example for explanation below. When performing data replacement, the binary format message may be divided into bytes, and a predefined replacement table may be used to determine which bytes need to be replaced, and then the bytes are replaced to obtain a preprocessed message.

[0076] Through the data obfuscation operation, the data order in the original binary format message is changed, which increases the obfuscation of the pre-processed message, making the pre-processed message more difficult to parse, and improving the security of the encrypted message.

[0077] In another optional embodiment, the binary format message can be input into the data compression algorithm, and the binary format message can be compressed by the data compression algorithm to obtain the pre-processed message. By performing the data compression operation on the binary format message, the size of the encrypted message is reduced, and the amount of encrypted message data to be transmitted is reduced, thereby achieving the purpose of improving the transmission efficiency of encrypted messages in in-vehicle communication.

[0078] In one implementation of the present application, based on an encryption key, a message in a binary format is encrypted using a symmetric encryption algorithm to obtain an encrypted message, including: performing an XOR operation on the encryption key and the message in the binary format to obtain the encrypted message.

[0079] The XOR operation in the above steps is a logical operation. The characteristics of the XOR operation are: when the two compared bits are different, the result is 1; when the two compared bits are the same, the result is 0. Any number XORed with itself is 0, and any number XORed with 0 is itself. The XOR operation satisfies the commutative law and the associative law.

[0080] In an optional embodiment, the binary message is recorded as A, and the encryption key is recorded as B. Then, the encryption key and the binary message are subjected to an XOR operation to obtain the encrypted message as follows:

[0081] A XOR B = C;

[0082] Among them, C is the encrypted message.

[0083] The decryption process corresponding to the encryption process is:

[0084] C XOR B=(A XOR B)XOR B=A XOR(B XOR B)=A XOR 0=A;

[0085] From the above encryption and decryption process, it can be seen that by using XOR operation as the encryption algorithm to encrypt the message, both the sending device and the receiving device can encrypt and decrypt the data through one operation, which has little impact on the system performance. The same key can be used for encryption and decryption. The receiving device can determine the decryption key by itself based on the unique identifier in the encrypted message, reducing the difficulty of key distribution management.

[0086] Example 2

[0087] According to an embodiment of the present invention, an embodiment of a vehicle communication method is provided, and the vehicle communication method is applied to a receiving device inside the vehicle. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and, although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0088] Figure 3 is a flow chart of a vehicle communication method according to an embodiment of the present invention, such as Figure 3 As shown, the method comprises the following steps:

[0089] Step S302, receiving an encrypted message sent from a sending device inside the vehicle.

[0090] The sending device in the above steps is a device used by the vehicle content to send encrypted messages, which can be an ECU (Electron ic Control, electronic control unit), a gateway module, or a remote communication unit, but is not limited to these.

[0091] Step S304: Obtain the unique identifier carried in the encrypted message.

[0092] In an optional embodiment, after receiving the encrypted message, the position of the unique identifier in the encrypted message and the number of bits it occupies are determined according to the message type, and then the unique identifier is extracted from the header of the encrypted message.

[0093] Step S306: Determine a decryption key for the encrypted message based on the unique identifier.

[0094] The decryption key in the above steps is a key used to decrypt the encrypted message, which is the same as the encryption key. The receiving device can determine the decryption key based on the unique identifier in the encrypted message.

[0095] In an optional embodiment, the receiving device can process the unique identifier using the same preset algorithm as that in the sending device to obtain a decryption key that is the same as the encryption key. By utilizing the characteristics of the message itself, a part of the message to be sent, namely the unique identifier, is used as the basis for determining the encryption key, so that after receiving the encrypted message, the receiving device can also determine the decryption key according to the unique identifier carried in the encrypted message, thereby solving the problem of complex key management.

[0096] Step S308: decrypt the message content carried in the encrypted message based on the decryption key to obtain the original message content.

[0097] The original message content in the above steps is the message content carried in the message to be sent.

[0098] In an optional embodiment, the decryption key and the encrypted message are input into the same symmetric encryption algorithm as that in the sending device, and the symmetric encryption algorithm decrypts the message content carried in the encrypted message based on the decryption key to obtain the original message content.

[0099] Exemplarily, the symmetric encryption algorithm may be an XOR operation, and the sending device is recorded as A, and the receiving device is recorded as B. A sends a notification message to B. It should be noted that the notification message is a type of SOME / IP message, and the Message Id in the notification message is 0x10011007, and the payload is 0. That is, the unique identifier in the to-be-sent message and the encrypted message is 0x10011007, and the message content in the to-be-sent message is 0.

[0100] Using Message Id as the encryption key, the process of encrypting the payload using XOR operation is as follows:

[0101] 0x10011007XOR 0=0x10011007;

[0102] The encrypted payload is 0x10011007.

[0103] The Message Id is concatenated with the encrypted payload to obtain an encrypted message, which is then sent to B. After receiving the encrypted message, B uses the Message Id to decrypt the message content carried in the encrypted message, that is, the encrypted payload. The decryption process is as follows:

[0104] 0x10011007XOR 0x10011007=0;

[0105] Among them, 0 is the original message content.

[0106] Example 3

[0107] According to an embodiment of the present invention, an embodiment of a vehicle communication device is provided, which can execute the vehicle communication method provided in the above-mentioned embodiment 1. The specific implementation method and preferred application scenario are the same as those of the above-mentioned embodiment 1, and will not be repeated here.

[0108] Figure 4 is a schematic diagram of a vehicle communication device according to an embodiment of the present invention, wherein the vehicle communication device is Figure 4 As shown:

[0109] An acquisition module 40 is used to acquire a unique identifier carried in the message to be sent, wherein the unique identifier is used to uniquely identify the communication mode of the message to be sent;

[0110] A determination module 42, configured to determine an encryption key for a message to be sent based on the unique identifier;

[0111] The encryption module 44 is used to encrypt the message content carried in the message to be sent based on the encryption key to obtain an encrypted message;

[0112] The sending module 46 is used to send the encrypted message to the receiving device inside the vehicle based on the communication mode.

[0113] In one implementation of the present application, the determination module includes: a processing unit, configured to process the unique identifier using a preset algorithm to obtain an encryption key.

[0114] In one implementation manner of the present application, the processing unit is further configured to obtain a timestamp of the current time; and use a hash function to process the unique identifier and the timestamp to obtain an encryption key.

[0115] In one embodiment of the present application, the encryption module includes: a conversion unit, which is used to convert the message content into a binary format message; an encryption unit, which is used to encrypt the binary format message using a symmetric encryption algorithm based on an encryption key to obtain an encrypted message.

[0116] In one embodiment of the present application, the encryption unit is also used to perform a preprocessing operation on a binary format message to obtain a preprocessed message; based on the encryption key, the preprocessed message is encrypted using a symmetric encryption algorithm to obtain an encrypted message.

[0117] In one implementation of the present application, the encryption unit is also used to perform a data obfuscation operation on a binary format message to obtain a preprocessed message; and perform a data compression operation on the binary format message to obtain a preprocessed message.

[0118] In one implementation manner of the present application, the encryption unit is further used to perform an XOR operation on the encryption key and the message in binary format to obtain an encrypted message.

[0119] Example 4

[0120] According to an embodiment of the present invention, an embodiment of a vehicle communication device is provided, which can execute the vehicle communication method provided in the above-mentioned embodiment 2. The specific implementation method and preferred application scenario are the same as those of the above-mentioned embodiment 1, and will not be repeated here.

[0121] Figure 5 is a schematic diagram of a vehicle communication device according to an embodiment of the present invention, wherein the vehicle communication device is Figure 5 As shown:

[0122] The receiving module 50 is used to receive the encrypted message sent from the sending device inside the vehicle;

[0123] An acquisition module 52, used to acquire a unique identifier carried in the encrypted message;

[0124] A determination module 54, configured to determine a decryption key for the encrypted message based on the unique identifier;

[0125] The decryption module 56 is used to decrypt the message content carried in the encrypted message based on the decryption key to obtain the original message content.

[0126] Example 5

[0127] According to an embodiment of the present invention, a vehicle embodiment is provided. Figure 6 is a schematic diagram of a vehicle according to an embodiment of the present invention, the vehicle is as follows Figure 6 As shown:

[0128] The sending device 60 is used to obtain a unique identifier carried in the message to be sent, determine an encryption key for the message to be sent based on the unique identifier, encrypt the message content carried in the message to be sent based on the encryption key to obtain an encrypted message, and send the encrypted message based on the communication mode of the message to be sent, wherein the unique identifier is used to uniquely identify the communication mode;

[0129] The receiving device 62 is used to obtain the unique identifier carried in the received encrypted message, determine the decryption key of the encrypted message based on the unique identifier, decrypt the message content carried in the encrypted message based on the decryption key, and obtain the message content carried in the message to be sent.

[0130] Example 6

[0131] According to an embodiment of the present invention, there is also provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the vehicle communication method in embodiment 1 is executed when the program is running.

[0132] Example 7

[0133] An embodiment of the present application further provides a computer-readable storage medium, which includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the vehicle communication method in each embodiment of the present invention.

[0134] Example 8

[0135] An embodiment of the present application further provides a computer program product, including a computer program, which implements the vehicle communication method in various embodiments of the present invention when executed by a processor.

[0136] Example 9

[0137] An embodiment of the present application also provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the vehicle communication method in each embodiment of the present invention is implemented.

[0138] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0139] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0140] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0141] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0142] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0143] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0144] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A vehicle communication method, characterized in that: A transmitting device applied to a vehicle, the method comprising: Obtaining a unique identifier carried in the message to be sent, wherein the unique identifier is used to uniquely identify a communication mode of the message to be sent; Determining an encryption key for the message to be sent based on the unique identifier; Encrypting the message content carried in the message to be sent based on the encryption key to obtain an encrypted message; The encrypted message is sent to a receiving device inside the vehicle based on the communication mode.

2. The vehicle communication method according to claim 1, characterized in that: Determining an encryption key for a message to be sent based on the unique identifier includes: The unique identifier is processed using a preset algorithm to obtain the encryption key.

3. The vehicle communication method according to claim 2, characterized in that: Processing the unique identifier using a preset algorithm to obtain the encryption key includes: Get the timestamp of the current time; The unique identifier and the timestamp are processed using a hash function to obtain the encryption key.

4. The vehicle communication method according to claim 1, characterized in that: Encrypting the message content based on the encryption key to obtain an encrypted message includes: Converting the message content into a binary message format; Based on the encryption key, the binary message is encrypted using a symmetric encryption algorithm to obtain the encrypted message.

5. The vehicle communication method according to claim 4, characterized in that: Based on the encryption key, encrypting the binary message using a symmetric encryption algorithm to obtain the encrypted message includes: Performing a preprocessing operation on the message in the binary format to obtain a preprocessed message; Based on the encryption key, the preprocessed message is encrypted using the symmetric encryption algorithm to obtain the encrypted message.

6. The vehicle communication method according to claim 5, characterized in that: The binary message is preprocessed to obtain a preprocessed message, including at least one of the following: Performing a data obfuscation operation on the binary format message to obtain a preprocessed message; A data compression operation is performed on the binary format message to obtain a preprocessed message.

7. The vehicle communication method according to claim 4, characterized in that: Based on the encryption key, encrypting the binary message using a symmetric encryption algorithm to obtain the encrypted message includes: An XOR operation is performed on the encryption key and the message in the binary format to obtain the encrypted message.

8. A vehicle communication method, characterized in that: A receiving device applied to a vehicle interior, the method comprising: Receiving encrypted messages sent from a sending device inside the vehicle; Obtaining a unique identifier carried in the encrypted message; determining a decryption key for the encrypted message based on the unique identifier; The message content carried in the encrypted message is decrypted based on the decryption key to obtain the original message content.

9. A vehicle communication device, characterized in that: A transmitting device applied to a vehicle, the device comprising: An acquisition module, used to acquire a unique identifier carried in a message to be sent, wherein the unique identifier is used to uniquely identify a communication mode of the message to be sent; A determination module, configured to determine an encryption key for a message to be sent based on the unique identifier; An encryption module, used for encrypting the message content carried in the to-be-sent message based on the encryption key to obtain an encrypted message; A sending module is used to send the encrypted message to a receiving device inside the vehicle based on the communication mode.

10. A vehicle communication device, characterized in that: A receiving device applied to a vehicle interior, the device comprising: A receiving module, used for receiving an encrypted message from a sending device inside the vehicle; An acquisition module, used to acquire a unique identifier carried in the encrypted message; a determination module, configured to determine a decryption key of the encrypted message based on the unique identifier, wherein the decryption key is the same as the encryption key; The decryption module is used to decrypt the encrypted message using the decryption key to obtain the message content of the encrypted message.

11. A vehicle, characterized in that: include: A sending device, used to obtain a unique identifier carried in a message to be sent, determine an encryption key for the message to be sent based on the unique identifier, encrypt the message content carried in the message to be sent based on the encryption key to obtain an encrypted message, and send the encrypted message based on a communication mode of the message to be sent, wherein the unique identifier is used to uniquely identify the communication mode; A receiving device is used to obtain the unique identifier carried in the received encrypted message, determine the decryption key of the encrypted message based on the unique identifier, decrypt the message content carried in the encrypted message based on the decryption key, and obtain the message content carried in the message to be sent.

12. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 8 when running.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is executed, the device where the storage medium is located is controlled to execute the vehicle communication method according to any one of claims 1 to 8.

14. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the vehicle communication method according to any one of claims 1 to 8.