A data processing method and related device
By using the central gateway and VLAN technology in the vehicle network to allocate external devices and ECUs to different virtual LANs, the problem of ECUs being vulnerable to attacks in the vehicle network is solved, secure data communication and isolation is achieved, and the security of the ECU is improved. and data transmission efficiency.
Patent Information
- Application Number
- CN202011332135.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-24
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2040-11-24
AI Technical Summary
External devices in the vehicle network are connected to the in-vehicle network through the OBD interface, causing the electronic control unit (ECU) to become the target of attacks and affecting the security of the in-vehicle network.
The central gateway is used to allocate external devices and ECUs to different VLANs through virtual LAN (VLAN) technology, and the identifier of the central gateway is used to achieve data communication, avoiding direct communication and improving the security of the ECU.
It realizes data communication between external devices and ECU, while isolating the network, improving the security of ECU, avoiding unnecessary diffusion of data, improving data transmission efficiency, and protecting ECUs with different security requirements.
Smart Images

Figure CN114553634B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of vehicle-mounted Ethernet, and in particular to a data processing method and related devices. Background Art
[0002] After Ethernet is introduced into the in-vehicle network, the in-vehicle network can communicate directly with the traditional network infrastructure (Infrastructure, IT), which puts forward new requirements for the security of the in-vehicle network.
[0003] External devices can be connected to the in-vehicle network through the On Board Diagnostics (OBD) interface. In this connection mode, external devices can access all electronic control units (ECUs) in the vehicle through a switch, making each ECU a target of attack, posing a serious threat to the in-vehicle network security. Summary of the invention
[0004] In order to solve the above-mentioned technical problems existing in the prior art, the present application provides a data processing method and related devices, which improve the security of the in-vehicle ECU without affecting the communication between external devices and the in-vehicle ECU.
[0005] On the one hand, an embodiment of the present application provides a data processing method, characterized in that it is applied to a central gateway, the central gateway is used in a first virtual local area network VLAN through a first identifier, and is used in a second VLAN through a second identifier, and the method includes:
[0006] Receive a first message sent by a first device; the first message includes data to be processed, a first destination logical address, a first destination physical address MAC, and a first destination network address IP; the first destination logical address is the MAC of an electronic control unit ECU, and the first destination IP is the external IP of the central gateway; the first device is used in the first VLAN through the first identifier, and the ECU is used in the second VLAN through the second identifier;
[0007] According to the first destination logical address, obtaining the IP address and the second identifier of the ECU;
[0008] Update the first destination MAC to the MAC of the ECU, and update the first destination IP to the internal IP of the central gateway, to obtain an updated first message;
[0009] Based on the second identifier, the updated first message is sent to the ECU.
[0010] In a possible implementation, acquiring the IP address and the second identifier of the ECU according to the destination logical address includes:
[0011] According to the first destination logical address, the IP address and the second identifier of the ECU are obtained by searching the routing table.
[0012] In a possible implementation, the method further includes:
[0013] If the IP address and the second identifier of the ECU are not found, an exception handling message is generated.
[0014] In a possible implementation, before acquiring the IP address and the second identifier of the ECU according to the first destination logical address, the method further includes:
[0015] Determining whether the first destination logical address is the MAC of the central gateway;
[0016] If so, the data to be processed is processed by the central gateway.
[0017] In a possible implementation, the method further includes:
[0018] Determine whether the routing table includes a first source logical address in the first message; wherein the first source logical address is used to identify the MAC of the first device;
[0019] If not, store the first source logical address, the first source IP in the first message, and the first identifier in the routing table; wherein the first source IP is used to identify the IP of the first device.
[0020] In a possible implementation, the method includes:
[0021] receiving a second message sent by the ECU; the second message is generated by the ECU according to the data to be processed; the second message includes the data to be received, a second destination logical address, a second destination physical address MAC and a second destination network address IP; the second destination logical address is the MAC of the first device, and the second destination IP is the internal IP of the central gateway;
[0022] According to the second destination logical address, obtain the IP address and the first identifier of the first device;
[0023] Update the second destination MAC to the MAC of the first device, and update the second destination IP to the external IP of the central gateway, to obtain an updated second message;
[0024] Based on the first identifier, the updated second message is sent to the first device.
[0025] On the other hand, an embodiment of the present application further provides a data processing method, the method comprising:
[0026] Sending the first message to a central gateway so that the central gateway sends the updated first message to an electronic control unit ECU;
[0027] The central gateway is used in the first virtual local area network VLAN through the first identifier, and is used in the second VLAN through the second identifier; the first message includes data to be processed, a first destination logical address, a first destination physical address MAC and a first destination network address IP; the first destination logical address is the MAC of the electronic control unit ECU, and the first destination IP is the external IP of the central gateway; the first device is used in the first virtual local area network VLAN through the first identifier, and the ECU is used in the second VLAN through the second identifier;
[0028] The updated first message is obtained according to the following method:
[0029] The central gateway obtains the IP address and the second identifier of the ECU according to the first destination logical address;
[0030] Update the first destination MAC to the MAC of the ECU, and update the first destination IP to the internal IP of the central gateway to obtain the updated first message.
[0031] On the other hand, an embodiment of the present application further provides a data processing method, the method comprising:
[0032] Receiving an updated first message sent by a central gateway; the central gateway is used in a first virtual local area network VLAN through a first identifier and in a second VLAN through a second identifier;
[0033] The first message includes data to be processed, a first destination logical address, a first destination physical address MAC, and a first destination network address IP; the first destination logical address is the MAC of the electronic control unit ECU, and the first destination IP is the external IP of the central gateway; the first device is used in the first VLAN through the first identifier, and the ECU is used in the second VLAN through the second identifier;
[0034] The updated first message is obtained by the central gateway in the following manner:
[0035] According to the first destination logical address, obtaining the IP address and the second identifier of the ECU;
[0036] Update the first destination MAC to the MAC of the ECU, and update the first destination IP to the internal IP of the central gateway to obtain an updated first message.
[0037] On the other hand, an embodiment of the present application further provides a central gateway, which is used to execute the method described in the above aspects.
[0038] On the other hand, an embodiment of the present application also provides a car, comprising the central gateway described in the above aspects.
[0039] It can be seen from the above scheme that since the first device has a first identifier and is used in the first virtual local area network VLAN, and the electronic control unit ECU has a second identifier and is used in the second VLAN, that is, the first device and the ECU are used in different VLANs, the first device cannot directly communicate data with the ECU. When there is a need for data communication between the first device and the ECU, since the central gateway has the first identifier and the second identifier, the first device can achieve data communication with the ECU through the central gateway. It can be seen that the first device, the central gateway and the ECU are configured based on the VLAN technology, so that data communication between the first device and the ECU is achieved, avoiding the problem that the ECU is easily attacked due to direct communication between the first device and the ECU, and improving the security of the ECU. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0041] Figure 1 A schematic diagram of the structure of an in-vehicle network provided in an embodiment of the present application;
[0042] Figure 2 A schematic diagram of a solution to vehicle network security provided by this application;
[0043] Figure 3 A flowchart of a data processing method provided in this application;
[0044] Figure 4 A schematic diagram of an application scenario of a data processing method provided in an embodiment of the present application;
[0045] Figure 5 A flowchart of a data processing method provided in an embodiment of the present application;
[0046] Figure 6 A flowchart of another data processing method provided in an embodiment of the present application;
[0047] Figure 7 A flowchart of another data processing method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0049] See also Figure 1 , Figure 1 This is a schematic diagram of the structure of a vehicle network provided in an embodiment of the present application. Figure 1 As shown, the vehicle network includes an on-board automatic diagnostic system OBD interface 101 , an in-vehicle electronic control unit ECU 102 and a vehicle central gateway 103 , including a processor 104 and a switch 105 .
[0050] In actual applications, the external device is connected to the in-vehicle network via the OBD interface 101 , and performs data communication with the ECU 102 via the Switch 104 in the in-vehicle central gateway 103 .
[0051] In the related art, two Ethernet controllers can be configured for the processor 202 in the vehicle-mounted central gateway 201, wherein one controller is connected to the external device via the Ethernet interface Eth 203 and the OBD interface 204, and the other controller is connected to the ECU 207 in the vehicle network via the Ethernet interface Eth 205 via the Switch 206, thereby realizing data communication between the external device and the vehicle ECU, see Figure 2 However, the processor of the Ethernet controller is relatively expensive, and the ECUs in the car can communicate with each other arbitrarily, so the ECUs with high security requirements cannot obtain higher protection, and the communication data between external devices and ECUs must be forwarded through the central gateway processor, which places high performance requirements on the central network processor.
[0052] In view of this, the embodiments of the present application provide a data processing method, a central gateway and a car, which realize data communication between external devices and the ECU in the car and improve the security of the ECU in the car.
[0053] For ease of understanding, the following Figure 3, taking the vehicle network application scenario as an example, the application scenario of the data processing method provided by the embodiment of the present application is introduced. Figure 3 As shown, the application scenario includes a first device 301, a central gateway 302 used in a vehicle network, and in-vehicle ECU1 3031 and ECU2 3032. The first device 301 can be any external device in the vehicle, such as an audio player, a video player, etc. In actual applications, the external device and the ECU can be determined according to the actual scenario, and no limitation is made here.
[0054] exist Figure 3 In the illustrated scenario, the central gateway 302 includes a Switch 3021 and a processor 3022, wherein the Switch 3021 includes a plurality of ports for connecting the first device 301, ECU1 3031, ECU2 3032, and the processor 3022. The first device 301 is connected to the first port of the Switch 3021 via the OBD interface 304, and the processor 3022, ECU1 3031, and ECU2 3032 are connected to the second port, the third port, and the fourth port of the Switch 3021, respectively.
[0055] In the embodiment of the present application, based on the Virtual Local Area Network (NLAN) technology, VLAN affiliation is divided for each port included in the Switch 3021 through the vehicle-mounted central gateway 302.
[0056] Specifically, the first port and the port where the central gateway 302 is located, that is, the second port, are divided into the first VLAN through the first identifier, and the second port, the third port and the fourth port are divided into the second VLAN through the second identifier. Among them, different VLANs can be identified by different VLAN numbers. In the embodiment of the present application, the first identifier can be recorded as VLAN1, and the second identifier can be recorded as VLAN2. In actual applications, VLAN attribution can be divided for each port according to actual scenarios and security requirements, and no limitation is made here.
[0057] Since ports with the same identifier can communicate directly, but ports with different identifiers cannot communicate directly, the first device 301 and ECU1 3031, ECU2 3032 can only communicate indirectly through the central gateway 302, while the first device 301 cannot communicate directly with ECU1 3031, ECU2 3032, and ECU1 3031 and ECU2 3032 cannot communicate directly with each other.
[0058] The technical solution provided by the above embodiment, while meeting the data communication requirements between the external device and the ECU, realizes network isolation between the external device and the ECU based on VLAN technology, thereby improving the security of the ECU, avoiding unnecessary diffusion of data during the communication process, and improving data transmission efficiency, thereby realizing protection for ECUs with different security requirements.
[0059] For a better understanding, the following Figure 4 The data processing method provided in the embodiment of the present application is introduced. Figure 4 , Figure 4 A flow chart of a data processing method provided in an embodiment of the present application. Figure 4 As shown, the data processing method is applied to the central gateway, and specifically includes the following steps:
[0060] S401: Receive a first message sent by a first device.
[0061] In an embodiment of the present application, the central gateway is used in the first VLAN through the first identifier and in the second VLAN through the second identifier. During the data communication process, the central gateway receives a first message sent by the first device. In actual applications, the first device is connected to the central gateway through the OBD interface and the Switch port. The first device can be any terminal device and is not limited here. The first device is applied to the first VLAN through the first identifier.
[0062] See also Figure 5 , Figure 5 A schematic diagram of a message format provided in an embodiment of the present application. Figure 5 As shown, it includes Ethernet header, IP header, TCP header, application layer protocol header and application data. Among them, the Ethernet header includes the destination MAC and source MAC, the IP header includes the destination IP and source IP, and the application layer protocol header includes the source logical address, the destination logical address and other parts of the protocol header.
[0063] In the embodiment of the present application, the first destination MAC included in the first message is the MAC of the central gateway, the first source MAC is the MAC of the first device, the first destination IP is the external IP of the central gateway, the source IP is the IP of the first device, the first source logical address is the IP of the first device, the first destination logical address is the MAC of the central gateway, and the application data is the data to be processed. Among them, the ECU is applied to the second VLAN through the second identifier.
[0064] In actual application, the first device sends the first message to the Switch via the OBD interface, and then the Switch forwards the first message to the port where the central gateway processor is located according to the first identifier and the first destination MAC corresponding to the port where the OBD is located.
[0065] S402: Acquire the IP address and the second identifier of the ECU according to the first destination logical address.
[0066] In the central gateway, the first message is transmitted to the routing module of the central gateway processor. The processor obtains the IP address and the second identifier of the ECU according to the first destination logical address.
[0067] It is understandable that to achieve data communication between an external device and the in-vehicle ECU, while ensuring that the data to be processed is sent from the external device to the in-vehicle ECU, a response message corresponding to the data to be processed needs to be returned from the in-vehicle ECU to the external device.
[0068] Therefore, the embodiment of the present application provides a possible implementation method to determine whether the MAC of the first device identified by the first source logical address in the first message is stored in the routing table. If not, it indicates that the MAC of the first device, the IP of the first device, and the first identifier are not stored in the routing table. Therefore, the MAC of the first device identified by the first source logical address in the first message, the IP of the first identifier identified by the first destination IP, and the first identifier are stored in the routing table to ensure that the response message corresponding to the data to be processed can be returned to the first device.
[0069] By detecting whether an active logical address is stored, it is ensured that the data to be processed can be normally returned to the first device after being processed, thereby ensuring the transmission of data between the first device and the ECU and improving the effectiveness of data transmission.
[0070] It is understandable that external devices also have the need to communicate data with the central gateway. In view of this, in one possible implementation, before obtaining the IP and second identifier of the ECU according to the first destination logical address, the processor determines whether the first destination logical address is the MAC of the central gateway to determine whether the object that the first device needs to communicate data with is the central gateway or the ECU. If so, it indicates that the object for data communication with the first device is not the ECU, but the central gateway. Therefore, the data to be processed in the first message is directly processed by the processor without forwarding the first message to the ECU. If not, it indicates that the object for data communication with the first device is the ECU, not the central gateway, so continue to the next step.
[0071] By detecting the first destination logical address, the data processing object for the data to be processed is determined, thereby ensuring the correctness of data transmission and improving the data processing efficiency of the data communication process.
[0072] Based on the above, it can be known that the MAC, IP and first identifier of the first device can be stored in the routing table. Similarly, the MAC, IP and second identifier of the ECU can be stored in the routing table. In the actual process, the processor can search and obtain the IP and second identifier of the ECU in the routing table according to the MAC of the ECU.
[0073] The above-mentioned storage of the MAC, IP and corresponding first identifier of the first device and the MAC, IP and corresponding second identifier of the ECU through the routing table helps to find and obtain information during data transmission, ensures the correct transmission of data, and improves the efficiency of data transmission.
[0074] If the processor cannot find or obtain the IP and the second identifier of the ECU from the routing table, it indicates that the ECU identified by the first destination logical address does not exist. Therefore, an exception handling message is generated, indicating that normal communication cannot be performed.
[0075] S403: Update the first destination MAC to the MAC of the ECU, and update the first destination IP to the internal IP of the central gateway to obtain an updated first message.
[0076] In the embodiment of the present application, the central gateway has multiple IP addresses and IP address conversion functions. Figure 3 As shown, the vehicle-mounted central gateway has at least two IP addresses, one for external use and one for internal use. The external IP is used to communicate with external test equipment and is open to the outside world. The internal IP is used for internal communication and can interact with any ECU in the vehicle network for data packets. This IP address is not open to the outside world and external devices are not allowed to access it.
[0077] In actual applications, the routing module updates the first destination MAC in the first message according to the MAC of the ECU identified by the first destination logical address, that is, the first destination MAC is replaced by the MAC of the central gateway and the first destination IP is replaced by the internal IP. The updated first message is obtained, which can communicate with any ECU in the vehicle.
[0078] S404: Based on the second identifier, sending the updated first message to the ECU.
[0079] After obtaining the second identifier corresponding to the port where the ECU is located in S402, the routing module can forward the updated first message to the Switch. Then, the Switch sends the updated first message to the ECU according to the second identifier and the first destination MAC in the updated first message, so that the ECU processes the data to be processed.
[0080] It is understandable that after the ECU processes the data to be processed, it needs to make a corresponding response to the data to be processed, that is, the ECU also needs to send a response message to the first device.
[0081] To this end, an embodiment of the present application provides another possible implementation method, where the central gateway receives the second message sent by the ECU, and then obtains the IP and the first identifier of the first device based on the second destination logical address in the second message, and updates the second destination MAC in the second message to the MAC of the first device, and updates the second destination IP in the second message to the external IP of the central gateway, thereby sending the updated second message to the first device based on the first identifier.
[0082] It should be noted that the second message is generated by the ECU based on the above-mentioned data to be processed, including the data to be received, the second destination logical address, the second destination MAC and the second destination IP, and the second destination logical address is the MAC of the first device, the second destination MAC is the MAC of the central gateway, and the second destination IP is the internal IP of the central gateway. Among them, the data to be received can be understood as the response message of the ECU to the first message. The above-mentioned process of the ECU sending the second message to the first device is similar to the process of the first device sending the first message to the ECU, which will not be repeated here.
[0083] In the data processing method provided in the above embodiment, since the first device has a first identifier and is used in the first virtual local area network VLAN, and the electronic control unit ECU has a second identifier and is used in the second VLAN, that is, the first device and the ECU are used in different VLANs, the first device cannot directly communicate data with the ECU. When there is a need for data communication between the first device and the ECU, since the central gateway has the first identifier and the second identifier, the first device can achieve data communication with the ECU through the central gateway. It can be seen that the first device, the central gateway and the ECU are configured based on the VLAN technology, so that data communication between the first device and the ECU is achieved, avoiding the problem that the ECU is easily attacked due to direct communication between the first device and the ECU, and improving the security of the ECU.
[0084] For a better understanding, the following Figure 6 The working process of the above-mentioned routing module forwarding the first message is introduced. Figure 6 , Figure 6 A routing module workflow diagram provided in an embodiment of the present application. Figure 6 As shown, the following steps are included:
[0085] S601: Receive a first message.
[0086] S602: Determine whether the first source logical address in the first message is stored in the routing table. If not, execute S603. If yes, execute S604.
[0087] S603: Store the first source logical address, the first destination IP address and the first identifier in the routing table, and continue to execute S604.
[0088] S604: Determine whether the first destination logical address in the first message is the MAC of the central gateway. If yes, go to S605. If not, go to S606.
[0089] S605: Process the data to be processed in the first message through the central gateway, and terminate the execution of subsequent S606-S610.
[0090] S606: Look up the routing table to obtain the IP address and the second identifier of the ECU.
[0091] S607: Determine whether the IP and the second identifier of the ECU are successfully found. If not, execute S608. If yes, execute S609.
[0092] S608: Exception handling.
[0093] S609: Update the first destination MAC to the MAC of the ECU, and update the first destination IP to the internal IP, to obtain an updated first message.
[0094] S610: Sending an updated first message to the ECU based on the second identifier.
[0095] In order to better understand the data processing method provided by the above embodiment, Figure 7 Taking the scenario of an external device accessing the ECU in a vehicle as an example, the process of data communication between the first device and the ECU in the embodiment of the present application is introduced.
[0096] exist Figure 7 In the application scenario shown, the external device is connected to the first port of the Switch through the OBD interface, the VLAN number of the first port is set to 1, the in-vehicle ECU is connected to the second port of the Switch, the VLAN number of the second port is set to 2, and the central gateway processor is connected to the third port of the Switch, and the VLAN numbers of the third port include 1 and 2. Based on this configuration, the external device and the in-vehicle ECU can only communicate data through the central gateway, and the external device and the in-vehicle ECU cannot directly communicate data, that is, directly send and receive messages.
[0097] In the process of sending messages between external devices and in-vehicle ECUs, the external device sends the first message to the Switch (701) through the OBD interface, and then the Switch forwards the first message to the third port (702) where the central gateway is located according to the VLAN number of the first port: VLAN1 and the first destination MAC in the first message (i.e., the MAC of the central network gateway). The Switch sends the first message to the routing module (703) through the third port. Then, the routing module sends the first message to the Switch (704), and the Switch forwards the first message to the second port (705) of the Switch according to the VLAN number of the second port where the in-vehicle ECU is located, i.e., VLAN2. Thus, the Switch can send the first message to the in-vehicle ECU (706) according to the first destination MAC in the updated first message (i.e., the MAC of the in-vehicle ECU).
[0098] In the process of the external device receiving the message sent between the in-vehicle ECU, the in-vehicle ECU sends the second message to the Switch through the second port (707), and the Switch forwards the first message to the third port (708) according to VLAN2 and the second destination MAC in the second message (i.e., the MAC of the central gateway). The Switch sends the second message to the routing module (709) through the third port. Then, the routing module sends the second module to the Switch (710), and the Switch forwards the second message to the first port (711) of the Switch according to the VLAN number of the first port where the external device is located, i.e., VLAN1. Thus, the Switch can send the second message to the external device (712) according to the second destination MAC in the updated second message (i.e., the MAC of the external device). Among them, the second message is generated by the in-vehicle ECU according to the first message.
[0099] The above-mentioned forwarding of data packets inside and outside the vehicle through the on-board central gateway converts the destination MAC and IP address based on the destination logical address, solves the problem of hiding the IP address of the ECU inside the vehicle, does not affect the communication inside and outside the vehicle, and improves the security of the ECU inside the vehicle. In addition, compared with the NAT technology based on the transport (TCP or UDP) layer, the data processing method provided in the embodiment of the present application forwards at the network layer (the next layer of the transport layer), advances the forwarding timing, improves the forwarding efficiency, and saves the occupation of TCP / UDP resources. In addition, compared with the traditional NAT technology that can only realize the communication path initiated by the node inside the vehicle, the data processing method provided in the embodiment of the present application realizes the communication process initiated by the inside and outside of the vehicle, and expands the data transmission method.
[0100] In view of the data processing method described above, the embodiment of the present application also provides another data processing method. The data processing method is applied to the first device and specifically includes the following steps:
[0101] Sending the first message to a central gateway so that the central gateway sends the updated first message to an electronic control unit ECU;
[0102] The first message includes data to be processed, a first destination logical address, a first destination physical address MAC and a first destination network address IP; the first destination logical address is the MAC of an electronic control unit ECU; the first device is used in a first virtual local area network VLAN through a first identifier, and the ECU is used in a second VLAN through a second identifier;
[0103] The updated first message is obtained according to the following method:
[0104] The central gateway obtains the IP address and the second identifier of the ECU according to the first destination logical address;
[0105] The first destination MAC is updated by using the MAC of the ECU, and the first destination IP is updated by using the IP of the ECU to obtain the updated first message.
[0106] In a possible implementation, the method further includes:
[0107] receiving an updated second message sent by the central gateway;
[0108] The second message is generated by the ECU according to the data to be processed; the second message includes the data to be received, the second destination logical address, the second destination physical address MAC and the second destination network address IP; the second destination logical address is the MAC of the first device, and the second destination IP is the internal IP of the central gateway;
[0109] The updated second message is obtained in the following manner:
[0110] The central gateway obtains the IP address and the first identifier of the first device according to the second destination logical address;
[0111] The central gateway updates the second destination MAC to the MAC of the first device, and updates the second destination IP to the external IP of the central gateway, to obtain an updated second message.
[0112] The present application also provides another data processing method. The data processing method is applied to ECU and specifically includes the following steps:
[0113] Receiving an updated first message sent by a central gateway; the central gateway is used in a first virtual local area network VLAN through a first identifier and in a second VLAN through a second identifier;
[0114] The first message includes data to be processed, a first destination logical address, a first destination physical address MAC, and a first destination network address IP; the first destination logical address is the MAC of the electronic control unit ECU, and the first destination IP is the external IP of the central gateway; the first device is used in the first VLAN through the first identifier, and the ECU is used in the second VLAN through the second identifier;
[0115] The updated first message is obtained by the central gateway in the following manner:
[0116] According to the first destination logical address, obtaining the IP address and the second identifier of the ECU;
[0117] Update the first destination MAC to the MAC of the ECU, and update the first destination IP to the internal IP of the central gateway to obtain an updated first message.
[0118] In a possible implementation, the method further includes:
[0119] Generate a second message according to the data to be processed in the first message; wherein the second message includes the data to be received, the second destination logical address, the second destination physical address MAC and the second destination network address IP; the second destination logical address is the MAC of the first device, and the second destination IP is the internal IP of the central gateway;
[0120] Sending a second message to the central gateway so that the central gateway sends the updated second message to the first device;
[0121] The updated second message is obtained in the following manner:
[0122] The central gateway obtains the IP address and the first identifier of the first device according to the second destination logical address;
[0123] The central gateway updates the second destination MAC to the MAC of the first device, and updates the second destination IP to the external IP of the central gateway, to obtain an updated second message.
[0124] An embodiment of the present application also provides a central gateway, which is used to execute the data processing method provided in the above embodiment.
[0125] An embodiment of the present application also provides a car, which includes the above-mentioned central gateway.
[0126] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the above-mentioned storage medium can be at least one of the following media: read-only memory (English: read-only memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store program codes.
[0127] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0128] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data processing method, characterized in that: Applied to a central gateway, the central gateway is used in a first virtual local area network VLAN through a first identifier and is used in a second VLAN through a second identifier, the central gateway is a vehicle-mounted central gateway of a vehicle, and the method includes: Receive a first message sent by a first device; the first message includes data to be processed, a first destination logical address, a first destination physical address MAC and a first destination network address IP; the first destination logical address is the MAC of an electronic control unit ECU, and the first destination IP is the external IP of the central gateway; the first device is used in the first VLAN through the first identifier, and the ECU is used in the second VLAN through the second identifier; the first device is an external device, the external device does not belong to the vehicle, and the ECU is the electronic control unit of the vehicle; the external IP is open to the outside, and the external IP is used to communicate with the external device; According to the first destination logical address, obtaining the IP address and the second identifier of the ECU; The first destination MAC is updated to be the MAC of the ECU, and the first destination IP is updated to be the internal IP of the central gateway, to obtain an updated first message; the internal IP is not open to the outside, and the internal IP is used to communicate with the ECU; Based on the second identifier, sending the updated first message to the ECU; receiving a second message sent by the ECU; the second message is generated by the ECU according to the data to be processed; the second message includes the data to be received, a second destination logical address, a second destination physical address MAC and a second destination network address IP; the second destination logical address is the MAC of the first device, and the second destination IP is the internal IP of the central gateway; According to the second destination logical address, obtain the IP address and the first identifier of the first device; Update the second destination MAC to the MAC of the first device, and update the second destination IP to the external IP of the central gateway, to obtain an updated second message; Based on the first identifier, the updated second message is sent to the first device.
2. The method according to claim 1, characterized in that The acquiring the IP address and the second identifier of the ECU according to the destination logical address comprises: According to the first destination logical address, the IP address and the second identifier of the ECU are obtained by searching the routing table.
3. The method according to claim 2, characterized in that The method further comprises: If the IP address and the second identifier of the ECU are not found, an exception handling message is generated.
4. The method according to claim 1, characterized in that: Before acquiring the IP address and the second identifier of the ECU according to the first destination logical address, the method further includes: Determining whether the first destination logical address is the MAC of the central gateway; If so, the data to be processed is processed by the central gateway.
5. The method according to claim 2, characterized in that: The method further comprises: Determine whether the routing table includes a first source logical address in the first message; wherein the first source logical address is used to identify the MAC of the first device; If not, store the first source logical address, the first source IP in the first message, and the first identifier in the routing table; wherein the first source IP is used to identify the IP of the first device.
6. A data processing method, characterized in that: The method is applied to a first device, the first device is an external device, and the external device does not belong to a vehicle. The method includes: Sending the first message to a central gateway so that the central gateway sends the updated first message to an electronic control unit ECU based on the second identifier; the central gateway is an on-board central gateway of the vehicle, and the ECU is an electronic control unit of the vehicle; The central gateway is used in the first virtual local area network VLAN through the first identifier, and is used in the second VLAN through the second identifier; the first message includes data to be processed, a first destination logical address, a first destination physical address MAC and a first destination network address IP; the first destination logical address is the MAC of the electronic control unit ECU, and the first destination IP is the external IP of the central gateway; the first device is used in the first virtual local area network VLAN through the first identifier, and the ECU is used in the second VLAN through the second identifier; the external IP is open to the outside, and the external IP is used to communicate with the external device; The updated first message is obtained according to the following method: The central gateway obtains the IP address and the second identifier of the ECU according to the first destination logical address; The first destination MAC is updated to be the MAC of the ECU, and the first destination IP is updated to be the internal IP of the central gateway, to obtain the updated first message; the internal IP is not open to the outside, and the internal IP is used to communicate with the ECU; Receiving an updated second message sent by the central gateway based on the first identifier; The updated second message is obtained according to the following method: The central gateway receives a second message sent by the ECU; the second message is generated by the ECU according to the data to be processed; the second message includes the data to be received, the second destination logical address, the second destination physical address MAC and the second destination network address IP; the second destination logical address is the MAC of the first device, and the second destination IP is the internal IP of the central gateway; The central gateway obtains the IP address and the first identifier of the first device according to the second destination logical address; The central gateway updates the second destination MAC to the MAC of the first device, and updates the second destination IP to the external IP of the central gateway, to obtain an updated second message.
7. A data processing method, characterized in that: The method is applied to an electronic control unit ECU, where the ECU is an electronic control unit of a vehicle, and the method comprises: Receiving an updated first message sent by a central gateway based on a second identifier; the central gateway is used in a first virtual local area network VLAN through the first identifier and is used in a second VLAN through the second identifier; the central gateway is an on-board central gateway of the vehicle, and the first message is sent by a first device to the central gateway; The first message includes data to be processed, a first destination logical address, a first destination physical address MAC and a first destination network address IP; the first destination logical address is the MAC of the electronic control unit ECU, and the first destination IP is the external IP of the central gateway; the first device is used in the first VLAN through the first identifier, and the ECU is used in the second VLAN through the second identifier; the first device is an external device, and the external device does not belong to the vehicle; the external IP is open to the outside, and the external IP is used to communicate with the external device; The updated first message is obtained by the central gateway in the following manner: According to the first destination logical address, obtaining the IP address and the second identifier of the ECU; The first destination MAC is updated to be the MAC of the ECU, and the first destination IP is updated to be the internal IP of the central gateway, to obtain an updated first message; the internal IP is not open to the outside, and the internal IP is used to communicate with the ECU; Generate a second message according to the data to be processed; the second message includes the data to be received, the second destination logical address, the second destination physical address MAC and the second destination network address IP; the second destination logical address is the MAC of the first device, and the second destination IP is the internal IP of the central gateway; The second message is sent to the central gateway so that the central gateway obtains the IP and the first identifier of the first device according to the second destination logical address, updates the second destination MAC to the MAC of the first device, and updates the second destination IP to the external IP of the central gateway, obtains the updated second message, and based on the first identifier, sends the updated second message to the first device.
8. A central gateway, characterized in that: The central gateway is used to execute the method described in any one of claims 1-5.
9. A car, characterized in that: The car comprises the central gateway of claim 8.
Citation Information
Patent Citations
Media gateway equipment and method for forwarding data frame
CN102104525A
Network system and communication apparatuses
CN104604186A
Network switch
CN110574344A
On-board communication system, switching device, verification method, and verification program
CN111788796A
Data transmitting method and apparatus based on virtual LAN
CN1905528A
