Vehicle-mounted message conversion method and vehicle-mounted communication gateway
By using the configuration table in the vehicle message conversion method to determine whether the data is encrypted, the problem of sensitive data leakage in data transmission between the vehicle Ethernet network and the CAN network is solved, and the security and efficiency of data transmission are improved.
Patent Information
- Application Number
- CN202411444002.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-01-21
AI Technical Summary
During the data transmission between the on-board Ethernet network and the CAN network, there is a risk of sensitive and critical data being leaked.
By introducing a configuration table into the vehicle message conversion method, whether to perform encryption processing is determined based on the sensitivity of the data. After receiving the data, the message conversion unit queries the encryption flag information in the configuration table. If encryption is indicated, the data content is encrypted, and the encryption flag information and the encrypted data content are encapsulated together during transmission.
Effectively reduce the leakage risk of data during transmission, while avoiding encryption of all data, thereby improving the efficiency of data transmission.
Smart Images

Figure CN119342113A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and more specifically, to a vehicle-mounted message conversion method and a vehicle-mounted communication gateway. Background Art
[0002] With the improvement of the level of electrification and intelligence of new energy vehicles, the in-vehicle network system plays an increasingly important role in vehicles. At present, the in-vehicle network mainly adopts the CAN bus standard, but with the growth of data transmission demand, the bandwidth and transmission rate of the CAN network can no longer meet the application requirements of high bandwidth and high data volume. Ethernet technology has gradually become the preferred technology for the new generation of in-vehicle networks due to its high bandwidth, low latency and good scalability. However, since CAN networks have been deployed in large numbers in existing in-vehicle systems, directly replacing them with Ethernet networks is not only costly and technically difficult, but may also affect the stability and compatibility of existing systems. Therefore, how to effectively introduce Ethernet technology on the basis of maintaining the existing CAN network and realize seamless data intercommunication and storage reporting between the two network systems has become a problem that needs to be solved urgently.
[0003] Chinese patent application No. 201710182846.5, filed on March 24, 2017, discloses a hybrid network gateway network management device for CAN and Ethernet networks and its exchange method, which includes a CAN message transceiver module, an Ethernet message transceiver module, an information processing conversion module and a logic main control module, wherein the information processing conversion module, after receiving the CAN message, packages the information into Ethernet messages according to the required encapsulation method and puts it on the Ethernet network, and after receiving the Ethernet message, parses and unpacks it according to the encapsulation rules used by the sender, encapsulates it into multiple CAN messages, and sends it to the corresponding CAN bus. Although this patent can realize data communication between the vehicle Ethernet network and the CAN network, there is a risk of sensitive and critical data being leaked during the data transmission process. Summary of the invention
[0004] In view of this, the present invention provides a vehicle-mounted message conversion method and a vehicle-mounted communication gateway, which can reduce the risk of sensitive and critical data being leaked during data transmission between the vehicle-mounted Ethernet network and the CAN network.
[0005] In order to achieve the above object, the present invention adopts the following technical scheme:
[0006] In a first aspect, the present invention provides a vehicle-mounted message conversion method, the method comprising:
[0007] The message conversion unit receives and parses the first message forwarded by the first vehicle-mounted controller through the first forwarding unit to obtain first parsed data; wherein the first parsed data includes data type information and data content information;
[0008] The message conversion unit queries the configuration information corresponding to the data type information in the configuration table, wherein the configuration information includes encryption flag information for indicating whether to encrypt the data content information;
[0009] If the encryption flag information indicates that the data content information is to be encrypted, the message conversion unit encrypts the data content information;
[0010] The message conversion unit encapsulates the data to be encapsulated to obtain a second message; wherein the data to be encapsulated includes data type information, encryption flag information and encrypted data content information;
[0011] The message conversion unit sends the second message to the second vehicle-mounted controller through the second forwarding unit.
[0012] The method provided by the present invention can flexibly determine whether to perform encryption processing according to the sensitivity of the data by querying the configuration table during the data transmission process between the vehicle Ethernet network and the CAN network, effectively reducing the risk of data leakage, and while ensuring the security of data transmission, it can avoid encrypting all data, thereby improving the efficiency of data transmission. In addition, the use of the configuration table to manage the encryption requirements of the data type allows the system to be flexibly configured according to different application scenarios and security requirements, and only the corresponding configuration information needs to be added to the configuration table without large-scale modification of the system hardware or software.
[0013] In a possible implementation, the message conversion unit encrypts the data content information including:
[0014] The message conversion unit obtains the encryption key corresponding to the data type information;
[0015] The message conversion unit encrypts the data content information based on the encryption key.
[0016] In a possible implementation, the first forwarding unit is a bus transceiver, the first message is a controller area network bus message, the second forwarding unit is an Ethernet switch, the second message is an Ethernet message, and the configuration information also includes a target network address; the message conversion unit sends the second message to the second vehicle controller through the second forwarding unit, including:
[0017] The message conversion unit queries the address resolution protocol table for a target physical address corresponding to the target network address;
[0018] The message conversion unit sends the Ethernet message to the Ethernet switch, so that the Ethernet switch sends the Ethernet message to the second vehicle-mounted controller corresponding to the target physical address.
[0019] In a possible implementation, the first forwarding unit is an Ethernet switch, the first message is an Ethernet message, the second forwarding unit is a bus transceiver, the second message is a controller area network bus message, and the configuration information also includes a bus message frame identifier; the message conversion unit sends the second message to the second vehicle controller through the second forwarding unit, including:
[0020] The message conversion unit sends the controller area network bus message to the second vehicle-mounted controller through the bus transceiver based on the bus message frame identifier.
[0021] In a possible implementation manner, the configuration information further includes storage flag information for indicating whether to store the first message; and the method further includes:
[0022] If the storage flag information indicates to store the first message, the message conversion unit stores the first message.
[0023] In a second aspect, the present invention further provides a vehicle-mounted message conversion method, the method comprising:
[0024] The second on-vehicle controller receives and parses the second message forwarded by the message conversion unit through the second forwarding unit to obtain second parsed data; wherein the second parsed data includes data type information, data content information, and encryption flag information for indicating whether to encrypt the data content information;
[0025] If the encryption flag information indicates that the data content information is to be encrypted, the second vehicle-mounted controller decrypts the encrypted data content information based on the data type information.
[0026] In a possible implementation, the second vehicle controller decrypts the encrypted data content information based on the data type information, including:
[0027] The second on-vehicle controller obtains a decryption key corresponding to the data type information;
[0028] The second on-vehicle controller decrypts the encrypted data content information based on the decryption key.
[0029] In a third aspect, the present invention provides a vehicle-mounted communication gateway, which includes: a first vehicle-mounted controller, a first forwarding unit, a second vehicle-mounted controller, a second forwarding unit and a message conversion unit; wherein,
[0030] A first forwarding unit, connected to the first vehicle-mounted controller and the message conversion unit, respectively, and configured to forward a first message sent by the first vehicle-mounted controller to the message conversion unit;
[0031] A message conversion unit, connected to the first forwarding unit and the second forwarding unit respectively, comprises a first memory and a first processor, wherein the first memory stores a computer program or computer instruction that can be loaded by the first processor and executes the vehicle-mounted message conversion method according to the first aspect and any possible implementation thereof;
[0032] A second forwarding unit is connected to the second vehicle-mounted controller and the message conversion unit, respectively, and is used to forward the second message converted by the message conversion unit to the second vehicle-mounted controller;
[0033] The second vehicle-mounted controller is connected to the second forwarding unit and includes a second memory and a second processor. The second memory stores a computer program or computer instructions that can be loaded by the second processor and executed by the vehicle-mounted message conversion method such as the second aspect and any possible implementation method thereof.
[0034] In a fourth aspect, the present invention provides a computer-readable storage medium, which stores a computer program or computer instructions that can be loaded by a processor and executed by a vehicle-mounted message conversion method such as the first aspect or the second aspect and any possible implementation method thereof.
[0035] In a fifth aspect, the present invention provides a computer program product, comprising a computer program or computer instructions, which, when loaded and executed by a processor, implement the steps of the vehicle-mounted message conversion method of the first aspect or the second aspect and any possible implementation method thereof.
[0036] For the specific description of the third to fifth aspects and their various implementations in the present invention, reference can be made to the detailed description in the first aspect, the second aspect and their various implementations; and for the beneficial effects of the third to fifth aspects and their various implementations, reference can be made to the analysis of the beneficial effects in the first aspect, the second aspect and their various implementations, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
[0038] Figure 1 is a block diagram of the internal structure of a vehicle communication gateway according to an embodiment of the present invention;
[0039] Figure 2 It is a flow chart of a vehicle-mounted message conversion method applied to a message conversion unit according to an embodiment of the present invention;
[0040] Figure 3 is a schematic diagram of a vehicle message conversion method applied to a second vehicle controller according to an embodiment of the present invention;
[0041] Figure 4 It is a flowchart of a specific application of a vehicle-mounted message conversion method according to an embodiment of the present invention;
[0042] Figure 5 is a flowchart of another specific application of a vehicle-mounted message conversion method according to an embodiment of the present invention;
[0043] Figure 6 It is a block diagram of the internal structure of a message conversion unit according to an embodiment of the present invention;
[0044] Figure 7 It is a block diagram of the internal structure of a second vehicle-mounted controller according to an embodiment of the present invention. DETAILED DESCRIPTION
[0045] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.
[0046] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
[0047] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0048] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0049] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0050] In the following, the terms "first", "second", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", etc. may explicitly or implicitly include one or more of the features.
[0051] Embodiment 1:
[0052] First, an embodiment of the present invention provides a vehicle communication gateway 100. Please refer to Figure 1 , which is a block diagram of the internal structure of the vehicle communication gateway 100 provided by an embodiment of the present invention. Figure 1 As shown, the vehicle communication gateway 100 mainly includes a first vehicle controller 101 , a first forwarding unit 102 , a second vehicle controller 103 , a second forwarding unit 104 and a message conversion unit 105 .
[0053] A first vehicle-mounted controller 101 is connected to the first forwarding unit 102 and is used to send a first message to the first forwarding unit 102;
[0054] The first forwarding unit 102 is connected to the first vehicle controller 101 and the message conversion unit 105 respectively, and is used to forward the first message to the message conversion unit 105;
[0055] A message conversion unit 105, connected to the first forwarding unit 102 and the second forwarding unit 104 respectively, for converting the first message into a second message;
[0056] The second forwarding unit 104 is connected to the second vehicle-mounted controller 103 and the message conversion unit 105 respectively, and is used to forward the second message to the second vehicle-mounted controller 103;
[0057] The second vehicle-mounted controller 103 is connected to the second forwarding unit 104 and is used for receiving and parsing the second message.
[0058] In this embodiment, the network communication protocols of the first message and the second message are different, for example, the first message is an Ethernet message, and the second message is a CAN / CANFD message, or the first message is a CAN / CANFD message, and the second message is an Ethernet message. Correspondingly, the network communication protocols supported by the first vehicle controller 101 and the second vehicle controller 103 are also different, and the protocols supported by the first forwarding unit 102 and the second forwarding unit 104 are also different, for example, the first vehicle controller 101 and the first forwarding unit 102 support the Ethernet protocol, the first forwarding unit 102 is an Ethernet switch, the second vehicle controller 103 and the second forwarding unit 104 support the CAN / CANFD protocol, and the second forwarding unit 104 is a CAN transceiver, or the first vehicle controller 101 and the first forwarding unit 102 support the CAN / CANFD protocol, the first forwarding unit 102 is a CAN transceiver, the second vehicle controller 103 and the second forwarding unit 104 support the Ethernet protocol, and the second forwarding unit 104 is an Ethernet switch.
[0059] The message conversion unit 105 can receive data messages from the Ethernet, parse and process the Ethernet messages through the internal TCP / IP protocol stack, and convert the data content in the Ethernet messages into a format suitable for CAN / CANFD bus transmission, that is, CAN / CANFD messages. Once the CAN / CANFD message is generated, the message conversion unit 105 will send the CAN / CANFD message to the CAN / CANFD bus through the CAN / CANFD interface thereon.
[0060] When the message conversion unit 105 sends CAN / CANFD messages through the CAN / CANFD interface, these messages will first be sent to the CAN / CANFD transceiver, and then the CAN / CANFD transceiver will convert these CAN / CANFD messages into differential signals and send them to the CAN / CANFD bus.
[0061] The message conversion unit 105 receives the message from the CAN / CANFD bus, parses the data frame of the CAN message, encapsulates it into the format of the Ethernet frame, converts it into an Ethernet message, and sends the converted Ethernet message to the Ethernet through the Ethernet port. The Ethernet switch will send the Ethernet message to other Ethernet devices and process or store the message accordingly.
[0062] Furthermore, the CAN transceiver chip can be selected as TJA1043, which supports both CAN and CANFD communication protocols, and is used for receiving and sending CAN and CANFD messages of new energy vehicles, and communicating with new energy vehicles such as vehicle controllers, battery management control systems, and electric drive control systems.
[0063] The Ethernet switch chip can be 88Q5050, which supports up to Gigabit Ethernet communication and is used for receiving and sending Ethernet messages in new energy vehicles. It can communicate with new energy vehicles such as smart cockpit domain controllers.
[0064] The chip of the message conversion unit 105 can be selected as TC387QP, which integrates the TCPIP protocol stack, uses TCP and UDP protocols to receive and send Ethernet messages, does not use broadcast frames, avoids broadcast storms, improves system stability, and makes data transmission and reception more reliable.
[0065] It should be noted that the CAN transceiver corresponds to the controller one-to-one, and the Ethernet switch can connect multiple controllers with Ethernet communication. The first on-board controller 101 can also receive messages forwarded by the first forwarding device, and the second on-board controller 103 can also send messages through the second forwarding device. The first on-board controller 101 and the second on-board controller 103 are control systems that control and manage various functions of the car, including but not limited to the body control unit (BCM), powertrain control unit, chassis control unit, intelligent cockpit domain controller, automatic driving domain controller, electronic power steering system (EPS) controller, electronic stability system (ESP) controller, electric power steering system electronic control unit, vehicle controller (VCU), battery management system (BMS) and electric drive control system, etc.
[0066] Embodiment 2:
[0067] Based on the above-mentioned embodiment 1, the embodiment of the present invention provides a vehicle-mounted message conversion method applied to a message conversion unit. Figure 2 , which is a flow chart of the vehicle-mounted message conversion method provided by an embodiment of the present invention. Figure 2 As shown, the vehicle-mounted message conversion method provided by the present invention mainly includes the following steps (steps S201 to S205):
[0068] Step S201, a message conversion unit receives and parses a first message forwarded by a first vehicle-mounted controller through a first forwarding unit to obtain first parsed data; wherein the first parsed data includes data type information and data content information;
[0069] Step S202: The message conversion unit searches the configuration table for configuration information corresponding to the data type information, wherein the configuration information includes encryption flag information for indicating whether to encrypt the data content information;
[0070] Step S203, if the encryption flag information indicates to encrypt the data content information, the message conversion unit encrypts the data content information;
[0071] Step S204, the message conversion unit encapsulates the data to be encapsulated to obtain a second message; wherein the data to be encapsulated includes data type information, encryption flag information and encrypted data content information;
[0072] Step S205: the message conversion unit sends a second message to the second vehicle-mounted controller through the second forwarding unit.
[0073] After the vehicle communication gateway is powered on and initialized, the message conversion unit writes a configuration table that records the configuration information for converting CAN / CANFD messages into Ethernet messages and vice versa.
[0074] In this embodiment, the data type information is equivalent to the ID of the first message, that is, information identifying the data type of the first message, such as vehicle speed, longitude, latitude, MCU control board temperature, etc.
[0075] If the encryption flag information is YES, it means that the data content information needs to be encrypted and the encrypted data content information is sent; if the encryption flag information is NO, it means that the data content information does not need to be encrypted and the unencrypted data content information is directly sent. Whether encryption is required can be set according to the privacy and criticality of the data type of the first message. If the data type is relatively private and critical, its encryption flag information is set to YES; if the data type is not very private and critical, its encryption flag information is set to NO.
[0076] In some optional embodiments, for step S203, the message conversion unit may first obtain the encryption key corresponding to the data type information, and then encrypt the data content information based on the encryption key. The encryption keys corresponding to each data type information may be the same or different. For example, the encryption keys corresponding to all data type information may be set to be the same; the data type information and the encryption key may also be set to correspond one to one and be different; all data type information may also be divided into multiple data type sets according to preset rules, and an encryption key may be assigned to each data type set, wherein the preset rules may be to divide data type information with similar criticality and privacy into a data type set, or to divide the data type information of the first message from the same first vehicle-mounted controller into a data type set, or to divide the data type information of the first message sent to the same second vehicle-mounted controller into a data type set, and of course there are other division rules, which are not specifically limited in this embodiment.
[0077] In some optional embodiments, the configuration information may further include storage flag information for indicating whether to store the first message; if the storage flag information is YES, it indicates that the first message needs to be stored, and the message conversion unit stores the first message. The message conversion unit may store through a built-in storage module or an external storage module.
[0078] In some optional embodiments, the data to be encapsulated also includes verification information for verifying the correctness and integrity of the data of the first message, wherein the verification method may be CRC8.
[0079] In some optional embodiments, the configuration information further includes data length information for indicating the data length of the data content information, and the data to be encapsulated further includes the data length information.
[0080] In this embodiment, a private protocol is developed based on the TCP and UDP protocols to encrypt, transmit and store private or key information such as driving trajectories. The private protocol consists of a data type Tag (T), an encryption flag Encrypt (E), a data length Length (L), a data value Value (V), and a data checksum Checksum (C). Among them, the data type Tag (T) indicates the type of data of the transmitted message, and the encryption flag Encrypt (E) indicates whether the data is encrypted. When Encrypt is YES, it means that the message needs to be encrypted before being forwarded to the second forwarding unit. When Encrypt is YES, it means that no encryption is required. Tag and Encrypt together form two bytes of 16 bits, the highest bit is Encrypt, and the lower 15 bits are Tag. For example, the longitude Tag of the vehicle's location is binary 000000100100011. If it is encrypted data, Tag+Encrypt is 1000000100100011 (0x8123). If it is not encrypted, Tag+Encrypt is 0000000100100011 (0x0123).
[0081] Length (L) indicates the length of the data, for example, it consists of one byte. Value (V) indicates the specific content of the data, and its length is specified by Length (L). When decapsulating the second message, the second on-board controller can use the length information to determine the amount of data to be processed, so as to correctly decapsulate the message and extract the valid payload data. If the length of the received message is not as expected, it may indicate that the message has been damaged or incomplete during transmission.
[0082] Embodiment three:
[0083] Based on the above-mentioned embodiment 1 and embodiment 2, the embodiment of the present invention further provides a vehicle-mounted message conversion method applied to a second vehicle-mounted controller. Figure 3 , which is a flow chart of the vehicle-mounted message conversion method provided by an embodiment of the present invention. Figure 3 As shown, the vehicle-mounted message conversion method provided by the present invention mainly includes the following steps (steps S301-S302):
[0084] Step S301, the second vehicle-mounted controller receives and parses the second message forwarded by the message conversion unit through the second forwarding unit to obtain second parsed data; wherein the second parsed data includes data type information, data content information, and encryption flag information for indicating whether to encrypt the data content information;
[0085] Step S302: If the encryption flag information indicates that the data content information is to be encrypted, the second vehicle-mounted controller decrypts the encrypted data content information based on the data type information.
[0086] For step S302, after parsing the second message, the second vehicle-mounted controller obtains the data type information, and then obtains the decryption key corresponding to the data type information, and then decrypts the encrypted data content information based on the decryption key.
[0087] It should be noted that the decryption key can be a symmetric key like the encryption key in the second embodiment, such as AES-128, or an asymmetric key. If you want fast encryption and decryption speed, you can use a symmetric key, and if you want high security, you can use an asymmetric key.
[0088] Embodiment 4:
[0089] In order to facilitate technical personnel in this field to understand how to implement practical applications, the vehicle-mounted message conversion method provided in the above embodiment 2 is described in detail below, taking a specific application scenario in which the first forwarding unit is a bus transceiver, the first message is a controller LAN bus message, the second forwarding unit is an Ethernet switch, and the second message is an Ethernet message as an example.
[0090] Please refer to Figure 4 , which is a flow chart of the vehicle-mounted message conversion method provided by an embodiment of the present invention. Figure 4 As shown, the vehicle-mounted message conversion method provided by the present invention mainly includes the following steps (steps S401 to S406):
[0091] Step S401, a message conversion unit receives and parses a controller area network bus message forwarded by a first vehicle-mounted controller through a bus transceiver to obtain first parsed data; wherein the first parsed data includes data type information and data content information;
[0092] Step S402, the message conversion unit searches the configuration table for configuration information corresponding to the data type information, wherein the configuration information includes encryption flag information indicating whether to encrypt the data content information and a target network address;
[0093] Step S403: if the encryption flag information indicates that the data content information is to be encrypted, the message conversion unit encrypts the data content information;
[0094] Step S404, the message conversion unit encapsulates the data to be encapsulated to obtain an Ethernet message; wherein the data to be encapsulated includes data type information, encryption flag information, and encrypted data content information;
[0095] Step S405, the message conversion unit searches the address resolution protocol table for the target physical address corresponding to the target network address;
[0096] Step S406: The message conversion unit sends the Ethernet message to the Ethernet switch, so that the Ethernet switch sends the Ethernet message to the second vehicle-mounted controller corresponding to the target physical address.
[0097] After the vehicle communication gateway is powered on and initialized, the message conversion unit will write the CAN network to Ethernet configuration table, see Table 1.
[0098] Table 1 CAN network to Ethernet configuration table
[0099]
[0100] It should be noted that the above Table 1 only takes the three data types of vehicle speed, bus voltage, and MCU control board temperature as examples to illustrate the contents of the configuration table.
[0101] In addition, after the vehicle-mounted communication gateway is powered on and initialized, the message conversion unit will also build an address resolution protocol table (ARP table) based on the configuration table. Specifically, the message conversion unit queries the target network address (target IP address) in the configuration table, and sends an ARP request with each target network address through the Ethernet switch. If the IP address of the second vehicle-mounted controller is the same as the target network address, it will return an ARP response containing its own target physical address (target MAC address). In this way, the message conversion unit establishes an ARP table of the mapping relationship between the target IP address and the target MAC address. When step S402 obtains the target IP address corresponding to the data type information in the configuration table, the second vehicle-mounted controller that receives the Ethernet message can be determined by querying the ARP table, and the Ethernet message can be accurately sent to the second vehicle-mounted controller.
[0102] Embodiment five:
[0103] In order to facilitate technical personnel in this field to understand how to implement practical applications, the vehicle-mounted message conversion method provided in the above embodiment 2 is described in detail below, taking a specific application scenario in which the first forwarding unit is an Ethernet switch, the first message is an Ethernet message, the second forwarding unit is a bus transceiver, and the second message is a controller local area network bus message as an example.
[0104] Please refer to Figure 5 , which is a flow chart of the vehicle-mounted message conversion method provided by an embodiment of the present invention. Figure 5 As shown, the vehicle-mounted message conversion method provided by the present invention mainly includes the following steps (steps S501 to S505):
[0105] Step S501, the message conversion unit receives and parses the Ethernet message forwarded by the first vehicle-mounted controller through the Ethernet switch to obtain first parsed data; wherein the first parsed data includes data type information and data content information;
[0106] Step S502, the message conversion unit queries the configuration information corresponding to the data type information in the configuration table, wherein the configuration information includes encryption flag information indicating whether to encrypt the data content information and a bus message frame identifier;
[0107] Step S503: if the encryption flag information indicates to encrypt the data content information, the message conversion unit encrypts the data content information;
[0108] Step S504, the message conversion unit encapsulates the data to be encapsulated to obtain a controller area network bus message; wherein the data to be encapsulated includes data type information, encryption flag information and encrypted data content information;
[0109] Step S505: the message conversion unit sends the controller area network bus message to the second vehicle controller through the second forwarding unit based on the bus message frame identifier.
[0110] After the vehicle communication gateway is powered on and initialized, the message conversion unit will write the configuration table of Ethernet to CAN network, see Table 2.
[0111] It should be noted that the following Table 2 only takes the three data types of longitude, latitude and altitude as examples to illustrate the contents of the configuration table.
[0112] Table 2 Configuration table of Ethernet to CAN network
[0113]
[0114] When the message conversion unit needs to send a controller area network bus message (CAN / CANFD message), the message frame is sent to the CAN bus through the CAN transceiver. The second on-board controller receives the message frame through the CAN transceiver and determines whether the message frame needs to be processed based on the value of the message frame ID. Since the CAN message frame ID determines the priority of the message, the CAN transceiver will also arbitrate based on the value of the message frame ID when sending the message frame. If two nodes try to send a message frame at the same time and their ID values are different, the message frame with the lower ID value will be sent to the CAN bus first.
[0115] Embodiment six:
[0116] In addition, based on the above-mentioned embodiments 2 to 5, the message conversion unit 105 in the vehicle communication gateway 100 provided in the first embodiment of the present invention applies the vehicle message conversion method of the above-mentioned embodiments 2, 4 or 5, and the second vehicle-mounted unit applies the vehicle message conversion method of the above-mentioned embodiment 3.
[0117] like Figure 6 As shown, the message conversion unit 105 includes a first memory 1051 , a first processor 1052 and a first communication bus 1053 , and the first memory 1051 and the first processor 1052 are connected via the first communication bus 1053 .
[0118] The first memory 1051 may be used to store instructions, programs, codes, code sets or instruction sets. The first memory 1051 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function, and instructions for implementing the vehicle-mounted message conversion method provided in the second, fourth or fifth embodiment, etc.; the data storage area may store data involved in the vehicle-mounted message conversion method provided in the second, fourth or fifth embodiment, etc.
[0119] The first processor 1052 may include one or more processing cores. The first processor 1052 calls the data stored in the memory by running or executing the instructions, programs, code sets or instruction sets stored in the first memory 1051, and performs various functions and processes data of the present invention. The first processor 1052 may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller and a microprocessor. It can be understood that for different gateways, the electronic device used to implement the above-mentioned processor function can also be other, and the embodiment of the present invention is not specifically limited.
[0120] The first communication bus 1053 may include a path to transmit information between the above components. The first communication bus 1053 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The first communication bus 1053 may be divided into an address bus, a data bus, a control bus, etc.
[0121] like Figure 7 As shown, the second vehicle controller 103 includes a second memory 1031, a second processor 1032 and a second communication bus 1033, and the second memory 1031 and the second processor 1032 are connected via the second communication bus 1033. The second memory 1031 stores a computer program or computer instruction that can be loaded by the second processor 1032 and execute the vehicle message conversion method provided in the above embodiment 3.
[0122] The detailed description of the second memory 1031 , the second processor 1032 , and the second communication bus 1033 may refer to the first memory 1051 , the first processor 1052 , and the first communication bus 1053 , respectively, which will not be described in detail in this embodiment.
[0123] For ease of representation, Figure 6 , Figure 7 In the figure, only one double arrow is used to represent the first communication bus and the second communication bus, but it does not mean that there is only one bus or one type of bus. Figure 7 The message conversion unit and the second vehicle-mounted controller shown are merely examples and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0124] Those skilled in the art will understand that Figure 6 , Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the vehicle-mounted communication gateway to which the solution of the present invention is applied. The specific vehicle-mounted communication gateway may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0125] Embodiment seven:
[0126] In particular, according to an embodiment of the present invention, the process described in the above flowchart may be implemented as a computer software program.
[0127] The technical solution of the present invention, in essence, or the part that contributes to the prior art, or the 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, that is, the embodiment of the present invention also provides a computer-readable storage medium, which includes a number of computer programs or computer instructions, which are used to enable an electronic device (which can be a personal computer, server or network device, etc.) or a processor to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory, random access memory, disk or optical disk, etc., various media that can store program codes.
[0128] Embodiment eight:
[0129] An embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer readable medium, the computer program including a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), various functions defined in the present invention are performed.
[0130] Although some specific embodiments of the present invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will be appreciated by those skilled in the art that the above embodiments may be modified without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.
Claims
1. A vehicle-mounted message conversion method, characterized in that: The method comprises: The message conversion unit receives and parses the first message forwarded by the first vehicle controller through the first forwarding unit to obtain first parsed data; wherein the first parsed data includes data type information and data content information; The message conversion unit queries the configuration information corresponding to the data type information in the configuration table, wherein the configuration information includes encryption flag information for indicating whether to encrypt the data content information; If the encryption flag information indicates that the data content information is to be encrypted, the message conversion unit encrypts the data content information; The message conversion unit encapsulates the data to be encapsulated to obtain a second message; wherein the data to be encapsulated includes the data type information, the encryption flag information and the encrypted data content information; The message conversion unit sends the second message to the second vehicle-mounted controller through the second forwarding unit.
2. The vehicle-mounted message conversion method according to claim 1, characterized in that: The message conversion unit encrypting the data content information includes: The message conversion unit obtains an encryption key corresponding to the data type information; The message conversion unit encrypts the data content information based on the encryption key.
3. The vehicle-mounted message conversion method according to claim 1 or 2, characterized in that: The first forwarding unit is a bus transceiver, the first message is a controller area network bus message, the second forwarding unit is an Ethernet switch, the second message is an Ethernet message, and the configuration information further includes a target network address; The message conversion unit sends the second message to the second vehicle controller through the second forwarding unit, including: The message conversion unit queries the address resolution protocol table for a target physical address corresponding to the target network address; The message conversion unit sends the Ethernet message to the Ethernet switch, so that the Ethernet switch sends the Ethernet message to the second vehicle-mounted controller corresponding to the target physical address.
4. The vehicle-mounted message conversion method according to claim 1 or 2, characterized in that: The first forwarding unit is an Ethernet switch, the first message is an Ethernet message, the second forwarding unit is a bus transceiver, the second message is a controller area network bus message, and the configuration information further includes a bus message frame identifier; The message conversion unit sends the second message to the second vehicle controller through the second forwarding unit, including: The message conversion unit sends the controller area network bus message to the second vehicle controller through the bus transceiver based on the bus message frame identifier.
5. The vehicle-mounted message conversion method according to claim 1 or 2, characterized in that: The configuration information further includes storage flag information for indicating whether to store the first message; and the method further includes: If the storage flag information indicates to store the first message, the message conversion unit stores the first message.
6. A vehicle-mounted message conversion method, characterized in that: The method comprises: The second on-board controller receives and parses the second message forwarded by the message conversion unit through the second forwarding unit to obtain second parsed data; wherein the second parsed data includes data type information, data content information, and encryption flag information for indicating whether to encrypt the data content information; If the encryption flag information indicates that the data content information is to be encrypted, the second vehicle-mounted controller decrypts the encrypted data content information based on the data type information.
7. The vehicle-mounted message conversion method according to claim 6, characterized in that: The second vehicle-mounted controller decrypting the encrypted data content information based on the data type information includes: The second on-vehicle controller obtains a decryption key corresponding to the data type information; The second vehicle-mounted controller decrypts the encrypted data content information based on the decryption key.
8. A vehicle communication gateway, characterized in that: The vehicle communication gateway includes: a first vehicle controller, a first forwarding unit, a second vehicle controller, a second forwarding unit and a message conversion unit; wherein, The first forwarding unit is connected to the first vehicle-mounted controller and the message conversion unit respectively, and is used to forward the first message sent by the first vehicle-mounted controller to the message conversion unit; The message conversion unit is connected to the first forwarding unit and the second forwarding unit respectively, and includes a first memory and a first processor, wherein the first memory stores a computer program or computer instruction that can be loaded by the first processor and execute the vehicle-mounted message conversion method according to any one of claims 1 to 5; The second forwarding unit is connected to the second vehicle-mounted controller and the message conversion unit respectively, and is used to forward the second message converted by the message conversion unit to the second vehicle-mounted controller; The second vehicle-mounted controller is connected to the second forwarding unit, and includes a second memory and a second processor. The second memory stores a computer program or computer instruction that can be loaded by the second processor and executes the vehicle-mounted message conversion method as described in claim 6 or 7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or computer instructions that can be loaded by a processor and execute the in-vehicle message conversion method as described in any one of claims 1 to 7.
10. A computer program product comprising a computer program or computer instructions, characterized in that When the computer program or the computer instruction is loaded and executed by the processor, the steps of the vehicle-mounted message conversion method as claimed in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Hybrid-network-gateway network management device combining CAN with Ethernet network and exchange method thereof
CN106961437A
Cited By
In-vehicle device, communication method, and communication program
WO2026172852A1