A method for dynamically constructing display and control software based on visual data forms
By using a dynamic construction method for visual data form display and control software, the problems of complex form creation and management and difficult modification in existing technologies are solved, enabling flexible form editing and expansion, and reducing development costs and difficulties.
Patent Information
- Application Number
- CN202511446649.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-11
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2045-10-11
AI Technical Summary
The existing display and control system has complex form creation and management, requires professional programming knowledge, is difficult to modify and update, has insufficient system interface openness, is highly customized, is difficult to expand application scenarios, and has high costs for repeated development.
The software adopts a dynamic construction method based on visual data forms. Through protocol library configuration, control layout design, data form mapping rule binding and subscription and publication mode, it realizes graphical interface drag-and-drop components and model-driven logic, and supports the editing and binding of multiple forms, multiple attributes and multiple protocols.
It enables dynamic configuration of data form protocols and dynamic software construction, provides a unified processing mechanism, supports business application design in various scenarios, and reduces development difficulty and cost.
Smart Images

Figure CN120909474B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method for dynamically constructing display and control software based on a visual data form. Background Technology
[0002] In existing display and control systems, the creation and management of forms mainly rely on pre-written fixed code and configuration. This approach has the following problems:
[0003] First, the creation and management of forms is a complex process that requires professional programming knowledge.
[0004] Second, modifying and updating forms is difficult, requiring rewriting code based on the protocol and display requirements;
[0005] Third, the system interface is not open enough, the degree of customization is high, and the cost of secondary development is high;
[0006] Fourth, the application scenarios supported are limited, making it difficult to expand the application scenarios of the form. Repeated development will consume a lot of manpower and time costs.
[0007] Therefore, there is a need to implement a more convenient method for dynamically building display and control software based on visual data forms. This method can quickly build data forms and perform secondary design of the interface application through visualization. It enables developers with different experience levels to easily build the display and control interface using drag-and-drop components and model-driven logic through a graphical visual interface. Summary of the Invention
[0008] The present invention aims to at least solve one of the technical problems existing in related technologies. To this end, the present invention provides a method for dynamically constructing display and control software based on a visual data form.
[0009] A method for dynamically constructing display and control software based on visual data forms includes the following steps:
[0010] Configure the protocol library, which performs structured processing on the underlying communication protocol to generate protocol data containing message, fault, status, and format definitions. The protocol library configuration includes the configuration of the message module, fault module, status module, and format module.
[0011] Design the control layout of the form interface and generate an interface layout containing one or more controls; the control layout design of the form interface is achieved through the visual form design module;
[0012] The protocol library is scanned to store the protocol's XML configuration in memory, and the control attributes in the interface layout are bound to the protocol data through a visual checkbox matching method to form data form mapping rules; the scanning of the protocol library is implemented through a component protocol binding module;
[0013] The data form mapping rules are encoded into the form configuration information and published to the form runtime scanning directory.
[0014] Furthermore, the fault module configuration steps in the protocol library configuration include:
[0015] The basic configuration fault tree is used to form fault logic units, and the logic units are generated by the low-level hardware fault identification code.
[0016] Furthermore, the state module configuration steps in the protocol library configuration include:
[0017] The hardware status codes are mapped to the defined enumeration values, and the state transitions are dynamically injected into the data processing stage through reflection.
[0018] Furthermore, the formatting module configuration step in the protocol library configuration includes:
[0019] The common format specifiers of the application layer are stored as a set of format symbols, and the symbols are replaced and printed using the printf function when the data is displayed, so as to form a unique parameter symbol display.
[0020] Furthermore, the step of binding to form a data form mapping rule specifically includes:
[0021] Perform a protocol scan, scan the protocol's XML configuration into memory and parse the protocol fields;
[0022] Perform a UI scan of the form components and parse it to generate a form component mapping table in QHash format;
[0023] Using the interface designer as the interface binding operation object, the user completes the binding by visually selecting and matching options in the pop-up scan protocol data interface.
[0024] Furthermore, the binding includes:
[0025] Attribute name binding: Dynamically binds the Chinese name of the protocol to the displayed component text content;
[0026] And attribute value binding: Bind the received protocol data value to the component text.
[0027] Furthermore, it also includes the processing steps during the execution of the display and control software:
[0028] The form runtime scan directory is scanned, the form configuration is parsed to dynamically generate form controls and layouts according to the control types, and the protocol configuration in the form configuration is used to subscribe to protocol data to complete the subscription protocol binding. The scanning of the form runtime scan directory is completed through the form manager.
[0029] The form menu is created and generated based on the configuration file name, and then embedded into the form list;
[0030] In the absence of real-time data, the default formatting symbols are used for display.
[0031] Furthermore, the subscription agreement binding adopts a subscription and publish model for data transmission and reception binding.
[0032] Furthermore, the message module configuration steps in the protocol library configuration include:
[0033] Devices and messages, as well as messages and details, are entered using a many-to-many relationship to enable reuse between different protocols and devices.
[0034] The above-described one or more technical solutions in the embodiments of the present invention have at least one of the following technical effects:
[0035] It enables dynamic configuration of data form protocols and dynamic software construction, providing a unified processing mechanism for design, construction, release, and integration;
[0036] It integrates data form protocol binding and publishing, and has the ability to edit and bind multiple forms, multiple attributes, and multiple protocols;
[0037] It provides a dynamically built interface library and a rich set of general-purpose display components to meet the design needs of business applications in various scenarios.
[0038] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0040] Figure 1 This is a flowchart of the message module logic processing of the present invention;
[0041] Figure 2 This is a flowchart of the fault logic processing of the present invention;
[0042] Figure 3 This is a flowchart of the state processing of the present invention;
[0043] Figure 4 This is a flowchart of the formatting process of the present invention;
[0044] Figure 5 This is a flowchart of the component construction and protocol binding process of the present invention;
[0045] Figure 6 This is a flowchart of the integrated design process for data forms in this invention. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention. The following embodiments are used to illustrate this invention but should not be used to limit the scope of this invention.
[0047] This invention discloses a method for dynamically constructing display and control software based on a visual data form, comprising:
[0048] Perform protocol library configuration and dynamic form protocol binding; protocol library configuration includes configuration of message module, fault module, status module, and formatting module; the dynamic form protocol binding unit is used to provide graphical standardized component protocol binding;
[0049] The visual form design module is used for the layout design of control components in form interfaces;
[0050] The component protocol binding module is used to bind the properties of editable components to protocols to enable dynamic construction capabilities.
[0051] 1. The message module uses a dynamic attribute mechanism to map messages to entity objects, abstracts common attributes, and dynamically loads specific parameters to establish a protocol data buffer, which is uniformly managed by the message module and provides a public interface for external calls;
[0052] 2. Fault module: The upper layer uses a basic configuration fault tree to form fault logic units, which include logical operators such as AND, NOT, greater than, and less than. The logic units are generated and distributed by the lower-level hardware fault identification code, and public fault notification information processing is provided.
[0053] 3. The state module maps to hardware status codes and maintains an internal state switching mechanism. It is dynamically injected into the data processing stage through reflection and switches between different data application results in different states. The state is a defined enumeration value, and the public function is a state information switching function that drives external responses.
[0054] 4. Formatting module: Abstracts the common format specifiers of the application layer and stores them as a set of format symbols as an infrastructure resource. It replaces and prints device parameters according to specific symbols using the symbol bit printf to form unique parameter symbol displays.
[0055] 5. Component design and protocol binding module: Data sending and receiving are bound using a publish / subscribe pattern. The binding steps are as follows:
[0056] 1) Protocol scanning: The protocol XML configuration is scanned into memory, and the protocol fields are parsed, including protocol ID, protocol name, device, protocol parameters, etc.; the parameter types are converted and mapped.
[0057] 2) Type Registration: Initializes converters, mainly converting Int / String / float / double to basic types, and extends special type handling on top of basic types, including fault codes, status codes, and format codes;
[0058] 3) Scan the form component UI and parse it to generate a form component mapping table QHash.<QString, IFormWidget*> The object is determined to be a valid component by using the IFormWidget class component, and the enumeration type in the component is determined by WidgetType.
[0059] 4) Dynamic binding of component protocols: Using the interface designer as the interface binding operation object, select the component to obtain the component ID, pop up the interface of scanned protocol data, and the user can visually select and match to bind to the component properties.
[0060] Binding is mainly managed through ProtocolMessage communication, which categorizes and binds components by passing in the binding protocol ID, component attribute ID, attribute name, and attribute value.
[0061] Attribute name binding: Dynamically binds the Chinese name of the protocol to the displayed component text content;
[0062] Attribute value binding: Binds the received protocol data value to the component text;
[0063] This user-configurable approach allows for the handling of bound content, offering high availability, high configurability, and editability compared to traditional protocol-binding models. In subscription mode, data can be modified at runtime via commands to change the content displayed by the component according to different protocols, providing scalability.
[0064] 6. The integrated publishing module, combined with protocol binding, associates the protocol ID with the component attribute to form a data form mapping rule, which is then encoded into the form configuration information and published to the form runtime scanning directory to complete the publishing process.
[0065] I. Message Module
[0066] The message module provides basic message information, integrating and associating device / message / message details. It also maps to fault / status / formatting information, with each message corresponding to multiple data parameters, supporting protocol binding functionality for data forms.
[0067] The message is encapsulated by the protocol entity. The protocol entity is constructed by loading the protocol configuration, and protocol data is written to the established buffer. Dependencies (faults / states / formatting) in the protocol entity are loaded and mapped using lazy loading. Finally, the processing interface is called to populate the data, forming the entity data. The process is as follows: Figure 1 As shown.
[0068] The message configuration process is a step-by-step process, consisting of device entry, message entry, and details configuration. Devices and messages / messages and details are entered in a many-to-many relationship to enable reuse between different protocols and devices.
[0069] II. Fault Module
[0070] The fault module, comprised of fault code loading, fault parsing, fault mapping, and fault configuration binding, is associated with the protocol. Fault information for the corresponding device can be retrieved through the protocol. After the configured protocol is completed, the form displays fault protocol data based on protocol attributes and data-driven processing.
[0071] Fault code information is extracted from equipment hardware parameters and categorized into fault codes to form an equipment fault tree. This tree includes logical faults, hardware faults, and parameter faults. Each type of fault has corresponding processing and reporting logic. The fault display is automatically refreshed after each fault is processed. The design process is as follows: Figure 2 As shown.
[0072] III. Status Module
[0073] The status module is associated with the protocol through status code loading, status parsing, status mapping, and status configuration binding. The status information of the corresponding device can be retrieved through the protocol. After the configured protocol is completed, the form status protocol data is displayed based on protocol attributes and data-driven processing.
[0074] Status code information is extracted from device hardware parameters and categorized into status codes, which are then entered into a configuration file to form a device status code table. Dynamic parameters are monitored to drive the data to the status processing module, which switches between different data based on different status codes and refreshes the status information of the corresponding items. The design process is as follows: Figure 3 As shown.
[0075] 1. Configurable status information: The status required by existing business applications is solidified into the platform system to achieve unified scheduling of status information;
[0076] 2. Protocol data mapping of status information associates the unified status configuration with specific protocol detail parameters, realizing parameter status association;
[0077] 3. Serialize the associated state data into the protocol configuration file; different parameter details can be configured with different state information.
[0078] 4. Provides multiple protocol query interfaces and associated data to support status code parsing;
[0079] IV. Formatting Module
[0080] The formatting module is associated with the protocol through format code loading, format parsing, format mapping, and format configuration binding. The formatting information for the corresponding device can be retrieved via the protocol. After the protocol configuration is complete, the form formatted data is displayed based on protocol attributes and data-driven processing.
[0081] A shared set of formatting symbols is established, and a one-to-many formatting mapping is performed via a protocol. Placeholders in the formatting are replaced with existing actual symbols. Upon successful processing, the business symbol is output, and the corresponding numerical unit is displayed, completing the formatting process. The design flow is as follows: Figure 4 As shown.
[0082] 1. Formatted information configuration: The formatted data required by existing business applications is solidified into the platform system to realize a formatted information configuration library;
[0083] 2. Protocol mapping of format information: This associates the unified format configuration with specific protocol detail parameters, thereby achieving parameter table association.
[0084] 3. Serialize the associated table data into the protocol configuration file; different parameter details can be configured with different format information.
[0085] 4. Provides multiple protocol query interfaces and associated data to support the parsing of format codes;
[0086] V. Component Design and Protocol Binding
[0087] The data form is composed of various components and bound through attribute editing and communication protocols. The form is then saved to achieve serialization.
[0088] During component initialization, the first step is to construct an IFormWidget to build basic information. Next, a QWidget graphical base class is constructed to give the component graphical capabilities. Then, specific component types are constructed from IFormWidget and its derived classes. Finally, the entire component construction protocol binding process is completed by binding the component's associated component property editor, FormWidgetEditor. Its design flow is as follows: Figure 5 As shown.
[0089] By loading the protocol component, all information of the component is initialized, and the loading of the protocol component is completed.
[0090] After the component is loaded, the form control's property bar will retrieve the editable protocol property information of that control;
[0091] The obtained component protocol attribute information is dynamically used to generate an attribute bar according to the input grid.
[0092] The protocol property bar is dynamically generated. Users can select the protocol configuration to be bound. The protocol property bar will change the field according to different components. When the user clicks the configuration item, a protocol selection dialog box will pop up for the user to select. After clicking OK, the protocol editing work is completed.
[0093] The system determines whether the protocol selected by the user is valid. If it is invalid, the user is redirected to the protocol properties editing page to select a new protocol.
[0094] After selecting valid protocol data, the protocol is saved by applying the protocol attributes;
[0095] The process of binding the protocol to the control is checked for success. If it fails, the process returns to the application protocol property flow, allowing the user to reselect and apply the protocol data.
[0096] If the application protocol is successfully applied, it will be embedded in the configuration file to complete the control protocol binding process.
[0097] The protocol binding process, achieved through editing protocol configuration properties in the panel interface, is as follows:
[0098] A general configuration interface is generated by calling the initDataInfoSet interface of the MessageInfoSetWidget class of the protocol configuration interface based on the protocol ID.
[0099] The message details (CommonPageWidget class) table in the general configuration interface is called, and the hierarchical relationship of the general configuration XML file is read through MessageInfoData's readData method;
[0100] The device configuration file is determined based on the root structure being Config, and the device is identified by the name field in the device configuration file.
[0101] The ID field in the configuration file is used to determine which message it belongs to, and the XML message data is inserted into the configTableView function using the setEquipmentDatash function of the MessageInfoSetWidget class.
[0102] In the configTableView displayed in the general configuration interface, select the CommonPageWidget class of the protocol (selection event), send a click signal, and obtain the selected protocol;
[0103] The interface configuration protocol is obtained by calling the onApplyAgreement interface of the current control through the application button on the panel;
[0104] Finally, the setBindProtocol interface of the IFormWidget base class sets the binding protocol of the control.
[0105] The component interface includes the following reserved data and functions:
[0106] ID: The unique ID of the control;
[0107] parentId: Parent control ID;
[0108] widgetType: Control type;
[0109] index: The index order of the control in the parent control space;
[0110] setSelected: The selected control is highlighted in the center of the canvas;
[0111] editorPanel: Pointer to the editing panel corresponding to the control;
[0112] serialize: Serialization control.
[0113] Component Design: Different types of forms require separate structure designs. Component design involves multiple inheritance from the abstract control (IFormWidget) and subclassing the base control (QWidget) to construct control classes that implement all abstract interfaces. Based on component data, the editing panel is implemented by inheriting from FormWidgetEditor. For example, the container panel control LarkFormPanel and its editing panel LarkFormPanelEditor.
[0114] LarkFormPanel: Specifies the width and height of the panel, as well as its container control;
[0115] setFormLayout: Sets the layout direction inside the container control;
[0116] setFormLayoutMargins: Sets the four-way margins of the layout inside the container control;
[0117] setFormLayoutSpacing: Sets the spacing between elements in the layout inside the container control;
[0118] unsetFormLayout: Cancels the layout inside the container control;
[0119] addFormWidget: Adds a child control inside a container control;
[0120] removeFormWidget: Deletes and destroys child widgets;
[0121] The internal container layout of panel components can be divided into horizontal layout, vertical layout, and absolute layout (no layout). When a horizontal or vertical layout is applied, its internal child controls will be automatically positioned; otherwise, the internal child controls can have their coordinate positions edited in the property editing panel.
[0122] VI. Data Form Integration
[0123] After the data form is published, the parsed and generated visual interface is dynamically integrated into the display and control software.
[0124] The data form integration process first involves initializing the form manager, scanning the form files in the form configuration directory, and generating all form items in the directory, which are then displayed as a menu set for user selection. Next, interactively opening the form triggers form loading / parsing / component and layout generation. Simultaneously, the form manager triggers a protocol binding callback to bind the configured subscription protocol to the component. Once the subscription protocol binding is effective, it will receive data from the state network protocol and perform formatted interface calls based on whether the protocol has data. Finally, the data form integration is completed. Its design is as follows: Figure 6As shown.
[0125] 1. First, process the preset relevant information to complete the initialization of the form manager;
[0126] 2. Scan the current form's save directory to obtain all current forms, and filter out subform configurations;
[0127] 3. Generate form menus based on configuration file names and embed the menus into the form list to form a selectable list of forms to display;
[0128] 4. The user opens the form by clicking the form menu and enters the form's ID into the form manager;
[0129] 5. Parse the form configuration using the form ID, obtain the elements in the form, dynamically generate form controls and layouts according to their types, and embed them into the form interface;
[0130] 6. Subscribe to protocol data using the protocol configuration in the form configuration to complete the subscription protocol binding;
[0131] 7. Depending on whether there is real-time data after binding according to the protocol configuration, different displays will be made. If there is no data, the default formatting symbol will be used for display. If there is data, the data formatting symbol will be used for display.
[0132] 8. Finally, after the formatting symbols are invoked, they are rendered into the display control.
[0133] VII. Test Confirmation
[0134] To verify the feasibility of this invention, form construction experiments will be conducted under the following conditions:
[0135] 1. Hardware: Mainstream PC configuration (Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz, 32GB RAM);
[0136] 2. Software: Kylin V10 operating system, with gcc 9.3 compilation environment installed.
[0137] Perform the following operations in the test environment:
[0138] 1. Validate the data form designer and data form editor:
[0139] Click on Form Management, select Data Form, and set the data form name, identifier, and form size. Generally, the form size is set to 1920x1080, and the form name is set to Forms1. After the form is set, the set form will be displayed in the interface as 1920x1080.
[0140] Select the panel control in the control box, click "+", and the panel control will be added to the form. Set the panel control size to 1920x1080 in the properties.
[0141] Select four label controls in the control box, click "+", set the label control in the properties, name it "Astronomical Navigation", set the label control size to 100x50, and adjust the position of the label control in the interface;
[0142] Select four table controls from the control box, click "+", set the table control to 3 rows and 3 columns with no header in the properties, and then adjust the position of the table control below the label control.
[0143] 2. Verify communication protocol binding tool:
[0144] Select a row in the table, click the space bar in the protocol binding section, and a protocol selection window will pop up. Select different protocols to bind.
[0145] Bind all protocols to all forms, click the save button, and save the XML file in the Forms folder.
[0146] 3. Verify data form publishing tools and data form integration tools:
[0147] Click the menu button to bring up the central view interface.
[0148] Open the Forms1 form in the central view. The Forms1 form displays formatting symbols even when there is no data.
[0149] Open the simulated source, send the data form Forms1 bound to the protocol, open the send / receive component, and configure the address of the send / receive component;
[0150] In the central view, the received data under the Forms1 form matches the data sent by the simulated source.
[0151] The test results are as follows:
[0152] The simulated source data received in Forms1 of the central view is displayed on the interface. A new central view interface can be formed without programming, which can efficiently handle the interaction and storage of protocol data.
[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A dynamic construction method of visual data form-based console software, characterized in that, It comprises the following steps: Protocol library configuration is performed, which structures underlying communication protocols to generate protocol data containing messages, faults, states and formatting definitions, and the protocol library configuration comprises configuration of message modules, fault modules, state modules and formatting modules; Control layout design of the form interface is performed to generate an interface layout containing one or more controls; the control layout design of the form interface is achieved through a visual form design module; The protocol library is scanned to scan the XML configuration of the protocol into memory, and the control attributes in the interface layout are bound to the protocol data through visual check matching to form data form mapping rules; scanning the protocol library is achieved through a component protocol binding module; The data form mapping rules are encoded into form configuration information and published to a form running state scanning directory; The fault module configuration step in the protocol library configuration comprises: A basic configuration fault tree is used to form a fault logic unit, and a low-level hardware fault identification code is used to generate a logic unit; The state module configuration step in the protocol library configuration comprises: Hardware state codes are mapped to defined enmu enumeration values, and a state switching mechanism is used to dynamically inject states into the data processing stage; It also comprises the following processing steps of the display and control software runtime: The form running state scanning directory is scanned to parse the form configuration and dynamically generate form controls and layouts according to the control types, and the protocol configuration in the form configuration is used to subscribe to protocol data to complete the subscription protocol binding; scanning the form running state scanning directory is completed through a form manager; A form menu is created from a configuration file name, and the menu is embedded into a form list; In the absence of real-time data, a default formatting symbol is called to display.
2. The dynamic construction method of the display and control software based on the visual data form according to claim 1, wherein The formatting module configuration step in the protocol library configuration comprises: Common format symbols at the application layer are stored as a set of format symbol sets, and are replaced and printed through symbol bits printf when data is displayed to form a unique parameter symbol display.
3. The dynamic construction method of the display and control software based on the visual data form according to claim 1, wherein The step of binding to form data form mapping rules comprises: Protocol scanning is performed to scan the XML configuration of the protocol into memory and parse the protocol fields; Form component interface UI scanning is performed to parse and generate a QHash format form component mapping table; An interface designer is used as an interface binding operation object, and the user completes the binding through visual check matching selection in the pop-up scanning protocol data interface.
4. The dynamic construction method of the display and control software based on the visual data form according to claim 3, wherein The binding comprises: Attribute name binding: dynamically binding the Chinese name of the protocol to the displayed component text content; And attribute value binding: binding the received protocol data value to the component text.
5. The dynamic construction method of the display and control software based on the visual data form according to claim 1, wherein The subscription protocol binding adopts a subscription and publication mode to bind data transmission and reception.
6. The visual data form based dynamic control software construction method of claim 1, wherein, The message module configuration step in the protocol library configuration comprises: The device, the message and the details are recorded in a many-to-many relationship to realize the multiplexing between different protocols and devices.
Citation Information
Patent Citations
Interface development method, electronic device and readable storage medium
CN109240688A
Visual form design method and system implemented in low-code mode
CN114610280A