Message forwarding method, device, equipment and vehicle
By receiving network segment data service instructions of diagnostic equipment in commercial vehicles, turning on the routing mirroring function and forwarding messages, the problem of quickly obtaining vehicle network message data is solved, and effective positioning analysis of vehicle network routing abnormalities is realized.
Patent Information
- Application Number
- CN202411821741.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-25
AI Technical Summary
The prior art is difficult to quickly obtain commercial vehicle network message data, resulting in the problem of inability to effectively locate vehicle network routing abnormalities.
By receiving network segment data service instructions sent by the diagnostic device, the routing mirroring function of the vehicle target network segment is enabled, and the target network segment packets are mirrored to forward to the diagnostic device using the Ethernet diagnostic port.
It realizes the rapid acquisition of vehicle target network packets, which facilitates subsequent positioning and analysis of vehicle network routing abnormalities.
Smart Images

Figure CN119697293A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle technology, and in particular to a message forwarding method, device, equipment and vehicle. Background Art
[0002] Commercial vehicles often have dozens to hundreds of controllers. When a commercial vehicle has functional anomalies or network routing problems, it is necessary to analyze the signals between the vehicle's controllers to locate the problem. The existing solution is to use diagnostic equipment, or to test the OBD port during the commercial vehicle development phase to obtain messages from a certain controller network segment to troubleshoot the fault.
[0003] However, diagnostic equipment can only read fault codes, but cannot clearly identify the cause of the fault and cannot effectively locate the root cause of the problem. The test OBD port is used to troubleshoot faults during the commercial vehicle R&D stage, but when the vehicle is tested or mass-produced, the test OBD port will be cancelled due to information security requirements. At this time, it is impossible to troubleshoot faults through the test OBD port.
[0004] Based on the above content, how to quickly obtain vehicle network message data is an urgent problem to be solved.
[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0006] The main purpose of this application is to provide a message forwarding method, device, equipment and vehicle, aiming to solve the technical problem of how to quickly obtain vehicle network message data.
[0007] To achieve the above object, the present application proposes a message forwarding method, which is applied to a vehicle and includes:
[0008] Receive the network segment data service instruction sent by the diagnostic device;
[0009] According to the network segment data service instruction, the routing mirroring function of the vehicle target network segment is turned on, and the target network segment message mirror is forwarded to the diagnostic device through the Ethernet diagnostic port.
[0010] In one embodiment, the network segment data service instruction is an Ethernet switch port mirroring instruction, the vehicle includes a gateway controller, and the step of enabling the routing mirroring function of the target network segment of the vehicle according to the network segment data service instruction and forwarding the target network segment message mirror to the diagnostic device through the Ethernet diagnostic port includes:
[0011] The data export and data import of several Ethernet mirror source ports are configured by the gateway controller;
[0012] The data outlet and the data inlet are respectively connected to an external Ethernet diagnostic port through the gateway controller to obtain a pre-mirrored configured Ethernet diagnostic port.
[0013] In one embodiment, before the step of receiving the network segment data service instruction sent by the diagnostic device, the step further includes:
[0014] Receiving a security authentication instruction sent by the diagnostic device;
[0015] According to the security authentication instruction, sending a security key seed to the diagnostic device to perform security authentication on the diagnostic device;
[0016] Receiving a first security key sent by the diagnostic device, wherein the first security key is calculated by the diagnostic device based on a preset encryption algorithm and the security key seed;
[0017] When the first security key is consistent with the second security key, an affirmative response message is sent to the diagnostic device to open the data access permission of the diagnostic device, wherein the second security key is calculated by the vehicle based on a preset encryption algorithm and the security key seed before sending the security key seed.
[0018] In one embodiment, the step of enabling the routing mirroring function of the target network segment of the vehicle according to the network segment data service instruction and forwarding the target network segment message mirror to the diagnostic device through the Ethernet diagnostic port includes:
[0019] Determining whether to start a routine service according to a routine control state identifier in the network segment data service instruction, wherein the routine service includes a CAN-ETH mirror service and an Ethernet switch port mirror service;
[0020] When the routine control state flag is an on flag, determining a target network segment according to the network segment data service instruction;
[0021] The CAN message data of the target network segment is acquired by mirroring, and the CAN message data of the target network segment is forwarded to the diagnostic device through the Ethernet diagnostic port.
[0022] In one embodiment, when the routine control state flag is an on flag, the step of determining the target network segment according to the network segment data service instruction includes:
[0023] When the routine control state flag is an on flag, determining whether there are multiple target network segments according to the instruction valid byte flag in the network segment data service instruction;
[0024] When there are multiple target network segments, the CAN message data of the target network segments are obtained by mirroring, and the CAN message data of the target network segments are forwarded to the diagnostic device one by one through the Ethernet diagnostic port according to the preset priority forwarding level.
[0025] In one embodiment, the method further comprises:
[0026] When receiving a plurality of network segment data service instructions, determining the diagnostic priority ranking of the network segment data service instructions based on the diagnostic priority arbitration mechanism;
[0027] According to the diagnosis priority sorting, the network segment data service instruction is responded to and processed.
[0028] In one embodiment, the method further comprises:
[0029] Determine the corresponding diagnostic scenario and diagnostic communication channel according to the network segment data service instruction;
[0030] When the diagnostic scenarios of multiple network segment data service instructions are of the same priority, the network segment data service instructions are processed preferentially based on the first-come-first-served principle;
[0031] When multiple network segment data service instructions belong to different diagnostic communication channels in the same diagnostic scenario, the network segment data service instructions are processed preferentially based on the first-come-first-served principle.
[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes a message forwarding device, which includes:
[0033] A receiving module, used for receiving a network segment data service instruction sent by a diagnostic device;
[0034] The message forwarding module is used to enable the routing mirroring function of the vehicle target network segment according to the network segment data service instruction, and forward the target network segment message mirror to the diagnostic device through the Ethernet diagnostic port.
[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a message forwarding device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the message forwarding method described above.
[0036] In addition, to achieve the above-mentioned purpose, the present application also proposes a vehicle, which includes the message forwarding device as described above.
[0037] One or more technical solutions proposed in this application have at least the following technical effects:
[0038] The message forwarding method, apparatus, device and vehicle proposed in the embodiments of the present application specifically receive a network segment data service instruction sent by a diagnostic device; according to the network segment data service instruction, the routing mirroring function of the vehicle's target network segment is enabled, and the target network segment message mirror is forwarded to the diagnostic device through the Ethernet diagnostic port.
[0039] The present application receives the network segment data service instruction sent by the diagnostic device, and the network segment data service instruction is used to obtain the message data of the vehicle's target network segment; then the vehicle turns on the routing mirroring function of the corresponding vehicle target network segment according to the network segment data service instruction, mirrors the message data of the vehicle's target network segment to the Ethernet diagnostic port, and forwards the message data to the diagnostic device through the Ethernet diagnostic port, thereby realizing rapid acquisition of the message of the vehicle's target network segment, so as to further locate and analyze the vehicle network routing anomaly based on the message data. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0041] 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0042] Figure 1 A flowchart of the first embodiment of the message forwarding method of the present application is provided;
[0043] Figure 2 A flowchart of the second embodiment of the message forwarding method of the present application is provided;
[0044] Figure 3 A flowchart of the third embodiment of the message forwarding method of the present application is provided;
[0045] Figure 4 A flowchart of the fourth embodiment of the message forwarding method of the present application is provided;
[0046] Figure 5 This is a schematic diagram of the module structure of the message forwarding device according to an embodiment of the present application;
[0047] Figure 6 A schematic diagram of the device structure of the hardware operating environment involved in the message forwarding method in the embodiment of the present application;
[0048] Figure 7 This is an example diagram of implementing the mirroring function of an Ethernet diagnostic port involved in an embodiment of the present application.
[0049] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0050] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0051] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0052] The main solution of the embodiment of the present application is: receiving the network segment data service instruction sent by the diagnostic device; according to the network segment data service instruction, turning on the routing mirroring function of the vehicle target network segment, and forwarding the target network segment message mirror to the diagnostic device through the Ethernet diagnostic port.
[0053] Technical terms involved in the embodiments of this application:
[0054] CAN (Controller Area Network): CAN is a serial communication protocol, mainly used to achieve distributed control in the fields of industrial automation, automotive electrical systems, etc. CAN adopts a bus topology, supports multi-master mode, has the characteristics of strong real-time performance, high reliability, and strong flexibility, and is widely used in automotive electronics, industrial automation and other fields.
[0055] ETH (Ethernet): Ethernet is a commonly used wired LAN technology that uses the CSMA / CD protocol for data transmission and collision detection. It uses twisted pair or optical fiber as the physical transmission medium and supports high-speed data transmission. Common rates include 10Mbps, 100Mbps, 1Gbps, etc. Ethernet has the advantages of high reliability, ease of use and good cost-effectiveness. It is widely used in enterprise networks, data centers, home networks and other fields. It is an important technical foundation for modern network communications.
[0056] UDS (Unified Diagnostic Services) service: Unified diagnostic service, is a standardized automotive diagnostic communication protocol. UDS service is based on the ISO 14229 standard, which defines a strict security access control mechanism. UDS service is widely used in the communication between modern automotive electronic control units (ECU) and diagnostic test equipment. UDS service provides a set of standardized diagnostic service processes, including reading fault codes, reading data streams, clearing fault codes, etc. These services have their own independent ID (SID) for easy identification. Through the UDS protocol, diagnostic equipment can communicate efficiently with the vehicle ECU to quickly locate and repair vehicle faults.
[0057] ECU (Electronic Control Unit): ECU is an important component of modern cars. It is like the "brain" of the car, responsible for managing and controlling the various electronic systems of the car. ECU receives signals from various sensors, processes data and makes decisions, and then sends instructions to actuators to achieve precise control of various systems of the car.
[0058] Commercial vehicles often have dozens to hundreds of controllers. When a commercial vehicle has functional anomalies or network routing problems, it is necessary to analyze the signals between the vehicle's controllers to locate the problem. The existing solution is to use diagnostic equipment, or to test the OBD port during the commercial vehicle development phase to obtain messages from a certain controller network segment to troubleshoot the fault.
[0059] However, diagnostic equipment can only read fault codes, but cannot clearly identify the cause of the fault and cannot effectively locate the root cause of the problem. The test OBD port is used to troubleshoot faults during the commercial vehicle R&D stage, but when the vehicle is tested or mass-produced, the test OBD port will be cancelled due to information security requirements. At this time, it is impossible to troubleshoot faults through the test OBD port.
[0060] From the above analysis, it can be seen that how to quickly obtain vehicle network message data is an urgent problem to be solved.
[0061] The present application provides a solution, which receives a network segment data service instruction sent by a diagnostic device, and the network segment data service instruction is used to obtain the message data of the vehicle's target network segment; then the vehicle turns on the routing mirroring function of the corresponding vehicle target network segment according to the network segment data service instruction, mirrors the message data of the vehicle's target network segment to the Ethernet diagnostic port, and forwards the message data to the diagnostic device through the Ethernet diagnostic port, thereby realizing rapid acquisition of the message of the vehicle's target network segment, so as to further locate and analyze the vehicle network routing anomaly based on the message data.
[0062] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a message forwarding device capable of realizing the above functions, etc. The following takes the message forwarding device as an example to illustrate this embodiment and the following embodiments.
[0063] Based on this, the embodiment of the present application provides a message forwarding method, which is applied to a vehicle, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the message forwarding method of the present application.
[0064] In this embodiment, the method is applied to a vehicle, and the message forwarding method includes steps S110 to S120:
[0065] Step S110, receiving a network segment data service instruction sent by a diagnostic device;
[0066] Step S120, according to the network segment data service instruction, the routing mirroring function of the vehicle target network segment is enabled, and the target network segment message mirror is forwarded to the diagnostic device through the Ethernet diagnostic port.
[0067] Specifically, in this embodiment, the message forwarding device is connected to the vehicle standard diagnostic port through the UDS service. First, the message forwarding device needs to receive the network segment data service instruction sent by the diagnostic device, and then determine the target network segment included in the network segment data service instruction according to the diagnostic standard of the UDS service, and confirm whether to open the routine service of the routing mirror according to the routine control status identifier.
[0068] When the routine service of the routing mirror of the vehicle target network segment is turned on, the message data of the vehicle target network segment is mirrored to the Ethernet diagnostic port, and the message data is forwarded to the diagnostic device through the Ethernet diagnostic port, thereby realizing the rapid acquisition of the message of the vehicle target network segment.
[0069] Among them, the vehicle standard diagnostic port is often the OBD-II port, which provides a standardized 16-pin diagnostic interface and a unified communication protocol (such as SAE J1939, ISO 15765, etc.), so that diagnostic equipment between different brands and models can be compatible with each other. The segment data service instruction is used to instruct the vehicle ECU to turn on the routing mirror function of the target segment, and is used to mirror the message data of the target segment and send it to the vehicle standard diagnostic port. According to the UDS service, the segment data service instruction is usually an eight-byte instruction, in which the first byte is used to identify the valid bytes in the segment data service instruction, the second byte represents 31 routine services, the third byte represents the sub-function item of 31 routines, that is, the routine control state identifier, the fourth byte and the fifth byte are used to identify the routing mirror service routine, and the sixth byte, the seventh byte and the eighth byte are used to identify the target segment.
[0070] Furthermore, in order to comply with the security access control mechanism of the UDS service, it is necessary to unlock the access rights of the diagnostic device in advance. Therefore, before the above step S110, steps A01 to A04 are also included:
[0071] Step A01, receiving a security authentication instruction sent by the diagnostic device;
[0072] Step A02, according to the security authentication instruction, sending a security key seed to the diagnostic device to perform security authentication on the diagnostic device;
[0073] Step A03, receiving a first security key sent by the diagnostic device, wherein the first security key is calculated by the diagnostic device based on a preset encryption algorithm and the security key seed;
[0074] Specifically, the diagnostic device is first connected to the vehicle ECU through the vehicle standard diagnostic port, and then enters the diagnostic session mode through the diagnostic session control service, such as entering the default session through instruction 10 01, or entering the extended session through instruction 10 03. Then, the message forwarding device receives the security authentication instruction sent by the diagnostic device, thereby performing security authentication of the diagnostic device.
[0075] The message forwarding device needs to send a security key seed to the diagnostic device according to the security authentication instruction sent by the diagnostic device. The diagnostic device needs to use a preset encryption algorithm to calculate the security key seed to obtain a first security key, and send the first security key to the message forwarding device.
[0076] The first security key is then compared with a second security key calculated by the message forwarding device according to a preset encryption algorithm and a security key seed, and based on the comparison result, it is confirmed whether the diagnostic device has the authority to securely access the vehicle.
[0077] Step A04, when the first security key is consistent with the second security key, send an affirmative response message to the diagnostic device to open the data access rights of the diagnostic device, wherein the second security key is calculated by the vehicle based on a preset encryption algorithm and the security key seed before sending the security key seed.
[0078] Specifically, when the first security key is compared to the second security key and is consistent, the message forwarding device sends a positive response message to the diagnostic device, opens the data access permission of the diagnostic device, and enables the diagnostic device to interact with the vehicle ECU and access the vehicle ECU data. It should be understood that the data access permission of the diagnostic device should be closed by default.
[0079] For example, in this embodiment, the security authentication for the diagnostic device is Level 1 security authentication. The diagnostic device sends a security authentication instruction (e.g., 27 01) to the message forwarding device, and then the message forwarding device replies with an affirmative response (e.g., 6701 XX XX), and then the diagnostic device replies to the message forwarding device (e.g., 27 02 XX XX), and the message forwarding device replies with an affirmative response (e.g., 67 02), which means that the Level 1 security authentication of the diagnostic device is passed, and the data access permission of the diagnostic device can be opened.
[0080] It should be understood that in order to monitor the message data of the vehicle target network segment in real time, a session maintenance control instruction (such as 3E 80) can be sent by the diagnostic device to keep the session between the diagnostic device and the vehicle in a long-term maintenance state.
[0081] This embodiment provides a message forwarding method, which receives a network segment data service instruction sent by a diagnostic device; according to the network segment data service instruction, the routing mirroring function of the vehicle target network segment is enabled, and the target network segment message mirror is forwarded to the diagnostic device through the Ethernet diagnostic port.
[0082] The present application receives the network segment data service instruction sent by the diagnostic device, and the network segment data service instruction is used to obtain the message data of the vehicle's target network segment; then the vehicle turns on the routing mirroring function of the corresponding vehicle target network segment according to the network segment data service instruction, mirrors the message data of the vehicle's target network segment to the Ethernet diagnostic port, and forwards the message data to the diagnostic device through the Ethernet diagnostic port, thereby realizing rapid acquisition of the message of the vehicle's target network segment, so as to further locate and analyze the vehicle network routing anomaly based on the message data.
[0083] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and no further description will be given later. On this basis, the network segment data service instruction is an Ethernet switch port mirroring instruction, and the vehicle includes a gateway controller, please refer to Figure 2 , before the above step S120, it also includes steps S210 to S220:
[0084] Step S210, configuring data exports and data imports of several Ethernet mirror source ports through the gateway controller;
[0085] Step S220: Connect the data outlet and the data inlet to an external Ethernet diagnostic port respectively through the gateway controller to obtain a pre-mirrored Ethernet diagnostic port.
[0086] Specifically, refer to Figure 7 The figure shows an example of the implementation of the mirroring function of an Ethernet diagnostic port. The internal communication of vehicle Ethernet is usually based on multiple Ethernet switches for data exchange and communication. First, the message forwarding device needs to configure the mirroring function of each port of the Ethernet switch associated with the vehicle target network segment in advance according to the message acquisition requirements of the vehicle target network segment. In order to distinguish different types of data streams, each port ( Figure 7 In the gateway controller, the data inlet and the data outlet are distinguished by port1, port2, etc., where data inlet refers to data transmitted from the port to the gateway controller; data outlet refers to data sent from the port (including forwarded data) to other ports. It should be understood that because the amount of CAN data in the vehicle target network segment is limited, the ports of the Ethernet switches associated with the commonly used or common vehicle target network segments can be pre-configured for mirroring functions, such as the power domain controller, power battery exchange module controller, body driving domain controller, body chassis domain controller and other related network segments.
[0087] Finally, when the message forwarding device needs to mirror the internal Ethernet data to the external diagnostic Ethernet, it can select the mirror channel data according to the required network segment data and pre-configure the inlet or outlet of the mirror port. Figure 7 The path [1][3][5] shown in the figure mirrors the data sent from the gateway controller port to the external Ethernet diagnostic port; Figure 7 The [2][4][6] path shown mirrors data incoming to the Gateway Controller port to the external Ethernet diagnostic port.
[0088] The present embodiment provides a message forwarding method, which receives a network segment data service instruction sent by a diagnostic device; configures the data export and data import of several Ethernet mirror source ports through the gateway controller; connects the data export and data import to an external Ethernet diagnostic port through the gateway controller to obtain a pre-mirrored Ethernet diagnostic port; according to the network segment data service instruction, turns on the routing mirroring function of the vehicle target network segment, and forwards the target network segment message mirror to the diagnostic device through the Ethernet diagnostic port.
[0089] Through the above scheme, this embodiment configures the data export and data import of several Ethernet mirror source ports through the gateway controller, and then connects the data export and data import to the external Ethernet diagnostic port respectively to obtain a pre-mirrored Ethernet diagnostic port, so that the pre-mirrored Ethernet diagnostic port can be used to forward the message data to the diagnostic device, thereby realizing the rapid acquisition of the message of the vehicle target network segment, so as to further perform the positioning analysis of the vehicle network routing anomaly based on the message data.
[0090] Based on the first embodiment and / or the second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first embodiment and / or the second embodiment can refer to the above description, and will not be described in detail later. Figure 3 , the step S120 includes steps S310 to S330:
[0091] Step S310, judging whether to start the routine service according to the routine control state identifier in the network segment data service instruction, wherein the routine service includes a CAN-ETH mirror service and an Ethernet switch port mirror service;
[0092] Step S320, when the routine control state flag is an on flag, determining a target network segment according to the network segment data service instruction;
[0093] Specifically, the second byte in the network segment data service instruction represents 31 routine services, and the third byte represents the sub-function item of 31 routines, wherein the third byte is a routine control state identifier.
[0094] In the UDS service, the sub-function items of routine 31 include 01, 02 and 03. Among them, 31 01 represents the start routine, 3102 represents the stop routine, and 31 03 represents the request routine result. The fourth and fifth bytes in the network segment data service instruction are used to set the routing mirror service routine.
[0095] Regardless of whether the routine service is the CAN-ETH mirror service or the Ethernet switch port mirror service, the message forwarding device needs to obtain the routine control status identifier in the network segment data service instruction, that is, the third byte, to determine whether to start the routine service.
[0096] If and only if the routine control state flag is the enable flag, that is, the third byte in the network segment data service instruction is 01, the message forwarding device will determine the target network segment according to the sixth, seventh, and eighth bytes in the network segment data service instruction, and enable the routing mirroring function of the target network segment.
[0097] It should be noted that when the routine service is a CAN-ETH mirror service, the two bytes F1 and F4 can be used to represent the function of mirroring CAN bus data to the Ethernet diagnostic port.
[0098] When the routine service is an Ethernet switch port mirroring service, two bytes F1 and F5 can be defined to represent the function of mirroring CAN bus data to the Ethernet switch port.
[0099] It should be understood that the fourth byte and the fifth byte in the network segment data service instruction are usually routine identifiers customized by the diagnostic party, and this application does not limit the specific data of the fourth byte and the fifth byte.
[0100] In a feasible implementation manner, the step S320 may include steps B01 to B02:
[0101] Step B01, when the routine control state flag is an on flag, determining whether there are multiple target network segments according to the instruction valid byte flag in the network segment data service instruction;
[0102] Specifically, when the routine control state flag is the on flag, the message forwarding device can determine the valid bytes of the network segment data service instruction according to the first byte in the network segment data service instruction. Because only the sixth, seventh, and eighth bytes in the network segment data service instruction identify the target network segment, when the instruction valid byte flag is 06, it means that the valid bytes of the network segment data service instruction are only 6 bytes, and at this time there is only one target network segment.
[0103] When the instruction valid bytes indicated by the instruction valid byte identifier exceed 6 bytes, such as 07, 08, etc., there are multiple target network segments. In addition, a certain byte code can also be specified to represent all CAN network segments of the vehicle.
[0104] Step B02, when there are multiple target network segments, the CAN message data of the target network segment is obtained by mirroring, and the CAN message data of the target network segment is forwarded to the diagnostic device one by one through the Ethernet diagnostic port according to the preset priority forwarding level.
[0105] Then, the message forwarding device uses the gateway controller to monitor the CAN message data on multiple target network segments, and mirrors and copies the CAN message data to store it in the gateway controller. Then, according to the preset priority, the CAN message data of multiple target network segments are forwarded to the diagnostic device in turn.
[0106] Among them, the preset priority forwarding level is a message priority forwarding level pre-set by relevant personnel according to the safety level or functional importance of signals from different controllers of the vehicle.
[0107] Step S330, mirroring to obtain the CAN message data of the target network segment, and forwarding the CAN message data of the target network segment to the diagnostic device through the Ethernet diagnostic port.
[0108] Finally, after obtaining the target network segment, the message forwarding device turns on the routing mirroring function of the target network segment according to the CAN-ETH mirroring service and the Ethernet switch port mirroring service. According to the network segment data service instruction, the message data on the CAN bus corresponding to the target network segment is obtained by mirroring, and finally the CAN message data is forwarded to the diagnostic device through the Ethernet diagnostic port.
[0109] Among them, the CAN bus corresponding to the target network segment can be customized by relevant personnel, for example, the power domain controller network segment corresponds to the network segment CAN1 FD, the power battery exchange module controller network segment corresponds to the network segment CAN2 FD, and the body driving domain controller network segment corresponds to the network segment CAN3 FD.
[0110] It should be noted that CAN FD is developed based on CAN and can meet the needs of higher data transmission rates and larger data volumes.
[0111] For example, the diagnostic device sends 10 03 to enter the diagnostic extended session mode. After the diagnostic device receives 50 03 replied by the message forwarding device, it periodically (such as every 50ms) sends an online instruction 3E 80 to maintain the diagnostic extended session mode. When obtaining the power network segment message, the diagnostic device sends an access request 27 01. After the message forwarding device replies 67 01 XX XXXX XX XX XX (key seed), the diagnostic device sends 27 02 XX XX XX XX XX XX according to the key seed. When the first security key is consistent with the key generated inside the message forwarding device, the message forwarding device replies 67 02 to unlock the access rights of the diagnostic device. The diagnostic device sends 05 31 01 F1 F4 75 0000 to the message forwarding device through the UDS diagnostic port, and the message forwarding device replies 05 71 01 F1 F4 75 00 00, indicating that the message forwarding device has turned on the power segment mirroring function. The diagnostic device needs to send 03 22 74 03 00 00 00 00 at a cycle of 50ms to normally record the power segment message. When the mirroring function needs to be exited, the diagnostic device sends 04 31 02 F1 F4 00 00 00 through the UDS diagnostic CAN to turn it off.
[0112] The present embodiment provides a message forwarding method, which receives a network segment data service instruction sent by a diagnostic device; determines whether to enable a routine service according to a routine control status identifier in the network segment data service instruction, wherein the routine service includes a CAN-ETH mirror service and an Ethernet switch port mirror service; when the routine control status identifier is an enable identifier, determines a target network segment according to the network segment data service instruction; obtains CAN message data of the target network segment by mirroring, and forwards the CAN message data of the target network segment to the diagnostic device through an Ethernet diagnostic port.
[0113] Through the above scheme, this embodiment determines whether to turn on the routine service according to the routine control status flag in the network segment data service instruction, and then when the routine control status flag is the on flag, determines the target network segment, then obtains the CAN message data of the target network segment by mirroring, and forwards the message data to the diagnostic device through the Ethernet diagnostic port, thereby realizing the rapid acquisition of the message of the vehicle target network segment, so as to further locate and analyze the abnormality of the vehicle network routing according to the message data.
[0114] Based on the third embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the third embodiment can be referred to the above description, and will not be described in detail later. Figure 4 The method further comprises steps S410 to S420:
[0115] Step S410, when receiving a plurality of network segment data service instructions, determining the diagnostic priority ranking of the network segment data service instructions based on the diagnostic priority arbitration mechanism;
[0116] Step S420: respond to the network segment data service instruction according to the diagnosis priority sorting.
[0117] It should be noted that the diagnostic priority arbitration mechanism refers to the priority judgment method and rules of diagnostic instructions pre-set by relevant personnel, which are used to confirm and sort the diagnostic priorities of multiple network segment data service instructions.
[0118] Specifically, when the message forwarding device receives several network segment data service instructions from different diagnostic devices, it first needs to check the diagnostic device from which the network segment data service instructions come, so as to further determine the diagnostic scenario corresponding to the network segment data service instructions, such as external diagnostic equipment, OTA, remote diagnosis, and on-board diagnostic instrument. Then, combined with the diagnostic priority arbitration mechanism, the diagnostic priority ranking of the network segment data service instructions is determined according to the diagnostic scenario corresponding to the network segment data service instructions.
[0119] In this embodiment, the diagnosis priority arbitration mechanism may be the priority of the diagnosis scenario, and the priority of the diagnosis scenario is defined as follows:
[0120] External diagnostics = OTA > Remote diagnostics > On-board diagnostics
[0121] Finally, according to the diagnostic priority, the response processing is carried out one by one starting from the network segment data service instruction with the highest priority.
[0122] Further, when the message forwarding device receives a high-priority network segment data service instruction during processing of a low-priority network segment data service instruction, the gateway controller stops forwarding the relevant message data of the low-priority network segment data service instruction and delays for a certain time (in millimeters), during which the last response message route of the low-priority network segment data service instruction is maintained. After a certain time (in millimeters), the gateway controller stops responding to the low-priority network segment data service instruction and starts responding to the high-priority network segment data service instruction. Among them, the certain time is set by the relevant personnel themselves, and this application does not make specific restrictions here.
[0123] Furthermore, because the diagnosis scenarios may have the same priority, or the diagnosis communication channels in the same diagnosis scenario may be different, resulting in a conflict in diagnosis requirements, the method further includes steps C01 to C03:
[0124] Step C01, determining a corresponding diagnostic scenario and a diagnostic communication channel according to the network segment data service instruction;
[0125] Step C02, when the diagnosis scenarios of multiple network segment data service instructions are of the same priority, the network segment data service instructions are processed preferentially based on the first-come-first-served principle;
[0126] Step C03: when multiple network segment data service instructions belong to different diagnostic communication channels in the same diagnostic scenario, the network segment data service instructions are processed preferentially based on the first-come-first-served principle.
[0127] It should be understood that the same diagnostic port has two communication channels, CAN and ETH, and the network segment data service instruction can also be a CAN-CAN mirror routing service instruction, which is achieved by mirroring a certain CAN communication channel or communication port to obtain the CAN message data of the target network segment, and sending the CAN message data to the disputed device.
[0128] First, the message forwarding device needs to determine the diagnostic scenario and diagnostic communication channel corresponding to the network segment data service instruction based on the sender, network transmission path, network protocol, etc. of the network segment data service instruction.
[0129] When there are multiple network segment data service instructions with the same priority in the diagnosis scenario, that is, when the network segment data service instructions with the same priority conflict, the message forwarding device selects the earliest received network segment data service instruction for priority processing based on the first-come-first-served principle and the reception time of the network segment data service instruction.
[0130] When there are multiple network segment data service instructions belonging to different diagnostic communication channels in the same diagnostic scenario, that is, when there is a CAN and ETH channel conflict for the network segment data service instructions in the same diagnostic scenario, the network segment data service instructions include CAN-CAN mirror routing service instructions, and at least one of the CAN-ETH mirror service instructions and the Ethernet switch port mirror service instructions.
[0131] The message forwarding device selects the earliest received network segment data service instruction for priority processing based on the first-come-first-served principle and the time when the network segment data service instruction is received.
[0132] The present embodiment provides a message forwarding method, which receives a network segment data service instruction sent by a diagnostic device; according to the network segment data service instruction, enables the routing mirroring function of the target network segment of the vehicle, and forwards the target network segment message mirror to the diagnostic device through the Ethernet diagnostic port; when several network segment data service instructions are received, determines the diagnostic priority ranking of the network segment data service instructions based on a diagnostic priority arbitration mechanism; and responds to the network segment data service instructions according to the diagnostic priority ranking.
[0133] Through the above scheme, the diagnostic priority arbitration mechanism of this embodiment confirms the diagnostic priority ranking of several network segment data service instructions, and then responds to the network segment data service instructions according to the diagnostic priority ranking, which can solve the conflict processing of network segment data service instructions from different communication channels in different diagnostic scenarios.
[0134] This application also provides a message forwarding device, please refer to Figure 5 , the message forwarding device comprises:
[0135] The receiving module 10 is used to receive the network segment data service instruction sent by the diagnostic device;
[0136] The message forwarding module 20 is used to enable the routing mirroring function of the vehicle target network segment according to the network segment data service instruction, and forward the target network segment message mirror to the diagnostic device through the Ethernet diagnostic port.
[0137] The message forwarding device provided by the present application adopts the message forwarding method in the above embodiment, which can solve the technical problem of how to quickly obtain vehicle network message data. Compared with the prior art, the beneficial effects of the message forwarding device provided by the present application are the same as the beneficial effects of the message forwarding method provided by the above embodiment, and the other technical features in the message forwarding device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0138] The present application provides a message forwarding device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the message forwarding method in the above-mentioned implementation example.
[0139] Reference below Figure 6 , which shows a schematic diagram of the structure of a message forwarding device suitable for implementing the embodiment of the present application. The message forwarding device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The message forwarding device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0140] like Figure 6As shown, the message forwarding device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the message forwarding device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the message forwarding device to communicate with other devices wirelessly or wired to exchange data. Although the figure shows a message forwarding device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided alternatively.
[0141] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0142] The message forwarding device provided by the present application adopts the message forwarding method in the above embodiment, which can solve the technical problem of how to quickly obtain vehicle network message data. Compared with the prior art, the beneficial effects of the message forwarding device provided by the present application are the same as the beneficial effects of the message forwarding method provided by the above embodiment, and the other technical features in the message forwarding device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0143] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0144] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which 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.
[0145] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the message forwarding method in the above-mentioned embodiment.
[0146] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0147] The computer-readable storage medium may be included in the message forwarding device; or may exist independently without being assembled into the message forwarding device.
[0148] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the message forwarding device, the message forwarding device: receives the network segment data service instruction sent by the diagnostic device; according to the network segment data service instruction, turns on the routing mirroring function of the vehicle target network segment, and forwards the target network segment message mirror to the diagnostic device through the Ethernet diagnostic port.
[0149] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0150] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0151] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0152] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned message forwarding method, and can solve the technical problem of how to quickly obtain vehicle network message data. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the message forwarding method provided by the above-mentioned embodiment, and will not be repeated here.
[0153] An embodiment of the present application provides a computer program product, including a computer program, which implements the steps of the above-mentioned message forwarding method when executed by a processor.
[0154] The computer program product provided by this application can solve the technical problem of how to quickly obtain vehicle network message data. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of this application are the same as the beneficial effects of the message forwarding method provided by the above embodiment, which will not be repeated here.
[0155] An embodiment of the present application provides a vehicle, comprising a message forwarding device as provided in the above embodiment.
[0156] The vehicle provided by the present application can solve the technical problem of how to quickly obtain vehicle network message data. Compared with the prior art, the beneficial effects of the vehicle provided by the embodiment of the present application are the same as the beneficial effects of the message forwarding method provided by the above embodiment, which will not be repeated here.
[0157] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.
Claims
1. A message forwarding method, characterized in that: The method is applied to a vehicle, and comprises: Receive the network segment data service instruction sent by the diagnostic device; According to the network segment data service instruction, the routing mirroring function of the vehicle target network segment is turned on, and the target network segment message mirror is forwarded to the diagnostic device through the Ethernet diagnostic port.
2. The method according to claim 1, characterized in that The network segment data service instruction is an Ethernet switch port mirroring instruction, the vehicle includes a gateway controller, and the step of enabling the routing mirroring function of the target network segment of the vehicle according to the network segment data service instruction and forwarding the target network segment message mirror to the diagnostic device through the Ethernet diagnostic port includes: The data export and data import of several Ethernet mirror source ports are configured by the gateway controller; The data outlet and the data inlet are respectively connected to an external Ethernet diagnostic port through the gateway controller to obtain a pre-mirrored configured Ethernet diagnostic port.
3. The method according to claim 1, characterized in that Before the step of receiving the network segment data service instruction sent by the diagnostic device, the method further includes: Receiving a security authentication instruction sent by the diagnostic device; According to the security authentication instruction, sending a security key seed to the diagnostic device to perform security authentication on the diagnostic device; Receiving a first security key sent by the diagnostic device, wherein the first security key is calculated by the diagnostic device based on a preset encryption algorithm and the security key seed; When the first security key is consistent with the second security key, an affirmative response message is sent to the diagnostic device to open the data access permission of the diagnostic device, wherein the second security key is calculated by the vehicle based on a preset encryption algorithm and the security key seed before sending the security key seed.
4. The method according to claim 3, characterized in that: The step of enabling the routing mirroring function of the target network segment of the vehicle according to the network segment data service instruction and forwarding the target network segment message mirror to the diagnostic device through the Ethernet diagnostic port includes: Determining whether to start a routine service according to a routine control state identifier in the network segment data service instruction, wherein the routine service includes a CAN-ETH mirror service and an Ethernet switch port mirror service; When the routine control state flag is an on flag, determining a target network segment according to the network segment data service instruction; The CAN message data of the target network segment is acquired by mirroring, and the CAN message data of the target network segment is forwarded to the diagnostic device through the Ethernet diagnostic port.
5. The method according to claim 4, characterized in that The step of determining the target network segment according to the network segment data service instruction when the routine control state flag is an on flag includes: When the routine control state flag is an on flag, determining whether there are multiple target network segments according to the instruction valid byte flag in the network segment data service instruction; When there are multiple target network segments, the CAN message data of the target network segments are obtained by mirroring, and the CAN message data of the target network segments are forwarded to the diagnostic device one by one through the Ethernet diagnostic port according to the preset priority forwarding level.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: When receiving a plurality of network segment data service instructions, determining the diagnostic priority ranking of the network segment data service instructions based on the diagnostic priority arbitration mechanism; According to the diagnosis priority sorting, the network segment data service instruction is responded to and processed.
7. The method according to claim 6, characterized in that The method further comprises: Determine the corresponding diagnostic scenario and diagnostic communication channel according to the network segment data service instruction; When the diagnostic scenarios of multiple network segment data service instructions are of the same priority, the network segment data service instructions are processed preferentially based on the first-come-first-served principle; When multiple network segment data service instructions belong to different diagnostic communication channels in the same diagnostic scenario, the network segment data service instructions are processed preferentially based on the first-come-first-served principle.
8. A message forwarding device, characterized in that: The message forwarding device comprises: A receiving module, used for receiving a network segment data service instruction sent by a diagnostic device; The message forwarding module is used to enable the routing mirroring function of the vehicle target network segment according to the network segment data service instruction, and forward the target network segment message mirror to the diagnostic device through the Ethernet diagnostic port.
9. A message forwarding device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the message forwarding method according to any one of claims 1 to 7.
10. A vehicle, characterized in that: The vehicle comprises the message forwarding device according to claim 9.
Citation Information
Patent Citations
ECU updating method and main node equipment
CN112181463A
Platform-based gateway routing method for automobile flash diagnosis
CN113325831A
Message forwarding method and device, storage medium, gateway controller and vehicle
CN116112246A
Vehicle-mounted Ethernet looped network test method and device, electronic equipment and storage medium
CN118316825A
Ethernet message processing method, gateway controller, equipment and system
CN118984233A
Cited By
Vehicle diagnosis method, device and equipment based on multiple network segments and storage medium
CN120802912A