Power system XML generation method and system based on mxGraph and G6

By combining mxGraph and G6 technology, the problem of insufficient interactive functions in the conversion of graph model and XML data format of the power system is solved, and the rapid and accurate conversion and efficient graphical operation of the power system data is realized, which improves the flexibility and cross-platform compatibility of the system.

CN120337864APending Publication Date: 2025-07-18GUANGXI POWER GRID CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510284274.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-11
Publication Date
2025-07-18

Smart Images

  • Figure CN120337864A_ABST
    Figure CN120337864A_ABST
Patent Text Reader

Abstract

The invention discloses an electric power system XML generation method and system based on mxGraph and G6, and relates to the technical field of computer platform load balancing, and the method comprises the steps: collecting first object parameter data, analyzing the parameter data to obtain influence parameters, converting the influence parameters to obtain graph model data, and storing the graph model data in a database; and establishing a format conversion model to analyze and adjust the graph model data to obtain XML format data. According to the power system XML generation method based on mxGraph and G6, through combination of mxGraph and G6 technologies, the system can provide more flexible graphical operation and real-time feedback, and the interactive experience of a user in the power system design process is enhanced. An efficient graph model data analysis and conversion mechanism is introduced, so that the power system data can be quickly and accurately converted into a standardized XML format.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer platform load balancing, and specifically to a method and system for generating power system XML based on mxGraph and G6. Background Art

[0002] With the continuous expansion of the power grid scale and the deepening of the construction of the new power system, the grid framework structure and operation mode show a high degree of complexity. In this context, in a comprehensive software application system integrating power grid topology analysis, maintenance plan data flow, and multi-business scenarios, the information interaction and logical wiring relationship complexity between maintenance equipment have increased significantly. The traditional way of relying on text descriptions or table displays of field information to convey the maintenance plan information of system equipment can no longer effectively display the topological structure, equipment layout, and line connection mode of the power system, that is, the mutual relationship between key facilities such as power plants, substations, power transmission and transformation lines, and power generation equipment.

[0003] The list-style information display method restricts the improvement of power system management efficiency, the optimization of operation performance, and the shortening of fault recovery time. To ensure the safe and stable operation of the system and provide a more intuitive, convenient, and efficient working platform for system management personnel, constructing a high-efficiency graph-model integrated page data XML generation system that can clearly display the association and topological structure between each device can effectively improve the rationality, scientificity, and effectiveness of the decision-making of operation planners. This system aims to intuitively display the complex structure of the power system through graphical means and promote the intelligence and refinement of system management.

[0004] According to the complexity of the power system and the increasing construction requirements, the present invention innovatively proposes a method for designing a graph-model integrated system structure based on mxGraph and G6. This method aims to closely combine the core services such as the equipment maintenance plan, maintenance risk assessment, and grid connection form of the power system with graphical display, so as to construct an intuitive and efficient power grid framework structure. Summary of the Invention

[0005] In view of the above existing problems, the present invention is proposed.

[0006] Therefore, the technical problem solved by the present invention is: in the prior art, there are problems in the conversion process between the graph model and the XML data format, such as imperfect interactive functions of the graphical topology model, insufficient system performance optimization, poor version compatibility, and how to introduce dynamic interactive functions and custom graphic definition modules to improve the flexibility and interactive performance of the system.

[0007] To solve the above technical problems, the present invention provides the following technical solutions: A method for generating power system XML based on mxGraph and G6, including collecting first object parameter data and analyzing the parameter data to obtain influencing parameters;

[0008] Performing conversion processing on the influencing parameters to obtain graph model data;

[0009] Establishing a format conversion model to parse and adjust the graph model data to obtain XML format data.

[0010] As a preferred solution of the method for generating power system XML based on mxGraph and G6 according to the present invention, wherein: the influencing parameters include the technical conditions required for the first object to achieve the goal.

[0011] As a preferred solution of the method for generating power system XML based on mxGraph and G6 according to the present invention, wherein: the conversion processing includes sorting and converting the parameter data according to requirements.

[0012] As a preferred solution of the method for generating power system XML based on mxGraph and G6 according to the present invention, wherein: the parsing and adjustment includes parsing the graph model data into the structure required for subsequent processing through the format conversion model.

[0013] As a preferred solution of the method for generating power system XML based on mxGraph and G6 according to the present invention, wherein: obtaining the XML format data includes configuring the graph according to the adjusted graph model data and performing adjustment tests on the configured graph.

[0014] As a preferred solution of the method for generating power system XML based on mxGraph and G6 according to the present invention, wherein: the sorting and conversion process includes planning the page layout to construct a canvas container and initialize the drawing area, constructing elements for drawing graphics, setting the styles of nodes and connections, adding interactive functions, and saving the edited graph model data as XML.

[0015] The graph model data parsing process includes parsing the XML string into the corresponding DOM structure.

[0016] The configuring graph process includes using G6 technology to create and configure graph definition data and styles to implement interactive operations.

[0017] As a preferred solution of the method for generating power system XML based on mxGraph and G6 according to the present invention, wherein: the initializing the drawing area, adding node elements, and adding connection elements include using the API of mxGraph to implement initializing the drawing area, adding node elements, and adding connection elements in the drawing area.

[0018] The parsing and adjustment process includes combining mxGraph with G6 technology to render the graph model.

[0019] The process of overcoming the obstacles in the combination of mxGraph and G6 includes establishing a format conversion model, dynamically allocating the input data according to the requirements of G6, converting the input data through the format conversion model, and considering issues such as performance optimization, error handling, and version compatibility.

[0020] Another object of the present invention is to provide a power system XML generation system based on mxGraph and G6, which can combine the advantages of mxGraph and G6 technologies through dynamic interaction and visualization deduction functions, and solve the problems of insufficient graphic interaction functions, low data processing efficiency, and poor performance optimization in the current power system graph model generation and data format conversion technologies.

[0021] As a preferred embodiment of the power system XML generation system based on mxGraph and G6 according to the present invention, it includes a data acquisition and analysis module, a parsing and processing module, and a configuration adjustment module.

[0022] The data acquisition and analysis module is used to acquire the parameter data of the first object and analyze the parameter data to obtain the influencing parameters.

[0023] The parsing and processing module is used to perform conversion processing on the influencing parameters to obtain graph model data.

[0024] The configuration adjustment module is used to establish a format conversion model to parse and adjust the graph model data to obtain XML format data.

[0025] A computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the power system XML generation method based on mxGraph and G6 are implemented.

[0026] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the power system XML generation method based on mxGraph and G6 are implemented.

[0027] Advantages of the present invention: The method for generating power system XML based on mxGraph and G6 provided by the present invention combines mxGraph and G6 technologies, enabling the system to provide more flexible graphical operations and real-time feedback, enhancing the user interaction experience during the power system design process. It introduces an efficient graph model data parsing and conversion mechanism, enabling power system data to be quickly and accurately converted into a standardized XML format and supporting the processing of large-scale data. Through modular design and a flexible format conversion model, the system can adapt to power systems of different scales and requirements, and has good cross-platform compatibility and subsequent expansion capabilities. The present invention achieves better results in terms of graphical interactivity, data processing performance, and system scalability. Description of the Drawings

[0028] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0029] Figure 1 It is the overall flowchart of a method for generating power system XML based on mxGraph and G6 provided by the first embodiment of the present invention.

[0030] Figure 2 It is the format conversion model diagram of a method for generating power system XML based on mxGraph and G6 provided by the first embodiment of the present invention.

[0031] Figure 3 It is to parse mxGraph XML and extract structured data of a method for generating power system XML based on mxGraph and G6 provided by the first embodiment of the present invention.

[0032] Figure 4 It is to define a two-way mapping rule library of a method for generating power system XML based on mxGraph and G6 provided by the first embodiment of the present invention.

[0033] Figure 5 It is to process the difference compensation diagram of a method for generating power system XML based on mxGraph and G6 provided by the first embodiment of the present invention.

[0034] Figure 6 It is to generate G6 standard JSON of a method for generating power system XML based on mxGraph and G6 provided by the first embodiment of the present invention.

[0035] Figure 7Reverse conversion (G6→mxGraphXML) of a method for generating power system XML based on mxGraph and G6 provided for the first embodiment of the present invention. Detailed implementation manners

[0036] To make the above objects, features and advantages of the present invention more obvious and understandable, the following will describe in detail the specific implementation manners of the present invention with reference to the accompanying drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0037] Example 1, referring to Figure 1 , which is an embodiment of the present invention, provides a method for generating power system XML based on mxGraph and G6, including:

[0038] S1: Collect the first object parameter data and analyze the parameter data to obtain the influencing parameters.

[0039] Collect the power system parameter data and analyze the conditions that the parameter data needs to meet when implementing the function.

[0040] In this embodiment, the first object includes the power system, and the influencing parameters include the parameters that affect the construction of the power system influence diagram model and the function. The process of analyzing the parameter data to obtain the influencing parameters is specifically

[0041] It should be noted that by collecting data through the first object parameter, the first data required for generating the integrated diagram model is obtained. Such as voltage, current, power, frequency, impedance, phase angle, etc., as well as the status information of the equipment (such as online / offline, faulty / normal) and the network topology structure information.

[0042] Preferably, before generating the integrated diagram model parameter data, it also includes two steps of data preprocessing and data algorithm model analysis. Specifically,

[0043] The first step, data preprocessing: Clean, verify and format the collected raw data to ensure the accuracy and consistency of the data.

[0044] The second step, data algorithm model analysis:

[0045] First, feature extraction: Use statistical methods to extract the key features in the parameter data, and these features can reflect the operating status and functional requirements of the power system.

[0046] Further, formula processing:

[0047] Correlation analysis: Use the Pearson correlation coefficient formula to evaluate the linear or non-linear correlation between parameters. The Pearson correlation coefficient formula is:

[0048]

[0049] where x i , y i are the i-th observations of two parameters; x̄, ȳ are the means, and n is the number of observations.

[0050] Based on the analysis results of the data algorithm model, identify the parameters that have a direct or significant impact on the construction of the power system diagram model data and the realization of functions. These influencing parameters may include key equipment parameters, network topology parameters, and operating status parameters of the power system, etc.

[0051] Sort out and output the influencing parameters obtained from the analysis and their related information (such as parameter names, data types, influencing degrees, conditions met, etc.) to provide basic data support for subsequent steps (such as diagram model construction, XML generation, etc.).

[0052] By introducing formula processing, we can analyze the power system parameter data more precisely and quantitatively, so as to accurately identify the key parameters that affect the construction of the power system diagram model and the realization of functions. This method not only improves the accuracy and efficiency of the analysis, but also provides strong technical support for the optimal design and operation management of the power system.

[0053] S2: Perform conversion processing on the influencing parameters to obtain diagram model data.

[0054] Sort out and convert the parameter data according to the required conditions, and construct a front-end drawing library to obtain diagram model data.

[0055] In this embodiment,

[0056] Mainly perform conversion processing on the influencing parameters identified in step S1 to construct the diagram model data required by the front-end drawing library. In this process, we will clean, verify, and format the format of the parameter data to ensure the accuracy and consistency of the data. At the same time, for the situation of missing data, we will use the interpolation method to fill it.

[0057] First, clean and verify the data format, including removing invalid data, format verification, data cleaning, etc.

[0058] Remove invalid data: Delete invalid or redundant information in the parameter data, such as null values, duplicate values, or data that does not meet the format requirements.

[0059] Format verification: Check whether the format of parameter data meets the requirements of the front-end drawing library, such as data type, data range, data accuracy, etc. For data that does not meet the requirements, format conversion or correction is required.

[0060] Data cleaning: Processing outliers or noise in parameter data, such as improving data accuracy through smoothing, denoising, etc.

[0061] Further, data interpolation is performed:

[0062] For the missing parts of parameter data, we use interpolation to fill them in. Interpolation is a method of inferring unknown data points based on known data points, and is often used to fill in missing data.

[0063] The specific interpolation method can be selected according to the characteristics and requirements of the data. In this embodiment, we use linear interpolation to fill in.

[0064] The linear interpolation formula is:

[0065]

[0066] By using this formula, we can calculate the dependent variable value y for the missing data point 插值 .

[0067] Therefore, the data is formatted, and the parameter data after cleaning, verification and filling is first converted into a format suitable for the front-end drawing library, including data type conversion, data structure adjustment, etc.

[0068] Furthermore, the front-end drawing library model data is constructed, and the formatted parameter data is imported into the drawing library according to the API and data format requirements of the front-end drawing library.

[0069] Use the functions and methods provided by the drawing library to build the power system model data based on the parameter data. Create elements such as nodes (representing generators, transformers, etc.), edges (representing transmission lines), labels (displaying information such as device names and parameter values), and set their properties (such as position, size, color, etc.).

[0070] Through the above steps, the influencing parameters can be converted into graphic model data suitable for use by the front-end drawing library, and the accuracy and consistency of the data can be ensured. At the same time, the interpolation method is used to fill in the missing parts of the data, which improves the integrity and availability of the data.

[0071] S3: Establish a format conversion model to parse and adjust the image data to obtain XML format data.

[0072] The graph model data is parsed into the structure required for subsequent processing through a format conversion model, and the graphics are configured according to the adjusted graph model data, and the configured graphics are adjusted and tested.

[0073] Both mxGraph and G6 are front-end drawing libraries, but there are essential differences in their data models, rendering mechanisms, and interaction logics, resulting in the following technical obstacles in direct combination:

[0074] 1. Incompatible data models

[0075] mxGraph: A tree structure model based on cells (Cell), where each node / edge contains geometric attributes (position, size), styles (color, shape), and business metadata.

[0076] G6: A flattened structure based on a graph data model, where nodes / edges are defined in the form of JSON arrays, associated by id, and have no hierarchical nesting.

[0077] 2. Differences in rendering mechanisms

[0078] mxGraph: Depends on SVG / VML rendering, emphasizing topological editing capabilities (dragging, connecting lines, grouping).

[0079] G6: Based on Canvas / WebGL rendering, focusing on the visualization of dynamic relationship networks (layout algorithms, animation effects).

[0080] 3. The format gap between XML and JSON

[0081] mxGraph exports XML: Contains complex nested levels and redundant metadata (such as <mxgeometry> 、 <mxcell>)。

[0082] The required data format for G6: flattened JSON structure (such as {nodes:[...],edges:[...]}).

[0083] In order to overcome the obstacles in the combination of mxGraph and G6 technologies, a format conversion model is designed:

[0084] By constructing an intermediate layer conversion engine, the data and interaction gap between the two libraries is solved. The model architecture is as Figure 2 ,。

[0085] The core modules of the intermediate layer conversion engine are shown in Table 1:

[0086] Table 1 Core Module Table

[0087]

[0088] Furthermore, a format conversion model is designed, and the key technical implementation steps are:

[0089] 1. Parse mxGraph XML and extract structured data as shown in the figure.

[0090] 2. Define a two-way mapping rule library as Figure 4 。

[0091] 3. Process differential compensation (hierarchical structure) as Figure 5 。

[0092] 4. Generate G6 standard JSON as Figure 6 。

[0093] 5. Reverse conversion (G6 → mxGraph XML) as Figure 7 。

[0094] After being processed by the format conversion model, the key technical obstacles solved are shown in Table 2:

[0095] Table 2 Obstacle Technology Table

[0096]

[0097] Through this model, while retaining the powerful editing ability of mxGraph, the high-performance rendering and dynamic interaction characteristics of G6 are utilized to achieve a graph-model integration solution for the power system.

[0098] Example 2, an embodiment of the present invention, provides a method for generating power system XML based on mxGraph and G6. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.

[0099] First, analyze the data content required for the analysis diagram model, determine the information type, data structure, and graphical display form, construct a customized icon component library, and flexibly configure the colors, shapes, and fonts of the icon components. Plan the page layout, including the canvas position, node and connection layout, filtering panel layout, toolbox operation layout, etc.

[0100] Create a canvas container and use graphical modeling technology to construct a canvas that meets the function of drawing graphics. Add Add node element element, and use the API of mxGraph to add the node element to the drawing area. Add connection Elements to represent the associations or connections between nodes. Support custom nodes and connections, draw different electrical components using SVG elements according to business requirements, and import them into the drawing board as node materials for diagram model editing.

[0101] Set the style attributes of the nodes and connections, including colors, shapes, fonts, etc., to meet the page design requirements.

[0102] Analyze the interactive functions of the business requirements and configure and implement them one by one. Listen to various events of mxGraph to implement specific functions, such as updating the connection position, triggering specific operations, etc. Save the edited diagram model data in XML format.

[0103] Deconstruct the XML data and convert it into a JSON format recognizable by G6. Use G6 technology to create and configure the graphics, define the data and styles, and implement interactive operations.

[0104] Finally, perform debugging and testing to ensure that the graphical display and interactive functions are normal.

[0105] Embodiment 3, an embodiment of the present invention, provides a power system XML generation system based on mxGraph and G6, including an acquisition and analysis module, a parsing and processing module, and a configuration and adjustment module.

[0106] The acquisition and analysis module is used to acquire the first object parameter data and analyze the parameter data to obtain the influencing parameters.

[0107] The parsing and processing module is used to perform conversion processing on the influencing parameters to obtain diagram model data.

[0108] The configuration and adjustment module is used to establish a format conversion model to parse and adjust the diagram model data to obtain XML format data.

[0109] If a function is implemented in the form of 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 a part of this 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 for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods according to the various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs, etc., which can store program codes of various kinds.

[0110] The logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch instructions from the instruction execution system, apparatus, or device and execute the instructions), or used in combination with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.

[0111] More specific examples (a non-exhaustive list) of computer-readable media include the following: electrical connection parts with one or more wirings (electronic devices), portable computer disk cartridges (magnetic devices), random access memories (RAMs), read-only memories (ROMs), erasable programmable read-only memories (EPROMs or flash memories), optical fiber devices, and portable compact disc read-only memories (CDROMs). Additionally, the computer-readable medium can even be paper or other suitable media on which a program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other appropriate processing as necessary, and then stored in a computer memory.

[0112] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc. 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 preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.

[0113] 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 preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.< / mxcell> < / mxgeometry>

Claims

1. A method for generating power system XML based on mxGraph and G6, characterized in that, Including: Collect the parameter data of the first object, and analyze the parameter data to obtain the influencing parameters; Perform conversion processing on the influencing parameters to obtain graphic model data; Establish a format conversion model to parse and adjust the graphic model data to obtain XML format data.

2. The power system XML generation method based on mxGraph and G6 according to claim 1, characterized in that: The influencing parameters include the technical conditions required for the first object to achieve the goal.

3. The method for generating the power system XML based on mxGraph and G6 according to claim 2, characterized in that: The conversion processing includes sorting and converting the parameter data according to requirements.

4. The method for generating the power system XML based on mxGraph and G6 according to claim 3, wherein: The parsing and adjustment include parsing the graphic model data into the structure required for subsequent processing through the format conversion model.

5. The power system XML generation method based on mxGraph and G6 according to claim 4, characterized in that: The obtaining of XML format data includes configuring the graphics according to the adjusted graphic model data and adjusting and testing the configured graphics.

6. The method for generating the power system XML based on mxGraph and G6 according to claim 5, wherein: The sorting and conversion process includes planning the page layout to construct a canvas container and initialize the drawing area, constructing the elements for drawing graphics, setting the styles of nodes and connections, adding interactive functions, and saving the edited graphic model data XML; The graphic model data parsing process includes parsing the XML string into the corresponding DOM structure; The graphic configuration process includes using G6 technology to create and configure graphic definition data and styles to achieve interactive operations.

7. The method for generating the power system XML based on mxGraph and G6 according to claim 6, characterized in that: The initialization of the drawing area, adding node elements, and adding connection elements include using the APIs of mxGraph to implement the initialization of the drawing area, adding node elements, and adding connection elements in the drawing area; The parsing and adjustment process includes combining mxGraph and G6 technologies to render the graphic model; The process of overcoming the obstacles in the combination of mxGraph and G6 includes establishing a format conversion model, dynamically allocating the input data according to the requirements of G6, inputting it into the format conversion model for conversion, and considering issues such as performance optimization, error handling, and version compatibility.

8. A system adopting the power system XML generation method based on mxGraph and G6 as described in any one of claims 1 to 7, characterized in that: Including a data collection and analysis module, a parsing and processing module, and a configuration and adjustment module; The data collection and analysis module is used to collect the parameter data of the first object and analyze the parameter data to obtain the influencing parameters; The parsing and processing module is used to perform conversion processing on the influencing parameters to obtain graphic model data; The configuration and adjustment module is used to establish a format conversion model to parse and adjust the graphic model data to obtain XML format data.

9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method for generating power system XML based on mxGraph and G6 according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for generating power system XML based on mxGraph and G6 according to any one of claims 1 to 7.