Power grid mode system dynamic file configuration method and device, electronic equipment and medium

By acquiring metadata configuration files and building field configuration mapping tables, generating table columns, filter items, and form item configurations, and dynamically rendering the power grid mode system interface, the problems of low efficiency, high cost, and poor scalability in the development of traditional power grid mode systems are solved, achieving efficient configuration management and flexible interface generation.

CN121635989APending Publication Date: 2026-03-10ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Traditional power grid system development suffers from low development efficiency, high code maintenance costs, low reusability, and poor configuration information scalability. Especially when there are many types of equipment in the power grid system, the workload of repetitive configuration is huge, making it difficult to achieve one-time definition and multiple reuse.

Method used

By obtaining the metadata configuration file, a field configuration mapping table is built, generating table column configuration, filter item configuration, and form item configuration, and then passing them to the front-end rendering engine for dynamic rendering. This metadata-driven approach automatically generates interface elements, avoiding repetitive configuration work.

Benefits of technology

It significantly improves development efficiency, reduces code maintenance costs, achieves scalability and reusability of configuration information, supports runtime hot updates, and quickly responds to changes in business requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121635989A_ABST
    Figure CN121635989A_ABST
Patent Text Reader

Abstract

The invention discloses a power grid mode system dynamic file configuration method and device, electronic equipment and a medium, which are used for solving the technical problems of low development efficiency, high code maintenance cost, low reuse rate and poor configuration information expansibility in the prior art. The method comprises the following steps: acquiring a metadata configuration file; constructing a field configuration mapping table according to the metadata configuration file; based on the field configuration mapping table, table column configuration, screening item configuration and form item configuration are generated respectively; and transmitting the table column configuration, the screening item configuration and the form item configuration to a front-end rendering engine of the power grid mode system, so that the front-end rendering engine performs dynamic rendering according to the table column configuration, the screening item configuration and the form item configuration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power grid mode system development technology, and in particular to a method, apparatus, electronic device and medium for dynamic file configuration of power grid mode systems. Background Technology

[0002] In the field of power grid mode system development, traditional development models face severe challenges. As a core business system in the power industry, power grid mode systems need to manage a large amount of power grid equipment information, operating modes, and calculation data. Each equipment type (such as transformers, switches, and lines) requires a separate form page for data display and operation. These pages typically contain complex data tables, filtering conditions, and editable forms.

[0003] In traditional development models, front-end developers need to manually write a lot of repetitive configuration code for each page, including: the display name, width, frozen state, editability, and visibility of table columns; field selection and control types (input boxes, dropdown lists, date pickers, etc.) for filter areas; and the layout, type, default value, validation rules, and grouping logic of form controls.

[0004] While mainstream front-end UI frameworks offer component-based capabilities, interface configuration still heavily relies on hard-coding. For example, in projects, developers need to define data structures for list, table, and form components in each device module. Even with the use of higher-order components or mixins for partial reuse, the power grid system has numerous device types (such as switches, busbars, transformers, and reactors), each with its own independent page, resulting in a huge workload of repetitive configuration and low development efficiency. When a field attribute (such as changing "dispatching agency" from text to a tree selector) needs to be adjusted globally, code must be modified page by page, which is prone to omissions or inconsistencies, leading to high maintenance costs. Furthermore, there are many configuration logics with similar structures but different content across different pages, resulting in severe code redundancy and low reusability. In addition, adding a new device type page requires configuration from scratch, as it cannot inherit existing logic, resulting in poor scalability. Summary of the Invention

[0005] This invention provides a method, apparatus, electronic device, and medium for dynamic file configuration of power grid systems, which solves or partially solves the technical problems of low development efficiency, high code maintenance cost, low reusability, and poor scalability of configuration information in current related technologies.

[0006] This invention provides a method for configuring dynamic files in a power grid system, comprising:

[0007] Retrieve metadata configuration file;

[0008] Based on the metadata configuration file, construct a field configuration mapping table;

[0009] Based on the field configuration mapping table, generate table column configuration, filter item configuration and form item configuration respectively;

[0010] The table column configuration, the filter item configuration, and the form item configuration are passed to the front-end rendering engine of the power grid system so that the front-end rendering engine can perform dynamic rendering based on the table column configuration, the filter item configuration, and the form item configuration.

[0011] Optionally, constructing the field configuration mapping table based on the metadata configuration file includes:

[0012] Parse the metadata configuration file to obtain the items array;

[0013] Iterate through the items array and construct a field configuration object for each field;

[0014] Establish a hash mapping from field name to FieldConfig, and generate the corresponding hash mapping table;

[0015] Pre-group the form items by the group field to generate a grouping mapping table;

[0016] The hash mapping table and the grouping mapping table are integrated and configured as fields in the mapping table.

[0017] Optionally, the process of generating the table column configuration includes:

[0018] Based on the fields configured in the mapping table, configuration data is obtained;

[0019] Iterate through all fields of the configuration data, filter the first configuration item that meets the first preset filtering condition, and generate the first column of configuration;

[0020] Iterate through the first column of configurations and set the basic configuration information;

[0021] Convert target fields that conform to preset type fields into actual readable text;

[0022] Complete the field traversal of the configuration data and output the table column configuration.

[0023] Optionally, the process of generating the filter configuration includes:

[0024] Based on the fields configured in the mapping table, configuration data is obtained;

[0025] Iterate through all fields of the configuration data, filter the second configuration items that meet the second preset filtering conditions, and generate the second column of configuration;

[0026] Iterate through the configuration in the second column and map the corresponding filter controls according to the style value; where the style value maps the corresponding filter controls to include text mapping to an input box, date mapping to a date picker, select mapping to a drop-down selection box, and treeselect mapping to a tree selector;

[0027] Automatically bind field names as filter parameter keys;

[0028] Complete the field traversal of the configuration data and output the filter option configuration.

[0029] Optionally, the process of generating the form item configuration includes:

[0030] Based on the fields configured in the mapping table, configuration data is obtained;

[0031] Iterate through all fields of the configuration data and determine whether each field is a foreign key field.

[0032] When the field is a foreign key field, the list data of the foreign key field is obtained through optionType and fkHeader, and the list data is rendered as a pop-up selection list control;

[0033] When the field is not a foreign key field, the corresponding form control is mapped according to the style value; wherein, the form control mapped by the style value includes text mapping to an input box, date mapping to a date picker, select mapping to a drop-down selection box, and treeselect mapping to a tree selector;

[0034] Set attributes based on preset configuration fields, and group all fields according to group;

[0035] Complete the field traversal of the configuration data and output the form item configuration.

[0036] Optionally, the method further includes:

[0037] Metadata configuration files are constructed using JSON format based on preset basic field attributes.

[0038] Optionally, the method further includes:

[0039] Based on the table column configuration, the filter item configuration, and the form item configuration, the basic UI components are called through the front-end rendering engine to dynamically create component instances;

[0040] Based on the component instance, render the user interface of the power grid system.

[0041] The present invention also provides a dynamic file configuration device for a power grid system, comprising:

[0042] The file acquisition unit is used to acquire metadata configuration files;

[0043] The mapping table construction unit is used to construct a field configuration mapping table based on the metadata configuration file;

[0044] The file configuration unit is used to generate table column configuration, filter item configuration and form item configuration respectively based on the field configuration mapping table;

[0045] The data transmission unit is used to transmit the table column configuration, the filter item configuration, and the form item configuration to the front-end rendering engine of the power grid mode system, so that the front-end rendering engine can perform dynamic rendering based on the table column configuration, the filter item configuration, and the form item configuration.

[0046] The present invention also provides an electronic device, the device comprising a processor and a memory:

[0047] The memory is used to store program code and transmit the program code to the processor;

[0048] The processor is used to execute the power grid mode system dynamic file configuration method as described above, according to the instructions in the program code.

[0049] The present invention also provides a computer-readable storage medium for storing program code for executing the power grid mode system dynamic file configuration method as described in any of the preceding claims.

[0050] As can be seen from the above technical solutions, the present invention has the following advantages:

[0051] This paper presents a method for dynamic file configuration in a power grid system. First, a metadata configuration file is obtained. Then, a field configuration mapping table is constructed based on the metadata configuration file. Next, based on the field configuration mapping table, table column configurations, filter item configurations, and form item configurations are generated. Finally, these configurations are passed to the front-end rendering engine of the power grid system for dynamic rendering. By using a predefined metadata configuration file, UI elements such as table columns, filter conditions, and form controls can be automatically parsed and generated. This metadata-driven approach automatically generates UI elements, avoiding a large amount of repetitive configuration work, significantly improving development efficiency, and reducing code maintenance costs. Attached Figure Description

[0052] To more clearly illustrate the technical solutions in the embodiments of the present 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 only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0053] Figure 1 A flowchart illustrating the steps of a dynamic file configuration method for a power grid system.

[0054] Figure 2 A flowchart outlining the steps involved in configuring a table column.

[0055] Figure 3 A flowchart outlining the steps involved in generating filter configurations;

[0056] Figure 4 A flowchart illustrating the steps involved in generating form field configurations;

[0057] Figure 5 A schematic diagram illustrating the overall process of a dynamic file configuration method for a power grid system.

[0058] Figure 6 This is a structural block diagram of a dynamic file configuration device for a power grid system. Detailed Implementation

[0059] This invention provides a method, apparatus, electronic device, and medium for dynamic file configuration of power grid systems, which solves or partially solves the technical problems of low development efficiency, high code maintenance cost, low reusability, and poor scalability of configuration information in current related technologies.

[0060] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0061] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of the present invention, some of the technical features involved in the solutions are briefly described first:

[0062] JSON (JavaScript Object Notation): An open standard file and data exchange format. Its files typically use the .json extension.

[0063] Semantic fields: Semanticization of form attribute fields refers to a technical approach that matches field content with its meaning by selecting appropriate word attributes. This embodiment of the invention employs semantically named fields, which, through concrete semantic naming and value conventions, makes it easier for developers to understand the fields.

[0064] A table (also known as a graph) is a visual communication method and a means of organizing and structuring data.

[0065] Forms: In web pages, forms are primarily responsible for data collection. A form consists of three basic parts: form tags, form fields, and form buttons.

[0066] As an example, in the traditional development model, front-end developers need to manually write a lot of repetitive configuration code for each page, including: the display name, width, frozen state, whether it is editable, whether it is visible, etc. of table columns; field selection and control type (input box, drop-down box, date picker, etc.) of filter areas; layout, type, default value, validation rules, grouping logic, etc. of form controls.

[0067] While mainstream front-end UI frameworks offer component-based capabilities, interface configuration still heavily relies on hard-coding. For example, in projects, developers need to define data structures for list, table, and form components in each device module. Even with the use of higher-order components or mixins for partial reuse, the power grid system has numerous device types (such as switches, busbars, transformers, and reactors), each with its own independent page, resulting in a huge workload of repetitive configuration and low development efficiency. When a field attribute (such as changing "dispatching agency" from text to a tree selector) needs to be adjusted globally, code must be modified page by page, which is prone to omissions or inconsistencies, leading to high maintenance costs. Furthermore, there are many configuration logics with similar structures but different content across different pages, resulting in severe code redundancy and low reusability. In addition, adding a new device type page requires configuration from scratch, as it cannot inherit existing logic, resulting in poor scalability.

[0068] Further analysis of the present invention reveals the following problems with the current technology: Firstly, front-end interface elements (table columns, filter items, form items) cannot be automatically generated through unified configuration and must be manually coded.

[0069] On the other hand, the current lack of a metadata-driven mechanism leads to a high degree of coupling between the interface and the business model, making it difficult to achieve "define once, reuse everywhere." Furthermore, current technology does not support runtime dynamic adjustments, requiring code redeployment for changes to business rules.

[0070] Therefore, one of the core inventive points of this invention is to provide a metadata-driven dynamic interface file configuration method. By using a predefined JSON-formatted metadata configuration file, interface elements such as table columns, filter conditions, and form controls are automatically parsed and generated. This metadata-driven approach automatically generates interface elements, avoiding a large amount of repetitive configuration work, significantly improving development efficiency, and reducing code maintenance costs.

[0071] Reference Figure 1 The diagram illustrates a flowchart of a dynamic file configuration method for a power grid system according to an embodiment of the present invention, which may specifically include the following steps:

[0072] Step 101: Obtain the metadata configuration file;

[0073] This invention adopts the "Configuration-as-Code" concept to build a metadata-driven dynamic interface generation engine. Its core process mainly includes: metadata configuration file definition; metadata parsing and field mapping establishment; dynamic generation of three types of configuration information (table columns, filter items, and form items); front-end framework rendering and interaction binding.

[0074] The core process begins with a JSON metadata configuration file written by the developer. The main steps include the system loading and parsing the configuration file, building a field configuration mapping table (FieldConfigMap), generating table column configuration (TableColumnConfig), filter item configuration (SearchItemConfig), and form item configuration (FormItemConfig) based on the mapping table, and then passing the three types of configurations to the front-end rendering engine. The front-end framework dynamically renders the table, filter area, and form based on the configuration and binds data and events as the end point of the core process.

[0075] In the specific implementation, a metadata configuration file can be built using JSON format based on preset basic field attributes.

[0076] The JSON metadata defined in this invention includes the following basic field attributes (wherein, the field names are semantically named for ease of understanding and use by developers):

[0077] Table 1: Basic Field Attributes

[0078]

[0079] By designing metadata structures using fields such as editable (four states), visible (two values), group, unit, and remark, and explicitly encoding business rules into the configuration, precise control over interface behavior can be achieved.

[0080] Step 102: Construct a field configuration mapping table based on the metadata configuration file;

[0081] Next, a field configuration mapping table can be built based on the metadata configuration file. Specifically, the implementation process may include: parsing the metadata configuration file to obtain the items array; traversing the items array and building a field configuration object for each field; establishing a hash mapping from the field name to the FieldConfig and generating the corresponding hash mapping table; pre-grouping the form items by the group field to generate a group mapping table; and integrating the hash mapping table and the group mapping table as the field configuration mapping table.

[0082] Specifically, this step mainly involves parsing metadata and establishing the mapping relationship between field configurations. The following parsing logic is executed during system startup or page loading:

[0083] First, read the .json configuration file from the specified path;

[0084] Next, iterate through the items array and build a field configuration object (FieldConfig) for each field;

[0085] Then create a hash mapping (Map) for field name → FieldConfig.<String, FieldConfig> );

[0086] Simultaneously, form items are pre-grouped by the `group` field to generate a grouping mapping table (Map). <String, List <fieldconfig>>).

[0087] By simultaneously constructing mappings for "field name → configuration" and "group → field list", a dual mapping system for field configuration is designed, which can balance traversal efficiency and group layout requirements.

[0088] Step 103: Based on the field configuration mapping table, generate table column configuration, filter item configuration and form item configuration respectively;

[0089] Based on the field configuration mapping table, three types of configuration information can be generated: table column configuration, filter item configuration, and form item configuration.

[0090] The general execution logic for generating table column configurations is as follows:

[0091] Iterate through all fields; if visible = "visible", then generate the column configuration.

[0092] Iterate through the column configurations and set basic configuration information such as width, fixed, sortable (expandable), and formatter (e.g., unit concatenation, dictionary conversion);

[0093] Convert target fields that match the preset type into actual readable text. Specifically, for fields with style "select / treeselect", automatically bind dropdown options (via message or asynchronous request optionType).

[0094] Figure 2 A flowchart illustrating the steps involved in generating a table column configuration is provided. Figure 2 The process of generating the table column configuration may include the following steps 201 to 205:

[0095] Step 201: Obtain configuration data based on the field configuration mapping table;

[0096] Step 202: Traverse all fields of the configuration data, filter the first configuration item that meets the first preset filter condition, and generate the first column of configuration;

[0097] Step 203: Traverse the first column of configuration and set the basic configuration information;

[0098] Step 204: Convert the target field that matches the preset type field into actual readable text;

[0099] Step 205: Complete the field traversal of the configuration data and output the table column configuration.

[0100] The general execution logic for generating filter option configurations is as follows:

[0101] Iterate through all fields, processing only those fields where search = true;

[0102] Based on style mapping, corresponding filter controls are mapped, mainly including:

[0103] text → Input box;

[0104] date → date picker;

[0105] select / treeselect → dropdown / tree selector;

[0106] Automatically bind the field name (name) as the filter parameter key.

[0107] Figure 3 A flowchart illustrating the steps involved in generating filter configurations is provided. (Combined with...) Figure 3 The process of generating the filter configuration may include the following steps 301 to 305:

[0108] Step 301: Obtain configuration data based on the field configuration mapping table;

[0109] Step 302: Traverse all fields of the configuration data, filter the second configuration items that meet the second preset filtering conditions, and generate the second column of configuration;

[0110] Step 303: Iterate through the configuration in the second column and map the corresponding filter controls based on the style value;

[0111] Among them, the style value mapping corresponds to the filter controls including text mapping to input box, date mapping to date picker, select mapping to drop-down selection box, and treeselect mapping to tree selector.

[0112] Step 304: Automatically bind field names as filter parameter keys;

[0113] Step 305: Complete the field traversal of the configuration data and output the filter option configuration.

[0114] The general execution logic for generating form field configurations is as follows:

[0115] Iterate through all fields and check each field to see if it is a foreign key field.

[0116] When the field is a foreign key field, the list data of the foreign key field is obtained through optionType and fkHeader, and the list data is rendered as a pop-up selection list control;

[0117] When the field is not a foreign key field, for each group of fields, generate corresponding form controls based on the style, mainly including:

[0118] text → Input box;

[0119] date → date picker;

[0120] select / treeselect → dropdown / tree selector;

[0121] Perform the following property settings:

[0122] defaultValue is used as the initial value;

[0123] Setting nullable=false triggers the mandatory field validation;

[0124] totalLength / decimalLength limits the input;

[0125] Editable controls the disabled state of controls (e.g., const type is displayed as a read-only label);

[0126] The unit is displayed as a suffix in the input box (e.g., "MVA").

[0127] The remark is used as a tooltip for the control;

[0128] Finally, render the data by group.

[0129] Figure 4 A flowchart illustrating the steps involved in generating form item configurations is provided. Figure 4 The process of generating form field configurations may include the following steps 401 to 405:

[0130] Step 401: Obtain configuration data based on the field configuration mapping table;

[0131] Step 402: Iterate through all fields of the configuration data and determine whether each field is a foreign key field;

[0132] Step 403: When the field is a foreign key field, obtain the list data of the foreign key field through optionType and fkHeader, and render the list data as a pop-up selection list control; when the field is not a foreign key field, map the corresponding form control according to the style value;

[0133] Among them, the style value mapping corresponds to the form controls including text mapping to input box, date mapping to date picker, select mapping to drop-down selection box, and treeselect mapping to tree selector.

[0134] Step 404: Set the attributes according to the preset configuration fields, and group all fields according to the group;

[0135] Step 405: Complete the field traversal of the configuration data and output the form item configuration.

[0136] Thus, through the above process, a three-terminal dynamic generation mechanism based on a single metadata source was constructed. That is, the same JSON configuration can simultaneously drive the generation of table columns, filter items, and form items, achieving the effect of defining once and reusing across multiple platforms.

[0137] Step 104: Pass the table column configuration, the filter item configuration, and the form item configuration to the front-end rendering engine of the power grid system so that the front-end rendering engine can perform dynamic rendering based on the table column configuration, the filter item configuration, and the form item configuration.

[0138] Finally, the table column configuration, filter configuration, and form item configuration can be passed to the front-end rendering engine of the power grid system so that the front-end rendering engine can perform dynamic rendering based on the table column configuration, filter configuration, and form item configuration.

[0139] For the front end, based on the table column configuration, filter item configuration, and form item configuration, the front-end rendering engine can call basic UI components to dynamically create component instances; based on the component instances, the user interface of the power grid system is rendered.

[0140] Specifically, this step primarily relies on configuration information to render the user interface. The front-end uses a configuration-driven dynamic rendering module to dynamically construct and render the complete user interface by calling the corresponding basic UI components (such as table components, input boxes, dropdown selectors, date pickers, etc.) based on the received table column configuration, filter item configuration, and form item configuration. Upon receiving the three types of configuration, it mainly achieves complete user interface rendering by dynamically creating component instances and using these instances as the basis for rendering.

[0141] In addition, high-frequency operations (such as dictionary loading and foreign key queries) can be optimized through caching and lazy loading. When the metadata file changes, the frontend can be notified to reload the configuration via WebSocket or polling mechanism, without redeploying the application.

[0142] This step thus builds a dynamic rendering architecture that supports runtime hot updates, eliminating the need for recompilation and deployment when configurations change, significantly improving system agility.

[0143] This invention provides a metadata-driven dynamic interface file configuration method. By using a predefined JSON-formatted metadata configuration file, interface elements such as table columns, filter conditions, and form controls are automatically parsed and generated. This metadata-driven approach automatically generates interface elements, avoiding a large amount of repetitive configuration work, significantly improving development efficiency, and reducing code maintenance costs.

[0144] The technical solution provided by this invention offers several advantages. First, due to unified configuration maintenance, when business requirements change, only the metadata configuration file needs to be modified, and the system can automatically regenerate the corresponding interface, avoiding the problem of simultaneous modifications to multiple code sections and reducing system maintenance costs. Second, the same configuration logic can be applied to multiple similar pages, achieving standardization and modularization of configuration, improving code reusability and system scalability. Furthermore, by constructing a dynamic rendering architecture that supports runtime hot updates, flexible adjustments to business rules can be supported, enhancing system flexibility and enabling rapid response to changing business needs. In addition, the method provided by this invention simplifies the development process, allowing developers to focus more on implementing business logic rather than interface configuration, thus improving the user development experience.

[0145] For better illustration, refer to Figure 5 This diagram illustrates the overall flow of a dynamic file configuration method for a power grid system according to an embodiment of the present invention. It should be noted that this embodiment only provides a brief description of the general flow of dynamic file configuration for a power grid system. The specific implementation process of each step can be understood by referring to the relevant content in the foregoing embodiments, and will not be elaborated upon here. It is understood that the present invention does not impose any limitations on this.

[0146] Step 501: Based on the preset basic field attributes, construct the metadata configuration file using JSON format;

[0147] Step 502: Parse the metadata configuration file and build a field configuration mapping table;

[0148] Step 503: Based on the field configuration mapping table, generate table column configuration, filter item configuration, and form item configuration respectively;

[0149] Step 504: Pass the table column configuration, filter item configuration, and form item configuration to the front-end rendering engine of the power grid system;

[0150] Step 505: Based on the table column configuration, filter item configuration, and form item configuration, the basic UI components are called through the front-end rendering engine to dynamically create component instances, and the user interface of the power grid system is rendered based on the component instances.

[0151] To enable those skilled in the art to better understand the technical solutions of the present invention, the following specific example is used to illustrate the embodiments of the present invention.

[0152] Suppose we need to develop a form page for power grid switchgear. This page should include a table display of switchgear information, filtering functionality, and form editing capabilities. Using the method provided in this embodiment of the invention, we first create the following metadata configuration file:

[0153] {

[0154] "items":

[0155] {

[0156] "name": "node1Name",

[0157] "text": "Node 1",

[0158] "totalLength": 19,

[0159] "decimalLength": 0,

[0160] "unit": "",

[0161] "nullable": false,

[0162] "search": false,

[0163] "width": 100,

[0164] "isFK": true,

[0165] "isDict": false,

[0166] "style": "text",

[0167] "group": "Management Information",

[0168] "visible": "visible",

[0169] "editable": "user",

[0170] "fixed": "left",

[0171] "optionType": "eqp / node",

[0172] "remark": "",

[0173] "defaultValue": null,

[0174] "fkHeader": "OpEqpHeader / node",

[0175] "message": "",

[0176] "wrap": false

[0177] },

[0178] {

[0179] "name": "node2Name",

[0180] "text": "Node 2",

[0181] "totalLength": 19,

[0182] "decimalLength": 0,

[0183] "unit": "",

[0184] "nullable": false,

[0185] "search": false,

[0186] "width": 100,

[0187] "isFK": true,

[0188] "isDict": false,

[0189] "style": "text",

[0190] "group": "Management Information",

[0191] "visible": "visible",

[0192] "editable": "user",

[0193] "fixed": "",

[0194] "optionType": "eqp / node",

[0195] "remark": "",

[0196] "defaultValue": null,

[0197] "fkHeader": "OpEqpHeader / node",

[0198] "message": "",

[0199] "wrap": false

[0200] },

[0201] {

[0202] "name": "planName",

[0203] "text": "Plan",

[0204] "totalLength": 19,

[0205] "decimalLength": 0,

[0206] "unit": "",

[0207] "nullable": false,

[0208] "search": false,

[0209] "width": 100,

[0210] "isFK": true,

[0211] "isDict": false,

[0212] "style": "text",

[0213] "group": "Management Information",

[0214] "visible": "hidden",

[0215] "editable": "const",

[0216] "fixed": "",

[0217] "optionType": "plan / info",

[0218] "remark": "",

[0219] "defaultValue": null,

[0220] "fkHeader": "OpPlanHeader / info",

[0221] "message": "",

[0222] "wrap": false

[0223] },

[0224] {

[0225] "name": "dispatcherId",

[0226] "text": "Dispatch Agency",

[0227] "totalLength": 19,

[0228] "decimalLength": 0,

[0229] "unit": "",

[0230] "nullable": false,

[0231] "search": true,

[0232] "width": 100,

[0233] "isFK": true,

[0234] "isDict": false,

[0235] "style": "treeselect",

[0236] "group": "Management Information",

[0237] "visible": "visible",

[0238] "editable": "user",

[0239] "fixed": "",

[0240] "optionType": "sys / dept",

[0241] "remark": "The scheduling mechanism is used to control the order of computational data output and the boundary lines of splicing. It has editing and review permissions for the equipment."

[0242] "defaultValue": null,

[0243] "fkHeader": "OpSysHeader / dept",

[0244] "message": "",

[0245] "wrap": false

[0246] },

[0247] {

[0248] "name": "managerId",

[0249] "text": "maintainer",

[0250] "totalLength": 19,

[0251] "decimalLength": 0,

[0252] "unit": "",

[0253] "nullable": false,

[0254] "search": true,

[0255] "width": 100,

[0256] "isFK": true,

[0257] "isDict": false,

[0258] "style": "treeselect",

[0259] "group": "Management Information",

[0260] "visible": "visible",

[0261] "editable": "user",

[0262] "fixed": "",

[0263] "optionType": "sys / dept",

[0264] "remark": "The maintainers and their superiors have editing permissions for the data",

[0265] "defaultValue": null,

[0266] "fkHeader": "OpSysHeader / dept",

[0267] "message": "",

[0268] "wrap": false

[0269] },

[0270] {

[0271] "name": "projectName",

[0272] "text": "Belonging process",

[0273] "totalLength": 19,

[0274] "decimalLength": 0,

[0275] "unit": "",

[0276] "nullable": true,

[0277] "search": false,

[0278] "width": 100,

[0279] "isFK": true,

[0280] "isDict": false,

[0281] "style": "text",

[0282] "group": "management information",

[0283] "visible": "hidden",

[0284] "editable": "user",

[0285] "fixed": "",

[0286] "optionType": "eqp / project",

[0287] "remark": "",

[0288] "defaultValue": null,

[0289] "fkHeader": "OpEqpHeader / project",

[0290] "message": "",

[0291] "wrap": false

[0292] },

[0293] {

[0294] "name": "stationName",

[0295] "text": "Affiliated station",

[0296] "totalLength": 19,

[0297] "decimalLength": 0,

[0298] "unit": "",

[0299] "nullable": false,

[0300] "search": true,

[0301] "width": 100,

[0302] "isFK": true,

[0303] "isDict": false,

[0304] "style": "text",

[0305] "group": "Management Information",

[0306] "visible": "visible",

[0307] "editable": "once",

[0308] "fixed": "",

[0309] "optionType": "eqp / station",

[0310] "remark": "",

[0311] "defaultValue": null,

[0312] "fkHeader": "OpEqpHeader / station",

[0313] "message": "",

[0314] "wrap": false

[0315] },

[0316] {

[0317] "name": "id",

[0318] "text": "ID",

[0319] "totalLength": 19,

[0320] "decimalLength": 0,

[0321] "unit": "",

[0322] "nullable": false,

[0323] "search": false,

[0324] "width": 120,

[0325] "isFK": false,

[0326] "isDict": false,

[0327] "style": "int",

[0328] "group": "Basic Information",

[0329] "visible": "hidden",

[0330] "editable": "const",

[0331] "fixed": "",

[0332] "optionType": "",

[0333] "remark": "Unique data identifier, Snowflake ID",

[0334] "defaultValue": null,

[0335] "fkHeader": "",

[0336] "message": "",

[0337] "wrap": false

[0338] },

[0339] {

[0340] "name": "serialNo",

[0341] "text": "serial number",

[0342] "totalLength": 10,

[0343] "decimalLength": 0,

[0344] "unit": "",

[0345] "nullable": true,

[0346] "search": true,

[0347] "width": 100,

[0348] "isFK": false,

[0349] "isDict": false,

[0350] "style": "int",

[0351] "group": "Basic Information",

[0352] "visible": "visible",

[0353] "editable": "system",

[0354] "fixed": "",

[0355] "optionType": "",

[0356] "remark": "",

[0357] "defaultValue": null,

[0358] "fkHeader": "",

[0359] "message": "",

[0360] "wrap": false

[0361] },

[0362] {

[0363] "name": "unit",

[0364] "text": "Equipment Number",

[0365] "totalLength": 3,

[0366] "decimalLength": 0,

[0367] "unit": "",

[0368] "nullable": false,

[0369] "search": false,

[0370] "width": 100,

[0371] "isFK": false,

[0372] "isDict": false,

[0373] "style": "int",

[0374] "group": "Basic Information",

[0375] "visible": "visible",

[0376] "editable": "user",

[0377] "fixed": "",

[0378] "optionType": "",

[0379] "remark": "Equipment station number or line parallel code",

[0380] "defaultValue": null,

[0381] "fkHeader": "",

[0382] "message": "",

[0383] "wrap": false

[0384] },

[0385] {

[0386] "name": "paramState",

[0387] "text": "Parameter status",

[0388] "totalLength": 1,

[0389] "decimalLength": 0,

[0390] "unit": "",

[0391] "nullable": true,

[0392] "search": false,

[0393] "width": 100,

[0394] "isFK": false,

[0395] "isDict": true,

[0396] "style": "select",

[0397] "group": "Basic Information",

[0398] "visible": "invisible",

[0399] "editable": "user",

[0400] "fixed": "",

[0401] "optionType": "eqp_state",

[0402] "remark": "",

[0403] "defaultValue": null,

[0404] "fkHeader": "",

[0405] "message": "[{\"label\":\"Typical parameters\",\"value\":\"0\"},{\"label\":\"Design parameters\",\"value\":\"1\"},{\"label\":\"Nameplate parameters\",\"value\":\"2\"},{\"label\":\"Measured parameters\",\"value\":\"3\"}]",

[0406] "wrap": false

[0407] },

[0408] {

[0409] "name": "capacity",

[0410] "text": "Break Capacity",

[0411] "totalLength": 16,

[0412] "decimalLength": 8,

[0413] "unit": "MVA",

[0414] "nullable": true,

[0415] "search": false,

[0416] "width": 100,

[0417] "isFK": false,

[0418] "isDict": false,

[0419] "style": "decimal",

[0420] "group": "Basic parameters",

[0421] "visible": "visible",

[0422] "editable": "user",

[0423] "fixed": "",

[0424] "optionType": "",

[0425] "remark": "",

[0426] "defaultValue": null,

[0427] "fkHeader": "",

[0428] "message": "",

[0429] "wrap": false

[0430] },

[0431] {

[0432] "name": "timeIn",

[0433] "text": "Production start time",

[0434] "totalLength": 0, [[ID=​​​​​​​​

[0438] "search": true,

[0439] "width": 100,

[0440] "isFK": false,

[0441] "isDict": false,

[0442] "style": "date",

[0443] "group": "Retirement time",

[0444] "visible": "visible",

[0445] "editable": "user",

[0446] "fixed": "",

[0447] "optionType": "",

[0448] "remark": "",

[0449] "defaultValue": null,

[0450] "fkHeader": "",

[0451] "message": "",

[0452] "wrap": false

[0453] },

[0454] {

[0455] "name": "timeOut",

[0456] "text": "Retirement time",

[0457] "totalLength": 0,

[0458] "decimalLength": 0,

[0459] "unit": "",

[0460] "nullable": true,

[0461] "search": true,

[0462] "width": 100,

[0463] "isFK": false,

[0464] "isDict": false,

[0465] "style": "date",

[0466] "group": "Investment and Withdrawal Time",

[0467] "visible": "visible",

[0468] "editable": "user",

[0469] "fixed": "",

[0470] "optionType": "",

[0471] "remark": "",

[0472] "defaultValue": null,

[0473] "fkHeader": "",

[0474] "message": "",

[0475] "wrap": false

[0476] },

[0477] {

[0478] "name": "recState",

[0479] "text": "Data Status",

[0480] "totalLength": 5,

[0481] "decimalLength": 0,

[0482] "unit": "",

[0483] "nullable": false,

[0484] "search": false,

[0485] "width": 100,

[0486] "isFK": false,

[0487] "isDict": false,

[0488] "style": "label",

[0489] "group": "Modify information",

[0490] "visible": "hidden",

[0491] "editable": "system",

[0492] "fixed": "",

[0493] "optionType": "rec_state",

[0494] "remark": "Status of data in the review process",

[0495] "defaultValue": 200,

[0496] "fkHeader": "",

[0497] "message": "[{\"label\":\"Valid\",\"value\":0},{\"label\":\"Delete\",\"value\":100},{\"label\":\"Draft\",\"value\":200},{\"label\":\"Undo\",\"value\":201},{\"label\":\"Approval\",\"value\":300}]",

[0498] "wrap": false

[0499] } ]

[0501] }

[0502] After the developer has prepared the JSON metadata configuration file (containing 15 fields) as described above, the system parses it using the method provided in this embodiment of the invention, resulting in:

[0503] Generate a visible table with 12 columns (e.g., "Node 1" is left-frozen, "Break Capacity" has the unit "MVA");

[0504] Generate 6 filter options (dispatching agency, maintainer, affiliated plant, etc., where "dispatching agency" is a tree selector);

[0505] Generate 5 group forms ("Management Information", "Basic Information", etc.), where "Parameter Status" is a drop-down list and "Production Time" is a date picker;

[0506] When users interact with the interface, all validation, default values, and disabling logic are automatically controlled by the configuration.

[0507] Reference Figure 6 The diagram illustrates a structural block diagram of a dynamic file configuration device for a power grid system according to an embodiment of the present invention, which may specifically include:

[0508] File acquisition unit 601 is used to acquire metadata configuration files;

[0509] The mapping table construction unit 602 is used to construct a field configuration mapping table based on the metadata configuration file;

[0510] File configuration unit 603 is used to generate table column configuration, filter item configuration and form item configuration respectively based on the field configuration mapping table;

[0511] The data transmission unit 604 is used to transmit the table column configuration, the filter item configuration, and the form item configuration to the front-end rendering engine of the power grid mode system, so that the front-end rendering engine can perform dynamic rendering based on the table column configuration, the filter item configuration, and the form item configuration.

[0512] In one alternative embodiment, the mapping table construction unit 602 includes:

[0513] The file parsing unit is used to parse the metadata configuration file to obtain the items array;

[0514] A field configuration object building unit is used to traverse the items array and build a field configuration object for each field.

[0515] The hash mapping unit is used to establish a hash mapping from the field name to the FieldConfig and generate the corresponding hash mapping table;

[0516] Pregrouping unit, used to pregroup form items by the group field to generate a grouping mapping table;

[0517] The mapping table integration unit is used to integrate the hash mapping table and the grouping mapping table as field configuration mapping tables.

[0518] In an optional embodiment, the file configuration unit 603 includes a table column configuration unit, which is specifically used for:

[0519] Based on the fields configured in the mapping table, configuration data is obtained;

[0520] Iterate through all fields of the configuration data, filter the first configuration item that meets the first preset filtering condition, and generate the first column of configuration;

[0521] Iterate through the first column of configurations and set the basic configuration information;

[0522] Convert target fields that conform to preset type fields into actual readable text;

[0523] Complete the field traversal of the configuration data and output the table column configuration.

[0524] In an optional embodiment, the file configuration unit 603 includes a filter item configuration unit, which is specifically used for:

[0525] Based on the fields configured in the mapping table, configuration data is obtained;

[0526] Iterate through all fields of the configuration data, filter the second configuration items that meet the second preset filtering conditions, and generate the second column of configuration;

[0527] Iterate through the configuration in the second column and map the corresponding filter controls according to the style value; where the style value maps the corresponding filter controls to include text mapping to an input box, date mapping to a date picker, select mapping to a drop-down selection box, and treeselect mapping to a tree selector;

[0528] Automatically bind field names as filter parameter keys;

[0529] Complete the field traversal of the configuration data and output the filter option configuration.

[0530] In an optional embodiment, the file configuration unit 603 includes a form item configuration unit, which is specifically used for:

[0531] Based on the fields configured in the mapping table, configuration data is obtained;

[0532] Iterate through all fields of the configuration data and determine whether each field is a foreign key field.

[0533] When the field is a foreign key field, the list data of the foreign key field is obtained through optionType and fkHeader, and the list data is rendered as a pop-up selection list control;

[0534] When the field is not a foreign key field, the corresponding form control is mapped according to the style value; wherein, the form control mapped by the style value includes text mapping to an input box, date mapping to a date picker, select mapping to a drop-down selection box, and treeselect mapping to a tree selector;

[0535] Set attributes based on preset configuration fields, and group all fields according to group;

[0536] Complete the field traversal of the configuration data and output the form item configuration.

[0537] In one alternative embodiment, the device further includes:

[0538] Metadata configuration file building unit, used to build metadata configuration files in JSON format based on preset basic field attributes.

[0539] In one alternative embodiment, the device further includes:

[0540] The component instance creation unit is used to dynamically create component instances by calling basic UI components through the front-end rendering engine based on the table column configuration, the filter item configuration, and the form item configuration.

[0541] The user interface rendering unit is used to render the user interface of the power grid system based on the component instance.

[0542] As the device embodiment is basically similar to the method embodiment, it is described in a relatively simple way. For relevant details, please refer to the description of the method embodiment above.

[0543] It should be noted that, in order to enable those skilled in the art to better distinguish data of the same type but with different actual meanings, the embodiments of the present invention use "first" and "second" to distinguish and describe some technical features. "First" and "second" are only used to distinguish data and have no other special meaning. It is understood that the present invention does not impose any limitations on them.

[0544] This invention also provides an electronic device, which includes a processor and a memory:

[0545] The memory is used to store program code and transfer the program code to the processor;

[0546] The processor is used to execute the power grid mode system dynamic file configuration method of any embodiment of the present invention according to the instructions in the program code.

[0547] This invention also provides a computer-readable storage medium for storing program code, which is used to execute the power grid mode system dynamic file configuration method of any embodiment of this invention.

[0548] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0549] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this invention are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0550] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.

[0551] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0552] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0553] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0554] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. 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. Such 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.< / fieldconfig>

Claims

1. A method for configuring a dynamic file of a power grid system, characterized in that, The method comprises the following steps: acquiring a metadata configuration file; constructing a field configuration mapping table according to the metadata configuration file; generating a table column configuration, a filter item configuration and a form item configuration respectively based on the field configuration mapping table; delivering the table column configuration, the filter item configuration and the form item configuration to a front-end rendering engine of a grid system, so that the front-end rendering engine performs dynamic rendering according to the table column configuration, the filter item configuration and the form item configuration.

2. The gridway system dynamic file configuration method of claim 1, wherein, The step of constructing a field configuration mapping table according to the metadata configuration file comprises the following steps: parsing the metadata configuration file to obtain an items array; traversing the items array to construct a field configuration object for each field; establishing a hash mapping table of FieldConfig pointed by a field name and generating a corresponding hash mapping table; pre-grouping form items according to a group field to generate a grouping mapping table; integrating the hash mapping table and the grouping mapping table as a field configuration mapping table.

3. The method of claim 1, wherein, The generation process of the table column configuration comprises the following steps: obtaining configuration data based on the field configuration mapping table; traversing all fields of the configuration data to filter first configuration items meeting a first preset filtering condition to generate a first column configuration; traversing the first column configuration to set basic configuration information; converting target fields meeting a preset type field into actual readable texts; completing the field traversal of the configuration data to output a table column configuration.

4. The method of claim 1, wherein, The generation process of the filter item configuration comprises the following steps: obtaining configuration data based on the field configuration mapping table; traversing all fields of the configuration data to filter second configuration items meeting a second preset filtering condition to generate a second column configuration; traversing the second column configuration to map corresponding filter controls according to a style value mapping; wherein the style value mapping corresponding filter controls include a text mapping input box, a date mapping date selector, a select mapping drop-down selection box and a treeselect mapping tree selector; automatically binding a field name as a filter parameter key; completing the field traversal of the configuration data to output a filter item configuration.

5. The method of claim 1, wherein, The generation process of the form item configuration comprises the following steps: obtaining configuration data based on the field configuration mapping table; traversing all fields of the configuration data to judge whether the fields are foreign key fields one by one; when the fields are foreign key fields, obtaining list data of the foreign key fields through optionType and fkHeader and rendering the list data into a pop-up selection list control; when the fields are not foreign key fields, mapping corresponding form controls according to a style value mapping; wherein the style value mapping corresponding form controls include a text mapping input box, a date mapping date selector, a select mapping drop-down selection box and a treeselect mapping tree selector; performing attribute setting according to a preset configuration field and grouping all fields according to a group; completing the field traversal of the configuration data to output a form item configuration.

6. The grid system dynamic file configuration method according to any one of claims 1 to 5, characterized in that, The method further comprises the following steps: constructing a metadata configuration file in a JSON format based on preset basic field attributes.

7. The grid-wise system dynamic file configuration method of any one of claims 1 to 5, wherein, The method further comprises the following steps: According to the table column configuration, the filter item configuration and the form item configuration, a basic UI component is invoked by the front-end rendering engine to dynamically create a component instance; Based on the component instance, a user interface of the power grid mode system is rendered.

8. A power grid system dynamic file configuration apparatus, characterized by comprising: Comprise: A file acquisition unit configured to acquire a metadata configuration file; A mapping table construction unit configured to construct a field configuration mapping table according to the metadata configuration file; A file configuration unit configured to generate a table column configuration, a filter item configuration and a form item configuration based on the field configuration mapping table; A data transmission unit configured to transmit the table column configuration, the filter item configuration and the form item configuration to a front-end rendering engine of the power grid mode system, so that the front-end rendering engine dynamically renders according to the table column configuration, the filter item configuration and the form item configuration.

9. An electronic device, comprising: The device comprises a processor and a memory: The memory is configured to store program code and transmit the program code to the processor; The processor is configured to execute the power grid mode system dynamic file configuration method according to the instructions in the program code.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium is configured to store program code, and the program code is configured to execute the power grid mode system dynamic file configuration method. The computer readable storage medium is configured to store program code, and the program code is configured to execute the power grid mode system dynamic file configuration method.

Citation Information

Cited By

  • A dynamic form generation method and system based on field format double-layer mapping

    CN122174818A