Interface generation system and method, display terminal, storage medium, electronic device, program product
By automating the processing of database container files, constructing parent-child hierarchical data structures, and dynamically creating interface controls, the problem of complex and inefficient iterative updates of the BMS host computer monitoring interface is solved, achieving efficient interface generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CALB GROUP CO LTD
- Filing Date
- 2026-04-20
- Publication Date
- 2026-07-21
AI Technical Summary
In the existing technology, the iterative update process of the host computer monitoring interface of the battery management system (BMS) is complex and inefficient, with low development efficiency, easy errors due to repetitive manual work, high maintenance costs, and a lack of automated synchronization mechanism due to the decoupling of the interface and communication protocol.
A user interface generation system is provided, including a file parsing module, a metadata structure module, and a generation module. By automatically processing database container files, constructing a parent-child hierarchical data structure, and dynamically creating interface controls, the system achieves automated conversion from raw database container files to a structured visual interface and automatically matches visual components to generate a battery status monitoring interface.
It achieves fully automated, zero-code generation of monitoring interfaces, improves development efficiency, reduces manual labor, and solves the problems of complex and inefficient iterative update processes.
Smart Images

Figure CN122431573A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of upper computer monitoring interface generation technology for battery management systems, specifically to an interface generation system and method, a display terminal, a storage medium, an electronic device, and a program product. Background Technology
[0002] In the development and testing of a Battery Management System (BMS), the host computer monitoring interface is a core tool for engineers to observe battery status in real time, analyze CAN bus communication signals, and perform fault diagnosis and system debugging. Currently, BMS communication data is generally based on the CAN bus protocol, and the physical attributes of the signals are defined through a Database Container (DBC) file, including information such as signal name, start bit, length, factor, offset, unit, minimum / maximum value, and message ID.
[0003] In related technologies, the development of BMS host computer monitoring interfaces is typically done manually: developers first need to parse the DBC file to extract all signals to be monitored; then, in a graphical development environment, they create corresponding UI controls one by one; next, they manually bind each UI control to the signals in the DBC and configure display attributes; finally, they adjust the interface layout and perform functional integration testing. This development model has the following significant drawbacks: First, development efficiency is extremely low, and repetitive manual work is prone to errors. Second, maintenance costs are high. When the DBC file is updated due to changes in requirements (such as adding signals, modifying signal offsets, or adjusting message periods), developers must manually check and modify the control mapping relationships in the host computer interface one by one, which easily leads to problems such as signal omissions, misbinding, and inconsistent attributes, resulting in distorted monitoring data and seriously affecting test reliability. Third, the interface and communication protocol are highly decoupled. The UI logic is independent of the DBC file and lacks an automated synchronization mechanism, resulting in slow system iteration. Therefore, related technologies suffer from complex and inefficient iterative update processes for host computer monitoring interfaces.
[0004] There is still no effective solution to the technical problem of complex and inefficient iterative update process of the host computer monitoring interface used to monitor battery status in related technologies. Summary of the Invention
[0005] This application provides an interface generation system and method, a display terminal, a storage medium, an electronic device, and a program product to at least solve the technical problem in the related art that the iterative update process of the host computer monitoring interface used to monitor battery status is complex and inefficient.
[0006] According to one embodiment of this application, an interface generation system is provided, comprising: a file parsing module, used to extract target information contained in a database container file, wherein the target information includes signal data and message data; a metadata structure module, connected to the file parsing module, used to generate a parent node with a message identifier as a unique identifier and child signal nodes associated with the parent node according to the target information, and construct a parent-child hierarchical data structure through the parent node and the child signal nodes; and a generation module, connected to the metadata structure module, used to establish a parent list control and a child list control with a nested relationship according to the parent-child hierarchical data structure, and determine the display interface to be generated based on a preset visualization component bound to each signal attribute in the child list control, wherein the parent list control is used to display message information corresponding to the message data, and the child list control is used to display the battery status carried by the battery status.
[0007] According to another aspect of the embodiments of this application, an interface generation method is also provided, comprising: extracting target information contained in a database container file, wherein the target information includes signal data and message data; generating a parent node with a message identifier as a unique identifier and child signal nodes associated with the parent node based on the target information, and constructing a parent-child hierarchical data structure through the parent node and the child signal nodes; establishing a parent list control and a child list control with a nested relationship based on the parent-child hierarchical data structure, and determining the display interface to be generated based on a preset visualization component bound to each signal attribute in the child list control, wherein the parent list control is used to display message information corresponding to the message data, and the child list control is used to display the battery status carried by the battery status.
[0008] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the above-described interface generation method at runtime.
[0009] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the interface generation method described above through the computer program.
[0010] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the above-described interface generation method.
[0011] According to another aspect of the embodiments of this application, a display terminal is also provided, including a display device and an interface generation system. The interface generation system is connected to multiple batteries and is used to process the multiple batteries to generate a display interface to be generated. The display device is used to display the display interface to be generated.
[0012] This application provides an interface generation system comprising three core modules: a file parsing module, a metadata structure module, and a generation module. These modules work collaboratively to automate the conversion from raw database container files to a structured visual interface. The file parsing module parses the database container file, extracting target information, including message data and signal data. The metadata structure module, connected to the file parsing module, constructs a parent-child hierarchical metadata structure based on the extracted target information, using a "message identifier" as the unique identifier. Based on this parent-child hierarchical metadata structure, the generation module dynamically creates a parent list control for each parent node, centrally displaying summary information such as the message identifier, name, period, and status of the corresponding message; and dynamically creates a child list control for each child signal node, nesting and binding it to its parent list control to display the status of the signal. Furthermore, the generation module automatically matches and instantiates preset visualization components based on the signal attributes bound to each sub-level signal node, and finally assembles and generates a visualization interface for the battery status. This achieves fully automatic, zero-coding generation of the monitoring interface, solving the technical problem of complex and inefficient iterative update process of the host computer monitoring interface for monitoring battery status in related technologies, improving development efficiency and reducing manual labor. Attached Figure Description
[0013] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0014] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is a structural block diagram of an interface generation system according to an embodiment of this application;
[0016] Figure 2 This is a flowchart illustrating the interface generation method according to an embodiment of this application;
[0017] Figure 3This is a flowchart illustrating the dynamic generation of a BMS monitoring interface based on DBC metadata according to an embodiment of this application.
[0018] Figure 4 This is a schematic representation of a data chain according to an embodiment of this application;
[0019] Figure 5 This is an example diagram of a parent-child control list according to an embodiment of this application. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0021] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to such processes, methods, products, or devices.
[0022] The following appropriately discloses an embodiment of a battery according to this application. However, unnecessary detailed descriptions may be omitted. For example, detailed descriptions of well-known matters and repetitive descriptions of practically identical structures may be omitted. This is to avoid making the following description unnecessarily lengthy and to facilitate understanding by those skilled in the art. Furthermore, the following description is provided to enable those skilled in the art to fully understand this application and is not intended to limit the subject matter of the claims.
[0023] The battery cell in this application is a secondary battery, also known as a rechargeable battery or accumulator, which refers to a battery that can be recharged after discharge to activate the active materials and continue to be used. Typically, a secondary battery includes an electrode assembly, an electrolyte, and an outer casing. The electrode assembly includes a positive electrode, a negative electrode, and a separator. The electrode assembly and electrolyte are assembled inside the outer casing. During battery charging and discharging, active ions (such as lithium ions) move back and forth between the positive and negative electrodes, inserting and extracting. The separator is located between the positive and negative electrodes, primarily serving to prevent short circuits between the positive and negative electrodes while allowing active ions to pass through. The electrolyte, located between the positive and negative electrodes, primarily serves to conduct active ions.
[0024] As an example, the preparation process of a secondary battery is as follows: the positive electrode, separator, and negative electrode are stacked in sequence, with the separator acting as a separator between the positive and negative electrodes. Then, the electrodes are wound or stacked to obtain an electrode assembly. The electrode assembly is placed in an outer packaging shell, dried, and then injected with electrolyte. After vacuum sealing, settling, formation, and shaping, a secondary battery is obtained.
[0025] As an optional implementation method, Figure 1 This is a structural block diagram of an interface generation system according to an embodiment of this application; as shown below. Figure 1 As shown, it includes:
[0026] The file parsing module 12 is used to extract target information contained in the database container file, wherein the target information includes signal data and message data;
[0027] In other words, the file parsing module 12 is responsible for reading and parsing standard DBC files, which are typically generated by automotive or power battery system development tools and contain the message and signal definitions for CAN bus communication. Module 12 extracts key fields, namely the aforementioned target information, as the data source for subsequent processing. Key fields may include message identifier, message length, signal name, start bit, bit length, factor, offset, and unit.
[0028] Metadata structure module 14, connected to file parsing module 12, is used to generate a parent node with a message identifier as a unique identifier and a child signal node associated with the parent node based on the target information, and to construct a parent-child hierarchical data structure through the parent node and the child signal node;
[0029] Optionally, the metadata structure module 14 receives the target information output by the file parsing module 12 and constructs a hierarchical data structure based on the unique message identifier of the message: each message serves as a parent node, and all associated signals under it serve as child signal nodes, forming a tree-like parent-child relationship. By restoring the logical organization of the DBC protocol through the parent-child hierarchical data structure, the originally scattered communication data has a clear hierarchical classification, laying the structural foundation for automatic interface generation.
[0030] The generation module 16, connected to the metadata structure module 14, is used to establish a parent list control and a child list control with a nested relationship according to the parent-child hierarchical data structure, and to determine the display interface to be generated based on the preset visualization component bound to each signal attribute in the child list control. The parent list control is used to display the message information corresponding to the message data, and the child list control is used to display the battery status carried by the battery status.
[0031] Optionally, the generation module 16 dynamically creates two associated UI controls based on the aforementioned parent-child hierarchical data structure: a parent list control that displays all message names and identifiers (IDs); and a child list control that displays all signals contained in the currently selected message. When the user selects a message in the parent list, the child list automatically loads its subordinate signals and automatically binds the corresponding visual components, such as meters, progress bars, indicator lights, and text boxes, according to preset rules. Ultimately, without manual coding, a complete and interactive host computer monitoring interface is generated. The aforementioned preset rules include, but are not limited to, binding temperature signals to a temperature instrument panel, binding voltage signals to a digital display box, etc.
[0032] The interface generation system comprises three core modules: a file parsing module, a metadata structure module, and a generation module. These modules work collaboratively to automate the conversion from raw database container files to a structured, visual interface. The file parsing module performs deep parsing of database container files, such as DBC, LDF, or ARXML formats, extracting target information. This target information includes message data (CAN or LIN message frames with unique message identifiers) and signal data (physical quantities carried in the message, such as battery voltage, current, temperature, and battery state of charge (SOC)). The metadata structure module, connected to the file parsing module, constructs a parent-child hierarchical metadata structure based on the extracted target information, using the "message identifier" as the unique identifier. Specifically, each message data is abstracted as a parent node, with its message identifier serving as the unique primary key. Each signal data belonging to that message is mapped to a child signal node under that parent node, carrying attributes such as signal name, unit, value range, update frequency, and data type. This hierarchical structure fully preserves the nested hierarchy of the original messages and signals, providing a structured semantic foundation for subsequent interface generation. The generation module connects to the metadata structure module to automatically generate a nested interface control system based on the aforementioned parent-child hierarchical metadata structure. Specifically, the generation module dynamically creates a parent list control for each parent node to centrally display summary information such as message identifier, name, period, and status of the corresponding message; it also dynamically creates a child list control for each child signal node and nests it under its parent list control to display the real-time value, unit, trend curve, and threshold alarm status of the signal. Furthermore, the generation module automatically matches and instantiates preset visualization components based on the signal attributes bound to each child signal node, ultimately assembling and generating a visualization interface for the battery status. This achieves fully automated, zero-coding generation of the monitoring interface, solving the technical problem of complex and inefficient iterative updates of the host computer monitoring interface for monitoring battery status in related technologies, improving development efficiency, and reducing manual labor.
[0033] In one exemplary embodiment, the above-mentioned generation module further includes: a first control unit, configured to count the number of child signal nodes that have been loaded in the sub-list control; if the number of nodes is greater than a preset signal display threshold, to determine to hide the sub-list control; and if the number of nodes is less than or equal to the preset signal display threshold, to determine to display the sub-list control.
[0034] In short, the generation module further includes a first control unit, which controls the display state of the sub-list control based on the actual number of child signal nodes loaded in the sub-list control, thereby optimizing the clarity and interaction efficiency of the user interface. Specifically, after the sub-list control completes the loading of signal data, the first control unit automatically counts the total number of signal nodes currently belonging to it. If this number exceeds a preset signal display threshold, it is determined that the information density of the current interface is too high. To avoid a cluttered interface and hinder the user from quickly locating key signals, the sub-list control will be automatically hidden, leaving only the parent list control visible. The user needs to actively click on a message to trigger the temporary expansion of the sub-list, or display it through an interactive button, achieving on-demand visibility. Conversely, if the number of child signal nodes is less than or equal to the preset threshold, it is determined that the information content is moderate and the interface remains clear and readable. In this case, the sub-list control is automatically displayed without any additional user operation, greatly improving the efficiency of interface generation.
[0035] In an exemplary embodiment, the generation module further includes: a second control unit, configured to determine the selected message of the target object in the parent list control, and identify the selected message identifier of the selected message; use the selected message identifier to query the parent-child hierarchical data structure to obtain multiple signal nodes to be loaded; record the number of signals to be displayed corresponding to the multiple signal nodes to be loaded; and when the number of signals to be displayed is greater than the maximum loading capacity of the child list control, divide the multiple signal nodes to be loaded into multiple subsets according to a preset grouping strategy, each subset corresponding to a child list control, wherein the preset grouping strategy includes at least one of the following: grouping by signal type, grouping by message period, grouping by alarm priority, or grouping by user-defined tags.
[0036] Optionally, the generation module is also configured with a second control unit, which is used to respond to the user's selection operation on a certain message in the parent list control, so as to realize the paginated loading and organization management of a large number of signals.
[0037] Specifically, when a user selects a message in the parent list control, the second control unit first identifies the selected message identifier, such as CAN message ID: 0x123, and searches the pre-built parent-child hierarchical data structure based on this identifier to obtain all associated child signal nodes to be loaded. Then, the total number of these signal nodes is counted, i.e., the number of signals to be displayed. If this number exceeds the maximum loading threshold of the child list control, such as a maximum of 20 signals per screen, to avoid interface lag, information overload, or visual clutter, the second control unit will activate a preset grouping strategy, intelligently dividing the signal nodes to be loaded into multiple subsets. Each subset is independently bound to a child list control, presented through tabs, collapsible panels, or columns, achieving paginated and grouped display of signals, thus avoiding the limitation of a single list carrying all signals.
[0038] Optionally, the above-mentioned preset grouping strategies include, but are not limited to: grouping by signal type, such as temperature, voltage, current, and status bit; grouping by message period, such as 10ms, 100ms, and 1s periodic signals; grouping by alarm priority, such as emergency, warning, and alert; and grouping by user-defined tags, such as user-labeled tags like battery safety and thermal management.
[0039] In an exemplary embodiment, the interface generation system further includes: a metadata definition module, used to obtain a first format of a standard database container file and determine a second format according to the usage requirements of the target object; and to determine the file format of the database container file based on the first format and the second format, wherein the second format is an enhanced format defined on the basis of the standard database container file through comments or extended fields, and the second format includes at least one of the following custom attributes: control type, display unit, alarm color, refresh rate, default visibility, and sorting priority.
[0040] Optionally, the metadata definition module first obtains the first format of the standard DBC file, which conforms to the original communication protocol specifications defined by tools such as CANoe and Vector, including standard fields such as message ID, signal start bit, length, factor, and offset. Based on this, according to the interface interaction requirements of the target object, such as BMS engineers or testers, a second format is defined. This format is an enhanced metadata added to the standard DBC file through comment lines or vendor-defined extended attributes, without breaking the original protocol compatibility, achieving backward compatibility. The second format supports at least one or more of the following custom attributes: control type to specify the visual representation of the signal, such as digital display, dashboard, indicator light, or graph; display unit to force a unified interface unit to avoid manual missetting; alarm color to bind the signal threshold and visual cues, such as red > 80%, yellow > 60%; refresh rate to control the interface update rate, balancing real-time performance and performance; default visibility to control whether the signal is displayed by default upon first loading; sorting priority to determine the order of signals in the sub-list, optimizing information layout. By combining the first and second formats, these enhanced attributes can be automatically identified and extracted as the configuration basis for generating a visual interface, thus realizing the transformation of the protocol into an interface.
[0041] In one exemplary embodiment, the interface generation system further includes: a monitoring module, configured to monitor file operations on the database container file; when the file operation involves changing target information contained in the file, sending a first instruction to the file parsing module to reload the database container file, and sending a second instruction to the metadata structure module to rebuild the parent-child hierarchical data structure; and, upon completion of the execution of the first instruction and the second instruction, instructing the generation module to perform a control list refresh, wherein the control list refresh is used to synchronize the updated content of the database container file to the parent list control and the child list control.
[0042] Optionally, the monitoring module can achieve dynamic perception and automatic response to database container files. That is, the monitoring module continuously listens for system-level file operation events of the target DBC file, including but not limited to: file modification, file replacement, file timestamp change, external tool writing, etc. When a change in file content is detected that affects the extracted target information, such as signal additions / deletions, message ID modifications, or updates to key fields like signal start bit / length / factor / unit, the monitoring module immediately triggers an automated synchronization process: It sends a first instruction to the file parsing module, requesting it to reread and parse the updated DBC file to ensure the original communication data is the latest version; it sends a second instruction to the metadata structure module, requesting it to rebuild the parent-child hierarchical data structure based on the newly parsed data, i.e., reconstructing the parent node and its associated child signal node set, uniquely identified by the message identifier, to ensure semantic consistency between the data structure and protocol changes; after both modules complete execution and provide feedback on successful loading and structure reconstruction, the monitoring module sends a refresh instruction to the generation module, driving it to dynamically refresh the control list, i.e., automatically updating all message entries in the parent list control; synchronously refreshing the corresponding signal name, unit, alarm threshold, control type, and other metadata in the child list control; maintaining the user's current selection state, only updating the content of its subordinate signals to avoid interface jumps interfering with the operation process.
[0043] In an exemplary embodiment, the interface generation system further includes: a configuration export module connected to the generation module, used to determine the interface layout, control binding relationship and display parameters corresponding to the display interface to be generated; and to generate a general configuration file based on the interface layout, the control binding relationship and the display parameters.
[0044] Understandably, after the interface is automatically generated, the configuration export module actively captures and extracts all interface configuration elements constructed by the generation module. Interface layout includes the relative positions, size ratios, column structure, and collapsible / expanded states of parent and child list controls; control binding relationships include the mapping between each child signal node and its corresponding visual component, such as digital display boxes, dashboards, indicator lights, and graphs; display parameters include, but are not limited to, default signal visibility, refresh rate, alarm threshold, color mapping rules, unit display format, and sorting priority. Based on these three types of information, the configuration export module generates a structured, universal configuration file that fully describes how to generate a monitoring interface with a specific function from a DBC file. This universal configuration file can be used in the following application scenarios: project reuse, version rollback, and automated deployment. It achieves efficient conversion between configuration and interface, ensuring efficient and consistent interface development.
[0045] In an exemplary embodiment, the interface generation system further includes: a display module connected to the generation module, configured to determine the interface size of the visual display interface associated with the interface generation system, obtain the first item height of the parent list control and the second item height of the child list control; and determine the number of messages allowed to be displayed by the parent list control and the maximum load of the child list control based on the interface size, the first item height, and the second item height.
[0046] In other words, the display module works in conjunction with the generation module to achieve adaptive calculation and intelligent capacity planning of the interface layout. The display module first obtains the physical or logical dimensions of the current visual display interface, such as the window resolution or available area size, and reads the first height of a single message item in the parent list control and the second height of a single signal item in the child list control. Based on this, it dynamically derives the maximum number of messages that the parent list control can display without scrolling within the current display area by dividing the available height by the single item height, as well as the maximum signal load that the child list control can fully accommodate without triggering the vertical scroll bar in the expanded state. This ensures that the interface maintains reasonable information density, smooth operation, and no visual overflow in any display environment.
[0047] In an exemplary embodiment, the interface generation system further includes: a caching module, configured to, upon successfully determining the parent-child hierarchical data structure and the visual display interface corresponding to the database container file, associate and cache the database container file, the parent-child hierarchical data structure, and the display interface to obtain a target template for storage in the cache database; and, upon reloading other files with the same content as the database container file, load the parent-child hierarchical data structure from the cache database, and establish target parent list controls and target child list controls corresponding to the other files based on the parent-child hierarchical data structure, thereby skipping the processing of the other files by the file parsing module and the metadata structure module.
[0048] Optionally, after successfully parsing the database container file and generating the corresponding parent-child hierarchical data structure and display interface, the file, data structure, and interface information are associated and stored to form a target template, which is then saved in the cache database. When another database container file with the same content is loaded again, the cache module compares the file content. If it identifies duplicate or equivalent data, it directly extracts the existing parent-child hierarchical data structure from the cache database and constructs the corresponding parent list control and child list control based on this structure, without having to re-execute the file parsing and data structure reconstruction process.
[0049] In an exemplary embodiment, the interface generation system further includes: a recording module, configured to record the conversion time from the database container file to the generated display interface; if the conversion time is greater than or equal to a preset valid time, determine that the interface generation system has an operational abnormality and send an alarm message for performing system verification to the management object of the interface generation system; if the conversion time is less than the preset valid time, determine that the interface generation system is operating normally.
[0050] Optionally, the time elapsed from when the database container file is read to when it is finally displayed on the screen is measured. If this time reaches or exceeds a preset valid time threshold, an anomaly is determined in the interface generation process, an alarm message is triggered and sent to the management object, prompting the system to perform a verification. If the time does not exceed the preset threshold, the current process is considered normal and no intervention is required.
[0051] This embodiment provides an interface generation method, such as Figure 2 As shown, Figure 2 This is a flowchart illustrating the interface generation method according to an embodiment of this application, including the following steps:
[0052] Step S202: Extract the target information contained in the database container file, wherein the target information includes signal data and message data;
[0053] Step S204: Generate a parent node with a message identifier as the unique identifier and a child signal node associated with the parent node based on the target information, and construct a parent-child hierarchical data structure through the parent node and the child signal node;
[0054] Step S206: Based on the parent-child hierarchical data structure, establish a parent list control and a child list control with a nested relationship, and determine the display interface to be generated based on the preset visualization component bound to each signal attribute in the child list control. The parent list control is used to display the message information corresponding to the message data, and the child list control is used to display the battery status carried by the battery status.
[0055] Through the above steps, target information is automatically extracted from the database container file. This target information includes signal data and message data from vehicle communication messages. Signal data is the smallest data unit carrying specific physical quantities, such as battery voltage, current, temperature, and battery state of charge (SOC). Message data is a communication frame structure containing multiple signals and has a unique message identifier. Based on the extracted target information, a tree-like data structure with a parent-child hierarchy is constructed: parent nodes are generated using the message identifier of the message data as a unique identifier. Each parent node is associated with one or more child signal nodes, and each child signal node corresponds to a specific signal data item, thus forming a hierarchical mapping relationship of "message—signal". Then, based on the above parent-child hierarchical data structure, a nested interface control system is dynamically generated: a parent list control and child list controls are constructed in the user interface. The parent list control is used to centrally display basic information such as message identifier, period, and length of each message. Each parent list control is associated with an expandable child list control, used to display the signal attributes it contains, such as name, value, unit, range, and update status. Furthermore, for the signal attributes in each sub-list control, corresponding visualization components, such as digital meters, progress bars, color indicator lights, and waveform graphs, are automatically bound according to preset visualization rules, thereby automatically generating a display interface for battery status monitoring. This process achieves fully automated, zero-code generation of the monitoring interface, solving the technical problem of complex and inefficient iterative updates to the host computer monitoring interface used for battery status monitoring in related technologies, improving development efficiency and reducing manual labor.
[0056] In an exemplary embodiment, after establishing a nested parent list control and a child list control based on the parent-child hierarchical data structure, the method further includes: counting the number of child signal nodes that have been loaded in the child list control; if the number of nodes is greater than a preset signal display threshold, determining to hide the child list control; if the number of nodes is less than or equal to the preset signal display threshold, determining to display the child list control.
[0057] In short, after the sub-list control finishes loading signal data, the total number of currently associated signal nodes is automatically counted. If this number exceeds a preset signal display threshold, the current interface is considered to have excessive information density. To avoid clutter and hinder users from quickly locating key signals, the sub-list control will be automatically hidden, leaving only the parent list control visible. Users must actively click on a message to trigger a temporary expansion of the sub-list, or it can be displayed via an interactive button, allowing for on-demand visibility. Conversely, if the number of child signal nodes is less than or equal to the preset threshold, the information content is considered appropriate, and the interface remains clear and readable. In this case, the sub-list control is automatically displayed without any additional user intervention, significantly improving interface generation efficiency.
[0058] In an exemplary embodiment, before determining the display interface to be generated based on the preset visualization component bound to each signal attribute in the sub-list control, the method further includes: determining the selected message of the target object in the parent list control and identifying the selected message identifier; using the selected message identifier to query in the parent-child hierarchical data structure to obtain multiple signal nodes to be loaded; recording the number of signals to be displayed corresponding to the multiple signal nodes to be loaded; when the number of signals to be displayed is greater than the maximum loading capacity of the sub-list control, dividing the multiple signal nodes to be loaded into multiple subsets according to a preset grouping strategy, each subset corresponding to a sub-list control, wherein the preset grouping strategy includes at least one of the following: grouping by signal type, grouping by message period, grouping by alarm priority, or grouping by user-defined label.
[0059] Optionally, when a user selects a message in the parent list control, the system first identifies the selected message identifier, such as CAN message ID: 0x123, and then searches the pre-built parent-child hierarchical data structure based on this identifier to obtain all associated child signal nodes to be loaded. Subsequently, the total number of these signal nodes is counted, i.e., the number of signals to be displayed. If this number exceeds the maximum loading threshold of the child list control (e.g., a maximum of 20 signals can be displayed on a single screen), to avoid interface lag, information overload, or visual clutter, the second control unit will activate a preset grouping strategy. This will intelligently divide the signal nodes to be loaded into multiple subsets, each subset independently bound to a child list control, such as through tabs, collapsible panels, or columns, to achieve paginated and grouped display of signals, thereby avoiding the limitation of a single list carrying all signals. The above-mentioned preset grouping strategies include, but are not limited to: grouping by signal type, such as temperature, voltage, current, and status bit; grouping by message period, such as 10ms, 100ms, and 1s periodic signals; grouping by alarm priority, such as emergency, warning, and alert; and grouping by user-defined tags, such as user-labeled tags like battery safety and thermal management.
[0060] In an exemplary embodiment, before extracting the target information contained in the database container file, the method further includes: obtaining a first format of the standard database container file and determining a second format according to the usage requirements of the target object; determining the file format of the database container file based on the first format and the second format, wherein the second format is an enhanced format defined on the basis of the standard database container file through comments or extended fields, and the second format includes at least one of the following custom attributes: control type, display unit, alarm color, refresh rate, default visibility, and sorting priority.
[0061] Optionally, the first format of the standard DBC file is obtained, which conforms to the original communication protocol specifications defined by tools such as CANoe and Vector, including standard fields such as message ID, signal start bit, length, factor, and offset. Based on this, a second format is defined according to the interface interaction requirements of the target object, such as BMS engineers or testers. This format is an enhanced metadata added to the standard DBC file through comment lines or vendor-defined extended attributes, without breaking the original protocol compatibility, achieving backward compatibility. The second format supports at least one or more of the following custom attributes: control type to specify the visual representation of the signal, such as digital display, dashboard, indicator light, or graph; display unit to force a unified interface unit to avoid manual missetting; alarm color to bind the signal threshold and visual cues, such as red > 80%, yellow > 60%; refresh rate to control the interface update rate, balancing real-time performance and performance; default visibility to control whether the signal is displayed by default upon first loading; sorting priority to determine the order of signals in the sub-list, optimizing information layout. By combining the first and second formats, these enhanced attributes can be automatically identified and extracted as the configuration basis for generating a visual interface, thus realizing the transformation of the protocol into an interface.
[0062] In an exemplary embodiment, before extracting the target information contained in the database container file, the method further includes: monitoring file operations on the database container file; if the file operation involves changing the target information contained in the file, sending a first instruction to the file parsing module to reload the database container file, and sending a second instruction to the metadata structure module to rebuild the parent-child hierarchical data structure; and, upon completion of the execution of the first and second instructions, instructing the generation module to perform a control list refresh, wherein the control list refresh is used to synchronize the updated content of the database container file to the parent list control and the child list control.
[0063] Optionally, continuously monitor system-level file operation events of the target DBC file, including but not limited to: file modification, file replacement, file timestamp change, and external tool writing. When a change in file content is detected, and this change affects the extracted target information, such as signal addition / deletion, message ID modification, or updates to key fields like signal start bit / length / factor / unit, send a first instruction to the file parsing module, requesting it to reread and parse the updated DBC file to ensure the original communication data is the latest version; send a second instruction to the metadata structure module, requesting it to rebuild the parent-child hierarchical data structure based on the newly parsed data, that is, to rebuild the parent node and its associated child signal node set with the message identifier as the unique identifier, ensuring that the data structure remains semantically consistent with the protocol change; after the two modules complete execution and return status signals of successful loading and structure reconstruction, send a refresh instruction to the generation module, driving it to dynamically refresh the control list, that is, automatically update all message entries in the parent list control; synchronously refresh the metadata information such as the name, unit, alarm threshold, and control type of the corresponding signal in the child list control; maintain the user's current selection state and only update the content of its subordinate signals to avoid interface jumps interfering with the operation process.
[0064] In an exemplary embodiment, after determining the display interface to be generated based on the preset visualization component bound to each signal attribute in the sublist control, the method further includes: determining the interface layout, control binding relationship and display parameters corresponding to the display interface to be generated; and generating a general configuration file based on the interface layout, control binding relationship and display parameters.
[0065] Understandably, after the interface is automatically generated, the system actively captures and extracts all interface configuration elements constructed by the generation module. Interface layout includes the relative positions, size ratios, column structure, and collapsible / expanded states of parent and child list controls, as well as other visual organization relationships. Control binding relationships include the mapping between each child signal node and its corresponding visual component, such as digital display boxes, dashboards, indicator lights, and graphs. Display parameters include, but are not limited to, default signal visibility, refresh rate, alarm threshold, color mapping rules, unit display format, and sorting priority. Based on these three types of information, a structured general configuration file is generated, which fully describes how to generate a monitoring interface with a specific function from a DBC file. This general configuration file can be used in the following application scenarios: project reuse, version rollback, and automated deployment. It achieves efficient conversion between configuration and interface, ensuring the efficiency and consistency of interface development.
[0066] In an exemplary embodiment, before determining the display interface to be generated based on the preset visualization component bound to each signal attribute in the sub-list control, the method further includes: determining the interface size of the visualization display interface associated with the interface generation system, obtaining the first item height of the parent list control and the second item height of the sub-list control; and determining the number of messages allowed to be displayed by the parent list control and the maximum load of the sub-list control based on the interface size, the first item height, and the second item height.
[0067] In other words, the system obtains the physical or logical dimensions of the current visual display interface, such as window resolution or available area size, and reads the first height of a single message item in the parent list control and the second height of a single signal item in the child list control. Based on this, it dynamically derives the maximum number of messages that the parent list control can display without scrolling within the current display area by dividing the available height by the single item height, as well as the maximum signal load that the child list control can fully accommodate without triggering the vertical scroll bar when expanded. This ensures that the interface maintains reasonable information density, smooth operation, and no visual overflow in any display environment.
[0068] In an exemplary embodiment, after determining the display interface to be generated based on the preset visualization component bound to each signal attribute in the sub-list control, the method further includes: if the parent-child hierarchical data structure and visualization display interface corresponding to the database container file are successfully determined, the database container file, the parent-child hierarchical data structure, and the display interface are associated and cached to obtain a target template for storage in the cache database; if other files with the same content as the database container file are reloaded, the parent-child hierarchical data structure is loaded from the cache database, and the target parent list control and target sub-list control corresponding to the other files are established based on the parent-child hierarchical data structure to skip the processing of other files by the file parsing module and the metadata structure module.
[0069] In an exemplary embodiment, after determining the display interface to be generated based on the preset visualization component bound to each signal attribute in the sublist control, the method further includes: recording the conversion time from the database container file to the generated display interface; if the conversion time is greater than or equal to a preset valid time, determining that the interface generation system has an operational abnormality, and sending an alarm message to the management object of the interface generation system to perform system verification; if the conversion time is less than the preset valid time, determining that the interface generation system is operating normally.
[0070] To better understand the process of the above-mentioned interface generation system and interface generation method, the implementation method flow of the above-mentioned interface generation system will be described below in conjunction with optional embodiments, but this is not intended to limit the technical solution of the embodiments of this application.
[0071] This embodiment provides a method and system for dynamically generating a BMS monitoring interface based on DBC metadata. Figure 3 This is a flowchart illustrating the dynamic generation of a BMS monitoring interface based on DBC metadata according to an embodiment of this application, specifically including the following steps:
[0072] Step S1: Metadata definition, which is to define a set of custom attributes to describe the characteristics and data information of UI controls based on the standard DBC file format.
[0073] Optionally, the fields in the DBC file format include, but are not limited to: Message Name, Msg ID, TX or RX (transmission direction), Signal Name, Startbit, Length (number of bits), Factor, Offset, Value (current or original value), and Unit.
[0074] Step S2: DBC file parsing and metadata extraction. When the host computer starts, it loads and parses the standard DBC file. The parser mainly extracts the information of the above fields and adds them to the data chain list as the data source for subsequent logic implementation. Figure 4 This is a schematic representation of a data chain according to an embodiment of this application.
[0075] Step S3: Dynamic creation and configuration of UI controls. The host computer initializes two blank DataGrid list controls (one parent and one child). Based on the data source obtained in Step 2, the host computer automatically adds data with values in the Message Name field to the parent list and data with values in the Signal Name field to the child list. The two tables are two independent controls that share the same data source. The parent-child relationship is established through frame IDs (i.e., the parent table contains the node name corresponding to the frame ID, and the child table contains the data details of the selected frame ID). Optional, Figure 5 This is an example diagram of a parent-child control list according to an embodiment of this application. Multiple Signals are allowed under one MessageName; that is, when a MessageName is selected in the parent table, the child table will automatically load all its associated Signal information into the table, making it convenient for users to observe the data. Specifically, the data source automatically generates a control for each Message signal and its corresponding Signal control. Initially, these controls can be hidden, such as... Figure 5As shown, selecting a node displays all its corresponding information in the right-hand control; otherwise, it is hidden, preventing the UI from becoming cluttered and difficult to find signals. Furthermore, it can count all signals to be displayed on the right side of the left-hand list, determining the signal count. If the number of signals exceeds a preset number, they are hidden; otherwise, they are all displayed. The preset number is determined based on the height of the display interface and the height of a single signal box. The height of a single signal box can be dynamically adjusted according to the user's settings, including font size and box size.
[0076] Step S4: Automatic binding of signal and control: Establish data binding relationship between dynamically created UI controls and corresponding CAN signals. The list control predefines the fields "Message Name", "Message ID", "Data Length", "Signal Name", "Start Bit", "Signal Length", "Signal Value", and "Unit". Then, the attribute values of the data source are assigned to these fields. The correspondence is shown in Table 1 below.
[0077] Table 1
[0078]
[0079] When loading the DBC file, the parent table loads all Message information into the table, and all Signal information is stored in the background. When a record (index A) in the parent table is selected, the child table dynamically loads the Signal information to which the current Message belongs. The unique identification mechanism is to find the frame ID of the currently selected information based on index A, and then find all Signal information in the data source based on the frame ID. In essence, there is no need to pay attention to the Message and Signal names, as the correct binding is ensured by index A and frame ID.
[0080] Step S5: Automatic interface generation. After binding all the information from the data source to the two DataGrid list controls, the host computer UI can automatically refresh all the information, completing the zero-code generation of the monitoring interface.
[0081] In summary, by implementing the above methods, UI development is moved forward to the DBC definition stage. Engineers only need to add attributes to the DBC file to automatically generate the interface, avoiding a large amount of manual coding and binding work. Furthermore, the interface definition and communication protocol definition share the same origin, both derived from the DBC, fundamentally eliminating data display errors or functional deficiencies caused by asynchronous manual modifications. Moreover, any modifications to the DBC file are automatically and accurately reflected on the interface. UI presentation rules and communication protocols are version-managed together, facilitating traceability and collaboration. Furthermore, custom attribute sets can be easily expanded as needed to support more complex UI controls or interaction logic, resulting in a highly adaptable system architecture. For example, the program only needs to load the DBC file to quickly browse all information, greatly saving time in upper-level computer development and significantly improving software reusability.
[0082] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0083] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.
[0084] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:
[0085] S1, extract the target information contained in the database container file, wherein the target information includes signal data and message data;
[0086] S2, Generate a parent node with a message identifier as the unique identifier and a child signal node associated with the parent node based on the target information, and construct a parent-child hierarchical data structure through the parent node and the child signal node;
[0087] S3. Based on the parent-child hierarchical data structure, establish a parent list control and a child list control with a nested relationship, and determine the display interface to be generated based on the preset visualization component bound to each signal attribute in the child list control. The parent list control is used to display the message information corresponding to the message data, and the child list control is used to display the battery status carried by the battery status.
[0088] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0089] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0090] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0091] S1, extract the target information contained in the database container file, wherein the target information includes signal data and message data;
[0092] S2, Generate a parent node with a message identifier as the unique identifier and a child signal node associated with the parent node based on the target information, and construct a parent-child hierarchical data structure through the parent node and the child signal node;
[0093] S3. Based on the parent-child hierarchical data structure, establish a parent list control and a child list control with a nested relationship, and determine the display interface to be generated based on the preset visualization component bound to each signal attribute in the child list control. The parent list control is used to display the message information corresponding to the message data, and the child list control is used to display the battery status carried by the battery status.
[0094] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0095] Optionally, embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0096] Optionally, embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above method embodiments.
[0097] Optionally, embodiments of this application also provide a computer program that includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in any of the above method embodiments.
[0098] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0099] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuits, or multiple modules or steps can be fabricated as a single integrated circuit. Thus, this application is not limited to any particular hardware and software combination.
[0100] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An interface generation system, characterized in that, include: The file parsing module is used to extract target information contained in the database container file, wherein the target information includes signal data and message data; The metadata structure module, connected to the file parsing module, is used to generate a parent node with a message identifier as a unique identifier and a child signal node associated with the parent node based on the target information, and to construct a parent-child hierarchical data structure through the parent node and the child signal node; The generation module, connected to the metadata structure module, is used to establish a nested parent list control and a child list control based on the parent-child hierarchical data structure, and to determine the display interface to be generated based on the preset visualization component bound to each signal attribute in the child list control. The parent list control is used to display the message information corresponding to the message data, and the child list control is used to display the battery status carried by the battery status.
2. The interface generation system according to claim 1, characterized in that, The generation module further includes: The first control unit is used to count the number of child signal nodes that have been loaded in the sub-list control; if the number of nodes is greater than a preset signal display threshold, it determines to hide the sub-list control; if the number of nodes is less than or equal to the preset signal display threshold, it determines to display the sub-list control.
3. The interface generation system according to claim 1, characterized in that, The generation module further includes: The second control unit is used to determine the selected message of the target object in the parent list control and identify the selected message identifier; use the selected message identifier to query in the parent-child hierarchical data structure to obtain multiple signal nodes to be loaded; record the number of signals to be displayed corresponding to the multiple signal nodes to be loaded; when the number of signals to be displayed is greater than the maximum loading capacity of the child list control, divide the multiple signal nodes to be loaded into multiple subsets according to a preset grouping strategy, each subset corresponding to a child list control, wherein the preset grouping strategy includes at least one of the following: grouping by signal type, grouping by message period, grouping by alarm priority, or grouping by user-defined label.
4. The interface generation system according to claim 1, characterized in that, The interface generation system also includes: The metadata definition module is used to obtain the first format of the standard database container file and determine the second format according to the usage requirements of the target object; the file format of the database container file is determined based on the first format and the second format, wherein the second format is an enhanced format defined by comments or extended fields on the basis of the standard database container file, and the second format includes at least one of the following custom attributes: control type, display unit, alarm color, refresh rate, default visibility, and sorting priority.
5. The interface generation system according to claim 1, characterized in that, The interface generation system also includes: The monitoring module is used to monitor file operations on the database container file; when the file operation involves changing target information contained in the file, it sends a first instruction to the file parsing module to reload the database container file and a second instruction to the metadata structure module to rebuild the parent-child hierarchical data structure; when the first instruction and the second instruction are executed, it instructs the generation module to perform a control list refresh, wherein the control list refresh is used to synchronize the updated content of the database container file to the parent list control and the child list control.
6. The interface generation system according to claim 1, characterized in that, The interface generation system also includes: The configuration export module, connected to the generation module, is used to determine the interface layout, control binding relationship, and display parameters corresponding to the display interface to be generated; and to generate a general configuration file based on the interface layout, the control binding relationship, and the display parameters.
7. The interface generation system according to claim 1, characterized in that, The interface generation system also includes: The display module, connected to the generation module, is used to determine the interface size of the visual display interface associated with the interface generation system, obtain the first item height of the parent list control and the second item height of the child list control, and determine the number of messages that the parent list control is allowed to display and the maximum load of the child list control based on the interface size, the first item height, and the second item height.
8. The interface generation system according to claim 1, characterized in that, The interface generation system also includes: The caching module is used to, upon successfully determining the parent-child hierarchical data structure and visual display interface corresponding to the database container file, associate and cache the database container file, the parent-child hierarchical data structure, and the display interface to obtain a target template for storage in the cache database; upon reloading other files with the same content as the database container file, the module loads the parent-child hierarchical data structure from the cache database, and establishes target parent list controls and target child list controls corresponding to the other files based on the parent-child hierarchical data structure, thereby skipping the processing of the other files by the file parsing module and the metadata structure module.
9. The interface generation system according to claim 1, characterized in that, The interface generation system also includes: The recording module is used to record the conversion time from the database container file to the generated display interface; if the conversion time is greater than or equal to a preset valid time, it is determined that the interface generation system has an operational abnormality, and an alarm message for performing system verification is sent to the management object of the interface generation system; if the conversion time is less than the preset valid time, it is determined that the interface generation system is operating normally.
10. A method for generating an interface, characterized in that, The interface generation system according to any one of claims 1 to 9 comprises: Extract the target information contained in the database container file, wherein the target information includes signal data and message data; Based on the target information, a parent node with a message identifier as its unique identifier and a child signal node associated with the parent node are generated, and a parent-child hierarchical data structure is constructed through the parent node and the child signal node; Based on the parent-child hierarchical data structure, a parent list control and a child list control with a nested relationship are established. The display interface to be generated is determined based on the preset visualization component bound to each signal attribute in the child list control. The parent list control is used to display the message information corresponding to the message data, and the child list control is used to display the battery status carried by the battery status.
11. A display terminal, characterized in that, The system includes a display device and an interface generation system as described in any one of claims 1-9, wherein the interface generation system is connected to a plurality of batteries and is used to process the plurality of batteries to generate a display interface to be generated; the display device is used to display the display interface to be generated.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the interface generation method of claim 10.
13. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the interface generation method of claim 10 through the computer program.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the interface generation method of claim 10.