Message transmission method and device, computer equipment, storage medium and program product
By converting CAN protocol messages into SLE protocol messages and using wireless communication, the problem of high wire harness load in vehicle internal communication is solved, and efficient and secure data transmission is achieved.
Patent Information
- Application Number
- CN202411194408.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-27
AI Technical Summary
The wired harness load is high in the internal communication of the vehicle, making it difficult to achieve efficient data transmission.
By converting the CAN protocol message of the vehicle into a star flash low-power access SLE protocol message and transmitting it using wireless communication methods, the conversion between wired and wireless communication data is realized, and the load of the wired harness is reduced.
It effectively reduces the wired harness load for internal communication of vehicles, improves data transmission efficiency and security, and is suitable for complex internal vehicle controller communication scenarios.
Smart Images

Figure CN119211375A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle technology, and in particular to a message transmission method, device, computer equipment, storage medium and program product. Background Art
[0002] With the continuous development of vehicle intelligence, networking and electrification, the functions of in-vehicle controllers are becoming more complex, the types and number of in-vehicle buses are becoming more and more complex, and the number of controller interfaces is also increasing rapidly. In order to achieve internal communication in the car, relying on wired harnesses for internal communication in the vehicle has the problem of high wire harness load.
[0003] In view of this, internal vehicle communication can be achieved by combining wired communication and wireless communication. Therefore, how to achieve the conversion between wired communication data and wireless communication data is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention
[0004] Based on this, it is necessary to provide a message transmission method, device, computer equipment, storage medium and program product to address the above technical problems, which can realize the conversion between wired communication data and wireless communication data, thereby reducing the load on the vehicle's internal communication wire harness.
[0005] In a first aspect, the present application provides a message transmission method, which is applied to a vehicle and includes:
[0006] Obtaining an original message containing a control instruction sent by a vehicle body controller; wherein the original message is a controller area network (CAN) protocol message;
[0007] Convert the original message into a Star Flash Low Energy Access SLE protocol message;
[0008] The SLE protocol message is transmitted to the control device corresponding to the control instruction.
[0009] In one embodiment, converting the original message into a Star Flash Low Energy Access SLE protocol message includes:
[0010] Extracting a message identifier, a data length identifier and data content of the original message;
[0011] Generate a payload message of the SLE protocol message according to the message identifier, the data length identifier and the data content;
[0012] The SLE protocol message is generated according to the load message of the SLE protocol message and the header of the SLE protocol message.
[0013] In one of the embodiments, generating a payload message of the SLE protocol message according to the message identifier, the data length identifier and the data content includes:
[0014] Generate a payload sub-message of the SLE protocol message according to the message identifier, the data length identifier and the data content;
[0015] Determining a message security level and a target encryption algorithm according to the message identifier;
[0016] Generate a payload subheader of the SLE protocol message according to the message identifier, the message security level, the algorithm identifier of the target encryption algorithm and the length of the message authentication code; wherein the message authentication code is determined according to the target encryption algorithm and the data content;
[0017] A payload message of the SLE protocol message is generated according to the payload sub-message, the payload sub-header and the message authentication code.
[0018] In one of the embodiments, generating the payload message of the SLE protocol message according to the payload sub-message, the payload sub-header and the message authentication code includes:
[0019] Determining whether to encrypt the payload sub-message according to the message security level;
[0020] In the case where it is determined that the load sub-message needs to be encrypted, encrypting the load sub-message to obtain an encrypted sub-message;
[0021] A payload message of the SLE protocol message is generated according to the encrypted sub-message, the payload sub-header and the message authentication code.
[0022] In one embodiment, determining whether the payload sub-message needs to be encrypted according to the message security level includes:
[0023] Determine a target encryption identifier corresponding to the message security level according to the correspondence between the candidate security levels and the candidate encryption identifiers;
[0024] According to the target encryption identifier, it is determined whether the payload sub-message needs to be encrypted.
[0025] In one embodiment, determining the message security level and the target encryption algorithm according to the message identifier includes:
[0026] Determining a message security level according to the message identifier;
[0027] According to the corresponding relationship between the candidate security levels and the candidate algorithms, a target encryption algorithm corresponding to the message security level is determined.
[0028] In a second aspect, the present application further provides a message transmission device, which is configured in a vehicle and includes:
[0029] An acquisition module, used for acquiring an original message containing a control instruction sent by a vehicle body controller; wherein the original message is a controller area network CAN protocol message;
[0030] A conversion module, used to convert the original message into a Star Flash Low Energy Access SLE protocol message;
[0031] The transmission module is used to transmit the SLE protocol message to the control device corresponding to the control instruction.
[0032] In a third aspect, the present application further provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:
[0033] Obtaining an original message containing a control instruction sent by a vehicle body controller; wherein the original message is a controller area network (CAN) protocol message;
[0034] Convert the original message into a Star Flash Low Energy Access SLE protocol message;
[0035] The SLE protocol message is transmitted to the control device corresponding to the control instruction.
[0036] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0037] Obtaining an original message containing a control instruction sent by a vehicle body controller; wherein the original message is a controller area network (CAN) protocol message;
[0038] Convert the original message into a Star Flash Low Energy Access SLE protocol message;
[0039] The SLE protocol message is transmitted to the control device corresponding to the control instruction.
[0040] In a fifth aspect, the present application further provides a computer program product, the computer program product comprising a computer program, which implements the following steps when executed by a processor:
[0041] Obtaining an original message containing a control instruction sent by a vehicle body controller; wherein the original message is a controller area network (CAN) protocol message;
[0042] Convert the original message into a Star Flash Low Energy Access SLE protocol message;
[0043] The SLE protocol message is transmitted to the control device corresponding to the control instruction.
[0044] The above-mentioned message transmission method, device, computer equipment, storage medium and program product obtain the original message containing the control instruction sent by the vehicle body controller, the original message is a CAN protocol message; and convert the original message into an SLE protocol message; and then transmit the SLE protocol message to the control device corresponding to the control instruction. In the above scheme, the original message is transmitted by wired communication, and the SLE protocol message can be transmitted by wireless communication. In this way, the original message is converted into an SLE protocol message, and the message can be transmitted by a combination of wired communication and wireless communication to reduce the load of the vehicle's internal communication wire harness. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A schematic diagram of a flow chart of a message transmission method in an embodiment;
[0046] Figure 2 A schematic diagram of a process of converting an original message into an SLE protocol message in one embodiment;
[0047] Figure 3A A schematic diagram of a process for generating a load message of an SLE protocol message in an embodiment;
[0048] Figure 3B A schematic diagram of the structure of an SLE protocol message in an embodiment;
[0049] Figure 4 A schematic diagram of another process of generating a load message of an SLE protocol message in one embodiment;
[0050] Figure 5 A schematic diagram of a process for determining whether a payload sub-message needs to be encrypted in one embodiment;
[0051] Figure 6 A schematic diagram of a process for determining a message security level and a target encryption algorithm in one embodiment;
[0052] Figure 7 is a schematic structural diagram of a conversion device in one embodiment;
[0053] Figure 8 A schematic diagram of message conversion of a conversion device in one embodiment;
[0054] Fig. 9 A schematic diagram of a process of message conversion and transmission in one embodiment;
[0055] Fig.10 A structural block diagram of a message transmission device in an embodiment;
[0056] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0058] The message transmission method provided in the embodiment of the present application can be applied in the application environment of internal vehicle communication, for example, in the application scenario of receiving the door opening command from the wireless car key and transmitting the door opening command to the door controller.
[0059] The message transmission method provided in the embodiment of the present application can be executed by a conversion device inside the vehicle. The conversion device is specifically a SparkLink Low Energy (SLE) and Controller Area Network / CAN with Flexible Data-rate (CAN / CANFD) bus conversion device.
[0060] In one embodiment, Figure 1 As shown, a message transmission method is provided, which is described by taking the method applied to a conversion device inside a vehicle as an example, and includes the following steps:
[0061] S101, obtaining an original message containing a control instruction sent by a body controller of a vehicle.
[0062] Exemplarily, the vehicle body controller first obtains a control instruction, such as a door opening instruction sent by a wireless car key via a radio frequency signal; the body controller generates an original message containing the control instruction; wherein the original message is a CAN protocol message, and the body controller transmits the original message to the conversion device via the CAN bus. wherein the CAN protocol message may be a CAN message or a CAN_FD message.
[0063] S102, converting the original message into a Star Flash Low Energy Access SLE protocol message.
[0064] Exemplarily, key fields of the original message may be extracted, and a message in the SLE protocol format, ie, an SLE protocol message, may be generated according to the key fields.
[0065] S103, transmitting the SLE protocol message to the control device corresponding to the control instruction.
[0066] Furthermore, the SLE protocol message can be transmitted to the control device corresponding to the control instruction by wireless transmission. For example, if the control instruction is a door opening instruction, the SLE protocol message can be transmitted to the door controller by wireless transmission so that the door controller performs the door opening operation.
[0067] The above message transmission method obtains the original message containing the control instruction sent by the vehicle body controller, the original message is a CAN protocol message; and converts the original message into an SLE protocol message; and then transmits the SLE protocol message to the control device corresponding to the control instruction. In the above scheme, the original message is transmitted by wired communication, and the SLE protocol message can be transmitted by wireless communication. In this way, the original message is converted into an SLE protocol message, and the message can be transmitted by combining wired communication and wireless communication to reduce the load of the vehicle's internal communication wire harness.
[0068] In some optional implementations, see Figure 2 , Figure 2 A flow chart of converting an original message into an SLE protocol message is provided, which specifically includes the following steps:
[0069] S201, extracting a message identifier, a data length identifier and data content of an original message.
[0070] The message identifier of the original message is used to distinguish the message protocol of the original message; for example, if the original message is a CAN message or a CAN_FD message, the message identifier CAN_ID is used to distinguish whether the message protocol of the original message is the CAN protocol or the CAN_FD protocol; wherein ID is the abbreviation of Identifier, which means identifier.
[0071] The data length identifier is used to indicate the number of bytes in the data field that follows it. For example, if the original message is a CAN message or a CAN_FD message, the data length identifier is CAN_DLC, where DLC is the abbreviation of Data Length Code.
[0072] The data content is the actual data part of the original message. For example, if the original message is a CAN message or a CAN_FD message, the data content is CAN_data, where data means data.
[0073] S202: Generate a payload message of the SLE protocol message according to the message identifier, the data length identifier and the data content.
[0074] Exemplarily, the message identifier, the data length identifier and the data content may be concatenated to obtain a payload message of the SLE protocol message; wherein the payload message of the SLE protocol message may be understood as the actual data portion of the SLE protocol message.
[0075] S203: Generate an SLE protocol message according to the payload message of the SLE protocol message and the header of the SLE protocol message.
[0076] The header of the SLE protocol message can be determined according to the specification of the SLE protocol message. For example, the specification of the SLE protocol message may be to require the header to include one or more of synchronization information, length information, control information, address information, and check information; wherein the synchronization information represents the receiver to identify the beginning of the message and ensure the synchronous reception of the message. The length information is used to indicate the length of the subsequent part of the message so that the receiver can correctly parse the entire message. The control information includes control fields such as the type, priority, and whether confirmation is required. The address information includes the source address and the destination address, which are used to identify the sender and the receiver of the message. Check information, such as CRC (cyclic redundancy check), is used to detect whether an error occurs during the transmission of the message.
[0077] Further, the SLE protocol message may be generated according to the payload message of the SLE protocol message and the header of the SLE protocol message.
[0078] In an embodiment of the present application, by extracting the key fields of the original message and generating the SLE protocol message based on the key fields, the conversion of the original message to the SLE protocol message is achieved, and then the SLE protocol message can be transmitted by wireless communication to reduce the load of the vehicle's internal communication wire harness.
[0079] In some optional implementations, see Figure 3A , Figure 3A A flow chart of generating a load message of an SLE protocol message is provided, which specifically includes the following steps:
[0080] S301, generating a payload sub-message of an SLE protocol message according to a message identifier, a data length identifier and data content.
[0081] Specifically, the message identifier, the data length identifier and the data content may be concatenated to obtain a payload sub-message of the SLE protocol message.
[0082] S302: Determine the message security level and target encryption algorithm according to the message identifier.
[0083] Exemplarily, a correspondence between a message identifier and a message security level can be pre-established, and based on the correspondence and the message identifier, the message security level corresponding to the message identifier can be determined; similarly, a correspondence between a message identifier and an encryption algorithm can be pre-established, and based on the correspondence and the message identifier, the target encryption algorithm corresponding to the message identifier can be determined. The message identifier, the message security level, and the calculation method of the target encryption algorithm can also be pre-determined, and the message security level and the target encryption algorithm can be determined according to the message identifier using a preset calculation method.
[0084] S303, generating a payload subheader of the SLE protocol message according to the message identifier, the message security level, the algorithm identifier of the target encryption algorithm and the length of the message authentication code.
[0085] Exemplarily, the message identifier, the message security level identifier, the algorithm identifier of the target encryption algorithm, and the length identifier of the message authentication code may be sequentially concatenated to obtain the payload subheader of the SLE protocol message. The message authentication code may be determined based on a preset algorithm, according to the target encryption algorithm and the data content, and is used to check the integrity of the message and perform identity authentication. For example, it may be determined based on a hash function algorithm, according to the target encryption algorithm and the data content.
[0086] S304: Generate a payload message of the SLE protocol message according to the payload sub-message, the payload sub-header and the message authentication code.
[0087] Furthermore, the message authentication code may be used as a sub-message tail, and the payload sub-message, the payload sub-header and the message authentication code may be sequentially concatenated to obtain the payload message of the SLE protocol message.
[0088] In an embodiment of the present application, an implementable method for generating a load message of an SLE protocol message based on a message identifier, a data length identifier, and data content is provided to facilitate subsequent message format conversion.
[0089] For example, see Figure 3B , Figure 3B A structural diagram of an SLE protocol message is provided. The SLE protocol message includes two parts: a header and a payload; wherein the payload includes three parts: a sub-header, a sub-message and a sub-message trailer.
[0090] Specifically, the subheader of the payload part of the SLE protocol message includes a protocol type field, a security level field, a cryptographic algorithm field, and a message authentication code length field. The protocol type field is used to identify whether the original data comes from the CAN2.0 protocol or the CAN_FD protocol; the security level field is used to identify the network security protection level; the cryptographic algorithm field is used to identify the cryptographic algorithm; and the message authentication code length field is used to identify the intercepted length of the message authentication code.
[0091] The sub-message of the payload part of the SLE protocol message contains the CAN_Data field from the CAN2.0 or CAN_FD protocol message; the sub-message tail of the payload part of the SLE protocol message contains the message authentication code.
[0092] In some optional implementations, see Figure 4 , Figure 4 A flow chart of another method for generating a load message of an SLE protocol message is provided, which specifically includes the following steps:
[0093] S401: Determine whether to encrypt the payload sub-message according to the message security level.
[0094] It should be noted that different SLE protocol messages have different transmission security level requirements during transmission, so before transmitting the SLE protocol message, it can be determined whether the payload sub-message of the SLE protocol message needs to be encrypted. For example, the message security level can be determined based on the message content or sub-message type of the payload sub-message, and then based on the message security level, it can be determined whether the payload sub-message needs to be encrypted.
[0095] S402: When it is determined that the payload sub-message needs to be encrypted, the payload sub-message is encrypted to obtain an encrypted sub-message.
[0096] Furthermore, when it is determined that the payload sub-message needs to be encrypted, a preset encryption algorithm may be used to encrypt the payload sub-message to obtain an encrypted sub-message.
[0097] S403, generating a payload message of the SLE protocol message according to the encrypted sub-message, the payload sub-header and the message authentication code.
[0098] Exemplarily, an encrypted sub-message may be used to replace the payload sub-message before encryption, and the payload message of the SLE protocol message may be generated based on the encrypted sub-message, the payload sub-header, and the message authentication code. If encryption is not required, the payload message of the SLE protocol message may still be generated based on the payload sub-message, the payload sub-header, and the message authentication code that have not been encrypted.
[0099] In an embodiment of the present application, in order to improve the security of data transmission, a method for encrypting a load sub-message is provided, and transmitting the encrypted sub-message after the encryption process can improve the security of data transmission.
[0100] In some optional implementations, see Figure 5 , Figure 5 A schematic diagram of a process for determining whether to encrypt a payload sub-message is provided, which specifically includes the following steps:
[0101] S501, determining a target encryption identifier corresponding to a message security level according to a correspondence between candidate security levels and candidate encryption identifiers.
[0102] Exemplarily, a correspondence between candidate security levels and candidate encryption identifiers can be established in advance. For example, the candidate security levels can be divided into three levels, namely, high, low and none, and when the security level is high or low, the candidate encryption identifier is set to require encryption; when the security level is none, the candidate encryption identifier is set to not require encryption. In this way, after the message security level is determined, the candidate encryption identifier corresponding to the same security level as the message security level can be used as the target encryption identifier.
[0103] S502: Determine whether the payload sub-message needs to be encrypted according to the target encryption identifier.
[0104] Furthermore, whether the payload sub-message needs to be encrypted can be determined based on the target encryption identifier. For example, if the target encryption identifier is that encryption is required, it is determined that the payload sub-message needs to be encrypted; if the target encryption identifier is that encryption is not required, it is determined that the payload sub-message does not need to be encrypted.
[0105] In some optional implementations, see Figure 6 , Figure 6 A flowchart for determining a message security level and a target encryption algorithm is provided, which specifically includes the following steps:
[0106] S601, determining a message security level according to a message identifier.
[0107] Exemplarily, a correspondence between candidate security levels and candidate encryption identifiers may be pre-established, and then based on the correspondence and according to the message identifier, the message security level may be determined.
[0108] S602: Determine a target encryption algorithm corresponding to the message security level according to the correspondence between the candidate security levels and the candidate algorithms.
[0109] Furthermore, a correspondence between candidate security levels and candidate algorithms can be established in advance. For example, if the candidate security level is high, the candidate algorithm is an Authenticated Encryption with Associated Data (AEAD) cryptographic algorithm; if the candidate security level is low, the candidate algorithm is a Message Authentication Code (MAC) cryptographic algorithm. Thus, the target encryption algorithm corresponding to the message security level can be determined based on the correspondence between the candidate security level and the candidate algorithm.
[0110] In an embodiment of the present application, a method is provided for determining a security level and a target encryption algorithm based on a message identifier. When the security level is determined to be high or medium, the load sub-message is encrypted; when the security level is determined to be low, the load sub-message is directly transmitted. In this way, not only the security of data transmission can be improved, but also the efficiency of data transmission can be improved.
[0111] For example, see Figure 7 , Figure 7 A structural schematic diagram of a conversion device is provided, which includes a Star Flash SLE transceiver module, a CAN / CANFD bus transceiver module, a protocol conversion module and an information security module.
[0112] Among them, the Xingshan SLE transceiver module is used for sending and receiving SLE protocol messages; the CAN / CANFD bus transceiver module is used for sending and receiving CAN protocol messages, and the CAN protocol includes CAN2.0 and CAN_FD; the protocol conversion module is responsible for unpacking the CAN protocol messages and re-encapsulating them into SLE protocol messages; the network security module is responsible for encrypting the SLE protocol messages using the target encryption algorithm during the protocol conversion process to ensure the information security of the data transmission process.
[0113] For example, see Figure 8 , Figure 8 A message conversion schematic diagram of a conversion device is provided. Taking the original message as a CAN protocol message as an example, the CAN protocol message includes an arbitration segment, a control segment, a data segment, a cyclic redundancy check (CRC) and an acknowledgement character (ACK). The protocol conversion module is responsible for unpacking the CAN protocol message and using the message identifier, data length identifier and data content as the payload sub-message of the SLE protocol message; the header of the SLE protocol message includes the protocol type, security level, algorithm identifier of the cryptographic algorithm (target encryption algorithm) and the length of the message authentication code.
[0114] When the security level is high, the network security module executes the AEAD cryptographic algorithm, first calculating the message authentication code of the payload field sub-header and sub-message of the SLE protocol message, and using the obtained message authentication code as the payload field sub-message footer of the SLE protocol message to provide complete protection for the data conversion and transmission process. Then, the payload field sub-message of the SLE protocol message is symmetrically encrypted to obtain the ciphertext corresponding to the message identifier, data length identifier and data content; and the obtained ciphertext replaces the payload field sub-message of the original SLE protocol message to provide confidentiality protection for the data conversion and transmission process.
[0115] When the security level is low, the network security module executes the MAC cryptographic algorithm, calculates the message authentication code of the payload field subheader and submessage of the SLE protocol message, and uses the obtained message authentication code as the payload field submessage trailer of the SLE protocol message to provide complete protection for the data conversion and transmission process; at this time, there is no need to encrypt the payload field submessage of the SLE protocol message.
[0116] When the security level is none, the network security module does not perform any action, the payload field sub-message tail of the SLE protocol message is empty, and the message authentication code length field of the sub-header is 0.
[0117] The SLE protocol message is then transmitted to the Xingshan SLE transceiver module, which is used to send the SLE protocol message to the control device corresponding to the data content.
[0118] For example, see Fig. 9 , Fig. 9 A schematic diagram of message conversion and transmission is provided, which is introduced by taking the original message as a CAN protocol message and the data content as a door opening instruction as an example, and specifically includes the following steps:
[0119] Step 1: Start the StarShine SLE and CAN / CANFD bus conversion device, and create the application gateway server GW-server in a self-starting manner. The application server App-server is responsible for calling the StarShine SLE transceiver module, CAN / CANFD bus transceiver module, protocol conversion model and information security module.
[0120] Step 2: The body domain controller receives the door opening command sent by the car key via a radio frequency signal.
[0121] Step 3: The body domain controller sends the door opening command to the Star Flash SLE and CAN / CANFD bus conversion device through the CAN bus.
[0122] Step 4: The Star Flash SLE and CAN / CANFD bus conversion device calls the CAN / CANFD transceiver module through the GW-server, receives the door opening command in the form of CAN protocol from the body domain controller, and extracts valid information such as CAN-ID, CAN-DLC, CAN-Data, etc.
[0123] Step 5: The Xingshan SLE and CAN / CANFD bus conversion device calls the protocol conversion module through the GW-server to convert the door control command carried by the CAN bus into the Xingshan SLE message format, and calls the network security module during the conversion process to perform information security protection on the door opening command in the SLE protocol format. Specifically: first, the CAN-ID, CAN-DLC, CAN-Data and other valid information are synthesized into the payload field sub-message of the SLE protocol message; then the payload field sub-header of the SLE protocol message is generated according to the protocol type ID, security level ID, cryptographic algorithm ID and message authentication code length ID.
[0124] Step 6: The Star Flash SLE and CAN / CANFD bus conversion device calls the Star Flash SLE transceiver module through the GW-server, and sends the packaged Star Flash SLE protocol format door opening command to the door controller.
[0125] Step 7: The door controller parses the sub-header of the received SLE protocol message, obtains the sub-message of the SLE protocol message, and controls the door according to the door opening instruction therein.
[0126] In the embodiment of the present application, the Star Flash SLE transceiver module supports the sending and receiving of SLE protocol messages. On the one hand, it effectively solves the problems of heavy wiring harness weight, high labor costs, and unavoidable connector reliability risks in traditional wired communication networks. On the other hand, it solves the problem that the CAN / CANFD bus data frame structure is different from the Star Flash SLE data frame structure, which causes the two to be unable to communicate directly, and effectively promotes the application of Star Flash SLE wireless short-range communication technology in the internal communication network of the car. In addition, three network security protection mechanisms with different security strengths are provided during the protocol conversion and data transmission process, which can be selected according to specific business needs to prevent frame forgery, frame tampering and frame sniffing attacks from car hackers. The CAN bus transceiver module supports the sending and receiving of CAN2.0 and CAN-FD protocol messages, which can effectively increase the communication bandwidth without significantly changing the automotive electronic and electrical architecture.
[0127] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0128] Based on the same inventive concept, the embodiment of the present application also provides a message transmission device for implementing the message transmission method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more message transmission device embodiments provided below can refer to the limitations on the message transmission method above, and will not be repeated here.
[0129] In one embodiment, Fig.10 As shown, a message transmission device is provided, which is configured in a vehicle and includes:
[0130] The acquisition module 10 is used to acquire the original message containing the control instruction sent by the vehicle body controller; wherein the original message is a controller area network CAN protocol message;
[0131] The conversion module 20 is used to convert the original message into a Star Flash Low Energy Access SLE protocol message;
[0132] The transmission module 30 is used to transmit the SLE protocol message to the control device corresponding to the control instruction.
[0133] The message transmission device obtains the original message containing the control instruction sent by the vehicle body controller, the original message is a CAN protocol message; and converts the original message into an SLE protocol message; and then transmits the SLE protocol message to the control device corresponding to the control instruction. In the above scheme, the original message is transmitted by wired communication, and the SLE protocol message can be transmitted by wireless communication. In this way, the original message is converted into an SLE protocol message, and the message can be transmitted by combining wired communication and wireless communication to reduce the load of the vehicle's internal communication wire harness.
[0134] In one embodiment, the conversion module 20 specifically includes:
[0135] An extraction unit, used for extracting a message identifier, a data length identifier and data content of an original message;
[0136] A first generating unit, configured to generate a payload message of an SLE protocol message according to a message identifier, a data length identifier and data content;
[0137] The second generating unit is used to generate an SLE protocol message according to a payload message of the SLE protocol message and a header of the SLE protocol message.
[0138] In one embodiment, the first generating unit specifically includes:
[0139] A first generating subunit, used for generating a load sub-message of the SLE protocol message according to the message identifier, the data length identifier and the data content;
[0140] A determination subunit, used to determine the message security level and target encryption algorithm according to the message identifier;
[0141] The second generating subunit is used to generate a payload subheader of the SLE protocol message according to the message identifier, the message security level, the algorithm identifier of the target encryption algorithm and the length of the message authentication code; wherein the message authentication code is determined according to the target encryption algorithm and the data content;
[0142] The third generating subunit is used to generate a payload message of the SLE protocol message according to the payload sub-message, the payload sub-header and the message authentication code.
[0143] In one embodiment, the third generating subunit is specifically used for:
[0144] According to the message security level, determine whether it is necessary to encrypt the payload sub-message; if it is determined that the payload sub-message needs to be encrypted, encrypt the payload sub-message to obtain an encrypted sub-message; and generate a payload message of the SLE protocol message according to the encrypted sub-message, the payload sub-header and the message authentication code.
[0145] In one embodiment, the third generating subunit is specifically used for:
[0146] According to the correspondence between the candidate security levels and the candidate encryption identifiers, a target encryption identifier corresponding to the message security level is determined; according to the target encryption identifier, it is determined whether the payload sub-message needs to be encrypted.
[0147] In one embodiment, the determining subunit is specifically configured to:
[0148] According to the message identifier, the message security level is determined; according to the corresponding relationship between the candidate security levels and the candidate algorithms, the target encryption algorithm corresponding to the message security level is determined.
[0149] Each module in the above-mentioned message transmission device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0150] In one embodiment, a computer device is provided. The computer device may be a conversion device in a vehicle, and its internal structure diagram may be as shown in FIG. Fig.11 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store message data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a message transmission method is implemented.
[0151] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0152] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0153] Obtaining an original message containing a control instruction sent by a vehicle body controller; wherein the original message is a controller area network CAN protocol message;
[0154] Convert the original message into the Star Flash Low Energy Access SLE protocol message;
[0155] The SLE protocol message is transmitted to the control device corresponding to the control instruction.
[0156] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0157] Extract the message identifier, data length identifier and data content of the original message; generate the payload message of the SLE protocol message according to the message identifier, data length identifier and data content; generate the SLE protocol message according to the payload message of the SLE protocol message and the header of the SLE protocol message.
[0158] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0159] Generate a payload sub-message of an SLE protocol message according to a message identifier, a data length identifier and data content; determine a message security level and a target encryption algorithm according to the message identifier; generate a payload sub-header of an SLE protocol message according to the message identifier, the message security level, an algorithm identifier of a target encryption algorithm and a length of a message authentication code; wherein the message authentication code is determined according to the target encryption algorithm and data content; generate a payload message of an SLE protocol message according to the payload sub-message, the payload sub-header and the message authentication code.
[0160] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0161] According to the message security level, determine whether it is necessary to encrypt the payload sub-message; if it is determined that the payload sub-message needs to be encrypted, encrypt the payload sub-message to obtain an encrypted sub-message; and generate a payload message of the SLE protocol message according to the encrypted sub-message, the payload sub-header and the message authentication code.
[0162] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0163] According to the correspondence between the candidate security levels and the candidate encryption identifiers, a target encryption identifier corresponding to the message security level is determined; according to the target encryption identifier, it is determined whether the payload sub-message needs to be encrypted.
[0164] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0165] According to the message identifier, the message security level is determined; according to the corresponding relationship between the candidate security levels and the candidate algorithms, the target encryption algorithm corresponding to the message security level is determined.
[0166] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0167] Obtaining an original message containing a control instruction sent by a vehicle body controller; wherein the original message is a controller area network CAN protocol message;
[0168] Convert the original message into the Star Flash Low Energy Access SLE protocol message;
[0169] The SLE protocol message is transmitted to the control device corresponding to the control instruction.
[0170] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0171] Extract the message identifier, data length identifier and data content of the original message; generate the payload message of the SLE protocol message according to the message identifier, data length identifier and data content; generate the SLE protocol message according to the payload message of the SLE protocol message and the header of the SLE protocol message.
[0172] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0173] Generate a payload sub-message of an SLE protocol message according to a message identifier, a data length identifier and data content; determine a message security level and a target encryption algorithm according to the message identifier; generate a payload sub-header of an SLE protocol message according to the message identifier, the message security level, an algorithm identifier of a target encryption algorithm and a length of a message authentication code; wherein the message authentication code is determined according to the target encryption algorithm and data content; generate a payload message of an SLE protocol message according to the payload sub-message, the payload sub-header and the message authentication code.
[0174] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0175] According to the message security level, determine whether it is necessary to encrypt the payload sub-message; if it is determined that the payload sub-message needs to be encrypted, encrypt the payload sub-message to obtain an encrypted sub-message; and generate a payload message of the SLE protocol message according to the encrypted sub-message, the payload sub-header and the message authentication code.
[0176] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0177] According to the correspondence between the candidate security levels and the candidate encryption identifiers, a target encryption identifier corresponding to the message security level is determined; according to the target encryption identifier, it is determined whether the payload sub-message needs to be encrypted.
[0178] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0179] According to the message identifier, the message security level is determined; according to the corresponding relationship between the candidate security levels and the candidate algorithms, the target encryption algorithm corresponding to the message security level is determined.
[0180] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0181] Obtaining an original message containing a control instruction sent by a vehicle body controller; wherein the original message is a controller area network CAN protocol message;
[0182] Convert the original message into the Star Flash Low Energy Access SLE protocol message;
[0183] The SLE protocol message is transmitted to the control device corresponding to the control instruction.
[0184] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0185] Extract the message identifier, data length identifier and data content of the original message; generate the payload message of the SLE protocol message according to the message identifier, data length identifier and data content; generate the SLE protocol message according to the payload message of the SLE protocol message and the header of the SLE protocol message.
[0186] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0187] Generate a payload sub-message of an SLE protocol message according to a message identifier, a data length identifier and data content; determine a message security level and a target encryption algorithm according to the message identifier; generate a payload sub-header of an SLE protocol message according to the message identifier, the message security level, an algorithm identifier of a target encryption algorithm and a length of a message authentication code; wherein the message authentication code is determined according to the target encryption algorithm and data content; generate a payload message of an SLE protocol message according to the payload sub-message, the payload sub-header and the message authentication code.
[0188] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0189] According to the message security level, determine whether it is necessary to encrypt the payload sub-message; if it is determined that the payload sub-message needs to be encrypted, encrypt the payload sub-message to obtain an encrypted sub-message; and generate a payload message of the SLE protocol message according to the encrypted sub-message, the payload sub-header and the message authentication code.
[0190] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0191] According to the correspondence between the candidate security levels and the candidate encryption identifiers, a target encryption identifier corresponding to the message security level is determined; according to the target encryption identifier, it is determined whether the payload sub-message needs to be encrypted.
[0192] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0193] According to the message identifier, the message security level is determined; according to the corresponding relationship between the candidate security levels and the candidate algorithms, the target encryption algorithm corresponding to the message security level is determined.
[0194] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0195] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0196] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0197] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A message transmission method, characterized in that: The method is applied to a vehicle, and comprises: Obtaining an original message containing a control instruction sent by a vehicle body controller; wherein the original message is a controller area network (CAN) protocol message; Convert the original message into a Star Flash Low Energy Access SLE protocol message; The SLE protocol message is transmitted to the control device corresponding to the control instruction.
2. The method according to claim 1, characterized in that The converting the original message into a Star Flash Low Energy Access SLE protocol message includes: Extracting a message identifier, a data length identifier and data content of the original message; Generate a payload message of the SLE protocol message according to the message identifier, the data length identifier and the data content; The SLE protocol message is generated according to the load message of the SLE protocol message and the header of the SLE protocol message.
3. The method according to claim 2, characterized in that The step of generating a load message of the SLE protocol message according to the message identifier, the data length identifier and the data content includes: Generate a payload sub-message of the SLE protocol message according to the message identifier, the data length identifier and the data content; Determining a message security level and a target encryption algorithm according to the message identifier; Generate a payload subheader of the SLE protocol message according to the message identifier, the message security level, the algorithm identifier of the target encryption algorithm and the length of the message authentication code; wherein the message authentication code is determined according to the target encryption algorithm and the data content; A payload message of the SLE protocol message is generated according to the payload sub-message, the payload sub-header and the message authentication code.
4. The method according to claim 3, characterized in that The step of generating the payload message of the SLE protocol message according to the payload sub-message, the payload sub-header and the message authentication code comprises: Determining whether to encrypt the payload sub-message according to the message security level; In the case where it is determined that the load sub-message needs to be encrypted, encrypting the load sub-message to obtain an encrypted sub-message; A payload message of the SLE protocol message is generated according to the encrypted sub-message, the payload sub-header and the message authentication code.
5. The method according to claim 4, characterized in that The determining, according to the message security level, whether it is necessary to encrypt the payload sub-message includes: Determine a target encryption identifier corresponding to the message security level according to the correspondence between the candidate security levels and the candidate encryption identifiers; According to the target encryption identifier, it is determined whether the payload sub-message needs to be encrypted.
6. The method according to claim 3, characterized in that Determining the message security level and the target encryption algorithm according to the message identifier includes: Determining a message security level according to the message identifier; According to the corresponding relationship between the candidate security levels and the candidate algorithms, a target encryption algorithm corresponding to the message security level is determined.
7. A message transmission device, characterized in that: The device is configured in a vehicle, and comprises: An acquisition module, used for acquiring an original message containing a control instruction sent by a vehicle body controller; wherein the original message is a controller area network CAN protocol message; A conversion module, used to convert the original message into a Star Flash Low Energy Access SLE protocol message; The transmission module is used to transmit the SLE protocol message to the control device corresponding to the control instruction.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Vehicle energy management system and method
CN116691438A
Data transmission synchronization method and device, chip, electronic equipment and storage medium
CN117560756A