A configurable communication plug-in system for CAN bus and a protocol dynamic generation method

CN122554561APending Publication Date: 2026-08-11SHENZHEN SILICON MOUNTAIN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-24
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0003]现有技术中,通信协议解析逻辑与上层业务功能紧密交织,导致协议调整时必须反复修改源代码并执行编译操作,这种高耦合性大幅延长了开发周期并推高了维护负担

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122554561A_ABST
    Figure CN122554561A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of communication technology, specifically a configurable communication plug-in system and a method for dynamically generating protocols for CAN bus. It includes: a configuration parsing module for parsing protocol configuration files, obtaining signal definition information for each communication signal, and generating a protocol item list; a dynamic UI generation module connected to the configuration parsing module; a multi-timer scheduling module; a data packaging module; and a waveform analysis module. This invention achieves flexible protocol configuration through configuration file parsing, avoiding repeated modifications to the source code; it employs independent scheduling with multiple timers to ensure precise control of the transmission cycle of each message; the data packaging module automatically performs byte order conversion, eliminating manual intervention; the waveform analysis module directly analyzes waveforms based on signal definition information to achieve functional integration; and the dynamic UI generation module intelligently adapts to protocol changes, offering advantages such as flexible protocol configuration, precise control of the transmission cycle, automatic byte order processing, integrated waveform analysis, and dynamic user interface generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, specifically to a configurable communication plug-in system and a method for dynamically generating protocols for CAN bus. Background Technology

[0002] As a fieldbus technology widely used in industrial control and automotive electronics, the CAN bus faces significant challenges in enabling data interaction with diverse lower-level devices through its host computer communication software.

[0003] In existing technologies, communication protocol parsing logic is tightly intertwined with upper-layer business functions, requiring repeated modifications to the source code and recompilation during protocol adjustments. This high coupling significantly prolongs the development cycle and increases the maintenance burden. In scenarios with concurrent multi-message transmission, traditional single-timer architectures struggle to accurately manage the independent transmission cycles of different messages, easily leading to timing conflicts or data corruption, affecting communication reliability. Furthermore, handling byte order differences in cross-platform communication relies entirely on manual intervention, requiring developers to manually write conversion code. This not only increases the probability of errors but also results in a large accumulation of redundant code. The disconnect between protocol definitions and data analysis tools prevents users from simultaneously completing data visualization during the configuration phase, necessitating secondary processing using external tools, disrupting workflow continuity. Moreover, the static association between user interface controls and protocol fields requires hard-coding corresponding controls for each signal. When the protocol changes, the interface code must be modified synchronously; this repetitive work is time-consuming and prone to introducing defects.

[0004] Therefore, we propose a configurable communication plug-in system for CAN bus and a method for dynamic protocol generation to solve the above problems. Summary of the Invention

[0005] (a) Technical problems to be solved To address the shortcomings of existing technologies, this invention provides a configurable communication plug-in system and a dynamic protocol generation method for CAN bus, which has the advantages of flexible protocol configuration, precise control of transmission cycle, automatic byte order processing, integrated waveform analysis, and dynamic generation of user interface, thus solving the problems mentioned in the background technology.

[0006] (II) Technical Solution To achieve the above objectives, the present invention specifically adopts the following technical solution: A configurable communication plug-in system for CAN bus, comprising: The configuration parsing module is used to parse the protocol configuration file, obtain the signal definition information of each communication signal, and generate a list of protocol items; The dynamic UI generation module, connected to the configuration parsing module, is used to dynamically generate the operation interface based on the protocol item list. The operation interface includes controls for signal value input and start / stop controls for controlling the periodic transmission of messages. The multi-timer scheduling module, connected to the dynamic UI generation module, is used to create independent timers for at least one periodically sent protocol item and independently trigger message sending operations according to the sending period corresponding to each protocol item. The data packaging module, connected to the multi-timer scheduling module and the dynamic UI generation module, is used to automatically convert the input value into message data that conforms to the bus byte order according to the byte order identifier of the corresponding protocol item when a change in the value of the input control is detected, and update it to the message buffer. The waveform analysis module communicates with the configuration parsing module to receive signal definition information and parse the independently loaded bus log file based on the signal definition information to generate and display waveform diagrams.

[0007] Furthermore, this application proposes that the signal definition information shall include at least: signal name, CAN identifier, byte offset, bit offset, bit length, scaling factor, offset, symbol type, unit, transmission period, endianness identifier, and a list of optional values.

[0008] Furthermore, this application also proposes that the dynamic UI generation module includes: The intelligent selection unit for control types is used to automatically select the input control type based on the list of optional values ​​for each signal in the protocol item list; when the number of optional values ​​is 2, a checkbox control is generated; when the number of optional values ​​is greater than 2, a drop-down selection box control is generated; when there are no optional values, a numeric input box control is generated.

[0009] Furthermore, this application also proposes that the multi-timer scheduling module includes: The timer mapping table stores the corresponding timer objects using the protocol item index as the key. The dynamic start / stop unit is used to create a timer object for the corresponding protocol item and start the timer when the start / stop control is triggered to the on state, and to stop and destroy the corresponding timer object when it is triggered to the off state; and the sending period of each protocol item is stored independently, and the timing period of each timer object is independent of each other.

[0010] Furthermore, this application also proposes that the waveform analysis module includes: The thread isolation unit is used to run the parsing operation of the bus record file in an independent worker thread, isolated from the main interface thread; The progress feedback unit is used to calculate the parsing progress in real time and display it to the user, and also supports the user to cancel the parsing operation.

[0011] Furthermore, this application also proposes that the configuration parsing module supports drag-and-drop loading: it provides a drag-and-drop receiving area, and when the protocol configuration file is detected to be dragged to the drag-and-drop receiving area, the configuration parsing operation is automatically triggered; and the display switches between the prompt interface and the configuration interface automatically depending on whether the configuration file has been loaded.

[0012] Furthermore, this application also proposes a method for dynamically generating protocols for a configurable communication plug-in system for CAN bus, which is based on the above-mentioned system and includes the following steps: Configuration and parsing steps: Parse the protocol configuration file to obtain the signal definition information of each communication signal and generate a list of protocol items; Dynamic UI generation steps: Dynamically generate the operation interface based on the protocol item list. The operation interface includes controls for signal value input and start / stop controls for controlling the periodic transmission of messages. Multi-timer scheduling steps: Create an independent timer for at least one periodically transmittable protocol item, and trigger the message transmission operation independently according to the transmission period corresponding to each protocol item; Data packaging steps: When a change in the value of an input control is detected, the input value is automatically converted into message data that conforms to the bus byte order according to the byte order identifier of the corresponding protocol item, and updated to the message buffer. Message sending steps: When the multi-timer scheduling step triggers the sending operation, message data is read from the message buffer and sent. Waveform analysis steps: Receive signal definition information, parse the independently loaded bus log file based on the signal definition information, and generate and display waveform diagrams.

[0013] Furthermore, this application also proposes that the dynamic UI generation step further includes: automatically selecting the input control type according to the list of optional values ​​for each signal in the protocol item list, wherein a checkbox control is generated when the number of optional values ​​is 2, a drop-down selection box control is generated when the number of optional values ​​is greater than 2, and a numeric input box control is generated when there are no optional values.

[0014] Furthermore, this application proposes that the multi-timer scheduling steps further include: storing timer objects in a timer mapping table using the protocol item index as the key; when the start / stop control is detected to be triggered to the on state, creating a timer object for the corresponding protocol item and starting the timer; when it is triggered to the off state, stopping and destroying the corresponding timer object; and the sending period of each protocol item is independent of each other, and the timing period of each timer object does not interfere with each other.

[0015] Furthermore, this application proposes that the waveform analysis step further includes: running the parsing operation of the bus record file in an independent working thread, calculating the parsing progress in real time and displaying it to the user, and supporting the user to cancel the parsing operation.

[0016] (III) Beneficial Effects Compared with the prior art, the present invention provides a configurable communication plug-in system and a method for dynamically generating protocols for CAN bus, which has the following advantages: This invention includes a configuration parsing module, a dynamic UI generation module, a multi-timer scheduling module, a data packaging module, and a waveform analysis module. It achieves flexible protocol configuration through configuration file parsing, avoiding repeated modifications to the source code; employs independent scheduling with multiple timers to ensure precise control of the transmission cycle of each message; the data packaging module automatically performs byte order conversion, eliminating manual intervention; the waveform analysis module directly parses waveforms based on signal definition information to achieve functional integration; and the dynamic UI generation module intelligently adapts to protocol changes, offering advantages such as flexible protocol configuration, precise control of the transmission cycle, automatic byte order processing, integrated waveform analysis, and dynamic generation of the user interface. Attached Figure Description

[0017] Figure 1 This is a diagram showing the overall system architecture of the present invention; Figure 2 This is a flowchart of the protocol dynamic generation method of the present invention; Figure 3 This is a system structure block diagram according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of the multi-timer scheduling module according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the method flow according to an embodiment of the present invention. Detailed Implementation

[0018] The technical solutions of 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, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] Example Traditional CAN bus host computer communication software suffers from several problems when interacting with slave devices, including high coupling between protocol and business logic, difficulty in controlling the timing of continuous transmission of multiple messages, reliance on manual conversion for endianness, separation of protocol configuration and data visualization, and static binding of UI controls to protocol fields. These problems lead to low development efficiency, high maintenance costs, susceptibility to errors, inability to achieve a unified user experience, and a large workload.

[0020] In this regard, such as Figure 1-2 As shown, this application proposes a configurable communication plug-in system for CAN bus, including: The configuration parsing module is used to parse the protocol configuration file, obtain the signal definition information of each communication signal, and generate a list of protocol items; The dynamic UI generation module, connected to the configuration parsing module, is used to dynamically generate an operation interface based on the protocol item list. The operation interface includes controls for signal value input and start / stop controls for controlling the periodic transmission of messages. The multi-timer scheduling module, connected to the dynamic UI generation module, is used to create independent timers for at least one periodically sent protocol item and independently trigger message sending operations according to the sending period corresponding to each protocol item. The data packaging module, connected to the multi-timer scheduling module and the dynamic UI generation module, is used to automatically convert the input value into message data that conforms to the bus byte order according to the byte order identifier of the corresponding protocol item when the value of the input control is detected to change, and update it to the message buffer. The waveform analysis module communicates with the configuration parsing module to receive the signal definition information, parse the independently loaded bus log file based on the signal definition information, and generate and display the waveform diagram.

[0021] This application provides a configurable communication plug-in system for CAN bus, which realizes flexible configuration, dynamic interaction and data analysis of CAN bus communication through the coordinated work of multiple functional modules.

[0022] Specifically, the system includes a configuration parsing module. This module is configured to parse the protocol configuration file to obtain the signal definition information of each communication signal and generate a list of protocol items. For example, the protocol configuration file can be a DBC file containing detailed information such as the CAN message ID, signal name, data type, offset, scaling factor, etc. The configuration parsing module can read the file content, extract these definitions line by line or segment by segment, and organize them into a structured list of protocol items. Alternatively, the user can manually specify the path to the protocol configuration file through a file selection dialog box, which the configuration parsing module will then load and parse.

[0023] Furthermore, the system includes a dynamic UI generation module. This module, connected to the configuration parsing module, dynamically generates the user interface based on the protocol item list. This interface includes controls for signal value input and start / stop controls for controlling the periodic transmission of messages. For example, for each signal in the protocol item list, the dynamic UI generation module can create a default text input box as the signal value input control and a simple toggle button for each sendable protocol item as the start / stop control. This user interface is generated once at system startup based on the loaded protocol item list and remains fixed.

[0024] In addition, the system also includes a multi-timer scheduling module. This module, connected to the dynamic UI generation module, creates independent timers for at least one periodically transmittable protocol item and triggers message transmission operations independently based on the transmission period corresponding to each protocol item. For example, when the system starts, a fixed number of timer objects can be pre-created and statically bound to protocol items. Each timer is configured to count according to the transmission period of its bound protocol item and trigger a message transmission request after the countdown ends.

[0025] Furthermore, the system also includes a data packaging module. This module, connected to the multi-timer scheduling module and the dynamic UI generation module, automatically converts the input value into message data conforming to the bus byte order according to the byte order identifier of the corresponding protocol item when a change in the input control is detected, and updates the message buffer. For example, when a user inputs a signal value into the input control on the operation interface, the data packaging module can directly fill the input value into the corresponding position in the message buffer according to the preset byte order rules in the protocol item.

[0026] Finally, the system also includes a waveform analysis module. This module communicates with the configuration parsing module to receive signal definition information and parse independently loaded bus log files based on this information, generating and displaying waveforms. For example, when a user selects a bus log file to load, the waveform analysis module can sequentially read the file in the main program thread, parse the message data line by line according to the signal definition information provided by the configuration parsing module, extract signal values, and plot them as waveforms for display on the interface.

[0027] This system addresses issues in traditional CAN bus host computer communication software, such as high coupling between protocol and business logic, static binding of UI controls, difficulty in controlling the timing of multiple messages, and reliance on manual conversion for endianness processing, by introducing modules for configuration parsing, dynamic UI generation, multi-timer scheduling, data packaging, and waveform analysis. This results in greater flexibility in communication protocol configuration and faster deployment, improved development efficiency, reduced maintenance costs, and enhanced data visualization and analysis capabilities, thereby optimizing the overall user experience of CAN bus communication software.

[0028] This application further proposes that the signal definition information should include at least: signal name, CAN identifier, byte offset, bit offset, bit length, scaling factor, offset, symbol type, unit, transmission period, endianness identifier, and a list of optional values.

[0029] Through the above technical solution, signal definition information is refined into specific parameters such as signal name, CAN identifier, byte offset, bit offset, bit length, scaling factor, offset, symbol type, unit, transmission period, endianness identifier, and a list of optional values. This enables the configuration parsing module to obtain a comprehensive and standardized signal description. This greatly improves the accuracy and intelligence of the dynamic UI generation module in generating the operation interface; for example, it can automatically select the appropriate control type based on the list of optional values. Simultaneously, the data packaging module can accurately convert user input values ​​into message data conforming to the CAN bus specification based on information such as byte offset, bit offset, bit length, scaling factor, offset, symbol type, and endianness identifier, avoiding data conversion errors. Furthermore, the waveform analysis module can also accurately parse and convert physical quantities from the raw data in the independently loaded bus log file based on this detailed definition information, thereby generating clear and meaningful waveforms. This detailed definition method ensures data consistency, operational convenience, and parsing accuracy throughout the system when processing CAN bus communication, significantly improving system robustness and user experience.

[0030] This application further proposes a dynamic UI generation module including a control type intelligent selection unit, used to automatically select the input control type based on the list of optional values ​​for each signal in the protocol item list. Specifically, when the number of optional values ​​is 2, a checkbox control is generated; when the number of optional values ​​is greater than 2, a drop-down selection box control is generated; and when there are no optional values, a numeric input box control is generated.

[0031] The intelligent control type selection unit is a logic processing unit whose core function is to intelligently determine and select the most suitable UI control type for the signal data input based on the signal definition information obtained from the configuration parsing module, especially the list of optional values ​​it contains. This unit analyzes the list of optional values ​​for each protocol item through built-in judgment logic, thereby guiding the dynamic UI generation module to create the corresponding interactive controls. For example, this unit can receive the complete data structure of a protocol item, extract field information about the "list of optional values," and then perform conditional judgments based on the characteristics of that field.

[0032] When the intelligent selection unit detects that a signal's list of possible values ​​contains only two preset values, such as a signal representing a binary state like "on / off," "enabled / disabled," or "true / false," the unit instructs the dynamic UI generation module to generate a checkbox control. The checkbox control, with its intuitive selected / unselected state, clearly represents the two possible states of a signal, greatly simplifying user operation and avoiding errors that may occur due to manual input. For example, if the protocol defines a signal's valid value as 0 or 1, the system will automatically generate a checkbox, and the user only needs to check or decheck it to complete the input.

[0033] Furthermore, when the intelligent selection unit determines that the list of possible values ​​for a signal contains more than two preset values, such as multiple working modes, multiple color selections, or multiple preset levels, the unit instructs the dynamic UI generation module to generate a drop-down selection box control. The drop-down selection box control effectively saves space on the user interface while presenting all legal possible values ​​to the user in a list format. The user simply selects an option from the list to complete the input. This approach not only improves the cleanliness of the interface but, more importantly, forces the user to choose from predefined legal options, thereby fundamentally eliminating the possibility of illegal data input and ensuring the accuracy and compliance of the data input.

[0034] Furthermore, when the intelligent selection unit for control types detects that the list of possible values ​​is not defined in the protocol item of a signal, or that the list of possible values ​​is empty, this usually means that the signal is a numeric, text, or signal with a continuous value range. In this case, the unit will instruct the dynamic UI generation module to generate a numeric input box control. The numeric input box provides users with a flexible input method, allowing users to input any numeric value or text according to the actual needs of the signal. To further improve the user experience and data accuracy, the numeric input box can also perform input validation based on the data type (such as integer, floating-point number) or value range specified in the signal definition information, and provide prompts when the user's input does not conform to the specifications.

[0035] Through the above technical solution, this application can automatically select the most suitable input control type based on the list of selectable values ​​for each signal in the protocol item list. Specifically, for signals with two selectable values, the system automatically generates a checkbox control, allowing users to intuitively make binary selections; for signals with multiple selectable values, the system automatically generates a drop-down selection box control, effectively saving interface space and limiting the user's input range, ensuring the legality of data input; and for signals with no selectable values, a numeric input box control is generated to accommodate flexible numeric or text input. This intelligent control selection mechanism significantly improves the user-friendliness and ease of use of the interface, reduces the possibility of users manually consulting protocol documents and making input errors, thereby improving the accuracy and efficiency of data input and optimizing the overall user experience.

[0036] This application further proposes that the above-mentioned multi-timer scheduling module includes a timer mapping table, a dynamic start / stop unit, and that the transmission period of each protocol item is stored independently, and the timing period of each timer object is independent of each other.

[0037] Specifically, the timer mapping table is a data structure, such as a hash table or dictionary, that establishes a one-to-one correspondence between protocol items and timer objects. By using the protocol item index as the key, this mapping table can efficiently store and retrieve the corresponding timer objects. The protocol item index can be a unique identifier for the protocol item in the protocol item list, while the timer object can be a timer handle provided by the operating system, a thread timer instance, or a custom timer class instance. This design enables the system to quickly locate and operate the timer associated with a specific protocol item, thereby achieving centralized and structured management of multiple independent timers.

[0038] The dynamic start / stop unit is a logical component within the multi-timer scheduling module. Its core function is to respond to user operations and dynamically manage the lifecycle of timers. When the start / stop control in the user interface is triggered to the open state by the user, the dynamic start / stop unit creates a new timer object based on the transmission cycle information of the corresponding protocol item. This timer object is configured to time at the specified transmission cycle and trigger a message transmission operation each time the timer expires. After successful creation, the timer object is stored in the timer mapping table and the timer starts immediately. Conversely, when the start / stop control is triggered to the closed state, the dynamic start / stop unit searches for and retrieves the timer object for the corresponding protocol item from the timer mapping table, then stops the timer's operation and releases the system resources it occupies, for example, by destroying the timer object or detaching it from the system resources.

[0039] Furthermore, this application emphasizes the independent storage of the transmission period for each protocol item. This means that in the protocol item list generated by the configuration parsing module, each protocol item's data structure includes an independent field for storing its transmission period, saved independently of other protocol items. Simultaneously, the timing periods of each timer object are independent of each other; that is, timers created for different protocol items have independent timing frequencies and triggering mechanisms. The system creates an independent timer instance for each protocol item that needs to be transmitted periodically. These timers can be thread-based timers, timers provided by the system API, or event loop-based timers. Each timer instance maintains its own timing state and callback function, thereby ensuring that its timing period does not interfere with other timers.

[0040] This application further proposes that the waveform analysis module includes a thread isolation unit and a progress feedback unit. The thread isolation unit is used to run the parsing operation of the bus log file in an independent working thread, isolated from the main interface thread; the progress feedback unit is used to calculate the parsing progress in real time and display it to the user, and supports the user in canceling the parsing operation.

[0041] Specifically, a thread isolation unit is a software design pattern or component whose core function is to separate potentially time-consuming or computationally intensive tasks from the application's main thread and execute them in one or more independent background worker threads. When the waveform analysis module needs to parse a bus log file, the thread isolation unit starts a new worker thread to execute the specific parsing logic, while the main interface thread continues to handle user interaction and UI rendering. This isolation mechanism ensures that even if the parsing task takes a long time, the main interface remains responsive, avoiding UI lag or unresponsiveness.

[0042] Meanwhile, the progress feedback unit provides users with the current status and progress information of long-running operations. This unit typically includes mechanisms for progress calculation, progress display, and operation interruption. Regarding progress calculation, worker threads, while performing parsing operations, can periodically (e.g., after processing a certain number of bytes or records) calculate the percentage of work completed relative to the total workload. For example, if the size of the bus record file is known, the current parsing progress can be calculated based on the ratio of read bytes to the total number of bytes. For progress display, the calculated progress information is transmitted to the main interface thread via inter-thread communication. The main interface thread then updates the corresponding user interface elements, such as progress bar controls or status text labels, to display the parsing progress to the user in real time. Furthermore, the progress feedback unit also supports user cancellation of parsing operations. When a user triggers a cancellation command through the interface, the main interface thread sends a cancellation signal to the worker threads. The worker threads periodically check for this cancellation signal during the parsing loop. Once the signal is detected, the current parsing operation is immediately stopped, related resources are released, and the main interface thread is notified that parsing has been cancelled. This ensures the timeliness and security of cancellation operations, preventing resource leaks or data corruption.

[0043] By separating the parsing operation of the bus record file from the main interface thread and running it in an independent worker thread, the above technical solution effectively avoids the problem of the main interface lag or unresponsiveness caused by parsing large files, significantly improving system responsiveness and user experience. Simultaneously, the progress feedback unit can calculate and display the parsing progress to the user in real time, allowing the user to clearly understand the operation's progress and eliminating uncertainty during the waiting process. More importantly, it allows users to cancel the parsing operation at any time, giving them control over time-consuming tasks, avoiding unnecessary waiting, and further optimizing the flexibility and efficiency of user interaction. This design enables the waveform analysis module to maintain a smooth interface and convenient operation even when processing complex data.

[0044] This application further proposes that the configuration parsing module supports drag-and-drop loading. Specifically, the system provides a drag-and-drop receiving area. When a protocol configuration file is detected to be dragged to the drag-and-drop receiving area, the configuration parsing operation is automatically triggered. And depending on whether the configuration file has been loaded, the system automatically switches between the prompt interface and the configuration interface.

[0045] The drag-and-drop loading method refers to a user interaction paradigm that allows users to drag and drop files (such as protocol configuration files) from their original location to a specific area within the application interface using a mouse or other input device, and then "release" the file to trigger a preset operation. This method aims to simplify the file import process, reduce user operation steps, and improve the intuitiveness and convenience of the interaction. In implementation, the system typically listens for drag-and-drop events in the user interface.

[0046] The drag-and-drop receiving area is a specially designated visual area in the system user interface, configured to recognize and receive files or data dragged and dropped by the user. This area can be a separate panel, a text box, or a specific part of the main window, and is typically guided by visual cues (such as highlighted borders, background color changes, or the display of text "Drag and drop files here"). When the user drags a protocol configuration file to this area and releases it, the system captures the event and obtains the path information of the dragged file.

[0047] When the system detects that a protocol configuration file has been dragged and dropped into the drag-and-drop receiving area, it will immediately and automatically trigger a configuration parsing operation. This means that the user no longer needs to click an additional "load" or "parse" button; the system will directly invoke the configuration parsing module to parse the received protocol configuration file, thereby obtaining the signal definition information of each communication signal and generating a list of protocol items. This automated processing flow significantly improves the consistency and efficiency of the operation.

[0048] Furthermore, the system can automatically switch between the prompt interface and the configuration interface depending on whether a configuration file has been loaded. When no configuration file has been loaded, the system interface may display a prompt, such as a guide message saying "Please drag the protocol configuration file to this area." Once the protocol configuration file is successfully loaded and parsed, the system intelligently switches to the configuration interface, which typically displays an "operation interface" dynamically generated by the dynamic UI generation module based on the protocol item list. This interface includes controls for signal value input and start / stop controls for controlling the periodic transmission of messages. This dynamic switching mechanism ensures that the user interface always presents information and operation options most relevant to the current system state.

[0049] Through the above technical solution, users can quickly load protocol configuration files without multiple steps, significantly simplifying the file loading process. When a user drags and drops the protocol configuration file into the drag-and-drop receiving area, the system automatically triggers the configuration parsing operation, eliminating the need to manually click the load button and improving operational continuity. Furthermore, the system can intelligently switch between the prompt interface and the configuration interface based on whether a configuration file has been loaded, providing users with clear and intuitive feedback and avoiding unnecessary interface jumps or information redundancy, further improving user efficiency and overall user experience. This approach makes configuration file management and loading more convenient and efficient, especially suitable for scenarios requiring frequent processing of different CAN bus protocol configurations.

[0050] Traditional CAN bus host computer communication software suffers from several problems when interacting with slave devices, including high coupling between protocol and business logic, difficulty in controlling the timing of continuous transmission of multiple messages, reliance on manual conversion for endianness, separation of protocol configuration and data visualization, and static binding of UI controls to protocol fields. These problems lead to low development efficiency, high maintenance costs, susceptibility to errors, inability to achieve a unified user experience, and a large workload.

[0051] In response, this application further proposes a method for dynamically generating protocols for a configurable communication plug-in system for the CAN bus, based on the aforementioned system. The core innovation of this embodiment lies in combining configuration parsing, dynamic UI generation, and multi-timer scheduling in a step-by-step manner. This achieves protocol changes without code modification, precise control of multi-message timing, and automatic handling of endianness conversion, thereby improving development efficiency and reducing maintenance costs.

[0052] The method includes the following steps: Configuration and parsing steps: Parse the protocol configuration file to obtain the signal definition information of each communication signal and generate a list of protocol items; Dynamic UI generation steps: Dynamically generate the operation interface based on the protocol item list. The operation interface includes controls for signal value input and start / stop controls for controlling the periodic transmission of messages. Multi-timer scheduling steps: Create an independent timer for at least one periodically transmittable protocol item, and trigger the message transmission operation independently according to the transmission period corresponding to each protocol item; Data packaging steps: When a change in the value of the input control is detected, the input value is automatically converted into message data that conforms to the bus byte order according to the byte order identifier of the corresponding protocol item, and updated to the message buffer. Message sending steps: When the multi-timer scheduling step triggers the sending operation, message data is read from the message buffer and sent. Waveform analysis steps: Receive the signal definition information, parse the independently loaded bus log file based on the signal definition information, and generate and display the waveform.

[0053] Through the above technical solutions, the protocol and business logic are effectively separated. When the protocol changes, only the configuration file needs to be adjusted without recompiling the code. The multi-timer scheduling mechanism ensures independent timing control of messages in different periods, avoiding transmission conflicts. The data packaging step automatically completes the conversion based on byte order identifiers, eliminating manual processing errors. The waveform analysis step is tightly integrated with configuration parsing, achieving seamless connection between protocol configuration and data visualization. The dynamic UI generation step intelligently creates controls based on the protocol definition, completely solving the problem of static binding between UI and protocol. In summary, this method significantly improves the development efficiency, operational reliability, and user experience of CAN bus communication software.

[0054] In some embodiments described above in this application, a user interface is proposed to be dynamically generated based on a list of protocol items. This user interface includes controls for signal value input. However, if only a single or general type of input control is used, it may cause inconvenience for users when inputting signals with specific selectable values, easily leading to input errors, and failing to intuitively reflect the range of signal values, thereby affecting user experience and the accuracy of data input.

[0055] In response, this application further proposes a dynamic UI generation step including: automatically selecting the input control type according to the list of optional values ​​for each signal in the protocol item list, wherein a checkbox control is generated when the number of optional values ​​is 2; a drop-down selection box control is generated when the number of optional values ​​is greater than 2; and a numeric input box control is generated when there are no optional values.

[0056] Specifically, in the dynamic UI generation step, the system no longer simply provides uniform controls for all signal value inputs. Instead, it first acquires and analyzes the "optional value list" contained in the signal definition information of each communication signal. This "optional value list" clearly defines all allowed discrete values ​​for the signal. Based on intelligent judgment of the list's contents, the system can automatically select the input control type that best matches the data characteristics and user interaction habits for each signal. This automated selection mechanism ensures a high degree of adaptability and user-friendliness of the user interface, allowing it to adjust to changes in protocol configuration without manual intervention.

[0057] In detail, when the system detects that a signal's "optional value list" contains only two mutually exclusive options (e.g., "on / off" or "true / false" indicating a switch state), the dynamic UI generation step intelligently generates a checkbox control for it. The checkbox control, with its intuitive "selected / unselected" state, perfectly matches the input requirements of binary signals. Users can simply click to switch signal values, greatly simplifying the operation process.

[0058] Furthermore, if a signal's "optional value list" contains more than two options (e.g., "Mode A / Mode B / Mode C" indicating mode selection), the dynamic UI generation step will generate a dropdown selection box control for it. The dropdown selection box effectively accommodates multiple optional values, saving interface space while providing users with a clear and limited set of options. Users can select a preset value by clicking the dropdown menu, thus avoiding errors that might occur with manual input.

[0059] Furthermore, for signals whose "optional value list" is not specified in the signal definition information, or whose "optional value list" is empty (usually indicating signals that can take continuous or arbitrary values), the dynamic UI generation step will generate a standard numeric input box control. This control allows users to directly input specific values ​​and can work with the background data validation logic to ensure the validity of the input values, thus meeting the flexible input requirements for non-discrete signals.

[0060] This application further proposes a specific implementation method for the multi-timer scheduling steps, including storing timer objects in a timer mapping table with the protocol item index as the key; when the start / stop control is detected to be triggered to the on state, creating a timer object for the corresponding protocol item and starting the timer; when triggered to the off state, stopping and destroying the corresponding timer object; and the sending period of each protocol item is independent of each other, and the timing period of each timer object does not interfere with each other.

[0061] Specifically, the timer mapping table is a data structure, such as a hash table or dictionary, that associates each unique protocol item (identified by its protocol item index) with a specific timer object. Through this mapping, the system can efficiently find, manage, and retrieve the timer objects corresponding to each protocol item, ensuring that each protocol item's timer can be accessed and controlled independently. The protocol item index is typically a unique identifier assigned to each communication signal during the configuration resolution step. When a user triggers the start / stop control of a protocol item to the on state via the user interface, the system detects this state change. At this time, the system dynamically instantiates a new timer object for that protocol item. This timer object is configured according to the preset transmission period in the protocol item's signal definition information and then starts. After starting, the timer object's reference or pointer is stored in the aforementioned timer mapping table, using the protocol item index as its key, for easy subsequent management. Conversely, when a user triggers the start / stop control of a protocol item to the off state, the system retrieves the timer object corresponding to that protocol item from the timer mapping table. Once the timer object is retrieved, the system performs a stop operation, preventing it from triggering message transmissions. Subsequently, the timer object is destroyed, for example, by releasing the memory resources it occupies and removing its corresponding entry from the timer mapping table. This is to prevent resource leaks and ensure effective reclamation of system resources. Furthermore, the transmission cycles of each protocol item are independent, and the timing cycles of each timer object do not interfere with each other. This means that each timer object has its own independent running state and timing mechanism. This independence is achieved by assigning an independent timer instance to each protocol item. Each timer instance is configured and runs according to the transmission cycle of its corresponding protocol item, without affecting others. The operating system or the underlying timer service is responsible for concurrently managing these independent timers, ensuring that they trigger accurately according to their respective set cycles, thereby meeting the differentiated transmission frequency requirements of different signals in CAN bus communication.

[0062] Through the above technical solution, this application effectively solves the problems of low efficiency in timer resource management and potential interference between timers when dynamically configuring and operating CAN bus communication. Specifically, by introducing a timer mapping table, the system can manage the independent timer of each protocol item in a structured and efficient manner, realizing rapid location and operation of timer objects. When the user dynamically controls message transmission through start / stop controls, the system can create and destroy timer objects as needed, avoiding unnecessary resource occupation and ensuring timely release of resources, thereby optimizing system performance and resource utilization. In addition, by clearly defining that the transmission period of each protocol item is independent and that the timing periods of each timer object do not interfere with each other, the flexibility and stability of CAN bus communication are further guaranteed, enabling precise and independent periodic transmission of different signals, greatly improving the configurability and reliability of the system.

[0063] This application further proposes that the above waveform analysis steps include: running the parsing operation of the bus record file in an independent working thread, calculating the parsing progress in real time and displaying it to the user, and supporting the user to cancel the parsing operation.

[0064] Specifically, an independent worker thread refers to a program execution flow separate from the main interface thread. By distributing time-consuming bus log file parsing tasks to one or more independent worker threads, blocking the main interface thread can be effectively avoided. The main interface thread can thus continue to respond to user input and update the interface display, maintaining the application's smoothness and responsiveness. Implementation methods can include, but are not limited to, using the thread APIs provided by the operating system, or leveraging concurrency mechanisms provided by high-level programming languages.

[0065] Meanwhile, real-time calculation of parsing progress refers to continuously monitoring and quantifying the completion status of the parsing task during the parsing process of the bus log file. For example, progress information can be obtained by calculating the percentage of processed data out of the total data volume, or the proportion of parsed messages out of the total number of messages. This progress information is then displayed to the user, typically through graphical user interface (GUI) elements such as progress bars, percentage text, or status messages, allowing the user to intuitively understand the current status of the parsing task and the estimated completion time, thereby reducing uncertainty during waiting.

[0066] Furthermore, this application supports user cancellation of parsing operations, providing a mechanism that allows users to actively terminate a parsing task before it is completed. This is typically achieved by providing a "Cancel" button or similar interactive element on the user interface. When a user triggers a cancellation operation, the system sends a cancellation signal or sets a cancellation flag to the independent worker thread executing the parsing task. The worker thread periodically checks this signal or flag during the parsing process, and once a cancellation request is detected, it safely terminates the current parsing operation, releases related resources, and reports the task cancellation status to the main interface thread.

[0067] By separating the parsing operation of bus log files from the main interface thread and running it in an independent worker thread, the above technical solution effectively avoids user interface lag or unresponsiveness caused by parsing large files for extended periods, significantly improving system responsiveness and user experience. Simultaneously, real-time calculation and display of parsing progress allows users to clearly understand the task's execution status, eliminating uncertainty during the waiting process. Furthermore, users can cancel parsing operations at any time, giving them control over time-consuming tasks, avoiding unnecessary waiting, and further enhancing system flexibility and user-friendliness. These improvements enable the system to provide a more stable, efficient, and user-friendly operating experience when processing large-scale bus data.

[0068] The following example will provide a more detailed explanation of the above technical solution: Suppose User A is developing and testing an automotive electronic control unit (ECU) based on the CAN bus. This ECU needs to send and receive various signals via the CAN bus, such as engine speed, coolant temperature, and door status. User A faces the challenge that every time the protocol definition (e.g., the DBC file) changes, the host computer communication software code needs to be manually modified and recompiled; simultaneously, precise control of the transmission timing of multiple periodic messages is required, along with handling data conversion between different byte orders; furthermore, User A wants to be able to easily view and analyze the bus log data.

[0069] To solve these problems, User A uses this system for development and testing.

[0070] First, User A drags and drops the ECU's CAN protocol configuration file (e.g., a DBC file) into the system's drag-and-drop receiving area. Upon detecting this operation, the configuration parsing module automatically triggers the configuration parsing process. This module parses the configuration file, extracting the signal definition information for each communication signal. This information includes the signal name, CAN identifier, byte offset, bit offset, bit length, scaling factor, offset, symbol type, unit, transmission period, endianness, and a list of possible values. After parsing, the configuration parsing module generates a list of protocol items. During this process, the system automatically switches between the prompt interface and the configuration interface depending on whether the configuration file has been loaded, providing User A with an intuitive operating experience. This approach avoids the high coupling between the protocol and business logic in traditional solutions. When the protocol changes, there is no need to modify the code or recompile; only the configuration file needs to be updated, significantly improving development efficiency and maintenance convenience.

[0071] Next, the dynamic UI generation module receives the protocol item list generated by the configuration parsing module. Based on the signal definition information in the list, this module dynamically constructs the user interface. For example, for the "door status" signal, its list of possible values ​​may contain two options: "open" and "close" (two possible values), and the dynamic UI generation module automatically generates a checkbox control. For the "gear" signal, its list of possible values ​​may contain multiple options such as "P", "R", "N", "D1", and "D2" (more than two possible values), and the module automatically generates a drop-down selection box control. For the "engine speed" signal, since it has no possible values, the module generates a numeric input box control. Furthermore, each periodically transmitted signal is accompanied by a start / stop control for controlling the periodic transmission of messages. This dynamic UI generation method solves the problem of static binding between UI controls and protocol fields in traditional solutions, avoiding the tediousness and error-proneness of manually modifying UI code when the protocol changes.

[0072] When user A needs to periodically send the "engine speed" and "water temperature" signals on the user interface, he will trigger the corresponding start / stop controls for these two signals to the on state. After detecting these operations, the multi-timer scheduling module creates an independent timer object for the "engine speed" protocol item and starts timing according to its specified transmission period (e.g., 100 milliseconds). Simultaneously, it creates another independent timer object for the "water temperature" protocol item and starts timing according to its transmission period (e.g., 500 milliseconds). These timer objects are independent of each other, each triggering message transmission operations according to its set period, ensuring precise control of the multi-message transmission timing and effectively solving the problem of traditional single-timer schemes struggling to achieve independent timing control. The multi-timer scheduling module internally maintains a timer mapping table, storing the corresponding timer objects using the protocol item index as the key for easy management. When user A triggers the start / stop control of a signal to the off state, the corresponding timer object will be stopped and destroyed.

[0073] During periodic transmission, if user A modifies the "Engine Speed" input value in the numerical input box on the operation interface, the data packaging module will immediately detect the change. Based on the byte order identifier of the "Engine Speed" protocol item (e.g., if the bus requires big-endian but the system internally uses little-endian), this module automatically converts the user-input value into message data conforming to the CAN bus byte order and updates the message buffer. When the multi-timer scheduling module triggers the "Engine Speed" transmission operation, the system reads the packaged message data from the message buffer and sends it. This automated data packaging and byte order conversion mechanism avoids errors and code redundancy that developers might introduce by manually handling endianness differences.

[0074] Furthermore, to analyze the CAN message data sent by the ECU during actual operation, User A can load a separately recorded bus log file into the system. The waveform analysis module receives signal definition information provided by the configuration parsing module and parses the loaded bus log file based on this information. To avoid main interface lag when parsing large files, the thread isolation unit of the waveform analysis module runs the bus log file parsing operation in a separate working thread, isolated from the main interface thread. Simultaneously, the progress feedback unit calculates the parsing progress in real time and displays it to User A, allowing User A to cancel the parsing operation when needed. After parsing is complete, the waveform analysis module generates and displays waveforms of various signals (e.g., the curve of engine speed changing over time), enabling User A to intuitively analyze the bus data. This integrated design of protocol configuration and data visualization provides a unified "configuration as analysis" experience, solving the problem of separation between protocol configuration and data analysis tools.

[0075] Example 1: System Architecture like Figure 3 As shown, this embodiment provides a configurable communication plug-in system for CAN bus, including: a configuration parsing module 100, a dynamic UI generation module 200, a multi-timer scheduling module 300, a data packaging module 400, and a waveform analysis module 500.

[0076] The system is integrated into the QtCreator development environment as a plugin and runs as an independent communication plugin.

[0077] Configuration parsing module 100: Parses the CSV format protocol configuration file, extracting the signal definition information for each communication signal. Each line of the configuration file corresponds to a signal and includes fields such as: signal name, CAN identifier, byte offset, bit offset, bit length, scaling factor, offset, symbol type, unit, transmission period, endianness identifier, and a list of optional values. After parsing, a list of protocol items is generated and stored separately for the transmission and reception directions.

[0078] Dynamic UI Generation Module 200: Dynamically generates the operation interface based on the protocol item list. For protocol items in the receiving direction, it generates corresponding signal name columns and value display columns in the receiving table; for protocol items in the transmitting direction, it groups them by CAN identifier and dynamically creates input controls for each signal.

[0079] Specifically, the dynamic UI generation module 200 automatically selects the control type based on the list of possible signal values: When the number of optional values ​​is 2, a checkbox control is generated, and the checkbox text displays the names of the two options and their corresponding values. When the number of possible values ​​is greater than 2, a drop-down selection box control is generated, and the drop-down options display the option name and corresponding value; When the list of selectable values ​​is empty, a numeric input box control is generated, allowing the user to directly enter a value.

[0080] At the same time, a continuous transmission switch (checkbox) is generated for each CAN frame in the transmission direction to control whether the frame is transmitted periodically.

[0081] Multi-timer scheduling module 300: such as Figure 4 As shown, an independent timer object is created for each CAN frame in the transmit direction protocol item list, and stored in the timer mapping table 301 with the frame index as the key. Each timer runs independently according to the transmit period configured for the corresponding frame, and triggers the transmit operation of the corresponding message when the timer expires.

[0082] When the user clicks the continuous sending switch: If the switch changes from closed to open, the system creates a timer object for that frame, sets the timing period, connects the timer timeout signal to the send slot function, starts the timer, and stores the timer object in the mapping table. If the switch changes from on to off, the system looks up the corresponding timer in the mapping table, stops and destroys the timer, and removes it from the mapping table.

[0083] Data Packaging Module 400: When a user modifies a signal value via an input control, the module acquires the current value and converts it into message data conforming to bus byte order based on the endianness identifier of the corresponding protocol item, updating the message buffer. Specifically, the system converts 8-byte message data into a 64-bit integer, determines the storage location of the data within the integer based on the endianness identifier, writes the input value into the specified bit field, and then converts it back to byte array format. When the multi-timer scheduling module 300 triggers transmission, it reads the complete 8-byte CAN data from the buffer, assembles it into a CAN frame, and transmits it through the CAN bus interface.

[0084] Waveform Analysis Module 500: Receives signal definition information forwarded by Configuration Analysis Module 100, independently loads bus log files (such as txt, log, asc, and csv formats), analyzes the signal values ​​in the file based on the signal definition information, and generates waveforms for display. The analysis operation runs in a separate worker thread, displays the analysis progress to the user through a progress dialog box, and supports user cancellation.

[0085] like Figure 5 As shown, this embodiment further illustrates the workflow of the dynamic UI generation module 200: After the system loads and parses the protocol configuration file, the dynamic UI generation module 200 iterates through the protocol item list for the transmission direction and groups them by CAN identifier. For each CAN identifier, the corresponding signal group is as follows: 1. Create group labels to display CAN identifier information.

[0086] 2. Create input controls for each signal: Obtain the list of possible values ​​for the signal and determine the size of the list; If the size is 2, create a checkbox with the text format "option1:value1;option2:value2"; If the size is greater than 2, create a drop-down selection box, with each option's text formatted as "option name:value"; If the value is 0, a numeric input box will be created, and 0 will be displayed by default. 3. Create a continuous send switch for each group to control the periodic transmission of all messages in that group.

[0087] 4. Arrange all controls in a grid layout, with each signal occupying a row, and display the signal name and input control side by side.

[0088] When a user interacts with an input control, the control emits a value change signal, triggering a data packaging operation.

[0089] Example 3: Multi-timer scheduling method: This embodiment further illustrates the specific implementation of the multi-timer scheduling module 300: The system maintains a mapping table with frame index as the key and timer pointer as the value.

[0090] When the user clicks the continuous transmission switch for a specific CAN frame: If the switch state changes to on, the system creates a new timer object for the frame, sets the timing period to the transmission interval configured for the frame, connects the timer timeout signal to the transmission function of the frame, starts the timer, and stores the timer object in the mapping table; If the switch state changes to off, the system checks if the timer corresponding to the frame exists in the mapping table. If it exists, the timer is stopped, the timer object is deleted, and the entry is removed from the mapping table.

[0091] Each timer operates independently without interfering with the others. When multiple CAN frames are configured with different transmission periods, each timer triggers transmission according to its own period, achieving precise concurrent transmission of multi-period messages.

[0092] Example 4: Data Packaging Method This embodiment further illustrates the specific implementation of the data packaging module 400: The data packaging module 400 implements the functions of extracting signal values ​​from message data and writing signal values ​​into message data.

[0093] In little-endian mode, data is stored in memory with the least significant byte first and the most significant byte last; in big-endian mode, the storage order is the reverse. When input values ​​need to be written to a message, the system automatically processes the byte order according to the configured endianness flag. 1. Convert 8-byte message data into a 64-bit unsigned integer; 2. Determine the position of the target bit field within the integer based on the endianness identifier; 3. Write the input value to the specified bit field; 4. Convert the modified 64-bit integer back to an 8-byte array and write it back to the message buffer.

[0094] When a user modifies the value of an input control, the system obtains the current input value, calculates the original value based on the configured scaling factor and offset, and then calls the aforementioned write method to write the original value to the corresponding bit field position in the buffer.

[0095] Example 5: Waveform Analysis Method This embodiment further illustrates the workflow of the waveform analysis module 500: After the user selects a bus log file, the system starts a separate worker thread to parse it. During the parsing process: 1. Read the file content line by line, skipping comment lines and statistics lines.

[0096] 2. Parse the timestamp of each line, supporting multiple time formats.

[0097] 3. Parse the CAN identifier and data fields.

[0098] 4. Match the parsed CAN frame data with the signal definition forwarded by the configuration parsing module: If the CAN identifier is the same as the CAN identifier of a certain signal, extract the signal value according to the endianness, byte offset, bit offset, and bit length of the signal, and calculate the actual physical value by combining the scaling factor and offset.

[0099] 5. Add the timestamp and physical value as data points to the curve data of the corresponding signal.

[0100] 6. Real-time calculation of parsing progress (percentage of bytes read out of the total number of bytes in the file), displayed to the user through a progress dialog box, and allows the user to cancel the parsing operation.

[0101] After analysis, the curve data of all signals are displayed on a waveform graph. Users can zoom and pan using the mouse drag and scroll wheel. As the mouse moves, the waveform graph displays the signal value at the current position and the time interval between adjacent data points.

[0102] Compared with the prior art, the present invention has the following beneficial effects: 1. Decoupling of Protocol and Business: By using the configuration parsing module and the dynamic UI generation module, the communication protocol definition is completely separated from the upper-layer business logic. Protocol changes do not require code modification, only configuration file updates, which greatly improves development efficiency and system maintainability.

[0103] 2. Intelligent generation of UI controls: Automatically selects the most suitable input control type (checkbox, drop-down list, or numeric input box) based on the list of optional values ​​in the protocol configuration, realizing automated mapping between protocol fields and UI controls, reducing the amount of manual coding work.

[0104] 3. Precise independent timing control of multiple messages: Through the multi-timer scheduling module, an independent timer is created for each message to be sent. Each message can be sent precisely according to its own configured period without interference, which solves the problem of difficult timing control in the traditional single timer scheme.

[0105] 4. Automatic endianness conversion: The data packaging module automatically converts byte order based on the configured endianness identifier. Upper-layer business does not need to care about platform byte order differences, reducing development complexity and error probability.

[0106] 5. Integrated configuration and analysis experience: The waveform analysis module receives the signal definition information forwarded by the configuration parsing module, realizing a seamless connection between protocol configuration and data visualization. Users can directly analyze bus data without repeated configuration.

[0107] 6. Excellent user experience: Supports drag-and-drop loading of protocol configuration files, automatic UI state switching, and provides intuitive operation guidance; waveform parsing runs on an independent thread, ensuring smooth interface performance.

[0108] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A configurable communication plug-in system for CAN bus, characterized in that, include: The configuration parsing module is used to parse the protocol configuration file, obtain the signal definition information of each communication signal, and generate a list of protocol items; A dynamic UI generation module, connected to the configuration parsing module, is used to dynamically generate an operation interface based on the protocol item list. The operation interface includes controls for signal value input and start / stop controls for controlling the periodic transmission of messages. The multi-timer scheduling module, connected to the dynamic UI generation module, is used to create independent timers for at least one periodically sendable protocol item, and independently trigger message sending operations according to the sending period corresponding to each protocol item. The data packaging module, connected to the multi-timer scheduling module and the dynamic UI generation module, is used to automatically convert the input value into message data conforming to the bus byte order according to the byte order identifier of the corresponding protocol item when the value of the input control is detected to change, and update it to the message buffer. The waveform analysis module is communicatively connected to the configuration parsing module. It is used to receive the signal definition information, parse the independently loaded bus record file based on the signal definition information, and generate and display the waveform diagram.

2. The configurable communication plug-in system for CAN bus according to claim 1, characterized in that: The signal definition information includes at least: signal name, CAN identifier, byte offset, bit offset, bit length, scaling factor, offset, symbol type, unit, transmission period, endianness identifier, and a list of optional values.

3. A configurable communication plug-in system for CAN bus according to claim 1, characterized in that: The dynamic UI generation module includes: The intelligent control type selection unit is used to automatically select the input control type based on the list of optional values ​​for each signal in the protocol item list; when the number of optional values ​​is 2, a checkbox control is generated; when the number of optional values ​​is greater than 2, a drop-down selection box control is generated; when there are no optional values, a numeric input box control is generated.

4. A configurable communication plug-in system for CAN bus according to claim 1, characterized in that: The multi-timer scheduling module includes: The timer mapping table stores the corresponding timer objects using the protocol item index as the key. The dynamic start / stop unit is used to create a timer object for the corresponding protocol item and start the timer when the start / stop control is triggered to the on state, and to stop and destroy the corresponding timer object when it is triggered to the off state; and the sending period of each protocol item is stored independently, and the timing period of each timer object is independent of each other.

5. A configurable communication plug-in system for CAN bus according to claim 1, characterized in that: The waveform analysis module includes: The thread isolation unit is used to run the parsing operation of the bus record file in an independent worker thread, isolated from the main interface thread; The progress feedback unit is used to calculate the parsing progress in real time and display it to the user, and also supports the user to cancel the parsing operation.

6. A configurable communication plug-in system for CAN bus according to claim 1, characterized in that: The configuration parsing module supports drag-and-drop loading: it provides a drag-and-drop receiving area, and when a protocol configuration file is detected to be dragged to the drag-and-drop receiving area, the configuration parsing operation is automatically triggered; and depending on whether the configuration file has been loaded, it automatically switches between the prompt interface and the configuration interface.

7. A method for dynamically generating protocols for a configurable communication plug-in system for a CAN bus, the method being used in the system described in any one of claims 1-8, characterized in that: Includes the following steps: Configuration and parsing steps: Parse the protocol configuration file to obtain the signal definition information of each communication signal and generate a list of protocol items; Dynamic UI generation steps: Dynamically generate an operation interface based on the protocol item list. The operation interface includes controls for signal value input and start / stop controls for controlling the periodic transmission of messages. Multi-timer scheduling steps: Create an independent timer for at least one periodically transmittable protocol item, and trigger the message transmission operation independently according to the transmission period corresponding to each protocol item; Data packaging step: When a change in the value of the input control is detected, the input value is automatically converted into message data that conforms to the bus byte order according to the byte order identifier of the corresponding protocol item, and updated to the message buffer. Message sending steps: When the multi-timer scheduling step triggers the sending operation, message data is read from the message buffer and sent; Waveform analysis steps: Receive the signal definition information, parse the independently loaded bus record file based on the signal definition information, and generate and display the waveform diagram.

8. The method for dynamically generating protocols in a configurable communication plug-in system for CAN bus according to claim 7, characterized in that: The dynamic UI generation step further includes: automatically selecting the input control type according to the list of optional values ​​for each signal in the protocol item list, wherein a checkbox control is generated when the number of optional values ​​is 2, a drop-down selection box control is generated when the number of optional values ​​is greater than 2, and a numeric input box control is generated when there are no optional values.

9. The method for dynamically generating protocols in a configurable communication plug-in system for CAN bus according to claim 7, characterized in that: The multi-timer scheduling step further includes: storing timer objects in a timer mapping table using the protocol item index as the key; when the start / stop control is triggered to the on state, creating a timer object for the corresponding protocol item and starting the timer; when triggered to the off state, stopping and destroying the corresponding timer object; and the sending period of each protocol item is independent of each other, and the timing period of each timer object does not interfere with each other.

10. The method for dynamically generating protocols in a configurable communication plug-in system for CAN bus according to claim 7, characterized in that: The waveform analysis step further includes: running the parsing operation of the bus record file in an independent working thread, calculating the parsing progress in real time and displaying it to the user, and supporting the user to cancel the parsing operation.