Vehicle-mounted communication network diagnosis processing method and related equipment
Automatically identifying the master-slave mode through external switches, realizing the automated processing of virtual LAN identification, solving the problem that external diagnostic equipment needs to manually set virtual LAN identification, and improving the compatibility and operational convenience of on-board communication diagnosis.
Patent Information
- Application Number
- CN202510697450.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-08-15
AI Technical Summary
In the prior art, external diagnostic equipment needs to manually set up virtual LAN identifiers, resulting in poor adaptability and difficulty in adapting to diverse on-board communication network testing scenarios, especially between the whole vehicle and the single-piece test, there is a risk of communication failure or misoperation.
Through the external switch based on the automatic identification and judgment mechanism of the master-slave mode, the automatic processing of virtual LAN identification is realized, including transparent transmission of messages in the vehicle communication mode and automatic addition of virtual LAN identification in the single-piece communication mode.
It improves the compatibility and operational convenience of on-board communication diagnosis, simplifies the operation process, and ensures communication accuracy and consistency in different test scenarios.
Smart Images

Figure CN120499055A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle testing technology, and more specifically, to a vehicle-mounted communication network diagnosis and processing method and related equipment. Background Art
[0002] As in-vehicle network architectures continue to evolve toward centralized, Ethernet-based architectures, diagnostic communications, a key component of vehicle development, testing, and after-sales maintenance, face increasingly complex network topologies and protocol environments. Diagnostics over Internet Protocol (DoIP), a high-speed, standardized protocol, has gained widespread adoption in modern intelligent connected vehicles. However, different services within in-vehicle communication networks are typically isolated via virtual local area networks (VLANs), and diagnostic messages must meet specific VLAN configuration requirements, placing greater demands on the adaptability and flexibility of external diagnostic equipment.
[0003] In related technologies, external diagnostic equipment is usually connected to the Ethernet interface of the vehicle under test directly through a wired connection by a diagnostic computer for diagnostic communication. In order to meet the VLAN isolation mechanism of the in-vehicle communication network, existing solutions often require the diagnostic computer to have the ability to manually add virtual LAN identifiers to the messages. However, this method has many limitations: on the one hand, some computer network cards do not support VLAN configuration themselves; on the other hand, even if they support configuration, administrator privileges are often required, and the setup process is complicated and tedious, which can easily lead to misoperation. At the same time, there are significant differences in network topology and communication paths between whole vehicle testing and single-unit testing scenarios. Existing technologies cannot automatically determine whether virtual LAN identifiers need to be processed in different scenarios, resulting in users still having to manually determine and switch configurations, increasing the usage threshold and the risk of errors.
[0004] Especially during the single-unit test process, since the diagnostic computer is directly connected to the Electronic Control Unit (ECU), VLAN encapsulation processing is no longer performed through the in-vehicle switch. Therefore, if the external device cannot correctly add the virtual LAN identifier, the target electronic control unit will not be able to recognize the message, resulting in communication failure. In the whole vehicle communication scenario, if the virtual LAN identifier is added incorrectly, it may cause the message to be unable to correctly enter the vehicle network. In other words, there are technical problems in the related art that the VLAN processing method in the diagnostic communication process relies on manual configuration, has poor automatic recognition capabilities, and is difficult to adapt to various test scenarios. Summary of the Invention
[0005] The Summary of the Invention section of this application introduces a series of simplified concepts that will be further described in detail in the Detailed Description of the Invention section. The Summary of the Invention section of this application is not intended to limit the key features and essential technical features of the claimed technical solution, nor is it intended to determine the scope of protection of the claimed technical solution.
[0006] The vehicle-mounted communication network diagnostic processing method and related equipment provided in this application can realize the automated processing of virtual local area network identification configuration through the automatic identification and judgment mechanism of the external switch based on the master-slave mode, taking into account the whole vehicle and single-piece testing scenarios, and effectively improving the compatibility and operational convenience of vehicle-mounted communication diagnosis.
[0007] In the first aspect, the present application provides a vehicle-mounted communication network diagnostic processing method, which is applied to an external diagnostic device, wherein the external diagnostic device includes an external switch and a diagnostic computer, and the external switch is arranged between the diagnostic computer and the vehicle under test. The vehicle-mounted communication network diagnostic processing method includes: obtaining a master-slave mode configuration signal of the external switch; when the master-slave mode configuration signal is a whole vehicle communication mode, transmitting the vehicle-mounted communication network diagnostic message of the diagnostic computer to the vehicle-mounted communication system of the vehicle under test through the external switch in a direct forwarding mode; when the master-slave mode configuration signal is a single-piece communication mode, performing virtual LAN identifier injection processing on the vehicle-mounted communication network diagnostic message through the external switch, and forwarding the target message to the target electronic control unit of the vehicle under test after obtaining it.
[0008] In some embodiments, obtaining the master-slave mode configuration signal of the external switch includes: obtaining current state parameters of a physical dial button device of the external switch, wherein the physical dial button device includes at least two switchable mechanical positioning gears; and converting the current state parameters into the master-slave mode configuration signal according to a preset gear mapping relationship.
[0009] In some embodiments, the process of injecting a virtual local area network identifier into the vehicle-mounted communication network diagnostic message through the external switch and forwarding the target message to the target electronic control unit of the vehicle under test includes: obtaining a preset virtual local area network identifier and the logical address information of the target electronic control unit; performing a label insertion operation on the Ethernet frame header of the vehicle-mounted communication network diagnostic message according to the preset virtual local area network identifier to generate an encapsulated message carrying the preset virtual local area network identifier; modifying the destination address field of the encapsulated message based on the logical address information to generate the target message; and sending the target message to the physical interface corresponding to the target electronic control unit through the first communication port of the external switch.
[0010] In some embodiments, the vehicle communication network diagnostic processing method further includes: when the master-slave mode configuration signal is a single-piece communication mode, performing a virtual local area network identifier stripping operation on the response message from the target electronic control unit through the external switch and forwarding it to the diagnostic computer.
[0011] In some embodiments, the virtual LAN identifier stripping operation on the response message from the target electronic control unit through the external switch and forwarding it to the diagnostic computer includes: when it is detected that the Ethernet frame header of the response message contains a virtual LAN identifier field, extracting the response identifier in the virtual LAN identifier field; when the response identifier is consistent with the preset virtual LAN identifier, removing the virtual LAN identifier field of the response message and reorganizing the Ethernet frame header of the response message to generate an unidentified response message; modifying the source address field of the unidentified response message to the logical address corresponding to the external switch to generate a reverse processing message; and forwarding the reverse processing message to the diagnostic computer through the first communication port of the external switch.
[0012] In some embodiments, the on-board communication network diagnostic message of the diagnostic computer is transmitted to the on-board communication system of the vehicle under test through the external switch in a direct forwarding mode, including: receiving the on-board communication network diagnostic message through the first communication port of the external switch; based on the direct forwarding rule, forwarding the on-board communication network diagnostic message to the second communication port of the on-board internal switch through the external switch, so that the on-board internal switch performs dynamic identification encapsulation processing and response message decapsulation processing on the on-board communication network diagnostic message based on a preset logical isolation strategy, and returns the generated unidentified response message to the external switch; the on-board communication network diagnostic processing method also includes: forwarding the unidentified response message to the diagnostic computer through the first preset port of the external switch.
[0013] In some embodiments, the vehicle-mounted communication network diagnostic processing method further includes: obtaining a message feature comparison database, the message feature comparison database including a whole-vehicle communication feature fingerprint and a single-piece communication feature fingerprint; when the master-slave mode configuration signal is not obtained, performing pattern matching identification on the received message based on the message feature comparison database to obtain a pattern matching result; and generating a master-slave mode configuration signal corresponding to the pattern matching result.
[0014] In some embodiments, obtaining the current state parameters of the physical dial button device of the external switch includes: collecting displacement data of the dial button block of the physical dial button device in real time through a photoelectric sensor array; inputting the displacement data into a preset Kalman filter algorithm for noise elimination processing to obtain denoised displacement data; and determining the current state parameters based on a comparison result of the denoised displacement data with a preset displacement threshold interval.
[0015] In the second aspect, the present application also provides a vehicle-mounted communication network diagnostic processing device, which is applied to an external diagnostic device, wherein the external diagnostic device includes an external switch and a diagnostic computer, and the external switch is arranged between the diagnostic computer and the vehicle under test. The vehicle-mounted communication network diagnostic processing device includes: a signal acquisition unit, used to obtain the master-slave mode configuration signal of the external switch; a whole vehicle test unit, used to transmit the vehicle-mounted communication network diagnostic message of the diagnostic computer to the vehicle-mounted communication system of the vehicle under test through the external switch in a direct forwarding mode when the master-slave mode configuration signal is the whole vehicle communication mode; a single-piece test unit, used to perform virtual LAN identifier injection processing on the vehicle-mounted communication network diagnostic message through the external switch when the master-slave mode configuration signal is the single-piece communication mode, and forward the target message to the target electronic control unit of the vehicle under test after obtaining it.
[0016] In a third aspect, the present application further provides an electronic device comprising: a memory and a processor, wherein the processor is configured to implement the steps of the vehicle communication network diagnostic processing method described in the first aspect when executing a computer program stored in the memory.
[0017] In a fourth aspect, the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the vehicle-mounted communication network diagnostic processing method described in the first aspect.
[0018] In a fifth aspect, the present application also provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, the vehicle communication network diagnostic processing method provided in the embodiment of the present application is implemented.
[0019] In summary, the present application firstly automatically detects the master-slave mode through an external switch, effectively avoiding the problem in the traditional solution that the external diagnostic equipment needs to manually set the virtual local area network identifier (VLANID), which can solve the phenomenon that the virtual local area network identifier configuration is difficult due to network card model restrictions or insufficient administrator authority, and simplifies the operation process; secondly, through the automatic judgment mechanism based on the master-slave mode configuration signal, it controls whether to add the virtual local area network identifier to the vehicle communication network diagnostic message, and can automatically adapt to the two typical scenarios of whole vehicle testing and single-piece testing, transparently transmit messages in the whole vehicle communication mode, and automatically complete the addition of the virtual local area network identifier in the single-piece communication mode, ensuring the accuracy and consistency of communication. In summary, the vehicle communication network diagnosis and processing method provided by the present application realizes the automated processing of the virtual local area network identifier configuration through the automatic recognition and judgment mechanism of the external switch based on the master-slave mode, taking into account the whole vehicle and single-piece test scenarios, and effectively improving the compatibility and operational convenience of the vehicle communication diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present description. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:
[0021] Figure 1 A flowchart of a vehicle communication network diagnosis and processing method provided in an embodiment of the present application;
[0022] Figure 2 A schematic diagram of the structure of a vehicle-mounted communication network diagnostic processing device provided in an embodiment of the present application;
[0023] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] Terms in the specification, claims, and drawings of this application, such as "first," "second," "third," "fourth," and the like (if any), are used to distinguish between similar objects, rather than to describe a particular order or precedence. Therefore, it is understood that these terms can be used interchangeably where appropriate, so that the embodiments described can be implemented in a different order, unless otherwise specified in the drawings or descriptions. In addition, the terms "is" and "has" and any variations thereof in this application are intended to cover all possible constituent elements on a non-exclusive basis. For example, a process, method, system, product, or apparatus that includes several steps or units is not necessarily limited to the steps or units that are explicitly listed, but may also include other steps or units that are not explicitly listed, or steps or units that are inherent to the process, method, product, or apparatus.
[0025] In this application, a "module" or "unit" refers to a computer program or part of a computer program that has a specific function and works in conjunction with other related parts to achieve a predetermined goal. These modules or units can be implemented by software, hardware (such as processing circuits or memories), or a combination of the two. One or more processors or memories can implement one or more modules or units. At the same time, each module or unit can also be part of a larger module or unit.
[0026] The technical solutions in this application will be described in detail below in conjunction with the accompanying drawings in the embodiments. It should be noted that the embodiments described are only part of this application, not all embodiments. In the following description, the "some embodiments" mentioned are only a subset of all possible embodiments, which may be the same or different subsets, and different embodiments can be combined with each other without conflict.
[0027] Figure 1 This is a flow chart of a vehicle communication network diagnosis and processing method provided by an embodiment of the present application. Figure 1 The vehicle communication network diagnostic processing method provided in an embodiment of the present application is applied to an external diagnostic device, wherein the external diagnostic device includes an external switch and a diagnostic computer, and the external switch is arranged between the diagnostic computer and the vehicle under test. The vehicle communication network diagnostic processing method may include the following steps 101 to 103:
[0028] Step 101: Obtain a master-slave mode configuration signal of an external switch;
[0029] In some examples, an external diagnostic device refers to a hardware assembly located outside the vehicle and used to perform diagnostic tasks. It can include a computer running diagnostic software (a diagnostic computer) and an external switch that supports network forwarding and processing. The external diagnostic device is not built into the vehicle under test, but is temporarily connected for use during testing or maintenance. The external switch is a component of the external diagnostic device and is deployed between the diagnostic computer and the vehicle under test. The external switch not only has traditional data forwarding capabilities but also supports functional enhancements under specific protocols, such as virtual LAN identifier insertion / stripping, automatic communication mode identification, and address rewriting. It has multiple communication ports and certain software and hardware configurability. The external switch can be an industrial-grade managed switch that supports the 802.1Q standard. The diagnostic computer refers to a control host running diagnostic software (such as UDS tools, CANoe, Vehicle Spy, etc.). It can be connected to the external switch via a standard Ethernet interface to send diagnostic messages and receive vehicle response information. The diagnostic computer can be a laptop, an industrial computer, an embedded electronic control unit, etc. The vehicle under test refers to a system consisting of a complete vehicle or a single electronic control unit that is currently connected to the diagnostic system for testing or debugging. Depending on the test type, it can be a complete vehicle bus system or a portion of an electronic control unit. The master-slave mode configuration signal is a control signal that represents the current communication test mode and is used to indicate whether the current mode is "complete vehicle communication mode" or "single unit communication mode." In the embodiment of the present application, the master-slave mode configuration signal determines the message processing method of the external switch. The master-slave mode configuration signal can be obtained by reading the status of a physical dial device on the external switch, such as a three-position rotary switch, or it can be read from the external switch's web configuration interface or serial command interface.
[0030] For example, the gear position of a physical dial device set on an external switch can be read, for example, "up gear" is the whole vehicle communication mode, and "down gear" is the single-piece communication mode, and the switch position status can be collected through the corresponding electrical signal or photoelectric sensor to convert it into a master-slave mode configuration signal.
[0031] Through the implementation of step 101, the current test scenario can be automatically identified, thereby providing a prerequisite for judging whether the virtual LAN identifier needs to be processed subsequently, realizing adaptive switching of subsequent processing logic, reducing manual intervention, and improving the intelligence level of vehicle communication network diagnosis and processing.
[0032] Step 102 , when the master-slave mode configuration signal is the vehicle communication mode, the vehicle communication network diagnostic message of the diagnostic computer is transmitted to the vehicle communication system of the vehicle under test in a direct forwarding mode through the external switch;
[0033] In some examples, the whole vehicle communication mode means that during the diagnostic process, the object under test is in the whole vehicle state, that is, all on-board electronic control units are interconnected through the vehicle's internal bus (such as Ethernet, CAN, FlexRay, etc.), and the system is in the overall joint debugging or actual vehicle verification state; at this time, in order to avoid affecting the existing network structure and message format of the whole vehicle, the on-board communication network diagnostic message does not need to be additionally encapsulated or inserted with a virtual LAN identifier, but should maintain the original message structure and be transmitted directly. The on-board communication network diagnostic message refers to the standard protocol message sent by the diagnostic computer to the vehicle under test for accessing the electronic control unit diagnostic service, such as the Unified Diagnostic Services (UDS) message, the Diagnostic Communication over Internet Protocol (DoIP) message, etc.; the content of the on-board communication network diagnostic message includes service requests (such as reading DTC, clearing fault codes, ECU programming, etc.) and requires the electronic control unit to respond; the on-board communication network diagnostic message may include an Ethernet frame header, an IP header, a TCP / UDP header, and a UDS message body, etc. Direct forwarding mode means that the external switch transparently forwards the original on-board communication network diagnostic message sent by the diagnostic computer to the on-board communication system directly according to the forwarding table without any content modification or additional processing. In this mode, the external switch only acts as a "non-perceptual relay" device, bridging the physical and data link layers. The on-board communication system of the vehicle under test refers to the network system used for communication between the various electronic control units within the vehicle. It includes an Ethernet backbone network and various electronic control unit nodes, which can be connected through the vehicle's internal switch. Once the on-board communication network diagnostic message enters the on-board communication system, it is distributed to the corresponding electronic control unit node based on its destination address or protocol header.
[0034] For example, when the external switch determines that the current communication mode is the whole vehicle communication mode, it will switch to the direct forwarding mode, so that the DoIP message sent by the diagnostic computer will enter the external switch through the first communication port as is without any processing, and will be forwarded directly from the second communication port to the inlet interface of the vehicle communication system; in this mode, the vehicle network will dynamically encapsulate the virtual LAN identifier according to the internal configuration or directly route to the target electronic control unit, so as to achieve seamless access to the diagnostic process of the whole vehicle network, thereby ensuring that the message structure is fully matched with the actual vehicle environment, avoiding communication anomalies or packet loss due to operations such as manually setting the virtual LAN identifier.
[0035] By implementing step 102, the complex operation of configuring the virtual LAN identifier of the external diagnostic device can be avoided, while ensuring that the diagnostic communication message enters the vehicle network smoothly, which can improve the compatibility and efficiency of the diagnostic process, and is particularly suitable for the scenario of original equipment manufacturer (OEM) or server-side vehicle testing.
[0036] Step 103: When the master-slave mode configuration signal is in single-unit communication mode, the vehicle communication network diagnostic message is injected with a virtual local area network identifier through an external switch, and the target message is forwarded to the target electronic control unit of the vehicle under test after being obtained;
[0037] In some examples, the single-piece communication mode means that the object being tested during the diagnostic process is a single or partial electronic control unit, rather than a whole vehicle; for example, in scenarios such as R&D, maintenance, and off-line testing of a production line, it is only necessary to perform independent communication verification on a certain electronic control unit, such as a gateway, automatic transmission control unit (TCU), body control module (BCM), etc.; because the network structure is simplified in the single-piece test state and the electronic control unit may be separated from the whole vehicle environment, it is necessary to use additional virtual LAN identification means to guide the message to be correctly routed to the target electronic control unit. Virtual LAN identifier injection processing refers to an external switch inserting a specific virtual LAN identifier (virtual LAN identifier) into the Ethernet frame header so that it can be correctly identified and distributed after entering the vehicle under test; virtual LAN identifier injection processing can be used to guide diagnostic messages to the target electronic control unit to make up for the insufficient addressing when the target electronic control unit is separated from the whole vehicle. The VLAN identifier is a field in the IEEE 802.1Q standard used to identify the virtual network segment to which a message belongs in the Ethernet frame header. Each electronic control unit can be pre-assigned a unique VLAN identifier when in a test state, allowing an external switch to forward the message to the corresponding port or device using this VLAN identifier. For example, if the VLAN identifier of target electronic control unit A is 101 and the VLAN identifier of target electronic control unit B is 102, the external switch will distribute the message to the corresponding physical port based on the VLAN identifier. A target message is a diagnostic message generated after processing by an external switch, with the VLAN identifier encapsulated and the destination address field modified. This meets the requirements for directional access to the in-vehicle network. The target message maintains its diagnostic content structurally unchanged, with only the VLAN identifier added to the frame header and the address routing information adjusted. The target electronic control unit of the vehicle under test is the on-board electronic control unit currently in the test state, which serves as the receiver and responder of the diagnostic message; the target electronic control unit may be separated from the original vehicle environment and connected to an external switch through manual wiring or a test platform, and auxiliary identification information is required to complete accurate communication; for example, the target electronic control unit can be a separately tested body control module, T-Box unit, Ethernet domain controller, etc.
[0038] For example, when it is detected that the current master-slave mode configuration signal is a single-piece communication mode, the external switch will automatically start the virtual LAN identifier injection process; after the UDS message sent by the diagnostic computer is received by the switch, the external switch will read the virtual LAN identifier and logical address configured by the target controller, perform the Ethernet frame header insertion operation, and modify the destination MAC address to the addressing identifier dedicated to the controller to generate a target message; the target message is then sent to the physically connected target electronic control unit through the switch port, thereby realizing point-to-point diagnostic access.
[0039] By implementing step 103, the problem of the inability of the in-vehicle switch to automatically process the virtual LAN identifier during single-unit testing can be solved, the accuracy and completeness of diagnostic communications can be guaranteed, the test coverage and adaptability can be improved, and communication failure or misdiagnosis due to the lack of the virtual LAN identifier can be avoided.
[0040] In summary, the embodiment of the present application firstly automatically detects the master-slave mode through an external switch, effectively avoiding the problem in the traditional solution that the external diagnostic equipment needs to manually set the virtual local area network identifier (VLANID), which can solve the phenomenon that the virtual local area network identifier configuration is difficult due to network card model restrictions or insufficient administrator authority, and simplifies the operation process; secondly, through the automatic judgment mechanism based on the master-slave mode configuration signal, it controls whether to add the virtual local area network identifier to the vehicle communication network diagnostic message, and can automatically adapt to the two typical scenarios of whole vehicle testing and single-piece testing, transparently transmit messages in the whole vehicle communication mode, and automatically complete the addition of the virtual local area network identifier in the single-piece communication mode, ensuring the accuracy and consistency of communication. In summary, the vehicle communication network diagnosis processing method provided by the embodiment of the present application realizes the automated processing of the virtual local area network identifier configuration through the automatic recognition and judgment mechanism of the external switch based on the master-slave mode, taking into account the whole vehicle and single-piece test scenarios, and effectively improving the compatibility and operational convenience of the vehicle communication diagnosis.
[0041] In some embodiments, the aforementioned obtaining of the master-slave mode configuration signal of the external switch may include: obtaining current state parameters of a physical dial button device of the external switch, wherein the physical dial button device may include at least two switchable mechanical positioning gears; and converting the current state parameters into the master-slave mode configuration signal according to a preset gear mapping relationship.
[0042] In some examples, the physical dial device is a manual control element with a mechanical switching function, which can be in the form of a knob switch, slider, or dip switch. The dial device is integrated into an external switch, allowing testers to select the communication mode. For example, the physical dial device can be a three-position knob switch, labeled "whole vehicle," "single unit," and "empty," corresponding to the whole vehicle communication mode, single unit communication mode, and off mode. The current state parameter refers to the physical state quantity of the physical dial device detected by the sensor or acquisition module, such as displacement, voltage value, code value, etc., which is used to represent the current position of the dial. The preset gear mapping relationship refers to a mapping table or rule set that maps various state parameters of the physical dial device (such as voltage, level, sensor code) to specific logical identifiers of the master-slave mode, that is, converting the current state parameters into the identification basis of "whole vehicle communication mode" or "single-piece communication mode". It can be preset in the program, burned into the embedded chip, or configured in the initialization parameters of the external switch; for example, [0,0] corresponds to "neutral gear" (invalid), [1,0] corresponds to "whole vehicle communication mode", and [0,1] corresponds to "single-piece communication mode".
[0043] For example, a three-speed mechanical dial can be integrated on the external switch, which is equipped with two photoelectric sensors inside. When the tester manually switches the dial to the "single-piece" position, the light shield will cover one sensor to generate the state [0,1]. After reading the state, it is identified as the "single-piece communication mode" through the mapping relationship, and the identification result is written into the internal register or state machine variable as the master-slave mode configuration signal.
[0044] Through the implementation of the above embodiments, a physical dial button device with multiple mechanical positioning gears is set up, which can switch between different master-slave modes in a simple and intuitive way, avoid software operation, and improve the convenience of device operation and fool-proofness; further, by mapping the dial button status to the master-slave mode configuration signal, it can provide a clear basis for the subsequent message processing process, and realize the automatic linkage of mode recognition and communication behavior.
[0045] In some embodiments, the aforementioned virtual LAN identifier injection processing of the vehicle communication network diagnostic message through an external switch, and forwarding the target message to the target electronic control unit of the vehicle under test after obtaining it, can include: obtaining a preset virtual LAN identifier and the logical address information of the target electronic control unit; performing a label insertion operation on the Ethernet frame header of the vehicle communication network diagnostic message according to the preset virtual LAN identifier to generate an encapsulated message carrying the preset virtual LAN identifier; modifying the destination address field of the encapsulated message based on the logical address information to generate a target message; and sending the target message to the physical interface corresponding to the target electronic control unit through the first communication port of the external switch.
[0046] In some examples, the preset virtual local area network (VLAN) identifier is a VLAN identifier used to specify the target control unit or control domain to which the vehicle communication network diagnostic message should be routed. The preset VLAN identifier can be predefined in a switch configuration file or web configuration interface, or dynamically issued by the diagnostic computer before starting the test. For example, target electronic control unit A is assigned a VLAN identifier of 100, and target electronic control unit B is assigned a VLAN identifier of 200. Logical address information refers to the abstract unique identifier of the target electronic control unit on the network, which can be an IP address, MAC address, or ECU identifier in the diagnostic protocol, such as the Logical Address field in DoIP, which is used to identify the destination node in the message. The logical address information can come from a configuration database, be parsed from a vehicle diagnostic description file, or be manually configured by the user. For example, a certain logical address information can be 192.168.0.10 or 00:11:22:33:44:55. The Ethernet frame header is the front section of an Ethernet data packet (such as an on-board communication network diagnostic message or response message) and can include a destination MAC address (6 bytes), a source MAC address (6 bytes), and a type field (2 bytes). Tag insertion involves inserting an 802.1Q tag field into the Ethernet frame header structure. This tag field contains at least a virtual local area network (VLAN) identifier, which specifies the virtual network to which the message belongs. An encapsulated message carrying a preset VLAN identifier is a complete Ethernet message with the VLAN identifier inserted. During transmission, it carries the VLAN identifier, which specifies the virtual network to which it belongs, enabling conditional forwarding, isolation, or priority processing within the on-board switching network. The destination address field, located in the Ethernet frame header, identifies the specific device address to which the message should be sent. Modifying this field allows the on-board communication network diagnostic message to be routed to the target electronic control unit. The specific data in the destination address field can be obtained from the target logical address mapping table or from the "target device" parameter in the user-configured diagnostic software. The first communication port is the port that connects the external switch to other devices (such as a diagnostic computer or target electronic control unit). It can be used to receive the original vehicle communication network diagnostic message sent by the diagnostic computer and is also the entry port for encapsulation processing. The physical interface corresponding to the target electronic control unit refers to the specific network physical port through which the target electronic control unit is connected to the external switch. For example, if the external switch is connected to port 3 of the target electronic control unit, port 3 is the "target physical interface". After the virtual LAN identifier encapsulation and address modification are completed, the encapsulated message will be accurately forwarded to this port.
[0047] For example, in a single-unit test scenario, the diagnostic computer sends a DoIP message for programming ECU_A. The external switch reads the current "single-unit communication mode" and finds that the target virtual LAN identifier is 100 and the target logical MAC address is 00:11:22:33:44:55. Then, after receiving the diagnostic message from the on-board communication network, it performs the virtual LAN identifier insertion operation and rewrites the destination MAC field to the address of ECU_A to form the target message; finally, the message is sent to the physical interface where ECU_A is located, completing accurate and automatic diagnostic message routing.
[0048] Through the implementation of the above embodiments, in the single-piece communication mode, the virtual LAN identifier encapsulation is performed on the message through the external switch and the target address field is modified, which not only realizes the docking of the diagnostic message format with the communication requirements of the target electronic control unit, but also enhances the accuracy of message forwarding and network compatibility, effectively improving the reliability and adaptability of diagnostic communication.
[0049] In some embodiments, the aforementioned vehicle communication network diagnostic processing method may further include: when the master-slave mode configuration signal is a single-piece communication mode, performing a virtual LAN identifier stripping operation on the response message from the target electronic control unit through an external switch and forwarding it to the diagnostic computer.
[0050] In some examples, a response message refers to a network message generated by a target electronic control unit in response to an on-vehicle communication network diagnostic message sent by a diagnostic computer, and may include response data and status information to the on-vehicle communication network diagnostic message; for example, the diagnostic computer requests to read the software version number of the target electronic control unit, and the response message of the target electronic control unit contains a version string, such as "SW_Version_1.2.3". The virtual local area network identifier stripping operation refers to the operation of removing the virtual local area network identifier field from the Ethernet frame, restoring the original structure of the frame to ensure that the diagnostic computer can recognize and correctly parse the response data. In single-piece communication mode, the external switch first performs a virtual local area network identifier stripping operation on the diagnostic response returned from the target electronic control unit, and then forwards the processed message back to the diagnostic computer to complete a complete diagnostic communication loop.
[0051] For example, in a single-unit test scenario, the diagnostic computer sends a DoIP request message with a virtual LAN identifier of 200 to the target electronic control unit B. After processing, the target electronic control unit B generates a response message with the same virtual LAN identifier; when the external switch receives the response message from the target electronic control unit B, it automatically performs virtual LAN identifier stripping according to the port binding policy, retains the Ethernet standard header and payload part, and then forwards the stripped frame as is to the diagnostic computer port.
[0052] Through the implementation of the above embodiment, the response message returned by the target electronic control unit is stripped of the virtual LAN identifier to ensure that the returned data format matches the receiving capability of the diagnostic computer, which can further improve the two-way compatibility of the message and avoid communication failure. At the same time, it can also simplify the protocol adaptation work on the diagnostic computer side and enhance the adaptability of the method.
[0053] In some embodiments, the aforementioned operation of stripping the virtual LAN identifier of the response message from the target electronic control unit through the external switch and forwarding it to the diagnostic computer may include: when it is detected that the Ethernet frame header of the response message contains a virtual LAN identifier field, extracting the response identifier in the virtual LAN identifier field; when the response identifier is consistent with the preset virtual LAN identifier, removing the virtual LAN identifier field of the response message and reorganizing the Ethernet frame header of the response message to generate an unidentified response message; modifying the source address field of the unidentified response message to the logical address corresponding to the external switch to generate a reverse processing message; and forwarding the reverse processing message to the diagnostic computer through the first communication port of the external switch.
[0054] In some examples, the Ethernet frame header of the response message contains a virtual LAN identification field, which means that the data link layer header of the response message contains a virtual LAN identification field, which is used to identify which virtual local area network (VLAN) the frame belongs to. An unidentified response message refers to a standard Ethernet data frame that is re-encapsulated after stripping off the virtual LAN identification. The frame does not contain any virtual LAN identification field and only retains the necessary link layer and transport layer information. The logical address corresponding to the external switch refers to the source MAC address or IP address used by the external switch as the sender of the response message in the network. When forwarding to the diagnostic computer, it is used as the response source to ensure a closed loop of the diagnostic process. The reverse processing message refers to a response message in which the source address field is replaced with the logical address of the external switch after stripping off the virtual LAN identification, thereby forming a data frame that is forwarded to the diagnostic computer in the form of "relay transmission" by the switch.
[0055] For example, during a single-unit test, the target electronic control unit B responds to the target message and generates an Ethernet data frame (response message) carrying a virtual LAN identifier of 100; after receiving this frame, the external switch recognizes that its frame header contains a virtual LAN identifier field, and reads its virtual LAN identifier. When it finds that it matches the local preset virtual LAN identifier, it immediately performs a stripping operation: removes the VLAN field, and replaces the source MAC address with the pre-configured address of the external switch (such as: 00:11:22:33:44:55); after completing the encapsulation adjustment, the switch sends the processed response message to the diagnostic computer through its upstream port.
[0056] By implementing the above-mentioned embodiments, the virtual LAN identification field in the response message is identified and stripped, and the source address is processed, which can ensure the standardization of the returned data format, improve security, prevent mismatches and address conflicts, and improve the identifiability and traceability of the message in the uplink.
[0057] In some embodiments, the aforementioned transmission of the vehicle-mounted communication network diagnostic message of the diagnostic computer to the vehicle-mounted communication system of the vehicle under test through the external switch in a direct forwarding mode may include: receiving the vehicle-mounted communication network diagnostic message through the first communication port of the external switch; based on the direct forwarding rule, forwarding the vehicle-mounted communication network diagnostic message to the second communication port of the on-board internal switch through the external switch, so that the on-board internal switch performs identification dynamic encapsulation processing and response message decapsulation processing on the vehicle-mounted communication network diagnostic message based on a preset logical isolation strategy, and returns the generated unidentified response message to the external switch; the vehicle-mounted communication network diagnostic processing method may also include: forwarding the unidentified response message to the diagnostic computer through the first preset port of the external switch.
[0058] In some examples, a straight-through forwarding rule refers to a set of rules in which the external switch does not perform any modification or encapsulation operations on the received message, but instead transparently forwards the original message to the destination port based on its port mapping relationship or MAC forwarding table; for example, if a message enters from port 1 and port 1 is mapped to port 2 in the lookup table, the message is directly forwarded to port 2. The on-board internal switch refers to the main switching node in the internal network of the vehicle under test, which is generally an Ethernet gateway or a central network management switching module, responsible for managing data forwarding and logical isolation between the electronic control units of the entire vehicle. The second communication port is a physical port of the on-board internal switch, which can be used to connect to the external switch and receive the diagnostic messages it transmits. The preset logical isolation strategy refers to the communication control rules such as VLAN division, MAC binding, port isolation, etc. set in the on-board internal switch, which is used to logically isolate different electronic control units or diagnostic channels in the network to prevent illegal access or conflicts; dynamic identification encapsulation processing refers to the on-board internal switch automatically adding the corresponding virtual LAN identification tag to the diagnostic message without virtual LAN identification after receiving it, so that it adapts to the internal logical isolation strategy and can be routed to the target electronic control unit; response message decapsulation processing refers to the target electronic control unit returning a response message with a virtual LAN identification, and the on-board internal switch removes the virtual LAN identification (i.e. decapsulation) and generates a standard Ethernet response message, which is then sent back to the external switch.
[0059] Exemplarily, in the whole vehicle communication mode, the diagnostic computer sends a UDS message to the external switch. The external switch forwards the original message through the first communication port to the second communication port of the on-board internal switch according to the direct forwarding rule. The on-board internal switch dynamically inserts the virtual LAN identifier of the diagnostic domain into the message according to the preset logical isolation strategy, so as to correctly forward it to the target electronic control unit; then, the target electronic control unit generates a response message and brings it back. The on-board internal switch performs an unpacking operation on it, strips off the virtual LAN identifier, and generates an unidentified response message. The message is transmitted back to the external switch via the on-board internal switch, and is sent to the diagnostic computer by the external switch through the first preset port. The entire process completes the diagnostic communication under the premise that the network structure remains unchanged, ensuring an efficient, isolated and secure whole vehicle testing environment.
[0060] Through the implementation of the above embodiment, when in the whole vehicle communication mode, the external switch enables the direct forwarding mode, which can completely bypass the virtual LAN identification processing, ensure the communication link between the diagnostic computer and the vehicle system is efficient and transparent, reduce message delay and processing burden, and at the same time give full play to the native ability of the vehicle's internal switch for network isolation and encapsulation, to achieve more reasonable load division and resource optimization.
[0061] In some embodiments, the aforementioned vehicle communication network diagnostic processing method may further include: obtaining a message feature comparison database, which may include a whole-vehicle communication feature fingerprint and a single-piece communication feature fingerprint; when the master-slave mode configuration signal is not obtained, performing pattern matching identification on the received message based on the message feature comparison database to obtain a pattern matching result; and generating a master-slave mode configuration signal corresponding to the pattern matching result.
[0062] In some examples, the message feature comparison database refers to a set of message feature templates used for automatic identification of diagnostic communication modes. The message feature comparison database stores multiple typical message structure features representing different communication modes, which are used to compare and analyze the diagnostic or communication messages actually received to determine the current mode. The message feature comparison database can be organized and solidified into a database by system engineers based on historical test data. It can be stored as a structured table (such as CSV, SQLite), JSON format, or embedded in diagnostic software. The whole vehicle communication feature fingerprint refers to a set of typical structural features of diagnostic messages or ordinary communication messages in the whole vehicle communication mode, representing the structural regularity characteristics of the communication traffic in this mode. Correspondingly, the single-piece communication feature fingerprint refers to a set of typical structural features of diagnostic messages or ordinary communication messages in the single-piece communication mode, representing the structural regularity characteristics of the communication traffic in this mode. This mode is often used for individual testing of a certain controller, and the communication features are different. The pattern matching result refers to the communication mode identification result (i.e., the "whole vehicle communication mode" or "single component communication mode") that has the highest degree of match with a specific type of feature fingerprint in the database after analyzing the actual received message features. Pattern matching can be performed using pattern recognition algorithms such as decision trees, rule matching, and simple machine learning models. Pattern matching can also be scored based on field weights, for example, a similarity threshold exceeding 80% is considered a match. The master-slave mode configuration signal corresponding to the pattern matching result is automatically generated based on the matching result identified in the previous step to control the operating mode of the external switch, replacing manual dialing or configuration.
[0063] For example, when the master-slave mode configuration signal cannot be obtained from the physical dial or remote interface, the message mode recognition process is started; at this time, the external switch monitors the received message traffic and compares its structural features with the local message feature comparison database one by one; for example, if it is detected that the message generally carries a virtual LAN identifier, the communication target is concentrated on a single electronic control unit, and there is no broadcast traffic, it is judged to be a single-piece communication mode; then, this matching result is converted into a master-slave configuration signal, and the switch is automatically controlled to switch to the corresponding mode, and then the virtual LAN identifier injection and address rewriting and other functions are enabled, thereby realizing full-process intelligent and adaptive diagnostic communication control without human intervention, which is particularly suitable for OTA remote diagnosis or unmanned testing environments.
[0064] Through the implementation of the above embodiments, a message feature comparison database is introduced to automatically identify the current communication mode, thereby improving the intelligence level of the method; when the physical button status cannot be obtained or the operation is missing, the communication mode can still be correctly judged through feature fingerprint matching, thereby enhancing the fault tolerance and adaptability of the method and avoiding diagnostic failure due to negligent operation.
[0065] In some embodiments, the aforementioned acquisition of the current state parameters of the physical dial button device of the external switch may include: collecting the displacement data of the dial button block of the physical dial button device in real time through a photoelectric sensor array; inputting the displacement data into a preset Kalman filter algorithm for noise elimination processing to obtain denoised displacement data; and determining the current state parameters based on the comparison result of the denoised displacement data with a preset displacement threshold interval.
[0066] In some examples, a photoelectric sensor array refers to a sensing component composed of multiple photosensitive elements (such as photodiodes or photoresistors) arranged in a specific space, which is used for non-contact detection of displacement changes of a dial block of a physical dial device during the switching process; the photoelectric sensor array can capture displacement data by emitting a light beam and sensing changes in occlusion or reflection, and has characteristics such as high resolution and anti-electromagnetic interference. The dial block is a mechanical component used for manual shifting of gears in a physical dial device. Its surface may have a light-shielding piece or a reflective mark. When it is turned, it causes a change in the light intensity received by the photoelectric sensor array, thereby generating corresponding displacement data. The preset Kalman filter algorithm is an optimal estimation algorithm based on a state-space model, which is used to recursively predict and correct noisy displacement data. By fusing the system dynamic model with the actual observation value, it realizes real-time denoising and smoothing of the displacement data; in this scenario, the Kalman filter algorithm can effectively suppress signal fluctuations caused by mechanical vibration, electromagnetic interference or sensor noise itself. The preset displacement threshold intervals refer to multiple pre-set displacement ranges, each corresponding to a valid gear state of the physical dial device (such as "whole vehicle communication mode," "single unit communication mode," or "neutral"). By comparing the denoised displacement data with the threshold intervals, the current gear position of the dial can be accurately determined and the corresponding state parameters can be output. For example, when the dial is in the middle position, the displacement data may fall within the interval [120, 180], corresponding to "neutral"; when the dial is moved upward to "whole vehicle communication mode," the displacement may exceed 180 units; when it is moved downward to "single unit communication mode," the displacement may be less than 120 units.
[0067] For example, if the external switch is equipped with a three-speed mechanical dial device, a set of spaced light shielding plates are fixed to the rear side of the dial block. When the operator switches the dial to the "single-piece communication mode", the dial block moves down, and the light shielding plates will partially block the 2nd and 3rd sensors in the photoelectric sensor array. At this time, the raw displacement data output by the sensor array may fluctuate due to mechanical gaps or ambient light interference (such as the measured displacement fluctuating between 98-105 units). The embedded processor of the external switch inputs the raw data into the preset Kalman filter algorithm, and the algorithm performs iterative calculations based on the displacement estimate of the previous moment and the current observation value, and finally outputs denoised displacement data that is stable at 102 units. Subsequently, the system compares the data with the preset threshold range ("single-piece communication mode": <110 units; "neutral": 110-190 units; "whole vehicle communication mode": ≥190 units), and determines that 102 units belong to the "single-piece communication mode" range, thereby generating the corresponding current state parameters (such as binary code [0,1]), and triggering the external switch to switch to the virtual LAN identifier injection logic in the single-piece communication mode.
[0068] Through the implementation of the above embodiments, photoelectric sensors are used to collect button displacement data, and Kalman filtering technology is combined to eliminate noise, thereby improving the accuracy and stability of master-slave mode recognition, overcoming the problem that traditional mechanical recognition methods are susceptible to jitter, wear, etc., and enhancing the reliability of mode switching recognition and the service life of the equipment.
[0069] In some embodiments, the aforementioned operation of injecting virtual LAN identifiers into the vehicle communication network diagnostic message through an external switch may further include a virtual LAN identifier adaptive allocation logic based on a dynamic network topology: when it is detected that the network address of the target electronic control unit has dynamically migrated, the corresponding relationship between its latest physical port and logical address is parsed in real time through the address mapping engine built into the external switch, and the allocation priority of the preset virtual LAN identifier is dynamically adjusted based on historical communication quality data to generate the optimal virtual LAN identifier injection strategy.
[0070] In some examples, dynamic network topology refers to changes in the access location of the electronic control unit (ECU) of the vehicle under test due to hardware plugging and unplugging, cable reconfiguration, or hot standby switching in single-piece communication mode, such as the migration of the target ECU from port 3 to port 5 of the external switch. The address mapping engine refers to a lightweight neural network model running in the firmware of the external switch. It builds a dynamic port-address relationship map by continuously collecting the link status of each port (such as bit error rate, latency, bandwidth utilization) and ECU heartbeat packet characteristics; the engine supports a decision-making mechanism based on reinforcement learning, giving priority to the physical path with the best communication quality when allocating virtual LAN identifiers. The optimal virtual LAN identifier injection strategy refers to an identifier allocation plan generated after comprehensively considering factors such as network congestion, port load balancing, and historical fault records. For example, it allocates virtual LAN identifier segments with low conflict probability (such as 1000-1999) to high-priority diagnostic services, and reserves a flexible virtual LAN identifier pool for frequently migrating electronic control units.
[0071] For example, in an automotive electronics R&D laboratory scenario, testers moved the autonomous driving domain controller under test from the hot-swappable slot of port 2 on an external switch to port 7 to optimize the electromagnetic interference environment. The external switch's address mapping engine recognized the device migration through the newly captured ECU signature code on port 7 (e.g., MAC address 00:1E:C2:8F:3A), and immediately triggered a dynamic adjustment process: first, it queried the ECU's historical communication data (e.g., the average latency during the port 2 period was 12ms and the packet loss rate was 0.3%), and then detected the current link quality of port 7 (latency 9ms, packet loss rate 0.1%). Then, based on the Q-learning algorithm, it was calculated that the original virtual LAN ID 205 should be rebound to port 7 and a backup virtual LAN ID 721 should be assigned to it as a disaster recovery ID. When the diagnostic computer sends the next DoIP message, the external switch automatically encapsulates it using virtual LAN ID 205 and achieves low-latency transmission through the optimized port 7.
[0072] Through the implementation of the above embodiments, dynamic network topology awareness is combined with intelligent virtual LAN identifier allocation, which solves the communication interruption problem of the traditional static configuration mode in the device migration scenario, significantly improves the flexibility and robustness of the single-piece test environment, and at the same time reduces the risk of network congestion through machine learning-driven path optimization, ensuring high-reliability transmission of critical diagnostic services.
[0073] In some embodiments, the aforementioned vehicle communication network diagnostic processing method may also include: based on the environmental perception module integrated in the external switch, real-time collection of multi-dimensional physical characteristic data of the test environment; inputting the multi-dimensional physical characteristic data into a preset pattern recognition neural network model, and obtaining the master-slave mode prediction result of the current test scenario through the model output; and automatically generating the corresponding master-slave mode configuration signal according to the master-slave mode prediction result.
[0074] In some examples, the environmental perception module includes a temperature and humidity sensor, a vibration sensor, an air pressure sensor, and an RFID tag reader, which are respectively used to collect the temperature gradient, mechanical vibration frequency, ambient air pressure value, and identification information of the vehicle under test at the test station; the multi-dimensional physical feature data is a standardized data vector generated by analog-to-digital conversion of the analog signal output by each sensor, such as [temperature, humidity, vibration frequency, air pressure, vehicle VIN code]; the pattern recognition neural network model is a lightweight convolutional neural network (CNN), whose input layer corresponds to the multi-dimensional physical feature data dimension, the hidden layer contains an attention mechanism module to highlight key features, and the output layer outputs the probability value of "whole vehicle communication mode" and "single-piece communication mode" through the Softmax function.
[0075] For example, when an external switch is connected to a test station, the environmental perception module collects the following data: temperature 22°C (close to the constant temperature environment of the vehicle test workshop), humidity 55% RH, vibration frequency presents periodic pulses (corresponding to the vehicle engine idling vibration characteristics), air pressure value 101.3kPa (standard atmospheric pressure), and at the same time, the RFID reader captures the VIN code of the vehicle under test and matches it to the vehicle test work order list; the pattern recognition neural network model extracts features from the input data vector and finds that the vibration frequency feature has a similarity of 92% with the feature vector of the vehicle's operating status. Combined with the VIN code matching result, the probability of outputting "vehicle communication mode" is 0.95; the external switch automatically generates a configuration signal for the vehicle communication mode based on this, triggering the direct forwarding mode.
[0076] Through the implementation of the above embodiments, environmental perception is combined with deep learning technology, so that external diagnostic equipment has the ability to autonomously understand test scenarios without relying on physical buttons or manual configuration. It is particularly suitable for automated test production lines or multi-mode hybrid diagnostic scenarios; the fusion analysis of multi-dimensional physical features effectively improves the robustness of pattern recognition, and can avoid single feature misjudgment, such as misidentification that may be caused by pre-configuration errors when relying solely on the existence of virtual LAN identifiers, further promoting the evolution of on-board diagnostics towards intelligent and unmanned directions.
[0077] Furthermore, as an implementation of the aforementioned method embodiment, the present application also provides an on-vehicle communication network diagnostic processing device, which is applied to an external diagnostic device. The external diagnostic device includes an external switch and a diagnostic computer. The external switch is provided between the diagnostic computer and the vehicle under test. The on-vehicle communication network diagnostic processing device is used to implement the aforementioned method embodiment. This device embodiment corresponds to the aforementioned method embodiment. For ease of reading, this on-vehicle communication network diagnostic processing device embodiment will no longer repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in the embodiment of the present application can correspond to and implement all the contents of the aforementioned method embodiment. Figure 2 As shown, the vehicle-mounted communication network diagnostic processing device 20 includes: a signal acquisition unit 201, a whole vehicle test unit 202 and a single unit test unit 203, wherein the signal acquisition unit 201 is used to obtain the master-slave mode configuration signal of the external switch; the whole vehicle test unit 202 is used to transmit the vehicle-mounted communication network diagnostic message of the diagnostic computer to the vehicle-mounted communication system of the vehicle under test in a direct forwarding mode through the external switch when the master-slave mode configuration signal is the whole vehicle communication mode; the single unit test unit 203 is used to perform virtual LAN identifier injection processing on the vehicle-mounted communication network diagnostic message through the external switch when the master-slave mode configuration signal is the single unit communication mode, and forward the target message to the target electronic control unit of the vehicle under test after obtaining it.
[0078] In some embodiments, the signal acquisition unit 201 is further used to obtain current state parameters of a physical dial button device of an external switch, wherein the physical dial button device includes at least two switchable mechanical positioning gears; and convert the current state parameters into a master-slave mode configuration signal according to a preset gear mapping relationship.
[0079] In some embodiments, the single-piece test unit 203 is also used to obtain a preset virtual local area network identifier and the logical address information of the target electronic control unit; according to the preset virtual local area network identifier, perform a label insertion operation on the Ethernet frame header of the vehicle communication network diagnostic message to generate an encapsulated message carrying the preset virtual local area network identifier; modify the destination address field of the encapsulated message based on the logical address information to generate a target message; and send the target message to the physical interface corresponding to the target electronic control unit through the first communication port of the external switch.
[0080] In some embodiments, the single-unit test unit 203 is further configured to strip the virtual local area network identifier from the response message from the target electronic control unit through an external switch and forward it to the diagnostic computer when the master-slave mode configuration signal is the single-unit communication mode.
[0081] In some embodiments, the single-piece test unit 203 is also used to extract the response identifier in the virtual LAN identification field when it is detected that the Ethernet frame header of the response message contains a virtual LAN identification field; when the response identifier is consistent with the preset virtual LAN identifier, remove the virtual LAN identification field of the response message and reorganize the Ethernet frame header of the response message to generate an unidentified response message; modify the source address field of the unidentified response message to the logical address corresponding to the external switch to generate a reverse processing message; and forward the reverse processing message to the diagnostic computer through the first communication port of the external switch.
[0082] In some embodiments, the vehicle test unit 202 is also used to receive the vehicle communication network diagnostic message through the first communication port of the external switch; based on the direct forwarding rule, the vehicle communication network diagnostic message is forwarded to the second communication port of the vehicle internal switch through the external switch, so that the vehicle internal switch performs identification dynamic encapsulation processing and response message decapsulation processing on the vehicle communication network diagnostic message based on the preset logical isolation strategy, and returns the generated unidentified response message to the external switch; the vehicle communication network diagnostic processing method also includes: forwarding the unidentified response message to the diagnostic computer through the first preset port of the external switch.
[0083] In some embodiments, the signal acquisition unit 201 is also used to obtain a message feature comparison database, which includes a whole-vehicle communication feature fingerprint and a single-piece communication feature fingerprint; when the master-slave mode configuration signal is not obtained, the received message is pattern matched and identified based on the message feature comparison database to obtain a pattern matching result; and a master-slave mode configuration signal corresponding to the pattern matching result is generated.
[0084] In some embodiments, the signal acquisition unit 201 is also used to collect the displacement data of the button guard of the physical button device in real time through the photoelectric sensor array; input the displacement data into the preset Kalman filter algorithm for noise elimination processing to obtain denoised displacement data; and determine the current state parameters based on the comparison result of the denoised displacement data and the preset displacement threshold interval.
[0085] The present application also provides a computer-readable storage medium, which stores computer-executable instructions or computer programs. When the computer-executable instructions or computer programs are executed by a processor, the processor will execute any step of the vehicle communication network diagnostic processing method provided in the present application.
[0086] In some embodiments, the computer-readable storage medium may be a random access memory (RAM), a read-only memory (ROM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); or it may be various devices including one or any combination of the above memories.
[0087] In some embodiments, computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0088] In some embodiments, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (for example, files storing one or more modules, subroutines, or code portions).
[0089] In some embodiments, computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed across multiple sites and interconnected by a communication network.
[0090] like Figure 3 As shown, the present application also provides an electronic device 30, including a memory 310, a processor 320 and a computer program 311 stored in the memory 310 and executable on the processor. When the processor 320 executes the computer program 311, any step of the above-mentioned vehicle communication network diagnostic processing method is implemented.
[0091] The present application also provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer program or computer-executable instructions from the computer-readable storage medium and executes the computer program or computer-executable instructions, causing the electronic device to perform any step of the vehicle communication network diagnostic processing method described above.
[0092] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A vehicle communication network diagnosis and processing method, characterized in that: Applied to an external diagnostic device, the external diagnostic device includes an external switch and a diagnostic computer, the external switch is arranged between the diagnostic computer and the vehicle under test, and the vehicle communication network diagnostic processing method includes: Obtaining a master-slave mode configuration signal of the external switch; When the master-slave mode configuration signal is the vehicle communication mode, the vehicle communication network diagnostic message of the diagnostic computer is transmitted to the vehicle communication system of the vehicle under test through the external switch in a direct forwarding mode; When the master-slave mode configuration signal is a single-piece communication mode, the vehicle-mounted communication network diagnostic message is subjected to virtual local area network identifier injection processing through the external switch, and a target message is obtained and then forwarded to a target electronic control unit of the vehicle under test.
2. The vehicle communication network diagnosis and processing method according to claim 1, characterized in that: The obtaining of the master-slave mode configuration signal of the external switch includes: Acquire current state parameters of a physical dial button device of the external switch, wherein the physical dial button device includes at least two switchable mechanical positioning gears; According to the preset gear mapping relationship, the current state parameter is converted into the master-slave mode configuration signal.
3. The vehicle communication network diagnosis and processing method according to claim 1, characterized in that: The method of injecting a virtual local area network identifier into the vehicle-mounted communication network diagnostic message through the external switch and forwarding the obtained target message to the target electronic control unit of the vehicle under test includes: Obtaining a preset virtual local area network identifier and logical address information of the target electronic control unit; Performing a label insertion operation on the Ethernet frame header of the vehicle communication network diagnostic message according to the preset virtual local area network identifier to generate an encapsulated message carrying the preset virtual local area network identifier; Modifying the destination address field of the encapsulated message based on the logical address information to generate the target message; The target message is sent to a physical interface corresponding to the target electronic control unit through the first communication port of the external switch.
4. The vehicle communication network diagnosis and processing method according to claim 3, characterized in that: The vehicle-mounted communication network diagnosis processing method further includes: When the master-slave mode configuration signal is a single-piece communication mode, the response message from the target electronic control unit is stripped of the virtual local area network identifier through the external switch and forwarded to the diagnostic computer.
5. The vehicle-mounted communication network diagnosis and processing method according to claim 4, characterized in that: The step of performing a virtual local area network (VLAN) identification stripping operation on the response message from the target electronic control unit through the external switch and forwarding the response message to the diagnostic computer includes: When detecting that the Ethernet frame header of the response message contains a virtual local area network identification field, extracting a response identifier in the virtual local area network identification field; When the response identifier is consistent with the preset virtual local area network identifier, removing the virtual local area network identification field of the response message and reassembling the Ethernet frame header of the response message to generate an unidentified response message; Modify the source address field of the unidentified response message to the logical address corresponding to the external switch, and generate a reverse processing message; The reverse processing message is forwarded to the diagnostic computer through the first communication port of the external switch.
6. The vehicle communication network diagnosis and processing method according to claim 1, characterized in that: The method of transmitting the vehicle-mounted communication network diagnostic message of the diagnostic computer to the vehicle-mounted communication system of the tested vehicle in a direct forwarding mode through the external switch includes: receiving the vehicle communication network diagnostic message through the first communication port of the external switch; Based on the direct forwarding rule, forward the vehicle communication network diagnostic message to the second communication port of the vehicle internal switch through the external switch, so that the vehicle internal switch performs dynamic encapsulation processing of the vehicle communication network diagnostic message and decapsulation processing of the response message based on the preset logical isolation strategy, and returns the generated unidentified response message to the external switch; The vehicle-mounted communication network diagnosis processing method further includes: The unidentified response message is forwarded to the diagnostic computer through the first preset port of the external switch.
7. The vehicle communication network diagnosis and processing method according to claim 1, characterized in that: The vehicle-mounted communication network diagnosis processing method further includes: Acquire a message feature comparison database, wherein the message feature comparison database includes a whole vehicle communication feature fingerprint and a single piece communication feature fingerprint; When the master-slave mode configuration signal is not obtained, performing pattern matching identification on the received message based on the message feature comparison database to obtain a pattern matching result; A master-slave mode configuration signal corresponding to the pattern matching result is generated.
8. A vehicle-mounted communication network diagnostic processing device, characterized in that: Applicable to an external diagnostic device, the external diagnostic device includes an external switch and a diagnostic computer, the external switch is arranged between the diagnostic computer and the vehicle under test, and the vehicle-mounted communication network diagnostic processing device includes: a signal acquisition unit, configured to acquire a master-slave mode configuration signal of the external switch; A vehicle test unit, configured to transmit the vehicle communication network diagnostic message of the diagnostic computer to the vehicle communication system of the tested vehicle in a direct forwarding mode through the external switch when the master-slave mode configuration signal is in a vehicle communication mode; The single-unit test unit is used to perform virtual local area network identifier injection processing on the vehicle communication network diagnostic message through the external switch when the master-slave mode configuration signal is a single-unit communication mode, and forward the target message to the target electronic control unit of the vehicle under test after obtaining it.
9. An electronic device comprising: A memory and a processor, wherein the processor is configured to implement the steps of the vehicle communication network diagnostic processing method according to any one of claims 1 to 7 when executing the computer program stored in the memory.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the vehicle communication network diagnosis processing method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Vehicle diagnosis method and device, electronic equipment and storage medium
CN121028746A
Vehicle diagnosis method and device, electronic equipment and storage medium
CN121028746B