Data transmission method, device, equipment and medium
By setting up multiple Ethernet controllers and switching devices in the on-board Ethernet and configuring the target communication link and the target transmission port, the problem of limited bandwidth of the on-board bus is solved, and data transmission from any port in the on-board Ethernet is realized to the on-board diagnostic interface, improving the convenience and security of data transmission.
Patent Information
- Application Number
- CN202311467220.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-06
- Publication Date
- 2025-05-06
AI Technical Summary
The on-vehicle bus bandwidth is limited, making it difficult to meet the increasing data and bandwidth needs, especially after the in-vehicle network switches from bus-type networks to switched networks, data acquisition difficulty increases.
A number of Ethernet controllers are arranged in the on-board Ethernet, and some of the Ethernet controllers include switching devices and control units. Through the configuration of the target communication link and the target transmission port, the transmission of diagnostic data to the on-board diagnostic interface is realized.
Through the setting of the target communication link and the configuration of the switching device, data transmission from any port in the on-board Ethernet is realized to the on-board diagnostic interface, improving the convenience and security of data transmission, and is suitable for on-board Ethernet of different structures.
Smart Images

Figure CN119945822A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a data transmission method, device, equipment and medium. Background Art
[0002] With the continuous development and improvement of automobiles, the number of in-vehicle functions has increased, and the amount of communication data has also increased greatly. For the layout of in-vehicle networks, the traditional method is to use the Controller Area Network (CAN) bus network and the Local Interconnect Network (LIN) bus network. However, the bandwidth provided by the bus network is limited and it is difficult to meet the increasing data and bandwidth needs. In order to solve the limitation of the in-vehicle bus bandwidth, more and more in-vehicle networks are adjusted from bus networks to switching networks, using Ethernet technology for communication.
[0003] In a bus-type network, you only need to connect the device to be collected to the bus to collect data from all devices connected to the bus. However, a switched network cannot directly collect data from the connected network like a bus-type network. It needs to be configured with the help of a switching device, which makes data collection more difficult than a bus-type network. Summary of the invention
[0004] The embodiments of the present disclosure at least provide a data transmission method, apparatus, device and medium.
[0005] The embodiment of the present disclosure provides a data transmission method, which is applied to a vehicle equipped with an in-vehicle Ethernet, wherein the in-vehicle Ethernet is provided with a plurality of Ethernet controllers, at least some of the Ethernet controllers respectively include a switching device and at least one control unit connected to the switching device, and the plurality of Ethernet controllers include a first Ethernet controller connected to an in-vehicle diagnostic interface; the method comprises:
[0006] In response to receiving a diagnostic instruction through the on-board diagnostic interface, determining that the diagnostic instruction indicates a first control unit for diagnosis, the first control unit being a control unit in the second Ethernet controller;
[0007] Based on the communication connection relationship between the Ethernet controllers in the vehicle Ethernet, a target communication link between the first Ethernet controller and the second Ethernet controller is determined; the Ethernet controller including the switching device is in the target communication link and is connected to other Ethernet controllers through the switching device included;
[0008] For each switching device located in the target communication link, a target transmission port for transmitting diagnostic data is configured respectively; the switching device transmits diagnostic data between the switching device of other Ethernet controllers through the target transmission port;
[0009] The diagnostic data of the first control unit is transmitted to the on-board diagnostic interface by utilizing the target communication link and the target transmission port configured for each switching device in the target communication link.
[0010] In an optional implementation manner, for each switching device located in the target communication link, respectively configuring a target transmission port for transmitting diagnostic data includes:
[0011] For each switching device located in the target communication link, a source port in the switching device and a mirror port corresponding to the source port are configured based on the connection relationship between the switching device and the switching devices of other Ethernet controllers in the target communication link, wherein the source port is used to receive diagnostic data and the mirror port is used to send the diagnostic data.
[0012] In an optional implementation manner, for a first switching device in the second Ethernet controller, configuring a target transmission port in the first switching device based on the target communication link includes:
[0013] The port in the first switching device connected to the first control unit is configured as a source port for receiving diagnostic data, and the port in the first switching device that communicates with the third Ethernet controller in the target communication link is configured as a mirror port corresponding to the source port, and the third Ethernet controller is an Ethernet controller that communicates with the second Ethernet controller in the target communication link.
[0014] In an optional implementation manner, for any second switching device other than the first switching device in the target communication link, configuring a target transmission port in the second switching device based on the target communication link includes:
[0015] The port in the second switching device connected to the previous switching device in the target communication link is configured as a source port for receiving diagnostic data, and the port in the second switching device connected to the next switching device in the target communication link or the on-board diagnostic interface is configured as a mirror port corresponding to the source port.
[0016] In an optional implementation, the use of the target communication link and the target transmission port configured for each switching device in the target communication link to transmit the diagnostic data of the first control unit to the on-board diagnostic interface includes:
[0017] For a first switching device in the second Ethernet controller, obtaining diagnostic data of the first control unit through a source port of the switching device, and sending the diagnostic data to a next switching device through a mirror port of the switching device;
[0018] For a second switching device in the target communication link other than the first switching device in the second Ethernet controller, receiving diagnostic data transmitted by a previous switching device in the target communication link through a source port of the second switching device, and sending the diagnostic data to a next switching device in the target communication link or an on-board diagnostic interface through a mirror port of the second switching device;
[0019] The above steps are repeated until the diagnostic data is transmitted to the on-board diagnostic interface through the mirror port of the switching device of the first Ethernet controller.
[0020] In an optional implementation, receiving diagnostic data through a source port of a switching device includes: receiving data to be filtered including diagnostic data through a source port of the switching device; the diagnostic data carries a destination MAC address, the destination MAC address is a MAC address of a fourth Ethernet controller that performs data exchange with the second Ethernet controller, and the diagnostic data is exchange data between the second Ethernet controller and the fourth Ethernet controller;
[0021] Sending the diagnostic data through the mirror port of the switching device includes: filtering the data to be filtered according to the destination MAC address carried in the data to be filtered to obtain the diagnostic data, and sending the diagnostic data through the mirror port.
[0022] In an optional implementation, after determining, in response to receiving a diagnostic instruction through the on-board diagnostic interface, that the diagnostic instruction indicates a first control unit for diagnosis, the method further includes:
[0023] Controlling the first Ethernet controller to receive a diagnostic instruction sent by the on-board diagnostic interface;
[0024] According to the on-board diagnostic instruction interaction protocol between Ethernet controllers, the first Ethernet controller is controlled to send the diagnostic instruction to the first control unit in the second Ethernet controller.
[0025] The embodiment of the present disclosure further provides a data transmission device, which is applied to a vehicle equipped with an in-vehicle Ethernet, wherein the in-vehicle Ethernet is provided with a plurality of Ethernet controllers, at least some of the Ethernet controllers respectively include a switching device and at least one control unit connected to the switching device, and the plurality of Ethernet controllers include a first Ethernet controller connected to an in-vehicle diagnostic interface; the device includes:
[0026] an instruction receiving module, configured to, in response to receiving a diagnostic instruction through the on-board diagnostic interface, determine a first control unit that the diagnostic instruction indicates to diagnose, the first control unit being a control unit in the second Ethernet controller;
[0027] A link determination module, configured to determine a target communication link between the first Ethernet controller and the second Ethernet controller based on a communication connection relationship between the Ethernet controllers in the vehicle Ethernet; wherein the Ethernet controller including the switching device is in the target communication link and is connected to other Ethernet controllers through the switching device included therein;
[0028] A port configuration module, configured to configure a target transmission port for transmitting diagnostic data for each switching device located in the target communication link; wherein the switching device transmits diagnostic data to the switching device of other Ethernet controllers through the target transmission port;
[0029] The data sending module is used to transmit the diagnostic data of the first control unit to the on-board diagnostic interface by using the target communication link and the target transmission port configured for each switching device in the target communication link.
[0030] In an optional implementation manner, the port configuration module is specifically used to:
[0031] For each switching device located in the target communication link, a source port in the switching device and a mirror port corresponding to the source port are configured based on the connection relationship between the switching device and the switching devices of other Ethernet controllers in the target communication link, wherein the source port is used to receive diagnostic data and the mirror port is used to send the diagnostic data.
[0032] In an optional implementation manner, for the first switching device in the second Ethernet controller, the port configuration module, when used to configure the target transmission port in the first switching device based on the target communication link, is specifically used to:
[0033] The port in the first switching device connected to the first control unit is configured as a source port for receiving diagnostic data, and the port in the first switching device that communicates with the third Ethernet controller in the target communication link is configured as a mirror port corresponding to the source port, and the third Ethernet controller is an Ethernet controller that communicates with the second Ethernet controller in the target communication link.
[0034] In an optional implementation, for any second switching device other than the first switching device in the target communication link, the port configuration module, when used to configure a target transmission port in the second switching device based on the target communication link, is specifically used to:
[0035] The port in the second switching device connected to the previous switching device in the target communication link is configured as a source port for receiving diagnostic data, and the port in the second switching device connected to the next switching device in the target communication link or the on-board diagnostic interface is configured as a mirror port corresponding to the source port.
[0036] In an optional implementation manner, the data sending module is specifically used to:
[0037] For a first switching device in the second Ethernet controller, obtaining diagnostic data of the first control unit through a source port of the switching device, and sending the diagnostic data to a next switching device through a mirror port of the switching device;
[0038] For a second switching device in the target communication link other than the first switching device in the second Ethernet controller, receiving diagnostic data transmitted by a previous switching device in the target communication link through a source port of the second switching device, and sending the diagnostic data to a next switching device in the target communication link or an on-board diagnostic interface through a mirror port of the second switching device;
[0039] The above steps are repeated until the diagnostic data is transmitted to the on-board diagnostic interface through the mirror port of the switching device of the first Ethernet controller.
[0040] In an optional implementation manner, when the data sending module is used to receive the diagnostic data through the source port of the switching device, it is specifically used to:
[0041] receiving, through a source port of a switching device, data to be filtered including diagnostic data; the diagnostic data carries a destination MAC address, the destination MAC address is a MAC address of a fourth Ethernet controller that performs data exchange with the second Ethernet controller, and the diagnostic data is exchange data between the second Ethernet controller and the fourth Ethernet controller;
[0042] When the data sending module is used to send the diagnostic data through the mirror port of the switching device, it is specifically used to:
[0043] The data to be filtered are filtered according to the destination MAC address carried in the data to be filtered to obtain the diagnostic data, and the diagnostic data is sent through the mirror port.
[0044] In an optional implementation, the data transmission device further includes an instruction sending module, and the instruction sending module is used to:
[0045] Controlling the first Ethernet controller to receive a diagnostic instruction sent by the on-board diagnostic interface;
[0046] According to the on-board diagnostic instruction interaction protocol between Ethernet controllers, the first Ethernet controller is controlled to send the diagnostic instruction to the first control unit in the second Ethernet controller.
[0047] An embodiment of the present disclosure also provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps in any possible implementation of the above-mentioned data transmission method are performed.
[0048] The embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in any possible implementation of the above-mentioned data transmission method are executed.
[0049] The data transmission method, device, equipment and medium provided by the embodiments of the present disclosure are for an in-vehicle Ethernet equipped with multiple Ethernet controllers. In response to receiving a diagnostic instruction through an on-board diagnostic interface, a first control unit indicated by the diagnostic instruction for diagnosis is determined. Based on the communication connection relationship between the Ethernet controllers in the in-vehicle Ethernet, a target communication link between the first Ethernet controller and the second Ethernet controller is determined. The Ethernet controller including a switching device is connected to communicate with other Ethernet controllers through the included switching device in the target communication link. For each switching device located in the target communication link, a target transmission port for transmitting diagnostic data is configured respectively. The switching device transmits diagnostic data between the switching devices of other Ethernet controllers through the target transmission port. The diagnostic data of the first control unit is transmitted to the on-board diagnostic interface by using the target communication link and the target transmission port configured for each switching device in the target communication link. In this way, by setting the target communication link and configuring the target transmission port for the switching device located in the target communication link, data passing through any port in the in-vehicle Ethernet can be transmitted to the on-board diagnostic interface, thereby realizing the transmission and collection of data sent and received by any Ethernet controller in the in-vehicle Ethernet, and improving the convenience and security of data transmission.
[0050] Furthermore, the data transmission method provided by the embodiment of the present disclosure is universal, does not require changes to the vehicle's topological environment, does not require hardware pre-embedding, and does not require lead setting. It can be applied to vehicle-mounted Ethernet with different structures and is decoupled from the vehicle-mounted network topology and Ethernet controller model.
[0051] Furthermore, when transmitting data within the switching device, the mirroring function can be combined with the filtering function to achieve transmission of specific data, which helps to reduce the impact of redundant data flows on network load and the impact on data diagnosis.
[0052] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present disclosure.
[0053] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0055] Figure 1 A schematic diagram of the structure of an in-vehicle Ethernet provided by an embodiment of the present disclosure is shown;
[0056] Figure 2 A flow chart of a data transmission method provided by an embodiment of the present disclosure is shown;
[0057] Figure 3 A schematic diagram showing a data transmission process provided by an embodiment of the present disclosure is shown;
[0058] Figure 4 A schematic diagram showing another data transmission process provided by an embodiment of the present disclosure;
[0059] Figure 5 One of the schematic diagrams of a data transmission device provided by an embodiment of the present disclosure is shown;
[0060] Figure 6 A second schematic diagram of a data transmission device provided by an embodiment of the present disclosure is shown;
[0061] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0063] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0064] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.
[0065] According to research, in order to solve the bandwidth limitation of the vehicle bus, more and more in-vehicle networks are adjusted from bus-type networks to switching-type networks, using Ethernet technology for communication. In a bus-type network, you only need to connect the device to be collected to the bus to collect data from all devices connected to the bus. However, a switching network cannot directly collect data connected to the network like a bus-type network. It needs to be configured with the help of a switching device, which makes data collection more difficult than a bus-type network. In addition, there was only one switching device in the early vehicle Ethernet. However, as the number of nodes in the vehicle Ethernet communication increases, the network topology of the vehicle Ethernet is becoming more and more complex. There will be multiple switching devices in the vehicle Ethernet, and each switching device is integrated in a different Ethernet controller, which further increases the difficulty of data collection.
[0066] Based on the above research, the present disclosure provides a data transmission method, which can achieve the transmission and collection of data received and sent by any Ethernet controller in the vehicle Ethernet through the setting of the target communication link and the configuration of the target transmission port of the switching device located in the target communication link, thereby improving the convenience and security of data transmission.
[0067] To facilitate understanding of this embodiment, a data transmission method disclosed in the embodiment of the present disclosure is first described in detail. The execution subject of the data transmission method provided in the embodiment of the present disclosure is generally a vehicle equipped with an in-vehicle Ethernet. The vehicle includes but is not limited to cars, buses, trucks, and tractors, etc., which are not limited here. Among them, cars, buses, and trucks can be collectively referred to as automobiles. In the embodiment of this application, a car is used as an example for explanation.
[0068] In other embodiments, the execution subject may also be a vehicle-mounted device, and the vehicle-mounted device may be a device including a processor and a memory. The data transmission method may be implemented by the processor calling computer-readable instructions stored in the memory, which is not limited here. In some embodiments, the data transmission method may also be applied to an implementation environment consisting of a vehicle and a server, or to an implementation environment consisting of a vehicle-mounted device and a server. Among them, the server may be an independent physical server, or a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, big data, and artificial intelligence platforms.
[0069] A data transmission method provided by an embodiment of the present disclosure is described below with reference to the accompanying drawings.
[0070] It should be noted that the data transmission method provided in the embodiment of the present disclosure is applied to a vehicle equipped with an in-vehicle Ethernet, in which a plurality of Ethernet controllers are arranged, at least some of the Ethernet controllers respectively include a switching device and at least one control unit connected to the switching device, while another part of the Ethernet controllers only include at least one control unit and do not include a switching device.
[0071] The switching device may refer to a switch, and the switching device includes a plurality of ports. It can be understood that when the Ethernet controller includes a switching device and a control unit, each control unit is connected to the switching device through a port on the switching device.
[0072] Here, each Ethernet controller in the vehicle Ethernet implements different functions respectively, such as automatic driving function, cockpit control function, gateway control function, distance detection function, etc. In actual applications, in order to ensure the realization of various functions, the control unit in the Ethernet controller can also be connected to corresponding actuators, sensors and other components.
[0073] The control unit may be a system on chip (SoC), a microcontroller unit (MCU), or the like.
[0074] Here, the vehicle is provided with an on-board diagnostic port, and the on-board diagnostic port is connected to the on-board Ethernet communication. Accordingly, the multiple Ethernet controllers include a first Ethernet controller connected to the on-board diagnostic interface.
[0075] For example, see Figure 1 , Figure 1The structure diagram of a vehicle Ethernet provided by an embodiment of the present disclosure is shown in FIG. Figure 1 As shown in the figure, four Ethernet controllers are provided in the vehicle Ethernet for explanation. Specifically, the Ethernet controller 1 includes a switching device 1, and a control unit 11 and a control unit 12 connected to the switching device 1. The switching device 1 includes a port 11, a port 12, a port 13 and a port 14. The control unit 11 is connected to the port 11, and the control unit 12 is connected to the port 12; the Ethernet controller 2 includes a switching device 2, and a control unit 21 and a control unit 22 connected to the switching device 2. The switching device 2 includes a port 21, a port 22, a port 23, a port 24 and a port 25. The control unit 21 is connected to the port 21, and the control unit 22 is connected to the port 22; the Ethernet controller 3 includes a switching device 3 and a control unit 3 connected to the switching device 3. The switching device 3 includes a port 31 and a port 32, and the control unit 3 is connected to the port 32; the Ethernet controller 4 includes a control unit 4.
[0076] The communication connection relationship between the Ethernet controllers in the vehicle-mounted Ethernet is specifically as follows: Ethernet controller 1 interacts with Ethernet controller 4 via port 13, Ethernet controller 1 interacts with Ethernet controller 2 via port 14, Ethernet controller 2 interacts with Ethernet controller 1 via port 23, Ethernet controller 2 interacts with Ethernet controller 3 via port 24, and Ethernet controller 3 interacts with Ethernet controller 2 via port 21.
[0077] Here, the vehicle further includes an on-board diagnostic interface, and the Ethernet controller 2 is connected to the on-board diagnostic interface. Specifically, the on-board diagnostic interface is connected to the port 25 of the switching device 2 .
[0078] See also Figure 2 As shown, it is a flowchart of a data transmission method provided by an embodiment of the present disclosure, and the data transmission method is applied to a Figure 1 The vehicle with in-vehicle Ethernet shown in , wherein the in-vehicle Ethernet is provided with a plurality of Ethernet controllers, at least some of the Ethernet controllers respectively include a switching device and at least one control unit connected to the switching device, and the plurality of Ethernet controllers include a first Ethernet controller connected to the in-vehicle diagnostic interface; Figure 2 As shown in , the data transmission method provided by the embodiment of the present disclosure includes steps S201 to S204, wherein:
[0079] S201: In response to receiving a diagnostic instruction through an on-board diagnostic interface, determining a first control unit that the diagnostic instruction indicates to diagnose, where the first control unit is a control unit in a second Ethernet controller.
[0080] In this step, one side of the on-board diagnostic interface is connected to the first Ethernet controller, and the other side is connected to an external diagnostic device. The external diagnostic device can send a diagnostic instruction to the on-board diagnostic interface, and the corresponding vehicle can receive the diagnostic instruction through the on-board diagnostic interface.
[0081] The external diagnostic device may be a diagnostic communication over Internet Protocol (DoIP) device based on vehicle Ethernet, which may perform service requests and response interactions of unified diagnostic services (UDS) through vehicle Ethernet. Optionally, the external diagnostic device may also be a terminal device or server running a diagnostic program based on vehicle Ethernet.
[0082] The UDS is specified by the ISO-14229 protocol, which defines various standard services for on-board diagnostics. Original Equipment Manufacturer (OEM) engineers can implement various diagnostic functions by designing parameters of different diagnostic services, such as reading data through ID and writing to memory through address.
[0083] In the vehicle field, the diagnostic instruction is used to instruct the collection of data that needs to be diagnosed. Specifically, in this embodiment, the diagnostic instruction is used to instruct the collection of data sent and / or received by the first control unit in the vehicle Ethernet for diagnosis. When the diagnostic instruction is received through the vehicle diagnostic interface, the first control unit that the diagnostic instruction instructs to diagnose can be determined.
[0084] Here, the on-board diagnostic interface may be an on-board diagnostic system (OBD) interface, which is used to enable the vehicle to communicate with the external diagnostic device. In practical applications, the on-board diagnostic interface may be located under the driver's seat.
[0085] In some possible implementations, an Ethernet controller for performing abnormality detection is disposed inside the vehicle, and the Ethernet controller can perform abnormality detection on data transmission of each control unit in the vehicle Ethernet.
[0086] Accordingly, before receiving the diagnostic instruction sent by the external diagnostic device through the on-board diagnostic interface, the method further includes:
[0087] When a transmission anomaly is detected in the vehicle Ethernet, a diagnostic request is sent to the external diagnostic device through the vehicle diagnostic interface, and the diagnostic request carries anomaly detection information.
[0088] Here, the abnormality detection information includes information of the control unit to be diagnosed. In this embodiment, the abnormality detection information is used to indicate that the first control unit in the vehicle Ethernet sends and / or receives data abnormally, so the diagnostic instruction sent by the external diagnostic device received through the vehicle diagnostic interface is used to instruct the collection of data sent and / or received by the first control unit in the vehicle Ethernet.
[0089] Back again Figure 1 ,like Figure 1 As shown in , the vehicle Ethernet is connected to the external diagnostic device through the vehicle diagnostic interface, and the vehicle diagnostic interface is connected to the port 25 of the switching device 2.
[0090] After the first control unit determines, in response to receiving a diagnostic instruction through the on-board diagnostic interface, that the diagnostic instruction indicates diagnosis, in some possible implementations, the first Ethernet controller may be controlled to receive the diagnostic instruction sent by the on-board diagnostic interface; and according to the on-board diagnostic instruction interaction protocol between Ethernet controllers, the first Ethernet controller may be controlled to send the diagnostic instruction to the first control unit in the second Ethernet controller.
[0091] Specifically, in the in-vehicle Ethernet, the first Ethernet controller is connected to the on-board diagnostic interface. Therefore, after receiving the diagnostic instruction sent by the on-board diagnostic interface through the first Ethernet controller, the first Ethernet controller can be controlled to send the diagnostic instruction to the first control unit in the second Ethernet controller to be diagnosed indicated by the diagnostic instruction according to the on-board diagnostic instruction interaction protocol between Ethernet controllers.
[0092] Among them, the on-board diagnostic command interaction protocol between the Ethernet controllers can be a diagnostic communication over Internet Protocol (DoIP) protocol based on on-board Ethernet, and the on-board diagnostic command interaction protocol indicates the sending method of the first Ethernet controller connected to the on-board diagnostic interface to send the diagnostic command received from the on-board diagnostic interface to the first control unit indicated by the diagnostic instruction.
[0093] In this way, the diagnostic instruction can be sent to the first control unit to be diagnosed through the first Ethernet controller connected to the on-board diagnostic interface, thereby facilitating the first control unit to subsequently transmit the data collected as instructed by the diagnostic instruction.
[0094] Exemplary, combined Figure 3 As shown, in Example 1, the diagnostic instruction indicates the diagnosis of the control unit 22 in the Ethernet controller 2, and the diagnostic instruction is used to instruct the collection of all data interacting between the control unit 22 and the control unit 3, that is, the diagnostic instruction is used to instruct the collection of data interacting between the control unit 22 and the control unit 3 in the vehicle Ethernet, that is, the data sent by the control unit 22 to the control unit 3 and the data received by the control unit 22 from the control unit 3. At this time, the Ethernet controller 2 connected to the on-board diagnostic interface can be controlled to receive the diagnostic instruction sent by the on-board diagnostic interface, and according to the on-board diagnostic instruction interaction protocol between Ethernet controllers, the Ethernet controller 2 is controlled to send the diagnostic instruction to the control unit 22.
[0095] In addition, combined Figure 4 As shown, in Example 2, the diagnostic instruction instructs the control unit 11 in the diagnostic Ethernet controller 1, and the diagnostic instruction is used to instruct the collection of all data sent by the control unit 11 to the control unit 4. At this time, the Ethernet controller 2 connected to the on-board diagnostic interface can be controlled to receive the diagnostic instruction sent by the on-board diagnostic interface, and according to the on-board diagnostic instruction interaction protocol between Ethernet controllers, the Ethernet controller 2 is controlled to send the diagnostic instruction to the control unit 11.
[0096] S202: Determine a target communication link between the first Ethernet controller and the second Ethernet controller based on the communication connection relationship between the Ethernet controllers in the vehicle Ethernet; the Ethernet controller including the switching device is communicatively connected with other Ethernet controllers in the target communication link through the switching device included therein.
[0097] Here, the determination of the target communication link specifically refers to the control unit in the Ethernet controller determining the target communication link.
[0098] Optionally, the control unit in each Ethernet controller may determine the communication connection relationship between the Ethernet controller and other Ethernet controllers respectively, thereby determining the target communication link.
[0099] Optionally, a control unit in one of the multiple Ethernet controllers may determine the target communication link based on the communication connection relationship between the Ethernet controllers in the in-vehicle Ethernet.
[0100] Wherein, based on the different positions of the second Ethernet controller in the in-vehicle Ethernet, the target communication link may include other Ethernet controllers except the first Ethernet controller and the second Ethernet controller.
[0101] Here, in order to realize data transmission, each Ethernet controller located in the target communication link includes a switching device.
[0102] Continuing with the above example, Figure 3 As shown in , in Example 1, the first Ethernet controller and the second Ethernet controller are both Ethernet controller 2, and the target communication link includes Ethernet controller 2.
[0103] like Figure 4 As shown in, in Example 2, the first Ethernet controller is Ethernet controller 2, and the second Ethernet controller is Ethernet controller 1. At this time, the target communication link includes the communication link between Ethernet controller 1 and Ethernet controller 2. Specifically, port 14 of switching device 1 included in Ethernet controller 1 is connected to port 23 of switching device 2 included in Ethernet controller 2.
[0104] In other possible implementations, if there are multiple communication links between the first Ethernet controller and the second Ethernet controller, the target communication link between the first Ethernet controller and the second Ethernet controller can be determined based on the port usage of each port in the vehicle Ethernet and the data transmission volume of each port.
[0105] S203: For each switching device located in the target communication link, a target transmission port for transmitting diagnostic data is configured respectively; the switching device transmits diagnostic data to the switching device of other Ethernet controllers through the target transmission port.
[0106] Here, the configuration of the target transmission port specifically refers to a control unit in an Ethernet controller determining the target communication link.
[0107] Optionally, it may be a control unit located in each Ethernet controller in the target communication link, which respectively configures the switching device in the Ethernet controller to be used for the target transmission port for transmitting the diagnostic data.
[0108] Alternatively, the target transmission port of each switching device in the target communication link may be configured by a control unit in one of the multiple Ethernet controllers.
[0109] Specifically, it is necessary to determine the source port and the mirror port in each switching device in the target communication link to obtain the target transmission port for transmitting the diagnostic data.
[0110] In some possible implementations, for each switching device located in the target communication link, a source port in the switching device and a mirror port corresponding to the source port are configured based on a connection relationship between the switching device and switching devices of other Ethernet controllers in the target communication link.
[0111] The source port is used to receive diagnostic data, and the mirror port is used to send the diagnostic data.
[0112] Here, the source port and its corresponding mirror port are ports in the same switching device.
[0113] In this way, data transmission between various switching devices on the target communication link can be achieved by configuring the source port and the mirror port in the switching device. The mirror setting can realize the transmission of data passing through any port in the vehicle Ethernet, which helps to improve the versatility and practicality of data transmission.
[0114] Since the target communication link is a communication link between the first Ethernet controller and the second Ethernet controller, the target communication link must include the first switching device in the second Ethernet controller. Based on this, for the first switching device in the second Ethernet controller, the port in the first switching device connected to the first control unit is configured as a source port for receiving diagnostic data, and the port in the first switching device that communicates with the third Ethernet controller in the target communication link is configured as a mirror port corresponding to the source port.
[0115] The third Ethernet controller is an Ethernet controller that communicates with the second Ethernet controller in the target communication link.
[0116] This helps to improve the efficiency of port configuration for the first switching device in the second Ethernet controller and improves the speed of obtaining the target transmission port.
[0117] In addition, in addition to the first switching device in the second Ethernet controller, the target communication link also includes a switching device in the first Ethernet controller, and there may also be switching devices in other Ethernet controllers. In a specific implementation, for any second switching device in the target communication link except the first switching device, the port in the second switching device connected to the previous switching device in the target communication link is configured as a source port for receiving diagnostic data, and the port in the second switching device connected to the next switching device in the target communication link or the on-board diagnostic interface is configured as a mirror port corresponding to the source port.
[0118] In this way, the port configuration can be quickly performed on the second switching device other than the first switching device in the target communication link in combination with the connection relationship between the switching devices in the target communication link, thereby improving the efficiency of obtaining the target transmission port.
[0119] Accordingly, if Figure 3 As shown in , in Example 1, the only switching device located in the target communication link is switching device 2, so it is only necessary to configure the target transmission port for switching device 2. Specifically, port 22 in switching device 2 connected to control unit 22 is configured as a source port for receiving diagnostic data, and port 25 in switching device 2 connected to the on-board diagnostic interface is configured as a mirror port corresponding to the source port.
[0120] like Figure 4 As shown in , in Example 2, the switching devices located in the target communication link are switching device 1 and switching device 2, so it is necessary to configure the target transmission port for switching device 1 and switching device 2 respectively. Specifically, for switching device 1, since switching device 1 is the first switching device in the second Ethernet controller, port 11 in switching device 1 connected to control unit 11 can be configured as a source port for receiving diagnostic data, and port 14 in switching device 1 communicating with Ethernet controller 2 in the target communication link can be configured as a mirror port corresponding to the source port; for switching device 2, since switching device 2 is the second switching device in the first Ethernet controller, port 23 in switching device 2 connected to the previous switching device (i.e., switching device 1) in the target communication link can be configured as a source port for receiving diagnostic data, and port 25 in switching device 2 connected to the on-board diagnostic interface can be configured as a mirror port corresponding to the source port.
[0121] S204: Transmitting the diagnostic data of the first control unit to the on-board diagnostic interface by using the target communication link and the target transmission port configured for each switching device in the target communication link.
[0122] After the diagnostic data of the first control unit is transmitted to the on-board diagnostic interface, the diagnostic data can be sent to the external diagnostic device through the on-board diagnostic interface, and the external diagnostic device can diagnose the vehicle according to the received diagnostic data.
[0123] In order to transmit the diagnosis of the first control unit to the on-board diagnostic interface, in some possible implementations, for the first switching device in the second Ethernet controller, the diagnostic data of the first control unit is obtained through the source port of the switching device, and the diagnostic data is sent to the next switching device through the mirror port of the switching device; for the second switching device in the target communication link except the first switching device belonging to the second Ethernet controller, the diagnostic data transmitted by the previous switching device in the target communication link is received through the source port of the second switching device, and the diagnostic data is sent to the next switching device or the on-board diagnostic interface in the target communication link through the mirror port of the second switching device; the above steps are repeated until the diagnostic data is transmitted to the on-board diagnostic interface through the mirror port of the switching device of the first Ethernet controller.
[0124] In this way, through single-layer or even multi-layer mirror replication, the data passing through any port in the vehicle Ethernet can be transmitted to the vehicle diagnostic interface, realizing the transmission and collection of data received and sent by any Ethernet controller in the vehicle Ethernet, thereby improving the convenience and security of data transmission.
[0125] Accordingly, if Figure 3 As shown in , in Example 1, data sent or received by the control unit 22 can be obtained through the port 22 of the switching device 2, the data obtained through the port 22 can be copied by the switching device 2 and the copied data can be transmitted to the port 25 of the switching device 2, and then the diagnostic data can be sent to the on-board diagnostic interface through the port 25 of the switching device 2.
[0126] like Figure 4 As shown in , in Example 2, data sent by the control unit 11 can be obtained through the port 11 of the switching device 1, the data obtained through the port 11 can be copied through the switching device 1 and the copied data can be transmitted to the port 14 of the switching device 1, and then the diagnostic data can be sent to the switching device 2 through the port 14 of the switching device 1, and then the diagnostic data transmitted by the switching device 1 can be received through the port 23 of the switching device 2, the data obtained through the port 23 can be copied through the switching device 2 and the copied data can be transmitted to the port 25 of the switching device 2, and then the diagnostic data can be sent to the on-board diagnostic interface through the port 25 of the switching device 2.
[0127] Since the mirroring function copies all data passing through a certain direction of the source port by default, in order to avoid copying redundant data and causing network overload and other problems, the switching device can be filtered and configured to implement mirroring for specific data, reducing redundant data and network load.
[0128] Specifically, in some possible implementations, when diagnostic data is received through the source port of the switching device, data to be filtered including the diagnostic data is received through the source port of the switching device; the diagnostic data carries a destination MAC address, and the destination MAC address is the MAC address of a fourth Ethernet controller that exchanges data with the second Ethernet controller, and the diagnostic data is interaction data between the second Ethernet controller and the fourth Ethernet controller.
[0129] Here, since the diagnostic data carries the destination MAC address, filtering can be performed based on the destination MAC address.
[0130] Exemplarily, the destination MAC address may specifically be a Media Access Control Address (MAC) address.
[0131] Correspondingly, when the diagnostic data is sent through the mirror port of the switching device, the data to be filtered is filtered according to the destination MAC address carried in the data to be filtered to obtain the diagnostic data, and the diagnostic data is sent through the mirror port.
[0132] In this implementation, for each switching device located in the target communication link, it can combine data filtering when performing data replication. The specific filtering process of each switching device is similar and will not be repeated here.
[0133] In this way, when transmitting data inside the switching device, the mirroring function can be combined with the filtering function to achieve transmission of specific data, which helps to reduce the impact of redundant data flows on network load and the impact on data diagnosis.
[0134] Accordingly, if Figure 3 As shown in , in Example 1, since the diagnostic instruction is used to instruct the collection of all data interacting between the control unit 22 and the control unit 3, when the data sent or received by the control unit 22 is obtained through the port 22 of the switching device 2, specifically, the data to be filtered including the diagnostic data is obtained through the port 22 of the switching device 2, and the diagnostic data carries the destination MAC address of the control unit 3; when the diagnostic data is sent to the on-board diagnostic interface through the port 25 of the switching device 2, specifically, according to the destination MAC address of the control unit 3 carried in the data to be filtered, the data to be filtered is filtered to obtain the diagnostic data, and the diagnostic data is sent to the on-board diagnostic interface through the port 25 of the switching device 2.
[0135] like Figure 4As shown in , in Example 2, since the diagnostic instruction is used to instruct the collection of all data sent by the control unit 11 to the control unit 4, when the data sent by the control unit 11 is obtained through the port 11 of the switching device 1, specifically, the data to be filtered including the diagnostic data is obtained through the port 11 of the switching device 1, and the diagnostic data carries the destination MAC address of the control unit 4; when the diagnostic data is sent to the switching device 2 through the port 14 of the switching device 1, specifically, according to the destination MAC address of the control unit 4 carried in the data to be filtered, the data to be filtered is filtered to obtain the diagnostic data, and the diagnostic data is sent to the switching device 2 through the port 14 of the switching device 1. Then, when the diagnostic data transmitted by the switching device 1 is received through the port 23 of the switching device 2, specifically, the data to be filtered including the diagnostic data is obtained through the port 23 of the switching device 2, and the diagnostic data carries the destination MAC address of the control unit 4; when the diagnostic data is sent to the on-board diagnostic interface through the port 25 of the switching device 2, specifically, according to the destination MAC address of the control unit 4 carried in the data to be filtered, the data to be filtered is filtered to obtain the diagnostic data, and the diagnostic data is sent to the on-board diagnostic interface through the port 25 of the switching device 2.
[0136] The data transmission method provided by the embodiment of the present disclosure is for an in-vehicle Ethernet equipped with multiple Ethernet controllers. In response to receiving a diagnostic instruction through an on-board diagnostic interface, a first control unit indicated by the diagnostic instruction for diagnosis is determined. Based on the communication connection relationship between the Ethernet controllers in the in-vehicle Ethernet, a target communication link between the first Ethernet controller and the second Ethernet controller is determined. The Ethernet controller including a switching device is in the target communication link. The Ethernet controller includes a switching device. The switching device communicates with other Ethernet controllers through the included switching device. For each switching device located in the target communication link, a target transmission port for transmitting diagnostic data is configured respectively. The switching device transmits diagnostic data to the switching devices of other Ethernet controllers through the target transmission port. The diagnostic data of the first control unit is transmitted to the on-board diagnostic interface by using the target communication link and the target transmission port configured for each switching device in the target communication link. In this way, the data passing through any port in the in-vehicle Ethernet can be transmitted to the on-board diagnostic interface through the setting of the target communication link and the configuration of the target transmission port for the switching device located in the target communication link, so that the transmission and collection of data sent and received by any Ethernet controller in the in-vehicle Ethernet is realized, and the convenience and security of data transmission are improved.
[0137] Furthermore, the data transmission method provided by the embodiment of the present disclosure is universal, does not require changes to the vehicle's topological environment, does not require hardware pre-embedding, and does not require lead setting. It can be applied to vehicle-mounted Ethernet with different structures and is decoupled from the vehicle-mounted network topology and Ethernet controller model.
[0138] Furthermore, when transmitting data within the switching device, the mirroring function can be combined with the filtering function to achieve transmission of specific data, which helps to reduce the impact of redundant data flows on network load and the impact on data diagnosis.
[0139] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0140] Based on the same inventive concept, a data transmission device corresponding to the data transmission method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned data transmission method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0141] See also Figure 5 and Figure 6 , Figure 5 This is one of the schematic diagrams of a data transmission device provided in an embodiment of the present disclosure, Figure 6 The second schematic diagram of a data transmission device provided by an embodiment of the present disclosure, wherein the data transmission device is arranged in a vehicle equipped with an in-vehicle Ethernet, wherein the in-vehicle Ethernet is provided with a plurality of Ethernet controllers, at least some of which respectively include a switching device and at least one control unit connected to the switching device, wherein the plurality of Ethernet controllers include a first Ethernet controller connected to an in-vehicle diagnostic interface. Figure 5 As shown in , the data transmission device 500 provided in the embodiment of the present disclosure includes:
[0142] An instruction receiving module 510 is used to determine, in response to receiving a diagnostic instruction through the on-board diagnostic interface, a first control unit that the diagnostic instruction indicates to diagnose, wherein the first control unit is a control unit in the second Ethernet controller;
[0143] The link determination module 520 is used to determine the target communication link between the first Ethernet controller and the second Ethernet controller based on the communication connection relationship between the Ethernet controllers in the vehicle Ethernet; wherein the Ethernet controller including the switching device is in the target communication link and is connected to the other Ethernet controllers through the switching device included;
[0144] The port configuration module 530 is used to configure a target transmission port for transmitting diagnostic data for each switching device located in the target communication link; wherein the switching device transmits diagnostic data to the switching device of other Ethernet controllers through the target transmission port;
[0145] The data sending module 540 is used to transmit the diagnostic data of the first control unit to the on-board diagnostic interface by using the target communication link and the target transmission port configured for each switching device in the target communication link.
[0146] In an optional implementation manner, the port configuration module 530 is specifically used to:
[0147] For each switching device located in the target communication link, a source port in the switching device and a mirror port corresponding to the source port are configured based on the connection relationship between the switching device and the switching devices of other Ethernet controllers in the target communication link, wherein the source port is used to receive diagnostic data and the mirror port is used to send the diagnostic data.
[0148] In an optional implementation, for the first switching device in the second Ethernet controller, the port configuration module 530, when used to configure the target transmission port in the first switching device based on the target communication link, is specifically used to:
[0149] The port in the first switching device connected to the first control unit is configured as a source port for receiving diagnostic data, and the port in the first switching device that communicates with the third Ethernet controller in the target communication link is configured as a mirror port corresponding to the source port, and the third Ethernet controller is an Ethernet controller that communicates with the second Ethernet controller in the target communication link.
[0150] In an optional implementation, for any second switching device other than the first switching device in the target communication link, the port configuration module 530, when used to configure a target transmission port in the second switching device based on the target communication link, is specifically used to:
[0151] The port in the second switching device connected to the previous switching device in the target communication link is configured as a source port for receiving diagnostic data, and the port in the second switching device connected to the next switching device in the target communication link or the on-board diagnostic interface is configured as a mirror port corresponding to the source port.
[0152] In an optional implementation manner, the data sending module 540 is specifically used to:
[0153] For a first switching device in the second Ethernet controller, obtaining diagnostic data of the first control unit through a source port of the switching device, and sending the diagnostic data to a next switching device through a mirror port of the switching device;
[0154] For a second switching device in the target communication link other than the first switching device in the second Ethernet controller, receiving diagnostic data transmitted by a previous switching device in the target communication link through a source port of the second switching device, and sending the diagnostic data to a next switching device in the target communication link or an on-board diagnostic interface through a mirror port of the second switching device;
[0155] The above steps are repeated until the diagnostic data is transmitted to the on-board diagnostic interface through the mirror port of the switching device of the first Ethernet controller.
[0156] In an optional implementation manner, when the data sending module 540 is used to receive the diagnostic data through the source port of the switching device, it is specifically used to:
[0157] receiving, through a source port of a switching device, data to be filtered including diagnostic data; the diagnostic data carries a destination MAC address, the destination MAC address is a MAC address of a fourth Ethernet controller that performs data exchange with the second Ethernet controller, and the diagnostic data is exchange data between the second Ethernet controller and the fourth Ethernet controller;
[0158] When the data sending module 540 is used to send the diagnostic data through the mirror port of the switching device, it is specifically used to:
[0159] The data to be filtered are filtered according to the destination MAC address carried in the data to be filtered to obtain the diagnostic data, and the diagnostic data is sent through the mirror port.
[0160] In an optional implementation, Figure 6 As shown in , the data transmission device further includes an instruction sending module 550, and the instruction sending module 550 is used to:
[0161] Controlling the first Ethernet controller to receive a diagnostic instruction sent by the on-board diagnostic interface;
[0162] According to the on-board diagnostic instruction interaction protocol between Ethernet controllers, the first Ethernet controller is controlled to send the diagnostic instruction to the first control unit in the second Ethernet controller.
[0163] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0164] The data transmission device provided by the embodiment of the present disclosure is for an in-vehicle Ethernet equipped with multiple Ethernet controllers. In response to receiving a diagnostic instruction through an on-board diagnostic interface, the device determines a first control unit indicated by the diagnostic instruction for diagnosis. Based on the communication connection relationship between the Ethernet controllers in the in-vehicle Ethernet, the device determines a target communication link between the first Ethernet controller and the second Ethernet controller. The Ethernet controller including a switching device is connected to communicate with other Ethernet controllers through the included switching device in the target communication link. For each switching device located in the target communication link, a target transmission port for transmitting diagnostic data is configured respectively. The switching device transmits diagnostic data with the switching devices of other Ethernet controllers through the target transmission port. The diagnostic data of the first control unit is transmitted to the on-board diagnostic interface by using the target communication link and the target transmission port configured for each switching device in the target communication link. In this way, by setting the target communication link and configuring the target transmission port for the switching device located in the target communication link, data passing through any port in the in-vehicle Ethernet can be transmitted to the on-board diagnostic interface, thereby realizing the transmission and collection of data sent and received by any Ethernet controller in the in-vehicle Ethernet, and improving the convenience and security of data transmission.
[0165] Furthermore, the data transmission device provided by the embodiment of the present disclosure is universal, does not require changes to the vehicle's topological environment, does not require hardware pre-embedding, and does not require lead setting. It can be applied to vehicle-mounted Ethernet with different structures and is decoupled from the vehicle-mounted network topology and Ethernet controller model.
[0166] Furthermore, when transmitting data within the switching device, the mirroring function can be combined with the filtering function to achieve transmission of specific data, which helps to reduce the impact of redundant data flows on network load and the impact on data diagnosis.
[0167] Corresponds to Figure 2 The data transmission method in the present disclosure also provides an electronic device 700, such as Figure 7 FIG. 7 is a schematic diagram of the structure of an electronic device 700 provided in an embodiment of the present disclosure, including:
[0168] Processor 710, memory 720, and bus 730. The memory 720 is used to store execution instructions, including internal memory 721 and external memory 722; the internal memory 721 is also called internal memory, which is used to temporarily store the operation data in the processor 710 and the data exchanged with the external memory 722 such as a hard disk. The processor 710 exchanges data with the external memory 722 through the internal memory 721.
[0169] In the embodiment of the present application, the memory 720 is specifically used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 710. That is, when the electronic device 700 is running, the processor 710 communicates with the memory 720 through the bus 730, so that the processor 710 executes the application code stored in the memory 720, and then executes the steps of the data transmission method described in any of the aforementioned embodiments.
[0170] Among them, the memory 720 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.
[0171] The processor 710 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present invention may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0172] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 700. In other embodiments of the present application, the electronic device 700 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0173] The present disclosure also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the data transmission method described in the above method embodiment are executed. The storage medium may be a volatile or non-volatile computer-readable storage medium.
[0174] The present disclosure also provides a computer program product, which includes computer instructions. When the computer instructions are executed by a processor, the steps of the data transmission method described in the above method embodiment can be executed. For details, please refer to the above method embodiment, which will not be repeated here.
[0175] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0176] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the above-described equipment and devices can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0177] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0178] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0179] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0180] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A data transmission method, characterized in that: Applicable to a vehicle equipped with an in-vehicle Ethernet, wherein the in-vehicle Ethernet is provided with a plurality of Ethernet controllers, at least some of the Ethernet controllers respectively include a switching device and at least one control unit connected to the switching device, and the plurality of Ethernet controllers include a first Ethernet controller connected to an in-vehicle diagnostic interface; the method comprises: In response to receiving a diagnostic instruction through the on-board diagnostic interface, determining that the diagnostic instruction indicates a first control unit for diagnosis, the first control unit being a control unit in the second Ethernet controller; Based on the communication connection relationship between the Ethernet controllers in the vehicle Ethernet, a target communication link between the first Ethernet controller and the second Ethernet controller is determined; the Ethernet controller including the switching device is in the target communication link and is connected to other Ethernet controllers through the switching device included; For each switching device located in the target communication link, a target transmission port for transmitting diagnostic data is configured respectively; the switching device transmits diagnostic data between the switching device of other Ethernet controllers through the target transmission port; The diagnostic data of the first control unit is transmitted to the on-board diagnostic interface by utilizing the target communication link and the target transmission port configured for each switching device in the target communication link.
2. The method according to claim 1, characterized in that The step of respectively configuring a target transmission port for transmitting diagnostic data for each switching device located in the target communication link includes: For each switching device located in the target communication link, a source port in the switching device and a mirror port corresponding to the source port are configured based on the connection relationship between the switching device and the switching devices of other Ethernet controllers in the target communication link, wherein the source port is used to receive diagnostic data and the mirror port is used to send the diagnostic data.
3. The method according to claim 2, characterized in that For a first switching device in the second Ethernet controller, configuring a target transmission port in the first switching device based on the target communication link includes: The port in the first switching device connected to the first control unit is configured as a source port for receiving diagnostic data, and the port in the first switching device that communicates with the third Ethernet controller in the target communication link is configured as a mirror port corresponding to the source port, and the third Ethernet controller is an Ethernet controller that communicates with the second Ethernet controller in the target communication link.
4. The method according to claim 3, characterized in that For any second switching device other than the first switching device in the target communication link, configuring a target transmission port in the second switching device based on the target communication link includes: The port in the second switching device connected to the previous switching device in the target communication link is configured as a source port for receiving diagnostic data, and the port in the second switching device connected to the next switching device in the target communication link or the on-board diagnostic interface is configured as a mirror port corresponding to the source port.
5. The method according to claim 1, characterized in that The method of transmitting the diagnostic data of the first control unit to the on-board diagnostic interface by using the target communication link and the target transmission port configured for each switching device in the target communication link comprises: For a first switching device in the second Ethernet controller, obtaining diagnostic data of the first control unit through a source port of the switching device, and sending the diagnostic data to a next switching device through a mirror port of the switching device; For a second switching device in the target communication link other than the first switching device in the second Ethernet controller, receiving diagnostic data transmitted by a previous switching device in the target communication link through a source port of the second switching device, and sending the diagnostic data to a next switching device in the target communication link or an on-board diagnostic interface through a mirror port of the second switching device; The above steps are repeated until the diagnostic data is transmitted to the on-board diagnostic interface through the mirror port of the switching device of the first Ethernet controller.
6. The method according to claim 5, characterized in that Receiving diagnostic data through a source port of a switching device, comprising: receiving to-be-filtered data including diagnostic data through a source port of the switching device; the diagnostic data carries a destination MAC address, the destination MAC address is a MAC address of a fourth Ethernet controller that performs data exchange with the second Ethernet controller, and the diagnostic data is exchange data between the second Ethernet controller and the fourth Ethernet controller; Sending the diagnostic data through the mirror port of the switching device includes: filtering the data to be filtered according to the destination MAC address carried in the data to be filtered to obtain the diagnostic data, and sending the diagnostic data through the mirror port.
7. The method according to claim 1, characterized in that After determining, in response to receiving a diagnostic instruction through the on-board diagnostic interface, that the diagnostic instruction indicates a first control unit for diagnosis, the method further includes: Controlling the first Ethernet controller to receive a diagnostic instruction sent by the on-board diagnostic interface; According to the on-board diagnostic instruction interaction protocol between Ethernet controllers, the first Ethernet controller is controlled to send the diagnostic instruction to the first control unit in the second Ethernet controller.
8. A data transmission device, characterized in that: Applicable to a vehicle equipped with an in-vehicle Ethernet, wherein the in-vehicle Ethernet is provided with a plurality of Ethernet controllers, at least some of the Ethernet controllers respectively include a switching device and at least one control unit connected to the switching device, and the plurality of Ethernet controllers include a first Ethernet controller connected to an in-vehicle diagnostic interface; the device comprises: an instruction receiving module, configured to, in response to receiving a diagnostic instruction through the on-board diagnostic interface, determine a first control unit that the diagnostic instruction indicates to diagnose, the first control unit being a control unit in the second Ethernet controller; A link determination module, configured to determine a target communication link between the first Ethernet controller and the second Ethernet controller based on a communication connection relationship between the Ethernet controllers in the vehicle Ethernet; wherein the Ethernet controller including the switching device is in the target communication link and is connected to other Ethernet controllers through the switching device included therein; A port configuration module, configured to configure a target transmission port for transmitting diagnostic data for each switching device located in the target communication link; wherein the switching device transmits diagnostic data to the switching device of other Ethernet controllers through the target transmission port; The data sending module is used to transmit the diagnostic data of the first control unit to the on-board diagnostic interface by using the target communication link and the target transmission port configured for each switching device in the target communication link.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the data transmission method as described in any one of claims 1 to 7 are performed.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data transmission method according to any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Operation method of communication node for mirroring in vehicle network and communication node
CN107920033A
Communication redundancy configuration method and device of vehicle-mounted controller, vehicle and storage medium
CN116248583A
Vehicle-mounted Ethernet looped network operation state information diagnosis method and related device
CN116719302A