A Visualized Debugging Method and System for Vehicle Wiper Controller CAN Bus
By using a custom protocol file and a tree-like signal list for visualization, the problem of signal misalignment and data accuracy under different models and versions of wiper controllers in existing CAN bus debugging tools is solved, enabling rapid switching and efficient debugging.
Patent Information
- Application Number
- CN202611301213.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-26
- Publication Date
- 2026-11-17
AI Technical Summary
Existing CAN bus debugging tools are difficult to switch between quickly when dealing with different models or versions of wiper controllers, and there are issues with signal misalignment and data accuracy. In particular, under multi-channel and multi-protocol configurations, inaccurate matching of parameter group numbers or CAN identifiers affects the accuracy and convenience of debugging data.
By loading a custom protocol file, an isolated protocol parsing context is established based on the CAN channel and configuration identifier. The CAN message is parsed and signal data is obtained. The waveform curve is displayed through a tree-shaped signal list and drag-and-drop operation, realizing the visualization of the signal and convenient saving of the data.
It improves the accuracy of message parsing under different CAN channels and protocol configurations, supports the compatible processing of custom protocol signals and telemetry signals, reduces the possibility of signal misalignment and data loss, and improves the reliability and convenience of debugging data.
Smart Images

Figure CN123113809A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automotive electronic diagnostics and testing technology, specifically to a visual debugging method and system for a vehicle-mounted wiper controller CAN bus. Background Technology
[0002] During the research, development, testing, and calibration of automotive wiper controllers, it is necessary to acquire operating parameters such as wiper angle, motor speed, voltage, current, fault signs, and alarm status in real time via the CAN bus, and display and record the corresponding parameters in order to analyze the controller's working status, locate the cause of faults, and optimize control parameters.
[0003] Existing CAN bus debugging tools typically embed the CAN communication protocol into the host computer program. When the communication protocol, signal definitions, or protocol version of the controller under test changes, it is often necessary to modify the program code and recompile and regenerate the host computer program, which is not conducive to the rapid switching and debugging of different models or versions of wiper controllers. Although some debugging tools can import protocol description files, they usually only support a single protocol file format, making it difficult to simultaneously support customer-defined CAN communication protocols and electronic data sheets used internally by the controller. Switching protocols may also require disconnecting the device connection or re-initializing the communication link.
[0004] Furthermore, when multiple CAN channels are connected simultaneously or multiple protocol configurations are used, the same parameter group number or CAN identifier may correspond to different signal layouts. If existing debugging tools match signal definitions solely based on parameter group numbers or CAN identifiers, they are prone to incorrectly parsing messages from one CAN channel or protocol configuration according to another CAN channel or protocol configuration, resulting in signal misalignment and numerical anomalies, thus affecting the accuracy of debugging data.
[0005] Existing debugging tools often display signals using tables or lists, requiring users to manually establish the correspondence between signals and waveform curves. This makes it inconvenient to quickly select multiple signals for real-time comparison. Furthermore, there is a lack of effective linkage between waveform display, data acquisition, and data export. When pausing to observe abnormal waveforms or stopping acquisition, historical data may be deleted or critical operating condition data may not be saved in a timely manner. Summary of the Invention
[0006] The purpose of this invention is to provide a visual debugging method and system for the CAN bus of an automotive wiper controller, which can improve the accuracy of message parsing under different CAN channels and different protocol configurations, realize the compatible processing of custom protocol signals and electronic data meter telemetry signals, and improve the convenience of signal selection, waveform observation and data storage.
[0007] The technical solution provided by this invention is as follows:
[0008] A visual debugging method for a vehicle wiper controller's CAN bus includes the following steps: S1. Load a custom protocol file that describes the correspondence between CAN messages and signals. The custom protocol file includes CAN channel identifier, configuration identifier, message matching information and signal parsing information. S2. Establish corresponding protocol parsing contexts based on CAN channel identifiers and configuration identifiers, and isolate different protocol parsing contexts with different combinations of CAN channel identifiers and configuration identifiers from each other. Store corresponding message matching information and signal parsing information in each protocol parsing context. S3. Receive the CAN message sent by the vehicle wiper controller, determine the CAN channel identifier and configuration identifier corresponding to the CAN message, and determine the target protocol parsing context based on the CAN channel identifier and configuration identifier; S4. Based on the matching result between the CAN message and the message matching information in the target protocol parsing context, determine the target signal parsing information, and use the target signal parsing information to parse the CAN message to obtain the first signal data; S5. Determine the telemetry signal to be acquired based on the electronic data sheet file, acquire the second signal data corresponding to the telemetry signal, and write the first signal data and the second signal data into the signal buffer; S6. Select at least one signal data from the signal buffer for visualization display.
[0009] Optionally, the custom protocol file may also include protocol identification information; After loading the custom protocol file, the protocol identification information is verified. If the protocol identification information is verified successfully, a protocol parsing context is established. If the protocol identification information is not verified, the custom protocol file is refused to be loaded.
[0010] Optionally, the protocol identification information includes the protocol version number and the protocol name; Verification of protocol identification information includes: Compare the protocol version number with the preset version number, and compare the protocol name with the preset protocol name; The protocol identification information is deemed to have passed verification when the protocol version number matches the preset version number and the protocol name matches the preset protocol name.
[0011] Optionally, the message matching information includes the parameter group number and the source address; Establish the corresponding protocol parsing context based on the CAN channel identifier and configuration identifier, including: The combination of the CAN channel identifier and the configuration identifier is used as the parsing context index; In the protocol parsing context corresponding to each parsing context index, at least one set of correspondences between parameter group numbers, source addresses, and signal parsing information is stored; Upon receiving a CAN message, the target protocol parsing context is first determined based on the CAN channel identifier and configuration identifier, and then the target signal parsing information is determined based on the parameter group number and source address of the CAN message.
[0012] Optionally, the custom protocol file is a JSON protocol file. The JSON protocol file includes an array of message definitions. Each message definition in the message definition array includes a CAN channel identifier, a configuration identifier, message matching information, and at least one signal definition. Signal parsing information includes the signal identifier, start bit, bit length, scaling factor, and offset from the signal definition.
[0013] Optionally, the CAN message can be parsed using the target signal parsing information, including: Based on the start bit and bit length, extract the corresponding bit data from the data field of the CAN message in little-endian byte order; Convert bit data into the original signal value; The original signal value is converted using a scaling factor and an offset to obtain the first signal data, where: First signal data = original signal value × scaling factor + offset.
[0014] Optionally, custom protocol files are loaded and parsed through a custom protocol parsing module, and telemetry signals are subscribed to and acquired through a telemetry signal processing module. The custom protocol parsing module and the telemetry signal processing module operate independently and in parallel. The loading, replacement, or reloading of custom protocol files is performed while maintaining the CAN communication connection.
[0015] Optionally, the first signal data and the second signal data are each associated with a source identifier used to characterize the source of the signal; Visualization includes: Based on the source identifier and / or CAN channel identifier, the signal data in the signal buffer is categorized and displayed as a tree-shaped signal list, which includes a parent node and signal leaf nodes located under the parent node; Receive drag-and-drop operations that involve dragging and dropping signal leaf nodes to the waveform display area; Based on the signal identifier corresponding to the dragged and dropped signal leaf node, a corresponding waveform curve is created in the waveform display area; The waveform curve data is stored in a sliding data window with a preset length, and the new sampled value of the corresponding signal data is written to the end of the sliding data window in each sampling period, so that the existing sampled values in the sliding data window move forward in sequence.
[0016] Optionally, visual debugging can display running, paused, and stopped states. During operation, signal data is periodically acquired, the visualization content is updated, and timestamped signal data is appended to the data record. When switching from running state to paused state, the update of the visual display content and the addition of signal data are stopped, while the visual display content and data records before switching to paused state are retained. When resuming from a paused state to a running state, the newly acquired signal data is appended to the retained data record; In both running and paused states, data records can be exported to data files; When switching to the stop state, signal data acquisition is stopped, subscribed telemetry signals are released, and the visualization display content and data records are cleared.
[0017] On the other hand, a vehicle wiper controller CAN bus visualization debugging system includes a CAN communication interface, a memory, a processor, and a display device; The CAN communication interface is used for CAN communication with the vehicle's windshield wiper controller; The memory contains computer programs; The processor is connected to the CAN communication interface, memory, and display device. When the processor executes the computer program, it implements the above-mentioned visual debugging method for the vehicle wiper controller CAN bus.
[0018] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) The present invention establishes a protocol parsing context that is isolated from each other based on the CAN channel identifier and the configuration identifier, and further determines the corresponding signal parsing information based on the message matching information in the target protocol parsing context, so that the same parameter group number under different CAN channels or different protocol configurations can be parsed using the corresponding signal definition, thereby reducing the signal misalignment caused by cross-channel and cross-configuration mismatch, and improving the accuracy of CAN message parsing and the reliability of debugging data.
[0019] (2) The present invention parses the custom protocol file through the custom protocol parsing module and obtains the telemetry signal defined in the electronic data sheet file through the telemetry signal processing module, so that the two signal processing processes are independent of each other and can run in parallel; when loading, replacing or reloading the custom protocol file, there is no need to disconnect the CAN device connection, which is conducive to the rapid switching of different protocol versions, and can uniformly cache and visualize the custom protocol signal and the telemetry signal.
[0020] (3) The present invention classifies and displays signal data in a tree-shaped signal list and establishes corresponding waveform curves through drag-and-drop operations, which can reduce the manual configuration of curve channels and signal mapping relationships. At the same time, through the linkage control between running state, paused state and stop state, the existing waveforms and data records are retained in the paused state, and data can be exported in the running state or paused state, which is beneficial for observing abnormal signals and saving corresponding debugging data, reducing the possibility of losing key operating data due to misoperation. Attached Figure Description
[0021] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a schematic diagram of the system module structure of the present invention; Figure 3 This is a schematic diagram of the interface for loading JSON protocol files and selecting EDS telemetry signals in the host computer software of this invention; Figure 4 This is a schematic diagram of the tree-shaped signal list, waveform curves, and status control interface of the present invention; Figure 5 This is a schematic diagram of the CSV data file exported by this invention. Detailed Implementation
[0022] To illustrate in detail the technical solutions adopted by the present invention to achieve the intended technical objectives, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Furthermore, the technical means or technical features in the embodiments of the present invention can be replaced without creative effort. The present invention will be described in detail below with reference to the accompanying drawings and embodiments.
[0023] like Figures 1 to 5As shown, this invention provides a visual debugging method for the CAN bus of an automotive wiper controller, which can be applied to the research, development, testing, calibration, and fault diagnosis of automotive wiper controllers. This method is executed by a host computer, which communicates with the automotive wiper controller to be debugged via a CAN communication interface. The host computer receives CAN messages sent by the automotive wiper controller and obtains signal data from different sources according to a custom protocol file and an electronic data sheet file. The obtained signal data is then cached, displayed, and recorded.
[0024] In one specific embodiment, the host computer uses a Windows 10 or Windows 11 operating system, and the software runtime environment includes Python 3.11 and PyQt5 5.15.x. The CAN communication interface uses a Kvaser Leaf Light interface device. The host computer software may also be configured with waveform plotting libraries, array processing libraries, and CAN communication libraries. The above-described hardware and software environment is only one optional implementation method; in practical applications, other hardware and software platforms capable of performing CAN communication, protocol parsing, and graphical display can also be used.
[0025] The host computer software includes a custom protocol parsing module, a protocol verification module, a protocol parsing context management module, a CAN message parsing module, a telemetry signal processing module, a signal buffering module, a visualization display module, a data logging module, and a status control module. Each of these modules can be implemented by an independent software program unit, or by a combination of one or more software program units.
[0026] Before debugging, a custom protocol file is first created to describe the correspondence between CAN messages and signals. In this embodiment, the custom protocol file is a JSON protocol file. The JSON protocol file includes a protocol name, a protocol version number, and an array of message definitions. The array of message definitions includes one or more message definitions, and each message definition includes at least the CAN channel identifier, configuration identifier, parameter group number, source address, and signal definition.
[0027] Among them, the CAN channel identifier is used to identify the CAN communication channel to which the corresponding CAN message belongs, such as CAN1, CAN2 or other channel names; the configuration identifier is used to identify the protocol configuration version corresponding to the vehicle wiper controller or test task, such as configuration A or configuration B; the parameter group number is used to identify the message type of the corresponding CAN message under the J1939 protocol; the source address is used to identify the node that sent the corresponding CAN message; and the signal definition is used to describe the bit layout and numerical conversion relationship of each signal in the CAN message data field.
[0028] Each signal definition may include a signal name, start bit, bit length, scaling factor, offset, and byte order. The signal name is used to uniquely or relatively uniquely identify the corresponding signal; the start bit is used to indicate the starting position of the signal in the CAN message data field; the bit length is used to indicate the number of data bits occupied by the signal; the scaling factor and offset are used to convert the original signal value into a signal physical value with actual physical meaning; the byte order is used to indicate whether the corresponding signal is arranged in little-endian or big-endian byte order.
[0029] For example, a message definition can have a CAN channel identifier of CAN1, a configuration identifier of A, a parameter group number of 65280, a source address of 236, and a data length of 8 bytes. This message definition can include washer status signals, washer pump status signals, wiper off status signals, wiper cycle status signals, wiper working status signals, motor fault signals, motor alarm signals, and motor angle signals.
[0030] The motor angle signal can have 48 start bits, a bit length of 16, a scaling factor of 0.022, an offset of 0, and a little-endian byte order. This field setting is for illustrative purposes only and does not limit the bit length, scaling factor, or offset of other signals.
[0031] After the user starts the host computer software and establishes a CAN communication connection, they can select a JSON protocol file to be loaded via the protocol file loading control. The custom protocol parsing module reads the selected JSON protocol file and converts the protocol name, protocol version number, message definition, and signal definition in the JSON protocol file into data objects that can be processed by the host computer program.
[0032] The protocol verification module verifies the protocol identification information of the JSON protocol file. In this embodiment, the protocol verification module checks whether the protocol version number is a preset version number and whether the protocol name is a preset protocol name. For example, the preset version number can be "1.0" and the preset protocol name can be "WiperCANProtocol".
[0033] The JSON protocol file contains the following structured fields: json { "version": "1.0", "protocolName": "WiperCANProtocol", "messages": [ { "canName": "CAN1", "config": "A", "canPgn": 65280, "source": 236, "signals": [ { "name": "wiperAngle", "startBit": 48, "bitLen": 16, "factor": 0.022, "offset": 0 } ] } ] }
[0034] When both the protocol version number and protocol name match the preset content, the protocol verification module determines that the JSON protocol file has passed verification and allows the construction of the protocol parsing context to continue. When at least one of the protocol version number or protocol name does not match, the protocol verification module refuses to load the JSON protocol file and outputs corresponding prompt information through the host computer interface to prevent erroneous protocol files from being used to parse CAN messages.
[0035] In addition to the protocol version number and protocol name, the protocol verification module can also verify whether necessary fields in the message definition are missing, whether the parameter group number is within a preset range, whether the sum of the start bit and the bit length exceeds the message data field, and whether the data type of the scaling factor is correct. The above-mentioned further verification is a preferred implementation method.
[0036] After the JSON protocol file is verified, the protocol parsing context management module establishes multiple isolated protocol parsing contexts based on the CAN channel identifier and configuration identifier in each message definition. Specifically, the combination of the CAN channel identifier and configuration identifier can be used as the parsing context index. For example, when the CAN channel identifier is CAN1 and the configuration identifier is A, the corresponding index is (CAN1, A); when the CAN channel identifier is CAN2 and the configuration identifier is A, the corresponding index is (CAN2, A); when the CAN channel identifier is CAN1 and the configuration identifier is B, the corresponding index is (CAN1, B).
[0037] With the above settings, even if the same parameter group number exists in different CAN communication channels or different configuration versions, the corresponding signal definitions can be isolated using different protocol parsing contexts, preventing a message from one CAN channel from incorrectly using the signal definition of another CAN channel or another configuration version.
[0038] Within each protocol parsing context, one or more message parsing entries are further stored. Each message parsing entry includes a parameter group number, a source address, and a corresponding list of signal definitions. This forms a two-level parsing relationship: the first level determines the protocol parsing context based on the CAN channel identifier and configuration identifier, and the second level determines the target message parsing entry within that protocol parsing context based on the parameter group number and source address.
[0039] In this embodiment, the configuration identifier is determined by the currently loaded and effective JSON protocol file. When the JSON protocol file contains multiple configuration identifiers, multiple protocol parsing contexts can be established respectively, and the configuration identifier corresponding to the current debugging task can be set as the currently effective configuration identifier. The currently effective configuration identifier can be updated as the protocol file or test task is switched.
[0040] When the vehicle wiper controller sends a CAN message, the CAN communication interface receives the message and transmits it, along with the corresponding CAN communication channel information, to the CAN message parsing module. The CAN message parsing module determines the CAN channel identifier corresponding to the CAN message based on the CAN communication interface or the message reception callback parameters, and obtains the currently active configuration identifier.
[0041] The CAN message parsing module first determines the target protocol parsing context based on the CAN channel identifier and configuration identifier. Then, it extracts the parameter group number and source address from the identifier field of the CAN message and matches the extracted parameter group number and source address with each message parsing entry in the target protocol parsing context.
[0042] When both the parameter group number and the source address match, the signal definition list in the corresponding message parsing entry is determined as the target signal parsing information. If no matching message parsing entry exists in the target protocol parsing context, parsing the CAN message can be abandoned, or the CAN message can be recorded as an undefined message.
[0043] The CAN message parsing module traverses the signal definitions in the target signal parsing information and extracts the corresponding bit data from the data field of the CAN message according to the start bit and bit length in the signal definition. In this embodiment, each signal adopts the Intel little-endian layout, and the CAN message parsing module completes the bit data extraction according to the little-endian byte order.
[0044] For any signal, the CAN message parsing module converts the extracted bit data into the original signal value, and then calculates the signal physical value according to the following conversion relationship: Signal physical value = original signal value × scaling factor + offset.
[0045] Taking the motor angle signal as an example, the CAN message parsing module extracts 16 consecutive bits of data starting from the 48th bit of the CAN message data field, converts the extracted bit data into the original signal value, multiplies the original signal value by the scaling factor 0.022 and adds the offset 0 to obtain the physical value of the motor angle signal.
[0046] In one optional implementation, when the calculated signal physical value is an integer after rounding, it can be stored or displayed in integer form; when the calculated signal physical value is not an integer, a preset number of decimal places can be retained, such as two decimal places. The signal physical values obtained by parsing the JSON protocol file constitute the first signal data described in this invention.
[0047] While parsing CAN messages via a JSON protocol file, the host computer software also loads the Electronic Data Sheet (EDS) file corresponding to the vehicle wiper controller. The EDS file describes the telemetry signals within the vehicle wiper controller that are available for debugging.
[0048] Users can select one or more telemetry signals from the telemetry signals defined in the EDS file using the telemetry signal selection control in the host computer interface. The telemetry signal processing module establishes a telemetry signal subscription based on the user's selection and sends the corresponding telemetry signal request to the microcontroller of the vehicle wiper controller.
[0049] The telemetry signal processing module acquires telemetry data returned by the vehicle wiper controller according to a preset cycle, processes the acquired telemetry data, and obtains second signal data corresponding to each telemetry signal to be acquired.
[0050] The custom protocol parsing module and the telemetry signal processing module operate independently. The custom protocol parsing module processes JSON protocol files and CAN messages, while the telemetry signal processing module processes the telemetry signals defined in the EDS file. When loading, replacing, or reloading the JSON protocol file, it is not necessary to replace the existing EDS file, nor is it necessary to disconnect the CAN device or reinitialize the telemetry signal processing module.
[0051] With the above settings, different JSON protocol files can be switched while maintaining the CAN communication connection, and the first signal data corresponding to the JSON protocol and the second signal data corresponding to the EDS file can be obtained simultaneously.
[0052] The signal buffer module receives the first signal data and the second signal data respectively, and writes the first signal data and the second signal data into the signal buffer. Each signal data can be associated with at least a signal identifier, a current value, and a signal source identifier. The signal source identifier is used to indicate that the corresponding signal data originates from a JSON protocol file or an EDS file.
[0053] For the first signal data, one or more of the following can also be associated: CAN channel identifier, configuration identifier, parameter group number, and source address; for the second signal data, the identification information of the corresponding telemetry signal in the EDS file can also be associated.
[0054] Signal buffering can be implemented using dictionaries, mapping tables, lists, or other data structures. In this embodiment, at least one of the signal source identifier, CAN channel identifier, and signal identifier is used to form the buffer index, so that the visualization display module can quickly obtain the current value of each signal.
[0055] The visualization module establishes a tree-shaped signal list in the signal display area of the host computer interface. The tree-shaped signal list includes a parent node and multiple leaf nodes under the parent node. The parent node can be categorized according to the signal source, such as setting a parent node for JSON protocol signals and a parent node for EDS telemetry signals; it can also be further grouped according to the CAN channel based on the signal source.
[0056] Each signal leaf node corresponds to a signal identifier and displays the name and current value of the corresponding signal. When the signal data in the signal buffer is updated, the current value in the tree-structured signal list is updated synchronously.
[0057] When a user needs to observe the change process of a certain signal, they can press and hold the corresponding leaf node of the signal and drag it. When the drag distance exceeds the drag threshold set by the system, the visualization display module starts the drag operation and uses the display name, real identifier, or cache index of the signal as the drag data.
[0058] When a signal leaf node is dragged and dropped into the waveform display area, the waveform display area receives the drag-and-drop event and extracts the signal identifier of the dragged signal from the dragged data. The visualization module creates a corresponding waveform curve based on the signal identifier and registers the waveform curve into the curve management data structure.
[0059] Before creating a waveform curve, the visualization module can determine whether a waveform curve corresponding to the signal identifier already exists in the curve management data structure. If it already exists, it will not be created again; if it does not exist, a new waveform curve will be created and the display name of the signal will be added to the legend.
[0060] The waveform curves corresponding to different signals can be automatically assigned different colors according to a cyclic color palette, allowing users to distinguish between multiple waveform curves. A right-click menu can also be set in the waveform display area to allow users to delete selected waveform curves. When the mouse hovers over a waveform curve, the time coordinates and signal values of the sampling point closest to the mouse position are displayed.
[0061] The data for each waveform curve is stored using a sliding data window of preset length. The sliding data window can be implemented using a fixed-length array. During each sampling period, the visualization module reads the current value of the corresponding signal from the signal buffer and writes this current value as the new sample value to the end of the sliding data window. Simultaneously, the existing sample values in the sliding data window move forward sequentially. When the sliding data window reaches its preset length, the earliest sample value is removed from the window, thus creating a real-time waveform display effect that scrolls from right to left.
[0062] The status control module is used to control the host computer software to switch between running, paused and stopped states.
[0063] In the initial state, the host computer interface displays a start control. When the user operates the start control, the status control module puts the host computer software into running mode. Upon entering running mode, the status control module can clear historical data records left from the previous debugging process, establish a signal buffer index based on the signal tree, and start the waveform update timer, data recording timer, and telemetry data acquisition timer.
[0064] The waveform update timer and data logging timer can run with the same sampling period. The telemetry signal processing module sends a telemetry signal subscription request to the vehicle wiper controller and acquires telemetry signals according to a preset period. At this time, the first signal data and the second signal data are continuously written to the signal buffer, and the waveform curve in the waveform display area is updated in real time.
[0065] The data recording module iterates through the signal buffer items to be recorded in each sampling period, obtains the current value of each signal data, and appends the sampling timestamp and the current value of each signal data as a sampling record to the data recording list.
[0066] In running mode, when the user operates the pause control, the state control module switches the host computer software from running mode to paused mode. After entering paused mode, the waveform update timer and data recording timer stop, the waveform display area stops updating, and the data recording module stops adding new sampling records. However, the waveform curves and data records formed before entering paused mode are all retained.
[0067] Users can zoom in, move, or hover over the waveform while it is paused to observe abnormal sampling points. Users can also export the recorded data while it is paused.
[0068] When the user operates the continue control, the status control module resumes the host computer software from the paused state to the running state, restarting the waveform update timer and data recording timer. New signal data acquired after resumption is appended to the data record saved before the pause, without overwriting the data record from before the pause.
[0069] When the user operates the stop control, the status control module puts the host computer software into a stop state. Once in the stop state, the status control module stops the waveform update timer, data logging timer, and telemetry data acquisition timer; the telemetry signal processing module releases the subscribed telemetry signals; the visualization display module clears the waveform curves in the waveform display area; the data logging module clears the data logging list; and the host computer interface returns to its initial state.
[0070] Since the stopped state clears waveform curves and data records, the host computer interface can use different control states or display attributes to indicate the current working status. For example, the running, paused, and stopped states can be indicated by different button text, icons, or colors to reduce the possibility of users accidentally entering the stopped state without saving data.
[0071] The data recording module is also equipped with a data export function. Whether running or paused, users can operate the data save control; the host computer software will display a file save dialog box, allowing the user to select the save path and file name for the data file.
[0072] In this embodiment, the data file adopts CSV format. The first row of the CSV file is set as the column name, which may include the timestamp and the signal name of each signal to be recorded; each subsequent row corresponds to a sampling time and records the timestamp of the corresponding sampling time and the value of each signal. The data file can be automatically named according to the date and time when the data was exported.
[0073] The working process of this invention will be described below using a specific debugging process.
[0074] First, connect the CAN communication interface to the vehicle wiper controller. In the network configuration interface of the host computer software, select the driver corresponding to the CAN communication interface and establish a CAN communication connection.
[0075] Then, the user selects and loads a pre-built JSON protocol file. The protocol verification module verifies the protocol name and version number of the JSON protocol file. After successful verification, the protocol parsing context management module establishes a protocol parsing context based on the CAN channel identifier and configuration identifier in the JSON protocol file, and stores the parameter group number, source address, and signal definition in the corresponding protocol parsing context.
[0076] Subsequently, the host computer software loads the EDS file. The user selects the telemetry signals to be observed from the telemetry signals defined in the EDS file, and the selected telemetry signals are added to the tree-shaped signal list.
[0077] Users drag and drop the corresponding leaf nodes of the motor angle signal and wiper operating status signal to the waveform display area in sequence. The visualization display module then creates the motor angle waveform curve and the wiper operating status waveform curve, respectively.
[0078] After the user activates the start control, the host computer software enters the running state. The CAN message parsing module receives the CAN message, determines the target protocol parsing context based on the CAN channel identifier and the current configuration identifier, then determines the target signal definition based on the parameter group number and source address of the CAN message, and parses it to obtain the first signal data. At the same time, the telemetry signal processing module periodically acquires the second signal data corresponding to the telemetry signal selected by the user.
[0079] The first and second signal data are written to the signal buffer respectively, the current value in the tree-shaped signal list is updated synchronously, the waveform curve in the waveform display area is displayed in a scrolling manner according to the preset sampling period, and the data recording module synchronously forms a data record with a timestamp.
[0080] When a user detects an abnormal change in the waveform, they can use the pause control to freeze the waveform and retain the current data. After observing the anomaly, the user can export the data records to a CSV file while the waveform is paused. Once observation is complete, the user can use the continue control to resume updating the waveform, with new sampled data appended to the existing data.
[0081] After debugging, the user operates the stop control, the host computer software stops data acquisition and releases telemetry signals, clears waveform curves and data records, and completes a visual debugging process of the vehicle wiper controller CAN bus.
[0082] In another embodiment, the present invention also provides a CAN bus visualization and debugging system for an automotive wiper controller, including a CAN communication interface, a memory, a processor, and a display device. The CAN communication interface is used for CAN communication with the automotive wiper controller; the memory is used to store custom protocol files, electronic data sheet files, signal data, and computer programs; the display device is used to display a tree-shaped signal list, waveform curves, and a status control interface; the processor is used to execute the computer program in the memory to perform operations such as loading the custom protocol file, constructing the protocol parsing context, parsing CAN messages, acquiring telemetry signals, buffering signals, displaying waveforms, switching statuses, and exporting data.
[0083] When the processor executes the computer program, it establishes isolated protocol parsing contexts based on the CAN channel identifier and configuration identifier, receives CAN messages sent by the vehicle wiper controller and determines the target protocol parsing context, determines the target signal parsing information based on the message matching information in the target protocol parsing context, and parses to obtain the first signal data; at the same time, it determines and obtains the second signal data based on the EDS file, writes the first signal data and the second signal data into the signal buffer, and visualizes at least one signal data through the display device.
[0084] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent substitutions, and improvements made to the above embodiments without departing from the scope of the present invention, based on the technical essence of the present invention and within the spirit and principles of the present invention, shall still fall within the protection scope of the present invention.
Claims
1. A visual debugging method for a vehicle-mounted windshield wiper controller CAN bus, characterized in that, Includes the following steps: S1. Load a custom protocol file that describes the correspondence between CAN messages and signals. The custom protocol file includes CAN channel identifier, configuration identifier, message matching information and signal parsing information. S2. Establish corresponding protocol parsing contexts based on the CAN channel identifier and the configuration identifier, and isolate different protocol parsing contexts with different combinations of CAN channel identifiers and configuration identifiers from each other. Store the corresponding message matching information and signal parsing information in each protocol parsing context. S3. Receive the CAN message sent by the vehicle wiper controller, determine the CAN channel identifier and configuration identifier corresponding to the CAN message, and determine the target protocol parsing context based on the CAN channel identifier and the configuration identifier; S4. Based on the matching result between the CAN message and the message matching information in the target protocol parsing context, determine the target signal parsing information, and use the target signal parsing information to parse the CAN message to obtain the first signal data; S5. Determine the telemetry signal to be acquired based on the electronic data sheet file, acquire the second signal data corresponding to the telemetry signal, and write the first signal data and the second signal data into the signal buffer; S6. Select at least one signal data from the signal buffer for visualization display.
2. The visual debugging method for the CAN bus of the vehicle wiper controller according to claim 1, characterized in that, The custom protocol file also includes protocol identification information; After loading the custom protocol file, the protocol identification information is verified. If the protocol identification information is verified successfully, the protocol parsing context is established. If the protocol identification information is not verified successfully, the custom protocol file is not loaded.
3. The visual debugging method for the CAN bus of the vehicle wiper controller according to claim 2, characterized in that, The protocol identification information includes the protocol version number and the protocol name; Verification of the protocol identification information includes: The protocol version number is compared with a preset version number, and the protocol name is compared with a preset protocol name; When the protocol version number matches the preset version number and the protocol name matches the preset protocol name, the protocol identification information is deemed to have passed verification.
4. The visual debugging method for the CAN bus of an on-board wiper controller according to claim 1, characterized in that, The message matching information includes the parameter group number and the source address; Establish a corresponding protocol parsing context based on the CAN channel identifier and the configuration identifier, including: The combination of the CAN channel identifier and the configuration identifier is used as the parsing context index; In the protocol parsing context corresponding to each of the parsing context indices, at least one set of correspondences between the parameter group numbers, the source address and the signal parsing information is stored. Upon receiving the CAN message, the target protocol parsing context is first determined based on the CAN channel identifier and the configuration identifier, and then the target signal parsing information is determined based on the parameter group number and source address of the CAN message.
5. The visual debugging method for the CAN bus of an on-board wiper controller according to claim 1, characterized in that, The custom protocol file is a JSON protocol file, which includes an array of message definitions. Each message definition in the array includes the CAN channel identifier, the configuration identifier, the message matching information, and at least one signal definition. The signal parsing information includes the signal identifier, start bit, bit length, scaling factor, and offset in the signal definition.
6. The visual debugging method for the CAN bus of an on-board wiper controller according to claim 5, characterized in that, Parsing the CAN message using the target signal parsing information includes: Based on the start bit and the bit length, extract the corresponding bit data from the data field of the CAN message in little-endian byte order; Convert the bit data into the original signal value; The original signal value is converted according to the scaling factor and the offset to obtain the first signal data, wherein: First signal data = original signal value × scaling factor + offset.
7. The visual debugging method for the CAN bus of an on-board wiper controller according to claim 1, characterized in that, The custom protocol file is loaded and parsed through the custom protocol parsing module, and the telemetry signal is subscribed to and obtained through the telemetry signal processing module; The custom protocol parsing module and the telemetry signal processing module operate independently and in parallel. The loading, replacement, or reloading of the custom protocol file is performed while maintaining the CAN communication connection.
8. The visual debugging method for the CAN bus of an on-board wiper controller according to claim 1, characterized in that, The first signal data and the second signal data are each associated with a source identifier used to characterize the source of the signal; The visualization display includes: Based on the source identifier and / or the CAN channel identifier, the signal data in the signal buffer is categorized and displayed in a tree-shaped signal list, which includes a parent node and signal leaf nodes located under the parent node; Receive drag-and-drop operations that involve dragging and dropping the signal leaf node to the waveform display area; Based on the signal identifier corresponding to the dragged and dropped signal leaf node, a corresponding waveform curve is established in the waveform display area; The waveform curve data is stored in a sliding data window with a preset length, and a new sample value of the corresponding signal data is written to the end of the sliding data window in each sampling period, so that the existing sample values in the sliding data window move forward sequentially.
9. The visual debugging method for the CAN bus of an on-board wiper controller according to claim 1, characterized in that, The visual debugging system has running, paused, and stopped states. In the aforementioned operating state, signal data is periodically acquired, the visual display content is updated, and the timestamped signal data is appended to the data record. When switching from the running state to the paused state, the updating of the visual display content and the addition of the signal data are stopped, while the visual display content and data records before switching to the paused state are retained. When resuming from the paused state to the running state, the newly acquired signal data is appended to the retained data record; In both the running state and the paused state, the data records can be exported as data files; When switching to the stopped state, signal data acquisition is stopped, subscribed telemetry signals are released, and the visualization display content and data records are cleared.
10. A visual debugging system for a vehicle-mounted windshield wiper controller using a CAN bus, characterized in that, Includes a CAN communication interface, memory, processor, and display device; The CAN communication interface is used for CAN communication with the vehicle wiper controller. The memory contains computer programs; The processor is connected to the CAN communication interface, the memory, and the display device. When the processor executes the computer program, it implements the vehicle wiper controller CAN bus visualization debugging method according to any one of claims 1 to 9.
