A system configuration diagram automatic generation method, device, equipment, medium and product

By automatically generating configuration diagrams using parsed object model files and layout algorithms, this technology solves the problems of high manual costs, high error risks, and poor scalability in existing technologies. It achieves automated and efficient generation and editing of configuration diagrams, reduces manual costs, and improves industrial visualization efficiency.

CN120597997BActive Publication Date: 2026-05-19SHANGHAI ELECTRIC POWER DESIGN INST +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI ELECTRIC POWER DESIGN INST
Filing Date
2025-05-22
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing system configuration diagram generation solutions suffer from high labor costs, high error risks, poor scalability, and low efficiency in industrial visualization.

Method used

The device's object set and edge set are obtained by resolving the object model file. The node coordinates of the device on the canvas are calculated using a layout algorithm. Combined with interactive rendering technology, a configuration diagram is automatically generated.

Benefits of technology

It reduces labor costs and error risks, improves scalability and industrial visualization efficiency, and enables automated, efficient generation and flexible, convenient editing of configuration diagrams.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120597997B_ABST
    Figure CN120597997B_ABST
Patent Text Reader

Abstract

The application discloses a system configuration diagram automatic generation method, device, equipment, medium and product, and relates to the technical field of industrial automation and visualization. The method is to first analyze corresponding object model files of each device in a target system to obtain corresponding object sets and edge sets, then calculate node coordinates of each device on a canvas by using a layout algorithm according to the edge sets and visual attributes in the object sets, then render corresponding object sets to corresponding node elements on the canvas and at corresponding node coordinates of each device, and further perform connection rendering on the canvas according to the edge sets to obtain line elements for connecting the node elements, and finally output all elements on the canvas as a configuration diagram, so that the deficiencies of traditional manual drawing methods in efficiency and accuracy can be solved, the artificial cost and error risk are reduced, and the expansibility and industrial visualization efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of industrial automation and visualization technology, specifically relating to a method, apparatus, equipment, medium and product for automatically generating system configuration diagrams. Background Technology

[0002] A system configuration diagram is a graphical representation used to describe the relationships and interactions between various elements in a system. It typically consists of nodes (also called vertices) and edges (also called connecting lines). Nodes represent various elements in the system, while edges represent the relationships or connections between nodes. Configuration diagrams visually demonstrate the dependencies, process sequences, and data transfer information between elements in the system, helping users to fully understand the system's structure and operation.

[0003] Currently, in traditional industrial automation scenarios, the design and maintenance of system configuration diagrams mainly rely on engineers to manually complete operations such as equipment node arrangement, pipeline connection and layout adjustment in the visual editor. This generation process has the following obvious defects: (1) High labor cost, that is, the node and connection relationship of complex systems such as heating, ventilation and air conditioning (HVAC) systems, industrial control systems and microgrid systems are intricate, making manual drawing not only time-consuming and laborious, but also inefficient in configuration; (2) High risk of error, that is, if manual operation is slightly careless, it may lead to node omission, connection error or layout imbalance, which will seriously affect the stability and reliability of the system display; (3) Poor scalability, that is, when equipment is updated or the topology changes, it is necessary to readjust manually, which is difficult to adapt to the rapid iteration needs of industrial Internet of Things (IoT) and digital twin technology.

[0004] Furthermore, with the development of object modeling technology, the attributes of equipment (such as names, icons, and location parameters), topological relationships (such as pipeline connections and signal flow directions), and visualization features have been standardized and defined. How to utilize this structured information from object models to drive the automated generation of system configuration diagrams, thereby improving industrial visualization efficiency and reducing manual intervention rates and labor costs, has become a pressing research topic for those skilled in the art. Summary of the Invention

[0005] The purpose of this invention is to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for automatically generating system configuration diagrams, in order to solve the problems of high labor costs, high error risk, poor scalability, and low efficiency of industrial visualization in existing system configuration diagram generation schemes.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] Firstly, a method for automatically generating system configuration diagrams is provided, including:

[0008] Obtain the object model files of each device in the target system;

[0009] For each device, the corresponding object model file is parsed to obtain the corresponding object set and edge set. The object set contains a unique identifier, type, and visual attributes, and the edge set contains all outgoing edges with the corresponding device node as the source node and / or all incoming edges with the corresponding device node as the target node.

[0010] Based on the edge set of each device and the visual attributes in the object set, the node coordinates of each device on the canvas are calculated using a layout algorithm.

[0011] For each device, at the position on the canvas and at the corresponding node coordinates, the corresponding set of objects is rendered as the corresponding visual node element;

[0012] Based on the edge sets of each device, connection rendering is also performed on the canvas to obtain visual connection elements for connecting the visual node elements;

[0013] All the visual node elements and all the visual connection elements on the canvas are output as the configuration diagram of the target system.

[0014] Based on the above-mentioned invention, a novel solution for automatically generating complex system configuration diagrams from object model files is provided. First, for each device in the target system, the corresponding object model file is parsed to obtain the corresponding object set and edge set. Then, based on the edge set and the visual attributes in the object set, a layout algorithm is used to calculate the node coordinates of each device on the canvas. Next, for each device, at the corresponding node coordinates on the canvas, the corresponding object set is rendered as the corresponding node element. Furthermore, based on the edge set, connection rendering is performed on the canvas to obtain the connecting lines used to connect the node elements. Finally, all elements on the canvas are used as the target system configuration diagram and output. This method, through in-depth analysis of the nodes and their connections in the object model and the clever integration of layout algorithms and interactive rendering technology, achieves automated and efficient generation and flexible editing of configuration diagrams. This effectively solves the shortcomings of traditional manual drawing methods in terms of efficiency and accuracy, reducing labor costs and error risks while improving scalability and industrial visualization efficiency, facilitating practical application and promotion.

[0015] In one possible design, the layout algorithm employs a force-directed algorithm, a grid layout algorithm, or a rule-based arrangement algorithm.

[0016] In one possible design, based on the edge set of each device and its visual attributes in the object set, a layout algorithm is used to calculate the node coordinates of each device on the canvas, including:

[0017] Based on the edge set of each device, the devices are layered and sorted within each layer to determine the layer number and in-layer sequence number of each device. The in-layer sorting refers to adjusting the left-to-right order of all devices within the layer using a strategy that minimizes the number of edge intersections.

[0018] For each device, the corresponding height and width are extracted from the corresponding visualization attributes, and the node coordinates of the corresponding device on the canvas are calculated according to the following formula:

[0019]

[0020] In the formula, m represents a positive integer, x coord,m The x-coordinate of the m-th device in the target system on the canvas is represented by y. coord,m Let x represent the ordinate of the node of the m-th device on the canvas. m y represents the layer index of the m-th device. m N represents the layer number of the m-th device. width,m N represents the width of the m-th device. height,m G represents the height of the m-th device. horizontal G represents the preset horizontal spacing between devices on the canvas. vertical This refers to the preset vertical spacing between devices on the canvas.

[0021] In one possible design, the devices are layered according to their respective edge sets to determine the layer number of each device, including the following steps S311 to S316:

[0022] S311. For each device, count the total number of incoming edges in the corresponding edge set, and use this total number as the corresponding current in-degree, and then execute step S312;

[0023] S312. Initialize integer variable i = 1, then execute step S313;

[0024] S313. Add all devices with an in-degree of zero to the device set of the i-th layer, and then execute step S314;

[0025] S314. For each device in the device set of the i-th layer, traverse each outgoing edge in the corresponding edge set in the following manner: first determine a device corresponding to the target node of the currently traversed outgoing edge, then decrement the current in-degree of the device by 1, then determine whether the current in-degree of the device is zero. If so, add the device to the device set of the (i+1)-th layer and traverse the next outgoing edge; otherwise, directly traverse the next outgoing edge, and finally execute step S315.

[0026] S315. Determine whether the device set of the (i+1)th layer is an empty set. If so, proceed to step S316; otherwise, increment i by 1 and return to step S314.

[0027] S316. End the layering process, and for each device, use the sequence number of the corresponding layer as the corresponding layer number.

[0028] In one possible design, the strategy for minimizing the number of edge intersections includes:

[0029] Adjust the left-to-right order of all devices within two adjacent layers to minimize the total number of device groups that satisfy the following edge crossing condition: The device group includes a first device, a second device, a third device, and a fourth device. The first device and the second device are located in one of the two adjacent layers, and the third device and the fourth device are located in the other of the two adjacent layers. The first device and the third device are the source and target nodes of one edge, and the second device and the fourth device are the source and target nodes of another edge. Furthermore, the left-to-right sequence number of the first device is less than that of the second device and the left-to-right sequence number of the third device is greater than that of the fourth device, or the left-to-right sequence number of the first device is greater than that of the second device and the left-to-right sequence number of the third device is less than that of the fourth device.

[0030] In one possible design, before outputting the configuration diagram of the target system, the method further includes:

[0031] In response to basic element operations performed by the user from the human-computer interaction interface, the pose of the visual node element or the visual connecting line element is adjusted, wherein the basic element operations include element dragging, element scaling or element rotation.

[0032] And / or, in response to attribute editing operations from the human-computer interaction interface and performed by the user, the visual node element is rendered and updated, wherein the attribute editing operations include node icon modification operations, node label modification operations, or node color modification operations;

[0033] And / or, in response to a layout optimization operation performed by the user from the human-computer interaction interface, for the multiple visual node elements selected by the operation and located in the layout area, the new coordinates of the nodes on the canvas of the corresponding device are recalculated using the layout algorithm based on the edge set of the corresponding device and the visual attributes in the object set, and the rendering is updated based on the calculation results.

[0034] Secondly, an automatic system configuration diagram generation device is provided, including a model file acquisition unit, a model file parsing unit, a node coordinate calculation unit, a node element rendering unit, a connection element rendering unit, and a configuration diagram output unit.

[0035] The model file acquisition unit is used to acquire the object model files of each device in the target system;

[0036] The model file parsing unit is communicatively connected to the model file acquisition unit and is used to parse the corresponding object model file for each device to obtain the corresponding object set and edge set. The object set includes a unique identifier, type and visualization attribute, and the edge set includes all outgoing edges with the corresponding device node as the source node and / or all incoming edges with the corresponding device node as the target node.

[0037] The node coordinate calculation unit is communicatively connected to the model file parsing unit, and is used to calculate the node coordinates of each device on the canvas using a layout algorithm based on the edge set of each device and the visual attributes in the object set.

[0038] The node element rendering unit is communicatively connected to the model file parsing unit and the node coordinate calculation unit, respectively, and is used to render the corresponding object set as the corresponding visual node element for each device, on the canvas and at the corresponding node coordinate position.

[0039] The connection element rendering unit is communicatively connected to the model file parsing unit and the node element rendering unit, respectively, and is used to perform connection rendering on the canvas according to the edge set of each device to obtain visual connection elements for connecting the visual node elements.

[0040] The configuration diagram output unit is communicatively connected to the node element rendering unit and the connection element rendering unit, respectively, and is used to output all the visual node elements and all the visual connection elements on the canvas as the configuration diagram of the target system.

[0041] Thirdly, the present invention provides a computer device comprising a memory, a processor, and a transceiver connected in sequence for communication, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the automatic generation method of system configuration diagram as described in the first aspect or any possible design in the first aspect.

[0042] Fourthly, the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, perform the automatic generation method for system configuration diagrams as described in the first aspect or any possible design within the first aspect.

[0043] Fifthly, the present invention provides a computer program product, including a computer program or instructions, wherein the computer program or instructions, when executed by a computer, implement the automatic generation method of system configuration diagram as described in the first aspect or any possible design in the first aspect.

[0044] The beneficial effects of the above scheme are:

[0045] (1) This invention creatively provides a new scheme for automatically generating complex system configuration diagrams based on object model files. First, for each device in the target system, the corresponding object model file is parsed to obtain the corresponding object set and edge set. Then, based on the edge set and the visualization attributes in the object set, the node coordinates of each device on the canvas are calculated using a layout algorithm. Next, for each device, the corresponding object set is rendered as the corresponding node element at the position of the corresponding node coordinate on the canvas. Based on the edge set, connection rendering is also performed on the canvas to obtain the connecting line elements used to connect the node elements. Finally, all elements on the canvas are used as the target system configuration diagram and output. Thus, by deeply analyzing the nodes and their connection relationships of the object model and cleverly integrating the layout algorithm and interactive rendering technology, the automated and efficient generation and flexible and convenient editing of the configuration diagram are realized. This effectively solves the shortcomings of traditional manual drawing methods in terms of efficiency and accuracy, reduces labor costs and error risks, and improves scalability and industrial visualization efficiency, making it convenient for practical application and promotion. Attached Figure Description

[0046] 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.

[0047] Figure 1This is a flowchart illustrating the automatic generation method for system configuration diagrams provided in this application embodiment.

[0048] Figure 2 This is a schematic diagram of the system configuration diagram automatic generation device provided in the embodiments of this application.

[0049] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in conjunction with the accompanying drawings and descriptions of the embodiments or the prior art. Obviously, the following description of the structure of the accompanying drawings is only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these embodiments without creative effort. It should be noted that the description of these embodiments is for the purpose of helping to understand the present invention, but does not constitute a limitation of the present invention.

[0051] It should be understood that although the terms "first" and "second", etc., may be used herein to describe various objects, these objects should not be limited by these terms. These terms are only used to distinguish one object from another. For example, the first object may be referred to as the second object, and similarly, the second object may be referred to as the first object, without departing from the scope of the exemplary embodiments of the invention.

[0052] It should be understood that the term "and / or" that may appear in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, B exists alone, or A and B exist simultaneously. Another example is A, B and / or C, which can mean that any one of A, B, and C or any combination thereof exists. The term " / and" that may appear in this document describes another relationship between related objects, indicating that two relationships can exist. For example, A / and B can mean: A exists alone or A and B exist simultaneously. In addition, the character " / " that may appear in this document generally indicates that the related objects before and after it are in an "or" relationship.

[0053] Example

[0054] like Figure 1As shown, the automatic system configuration diagram generation method provided in the first aspect of this embodiment can be executed, but is not limited to, by a computer device with certain computing resources, such as a cloud server, a personal computer (PC, referring to a multi-purpose computer of a size, price, and performance suitable for personal use; desktop computers, laptops, mini-laptops, tablets, and ultrabooks are all personal computers), a smartphone, a personal digital assistant (PDA), or a wearable device. Figure 1 As shown, the automatic generation method of the system configuration diagram may include, but is not limited to, the following steps S1 to S6.

[0055] S1. Obtain the object model files of each device in the target system.

[0056] In step S1, the target system is the object to be configured and plotted, which may be, but is not limited to, a HVAC system, an industrial control system, a microgrid system, or other complex systems with multi-level node structures. The object model file is a standardized file based on existing object modeling technology and may specifically include, but is not limited to, the following: device node information and topology information. The device node information includes, but is not limited to, device type (e.g., fan, valve, or sensor), unique identifier, and / or visual attributes (e.g., icon path, size, and color). The topology information includes, but is not limited to, the connection relationships between nodes (e.g., pipe connections, control signals, or transmission paths) and physical / logical location parameters. The object model files can be, but are not limited to, JSON (JavaScript Object Notation, a lightweight data exchange format) files and are pre-stored in existing file systems or NoSQL (non-relational databases) databases such as MongoDB (a distributed file storage database written in C++) for unified management (e.g., supporting storage, version control, retrieval, and loading). The object model files of each device can then be routinely retrieved from these file systems or databases, for example, by calling their provided data read / write interfaces such as the loadmode() function. For instance, when the target system is a HVAC system, object model files of devices such as fans (FAN_COIL_UNIT) and control valves (CONTROL_VALVE) can be read. These model files specifically contain id, type attributes, properties attributes (e.g., location parameters and icon paths), and connections attributes (e.g., indicating the connection relationship from the fan to the control valve).

[0057] S2. For each device, parse the corresponding object model file to obtain the corresponding object set and edge set. The object set includes, but is not limited to, unique identifiers, types, and visual attributes. The edge set includes, but is not limited to, all outgoing edges with the corresponding device node as the source node and / or all incoming edges with the corresponding device node as the target node.

[0058] In step S2, existing syntax parsing tools (such as ThingModelUtils) can be used, but are not limited to, to extract the core elements of the object model file: the set of objects reflecting the node content and the set of edges reflecting the connection relationships between nodes; for example, by calling the parseThingMode() function (which supports compatibility parsing of object models from different vendors), the object model file can be converted into a {nodes, edges} data structure, where nodes are the set of objects and edges are the set of edges.

[0059] S3. Based on the edge set of each device and the visual attributes in the object set, the node coordinates of each device on the canvas are calculated using a layout algorithm.

[0060] In step S3, the calculation of the node coordinates is similar to the application of multi-agent systems in the automatic layout generation of buildings in industrial parks and the application of image recognition technology in the generation of DCS (Distributed Control System, DCS configuration constructs the core process of the system by configuring hardware and software parameters to realize the automated control of industrial processes; its main goal is to connect equipment signals and define control logic, and ensure the precise operation of the system; in DCS configuration, through object model technology, the system can automatically generate and optimize configuration diagrams, helping to realize the effective layout of equipment nodes and the precise expression of control logic, and improving the efficiency and accuracy of system design and operation and maintenance) configuration screens. Specifically, the layout algorithm can be, but is not limited to, force-directed algorithms, grid layout algorithms, or rule-based algorithms. The force-directed algorithm is a commonly used algorithm in network visualization and social network analysis. It simulates the interaction between nodes through attraction and repulsion, thereby arranging the nodes in the network into an aesthetically pleasing and readable graphic. The grid layout algorithm involves dividing a webpage into grids and determining the position and size of each grid element through an algorithm, thus creating a complex page layout. The rule-based algorithm is a method that can rearrange a string of random data according to a specific order (such as ascending, descending, or alphabetical / character order). In detail, the force-directed algorithm can be implemented using the existing D3.js force module or other self-developed engines to achieve force-directed layout. Furthermore, the layout algorithm strategy can be dynamically switched through configuration parameters.

[0061] In step S3, in order to reduce the computational resource requirements and quickly calculate the node coordinates of each device on the canvas, preferably, the node coordinates of each device on the canvas are calculated by a layout algorithm based on the edge set of each device and the visualization attributes in the object set, including but not limited to the following steps S31 to S32.

[0062] S31. Based on the edge set of each device, the devices are layered and sorted within each layer to determine the layer number and in-layer sequence number of each device. The in-layer sorting refers to adjusting the left-to-right order of all devices within the layer using a strategy that minimizes the number of edge intersections.

[0063] In step S31, the devices need to be first layered and then sorted within each layer. Specifically, based on the edge set of each device, the devices are layered to determine the layer number of each device, including but not limited to the following steps S311 to S316.

[0064] S311. For each device, count the total number of incoming edges in the corresponding edge set, and use this total number as the corresponding current in-degree, and then execute step S312.

[0065] In step S311, the in-degree is used to measure the number of edges pointing to the corresponding device node; for example, if there are 2 in-edges in the edge set of device A, then the current in-degree of device A is 2.

[0066] S312. Initialize integer variable i = 1, and then execute step S313.

[0067] S313. Add all devices with an in-degree of zero to the device set of the i-th layer, and then execute step S314.

[0068] In step S313, for example, if the current in-degree of device A is 2, the current in-degree of device B is 0, the current in-degree of device C is 1, and the current in-degree of device D is 0, then device B and device D can be added to the device set of the first layer.

[0069] S314. For each device in the device set of the i-th layer, traverse each outgoing edge in the corresponding edge set in the following manner: first determine a device corresponding to the target node of the currently traversed outgoing edge, then decrement the current in-degree of the device by 1, then determine whether the current in-degree of the device is zero. If so, add the device to the device set of the (i+1)-th layer and traverse the next outgoing edge; otherwise, directly traverse the next outgoing edge. Finally, execute step S315.

[0070] In step S314, for example, when i=1, for device B in the device set of the first layer, if there are outgoing edges BC and BA in the corresponding edge set, when traversing outgoing edge BC, the current in-degree 1-1 of device C can be made 0, and then device C is added to the device set of the second layer. When traversing outgoing edge BA, the current in-degree 2-1 of device A can be made 1, but device A is not added to the device set of the second layer. For device D in the device set of the first layer, if there is outgoing edge DA in the corresponding edge set, when traversing outgoing edge DA, the current in-degree 1-1 of device A can be made 0, and then device A is added to the device set of the second layer.

[0071] S315. Determine whether the device set of the (i+1)th layer is an empty set. If so, proceed to step S316; otherwise, increment i by 1 and return to step S314.

[0072] In step S315, for example, since the device set of the second layer contains at least device C and device A, which is a non-empty set, i needs to be incremented by 1, and then return to step S314.

[0073] S316. End the layering process, and for each device, use the sequence number of the corresponding layer as the corresponding layer number.

[0074] In step S316, for example, since device B and device D are added to the device set of the first layer, and device C and device A are added to the device set of the second layer, it can be determined that: the layer number of device A is 2, the layer number of device B is 1, the layer number of device C is 2, and the layer number of device D is 1.

[0075] In step S31, the edge crossing number minimization strategy is used to ensure that the number of edge element crossings in the subsequent system configuration diagram is minimized, so as to clearly present the structural relationship of the configuration diagram. Specifically, the edge crossing number minimization strategy includes, but is not limited to, adjusting the left-to-right order of all devices in two adjacent layers to minimize the total number of device groups that satisfy the following edge crossing conditions: the device group includes a first device, a second device, a third device, and a fourth device; the first device and the second device are respectively located in one of the two adjacent layers; the third device and the fourth device are respectively located in the other of the two adjacent layers; the first device and the third device are the source node and target node of one edge to each other; the second device and the fourth device are the source node and target node of another edge to each other; and the left-to-right sequence number of the first device is less than the left-to-right sequence number of the second device and the left-to-right sequence number of the third device is greater than the left-to-right sequence number of the fourth device, or the left-to-right sequence number of the first device is greater than the left-to-right sequence number of the second device and the left-to-right sequence number of the third device is less than the left-to-right sequence number of the fourth device. For example, since devices B and D are in the first layer, and devices C and A are in the second layer, with outgoing edges BC and DA, the device order in the first layer needs to be adjusted to: device B, device D, and the device order in the second layer needs to be adjusted to: device C, device A, to ensure that outgoing edges BC and DA do not intersect. Furthermore, the aforementioned device order adjustment method can be implemented using enumeration or optimization algorithms such as particle swarm optimization or genetic algorithms.

[0076] S32. For each device, extract the corresponding height and width from the corresponding visualization attributes, and calculate the node coordinates of the corresponding device on the canvas according to the following formula:

[0077]

[0078] In the formula, m represents a positive integer, x coord,m The x-coordinate of the m-th device in the target system on the canvas is represented by y. coord,m Let x represent the ordinate of the node of the m-th device on the canvas. m y represents the layer index of the m-th device. m N represents the layer number of the m-th device. width,m N represents the width of the m-th device. height,m G represents the height of the m-th device. horizontal G represents the preset horizontal spacing between devices on the canvas. vertical This refers to the preset vertical spacing between devices on the canvas.

[0079] In step S32, since the visualization attributes contain size information, the height and width can be extracted conventionally based on this size information. Considering that the size information is static data, to make the rendering of node elements more accurate and flexible, the aforementioned height and width can be dynamically adjusted according to specific conditions (such as scaling factors or node types) or actual needs. The horizontal and vertical spacing between devices are used to ensure that node elements do not overlap and can be specifically determined by the user according to actual sparsity requirements. Furthermore, the units for the height, width, horizontal and vertical spacing between devices are specifically, but not limited to, pixels in the canvas; for example, the horizontal and vertical spacing between devices are each 10 pixels.

[0080] S4. For each device, on the canvas and at the corresponding node coordinates, render the corresponding object set as the corresponding visual node element.

[0081] In step S4, node rendering on the canvas can be implemented using the React framework (a JavaScript library for building user interfaces, originating from an internal Facebook project) and interaction libraries (such as Moveable or Selecto): device nodes are drawn based on visual attributes, and the drawing results are placed at positions specified by the node coordinates. Alternatively, an interactive canvas can be built first based on React, and then efficient node rendering can be achieved using either Canvas or SVG, two existing graphics rendering methods.

[0082] S5. Based on the edge sets of each device, connection rendering is also performed on the canvas to obtain visual connection elements for connecting the visual node elements.

[0083] In step S5, React and interactive libraries can also be used to implement the connection rendering on the canvas: Bézier curves or straight lines are used to draw the connections between nodes, while supporting dynamic updates of the connection paths to adapt to layout adjustments.

[0084] S6. Output all the visual node elements and all the visual connection elements on the canvas as the configuration diagram of the target system.

[0085] In step S6, the configuration diagram can be output and saved in multiple formats. For example, the configuration diagram can be exported using JSON (used to store node coordinates, connection relationships, and style attributes) and SVG (as a vector graphics format that supports high-definition printing and free scaling) formats, and stored locally or synchronized to a cloud database to support fast rendering and version management during subsequent loading. For example, the canvasStore.save() function can be used to serialize the current collection of canvas elements (i.e., including nodes, lines, and styles) into JSON or SVG formats. In addition, to provide multi-level interactive functionality to allow users to fine-tune the automatically generated configuration diagram, preferably, before outputting the configuration diagram of the target system, the method further includes, but is not limited to: responding to basic element operations performed by the user from the human-computer interaction interface, and adjusting the pose (i.e., position adjustment and / or posture adjustment) of the visualized node elements or the visualized connecting elements, wherein the basic element operations include, but are not limited to, element drag operations (specific implementation example: listening for mouse events in the CanvasContent.tsx file and triggering the onDragEnd event when the drag ends), element scaling operations, or element rotation operations, etc.; and / or, ... / or, adjusting the pose (i.e., position adjustment and / or posture adjustment) of the visualized node elements or the visualized connecting elements, wherein the basic element operations include, but are not limited to, element drag operations (specific implementation example: listening for mouse events in the CanvasContent.tsx file and triggering the onDragEnd event when the drag ends), element scaling operations, or element rotation operations, etc.; User-mandated attribute editing operations update the rendering of the visual node elements. These operations include, but are not limited to, modifying node icons, labels, or colors. Alternatively, in response to layout optimization operations performed by the user through the human-computer interface, for multiple visual node elements selected and located in the canvas layout area, the new coordinates of the nodes on the canvas are recalculated using the layout algorithm based on the edge set of the corresponding device and the visual attributes in the object set (to ensure that the adjusted nodes and connections remain consistent). The rendering is then updated based on the calculation results (i.e., steps S4-S5 are re-executed for the corresponding device). Specifically, the aforementioned interactive functions can be implemented using the CanvasContent component within the Vue3 framework, combined with the Moveable and Selecto libraries, to handle node dragging, scaling, and selection states, thereby rendering interactive elements. Furthermore, the aforementioned basic element operations also support batch grouping operations and alignment tools (e.g., horizontal / vertical alignment).

[0086] Therefore, based on the automatic generation method of system configuration diagrams described in steps S1 to S6 above, a new scheme for automatically generating complex system configuration diagrams based on object model files is provided. First, for each device in the target system, the corresponding object model file is parsed to obtain the corresponding object set and edge set. Then, based on the edge set and the visual attributes in the object set, a layout algorithm is used to calculate the node coordinates of each device on the canvas. Next, for each device, at the position of the corresponding node coordinates on the canvas, the corresponding object set is rendered as the corresponding node element. Furthermore, based on the edge set, connection rendering is performed on the canvas to obtain the connecting lines used to connect the node elements. Finally, all elements on the canvas are used as the target system configuration diagram and output. Thus, by deeply analyzing the nodes and their connection relationships of the object model and cleverly integrating layout algorithms and interactive rendering technology, automated and efficient generation and flexible and convenient editing of configuration diagrams are achieved. This effectively solves the shortcomings of traditional manual drawing methods in terms of efficiency and accuracy, reducing labor costs and error risks, while improving scalability and industrial visualization efficiency, facilitating practical application and promotion.

[0087] like Figure 2 As shown, the second aspect of this embodiment provides a virtual device for implementing the automatic generation method of system configuration diagrams described in the first aspect, including a model file acquisition unit, a model file parsing unit, a node coordinate calculation unit, a node element rendering unit, a connection element rendering unit, and a configuration diagram output unit;

[0088] The model file acquisition unit is used to acquire the object model files of each device in the target system;

[0089] The model file parsing unit is communicatively connected to the model file acquisition unit and is used to parse the corresponding object model file for each device to obtain the corresponding object set and edge set. The object set includes a unique identifier, type and visualization attribute, and the edge set includes all outgoing edges with the corresponding device node as the source node and / or all incoming edges with the corresponding device node as the target node.

[0090] The node coordinate calculation unit is communicatively connected to the model file parsing unit, and is used to calculate the node coordinates of each device on the canvas using a layout algorithm based on the edge set of each device and the visual attributes in the object set.

[0091] The node element rendering unit is communicatively connected to the model file parsing unit and the node coordinate calculation unit, respectively, and is used to render the corresponding object set as the corresponding visual node element for each device, on the canvas and at the corresponding node coordinate position.

[0092] The connection element rendering unit is communicatively connected to the model file parsing unit and the node element rendering unit, respectively, and is used to perform connection rendering on the canvas according to the edge set of each device to obtain visual connection elements for connecting the visual node elements.

[0093] The configuration diagram output unit is communicatively connected to the node element rendering unit and the connection element rendering unit, respectively, and is used to output all the visual node elements and all the visual connection elements on the canvas as the configuration diagram of the target system.

[0094] The working process, working details and technical effects of the aforementioned device provided in the second aspect of this embodiment can be found in the automatic generation method of system configuration diagram described in the first aspect, and will not be repeated here.

[0095] like Figure 3 As shown, the third aspect of this embodiment provides a computer device for executing the automatic system configuration diagram generation method as described in the first aspect. The device includes a memory, a processor, and a transceiver connected in sequence. The memory stores a computer program, the transceiver sends and receives messages, and the processor reads the computer program and executes the automatic system configuration diagram generation method as described in the first aspect. Specifically, the memory may include, but is not limited to, random-access memory (RAM), read-only memory (ROM), flash memory, first-in-first-out (FIFO) memory, and / or first-in-last-out (FILO) memory, etc.; the processor may include, but is not limited to, a microprocessor of the STM32F105 series. Furthermore, the computer device may also include, but is not limited to, a power supply module, a display screen, and other necessary components.

[0096] The working process, working details and technical effects of the aforementioned computer equipment provided in the third aspect of this embodiment can be found in the automatic generation method of system configuration diagram described in the first aspect, and will not be repeated here.

[0097] This fourth aspect of the embodiment provides a computer-readable storage medium storing instructions comprising the system configuration diagram automatic generation method as described in the first aspect. Specifically, the computer-readable storage medium stores instructions that, when executed on a computer, perform the system configuration diagram automatic generation method as described in the first aspect. The computer-readable storage medium refers to a data storage medium, which may include, but is not limited to, floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or Memory Sticks. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

[0098] The working process, working details and technical effects of the aforementioned computer-readable storage medium provided in the fourth aspect of this embodiment can be found in the automatic generation method of system configuration diagram as described in the first aspect, and will not be repeated here.

[0099] This fifth aspect of the embodiment provides a computer program product, including a computer program or instructions, which, when executed by a computer, implements the automatic system configuration diagram generation method as described in the first aspect. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.

[0100] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for automatically generating system configuration diagrams, characterized in that, include: Obtain the object model files of each device in the target system, wherein the target system is a heating, ventilation and air conditioning system or an industrial control system, and the object model files contain device node information and topology information. The device node information contains device type, unique identifier and / or visual attributes, and the topology information contains the connection relationship between nodes and physical / logical location parameters. For each device, the corresponding object model file is parsed to obtain the corresponding object set and edge set. The object set contains a unique identifier, type, and visual attributes, and the edge set contains all outgoing edges with the corresponding device node as the source node and / or all incoming edges with the corresponding device node as the target node. Based on the edge sets of each device and the visual attributes in the object set, a layout algorithm is used to calculate the node coordinates of each device on the canvas. Specifically, this includes: layering and sorting each device within each layer based on its edge set to determine the layer number and in-layer sequence of each device. The in-layer sorting refers to adjusting the left-to-right order of all devices within a layer using a strategy that minimizes the number of edge intersections; for each device, extracting its corresponding height and width from its visual attributes, and calculating the node coordinates of the corresponding device on the canvas using the following formula: In the formula, Represents positive integers. In the target system, the first The horizontal coordinates of the nodes of each device on the canvas. Indicates the first The vertical coordinates of the nodes of each device on the canvas. Indicates the first The layer sequence number of each device. Indicates the first The floor number of each device Indicates the first The width of each device Indicates the first The height of each device. This refers to the preset horizontal spacing between devices on the canvas. The preset vertical spacing between devices is indicated on the canvas. Based on the edge set of each device, the devices are layered to determine the layer number of each device, including the following steps S311 to S316: S311. For each device, count the total number of incoming edges in the corresponding edge set, and use this total number as the corresponding current in-degree, then execute step S312; S312. Initialize integer variables. Then execute step S313; S313. Add all devices with a current in-degree of zero to the first... In the set of devices in the layer, then execute step S314; S314. For the device set in the layer... For each device in the device set of a layer, the outgoing edges in the corresponding edge set are traversed sequentially as follows: First, determine a device corresponding to the target node of the currently traversed outgoing edge; then, decrement the current in-degree of that device by 1; then, check if the current in-degree of that device is zero. If it is, add that device to the layer. In the set of devices in the layer, iterate through the next outgoing edge; otherwise, iterate directly through the next outgoing edge, and finally execute step S315; S315. Determine the first... Is the device set of the layer empty? If yes, proceed to step S316; otherwise, make... Increment by 1, then return to step S314; S316. End layering, and for each device, use the sequence number of the corresponding layer as the corresponding layer number; The edge crossing number minimization strategy includes: adjusting the left-to-right order of all devices within two adjacent layers to minimize the total number of device groups that satisfy the following edge crossing conditions: the device group includes a first device, a second device, a third device, and a fourth device, the first device and the second device are respectively located in one of the two adjacent layers, the third device and the fourth device are respectively located in the other of the two adjacent layers, the first device and the third device are the source node and target node of one edge to each other, the second device and the fourth device are the source node and target node of another edge to each other, and there is a left-to-right sequence number of the first device that is less than the left-to-right sequence number of the second device and a left-to-right sequence number of the third device that is greater than the left-to-right sequence number of the fourth device, or there is a left-to-right sequence number of the first device that is greater than the left-to-right sequence number of the second device and a left-to-right sequence number of the third device that is less than the left-to-right sequence number of the fourth device; For each device, at the position on the canvas and at the corresponding node coordinates, the corresponding set of objects is rendered as the corresponding visual node element; Based on the edge sets of each device, connection rendering is also performed on the canvas to obtain visual connection elements for connecting the visual node elements; All the visual node elements and all the visual connection elements on the canvas are output as the configuration diagram of the target system.

2. The method for automatically generating system configuration diagrams according to claim 1, characterized in that, The layout algorithm employs a force-directed algorithm, a grid layout algorithm, or a rule-based arrangement algorithm.

3. The method for automatically generating system configuration diagrams according to claim 1, characterized in that, Before outputting the configuration diagram of the target system, the method further includes: In response to basic element operations performed by the user from the human-computer interaction interface, the pose of the visual node element or the visual connecting line element is adjusted, wherein the basic element operations include element dragging, element scaling or element rotation. And / or, in response to attribute editing operations from the human-computer interaction interface and performed by the user, the visual node element is rendered and updated, wherein the attribute editing operations include node icon modification operations, node label modification operations, or node color modification operations; And / or, in response to a layout optimization operation performed by the user from the human-computer interaction interface, for multiple visual node elements selected by the operation and located in the layout area, the new coordinates of the nodes on the canvas of the corresponding device are recalculated using the layout algorithm based on the edge set of the corresponding device and the visual attributes in the object set, and the rendering is updated based on the calculation results.

4. A system configuration diagram automatic generation device, characterized in that, It includes a model file acquisition unit, a model file parsing unit, a node coordinate calculation unit, a node element rendering unit, a connection element rendering unit, and a configuration diagram output unit; The model file acquisition unit is used to acquire the object model files of each device in the target system, wherein the target system is a heating, ventilation and air conditioning system or an industrial control system, and the object model files contain device node information and topology information. The device node information contains device type, unique identifier and / or visual attributes, and the topology information contains the connection relationship between nodes and physical / logical location parameters. The model file parsing unit is communicatively connected to the model file acquisition unit and is used to parse the corresponding object model file for each device to obtain the corresponding object set and edge set. The object set includes a unique identifier, type and visualization attribute, and the edge set includes all outgoing edges with the corresponding device node as the source node and / or all incoming edges with the corresponding device node as the target node. The node coordinate calculation unit, communicatively connected to the model file parsing unit, is used to calculate the node coordinates of each device on the canvas using a layout algorithm based on the edge set of each device and the visual attributes in the object set. Specifically, this includes: layering and sorting each device within each layer based on its edge set to determine the layer number and in-layer sequence of each device; wherein, the in-layer sorting refers to adjusting the left-to-right order of all devices within a layer using a strategy that minimizes the number of edge intersections; and for each device, extracting its corresponding height and width from its corresponding visual attributes, and calculating the node coordinates of the corresponding device on the canvas according to the following formula: In the formula, Represents positive integers. In the target system, the first The horizontal coordinates of the nodes of each device on the canvas. Indicates the first The vertical coordinates of the nodes of each device on the canvas. Indicates the first The layer sequence number of each device. Indicates the first The floor number of each device Indicates the first The width of each device Indicates the first The height of each device. This refers to the preset horizontal spacing between devices on the canvas. The preset vertical spacing between devices is indicated on the canvas. Based on the edge set of each device, the devices are layered to determine the layer number of each device, including the following steps S311 to S316: S311. For each device, count the total number of incoming edges in the corresponding edge set, and use this total number as the corresponding current in-degree, then execute step S312; S312. Initialize integer variables. Then execute step S313; S313. Add all devices with a current in-degree of zero to the first... In the set of devices in the layer, then execute step S314; S314. For the device set in the layer... For each device in the device set of a layer, the outgoing edges in the corresponding edge set are traversed sequentially as follows: First, determine a device corresponding to the target node of the currently traversed outgoing edge; then, decrement the current in-degree of that device by 1; then, check if the current in-degree of that device is zero. If it is, add that device to the layer. In the set of devices in the layer, iterate through the next outgoing edge; otherwise, iterate directly through the next outgoing edge, and finally execute step S315; S315. Determine the first... Is the device set of the layer empty? If yes, proceed to step S316; otherwise, make... Increment by 1, then return to step S314; S316. End layering, and for each device, use the sequence number of the corresponding layer as the corresponding layer number; The edge crossing number minimization strategy includes: adjusting the left-to-right order of all devices within two adjacent layers to minimize the total number of device groups that satisfy the following edge crossing conditions: the device group includes a first device, a second device, a third device, and a fourth device, the first device and the second device are respectively located in one of the two adjacent layers, the third device and the fourth device are respectively located in the other of the two adjacent layers, the first device and the third device are the source node and target node of one edge to each other, the second device and the fourth device are the source node and target node of another edge to each other, and there is a left-to-right sequence number of the first device that is less than the left-to-right sequence number of the second device and a left-to-right sequence number of the third device that is greater than the left-to-right sequence number of the fourth device, or there is a left-to-right sequence number of the first device that is greater than the left-to-right sequence number of the second device and a left-to-right sequence number of the third device that is less than the left-to-right sequence number of the fourth device; The node element rendering unit is communicatively connected to the model file parsing unit and the node coordinate calculation unit, respectively, and is used to render the corresponding object set as the corresponding visual node element for each device, on the canvas and at the corresponding node coordinate position. The connection element rendering unit is communicatively connected to the model file parsing unit and the node element rendering unit, respectively, and is used to perform connection rendering on the canvas according to the edge set of each device to obtain visual connection elements for connecting the visual node elements. The configuration diagram output unit is communicatively connected to the node element rendering unit and the connection element rendering unit, respectively, and is used to output all the visual node elements and all the visual connection elements on the canvas as the configuration diagram of the target system.

5. A computer device, characterized in that, The system includes a memory, a processor, and a transceiver connected in sequence for communication. The memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the automatic generation method of system configuration diagram as described in any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that... The computer-readable storage medium stores instructions that, when executed on a computer, perform the automatic generation method for system configuration diagrams as described in any one of claims 1 to 3.

7. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or the instructions are executed by the computer, they implement the automatic generation method of system configuration diagram as described in any one of claims 1 to 3.