A C#-based pipe network system topology graph construction method and computer equipment

CN117709034BActive Publication Date: 2026-09-25POWER CHINA KUNMING ENG CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311743681.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-18
Publication Date
2026-09-25
Estimated Expiration
2043-12-18

AI Technical Summary

Technical Problem

[0003]在现有技术中,由于供水、供电管网繁多且复杂,导致水电管网布置工作量大,并且水电管网还会因修建整改而发生变化,造成历史数据辨识的模型与现实管网存在一定差异,需要实时更新数据库中水电管网的基础属性数据和重新执行模拟计算的相应配置,导致传统的水电管网布置方式难以满足高效建模需求

Benefits of technology

[0026]1、本发明基于C#进行水电管网系统拓扑图形的构建,C#具有语法简单、易于学习的特点,结合winform软件设计的可视化、快捷性的特点,能够快速开发应用软件,通过拾取、放置、拖拽等简单操作就能生成水电站复杂的管网系统的拓扑布置,还能够为每个水电构件绑定参数,满足水电管网布置的仿真模拟,可收集所有管网元素的参数信息,支持管网拓扑模型及参数的导入和导出,为水电管网系统的布置计算等应用场景提供了数据基础。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117709034B_ABST
    Figure CN117709034B_ABST
Patent Text Reader

Abstract

The application discloses a kind of C#-based pipe network system topological graph construction method, comprising the following steps: S1: the component objectification commonly used in water and electricity pipe network, each component corresponds a C# class;S2: each component model is automatically assigned a unique GUID when creating;S3: using the winform program developed by C+ GDI drawing;S4: automatically store the parent component and child component of component model to data entity;S5: each component model and parameter are associated according to GUID;S6: provide data file import after restoring the topological graph and parameter of entire pipe network.The application is based on C# to construct water and electricity pipe network system topological graph, meets the simulation of water and electricity pipe network layout, can collect the parameter information of all pipe network elements, supports the import and export of pipe network topological model and parameter, provides data basis for water and electricity pipe network system layout calculation and other application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water conservancy and hydropower pipeline network systems, and more specifically to a method and computer equipment for constructing pipeline network topology diagrams based on C#. Background Technology

[0002] my country's hydropower construction is developing rapidly, and hydropower systems are also growing and expanding accordingly. Hydropower systems are complex nonlinear dynamic systems integrating water, machinery, and electrical characteristics. Their water pipeline layout is complex; however, a rational pipeline network layout can improve economic efficiency while ensuring the safe and stable operation of the power station.

[0003] In existing technologies, the large number and complexity of water and power supply networks result in a large workload for network layout. Furthermore, the networks can change due to construction and renovation, leading to discrepancies between historical data-based models and the actual networks. This necessitates real-time updates to the basic attribute data of the water and power networks in the database and re-execution of the corresponding simulation calculations. Consequently, traditional water and power network layout methods are insufficient to meet the demands of efficient modeling. Summary of the Invention

[0004] The present invention provides a C#-based method and computer equipment for simulating and collecting parameter information of all pipeline elements, visualizing, and constructing pipeline system topology graphs, which can at least solve one of the above-mentioned technical problems.

[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: a method for constructing a pipeline network system topology graph based on C#, comprising the following steps:

[0006] S1: Using C#'s object-oriented approach, commonly used components in the water and electricity pipeline network are objectified, with each component corresponding to a C# class;

[0007] S2: Automatically assign a unique GUID to each component model when it is created. The unique GUID can be used to locate the position of the component in the entire topology and retrieve the parameter information related to the component.

[0008] S3: A WinForms application developed in C# for GDI+ drawing, which draws the topology of the entire pipeline system onto the interface. GDI+ drawing includes model picking, placement, dragging, deletion, translation, and model parameter mounting.

[0009] S4: When placing component models, the parent and child components of the component models are automatically stored in the data entity according to the placement position of the component models, forming the pipeline topology relationship;

[0010] S5: Use C# parameter classes to separate component models and parameters, and associate each component model and parameter with a GUID;

[0011] S6: Use the Document class serialization method to save the topology and parameters of the pipeline system to a data file, and provide the ability to restore the topology and parameters of the entire pipeline network after importing the data file.

[0012] Furthermore, the commonly used components in S1 include: pipes, upper reservoir, lower reservoir, internal nodes, branch pipes, pressure regulating chambers, and water turbines.

[0013] Furthermore, the C# classes corresponding to the components in S1 include the model base class CEntity and various hydropower models that inherit from the model base class, including: pipe class CLine, upper reservoir class CUpperRev, lower reservoir class CDownRev, internal node class CNode, branch pipe class CTripipes, surge tank class CSurgeTank, and turbine class CHydroMechine.

[0014] Furthermore, the GDI+ drawing in S3 includes:

[0015] Model picking: Select a component model from the model area provided in the interface. This indicates that the component model has been picked and is ready for placement.

[0016] Placement: Place the selected component model at a specified location in the drawing area by clicking the mouse;

[0017] Drag allows you to click to select a placed component model, or select a group of placed component models by dragging;

[0018] Translation involves moving the entire placed topology horizontally or vertically.

[0019] Model parameter mounting: Double-clicking a placed component model will bring up the parameter input interface for that component model, and the parameters are bound to the component model through GUID.

[0020] Furthermore, S4 further includes:

[0021] S41: Search for the parent node in the topology. After the component model is placed, determine whether the starting coordinates of the pipeline are located within other nodes. If so, it means that the node is the parent node of the pipeline and the parent node is recorded.

[0022] S42: Search for child nodes in the topology. After the component model is placed, determine whether the endpoint coordinates of the pipeline are located within other nodes. If so, it means that the node is a child node of the pipeline and the child node is recorded.

[0023] S43: Automatically update parent and child nodes. After completing any operation in S3, it is necessary to re-examine the parent and child node relationships of all component models.

[0024] A computer device includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the above-described construction method.

[0025] The beneficial effects of this invention are reflected in:

[0026] 1. This invention is based on C# for constructing the topology diagram of hydropower pipeline network system. C# has the characteristics of simple syntax and easy learning. Combined with the visualization and speed of WinForms software design, it can quickly develop application software. Through simple operations such as picking, placing, and dragging, the topology layout of complex pipeline network system of hydropower station can be generated. It can also bind parameters to each hydropower component to meet the simulation of hydropower pipeline network layout. It can collect parameter information of all pipeline elements, and supports the import and export of pipeline network topology model and parameters, providing a data foundation for application scenarios such as layout calculation of hydropower pipeline network system.

[0027] 2. This invention provides a C#-based method for constructing a pipeline network topology graph, namely "drag and drop components → connect pipelines → identify parent and child components → bind component parameters → export pipeline topology", which has at least the following advantages:

[0028] ① By picking and placing components in the pipeline topology, the position of one or more nodes can be dragged and adjusted.

[0029] ② When placing the pipe connection components, the topology recognition method will be automatically triggered to identify and record the position of each node in the pipe network topology, as well as its parent and child nodes in the pipe network;

[0030] ③ Double-clicking any node allows you to input and edit its parameters;

[0031] ④ Data on the pipeline topology and data for each node can be imported and exported. Attached Figure Description

[0032] Figure 1 This is a schematic diagram of the construction method of an embodiment of the present invention.

[0033] Figure 2 This is a structural block diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0034] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. In the absence of conflict, the embodiments and features in the embodiments of this application can be combined with each other. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. It should be noted that the meaning of "and / or" throughout the text includes three parallel solutions. Taking "A and / or B" as an example, it includes solution A, solution B, or a solution that satisfies both A and B. Additionally, "multiple" refers to two or more. Furthermore, C# in this application is an object-oriented high-level programming language released by Microsoft in February 2000, running on the .NET Framework and .NET Core (fully open source, cross-platform). It is an object-oriented programming language derived from C and C++. WinForms is a visual software.

[0035] See Figure 1 This invention provides a method for constructing a pipeline network system topology graph based on C#, including the following steps:

[0036] S1: Using C#'s object-oriented approach, commonly used components in the water and electricity pipeline network are objectified, with each component corresponding to a C# class;

[0037] S2: Automatically assign a unique GUID to each component model when it is created. The unique GUID can be used to locate the component's position in the entire topology and retrieve the component's related parameter information.

[0038] S3: A WinForms application developed in C# for GDI+ drawing, which draws the topology of the entire pipeline system onto the interface. GDI+ drawing includes model picking, placement, dragging, deletion, translation, and model parameter mounting.

[0039] S4: When placing component models, the parent and child components of the component models are automatically stored in the data entity according to the placement position of the component models, forming the pipeline topology relationship;

[0040] S5: Use C# parameter classes to separate component models and parameters, and associate each component model and parameter with a GUID;

[0041] S6: Use the Document class serialization method to save the topology and parameters of the pipeline system to a data file, and provide the ability to restore the topology and parameters of the entire pipeline network after importing the data file.

[0042] This invention constructs the topology diagram of a hydropower pipeline network system based on C#. C# is characterized by its simple syntax and ease of learning. Combined with the visualization and speed features of WinForms software design, it enables rapid development of application software. Through simple operations such as picking, placing, and dragging, the topology layout of complex pipeline network systems of hydropower stations can be generated. It can also bind parameters to each hydropower component to meet the simulation requirements of hydropower pipeline network layout. It can collect parameter information of all pipeline elements and supports the import and export of pipeline network topology models and parameters, providing a data foundation for application scenarios such as layout calculation of hydropower pipeline network systems.

[0043] In this embodiment, the commonly used components in S1 include: pipes, upper reservoir, lower reservoir, inner node, branch pipe, pressure regulating chamber and water turbine.

[0044] In this embodiment, the C# classes corresponding to the components in S1 include the model base class CEntity and various hydropower models that inherit from the model base class, including: pipe class CLine, upper reservoir class CUpperRev, lower reservoir class CDownRev, internal node class CNode, branch pipe class CTripipes, surge tank class CSurgeTank, and turbine class CHydroMechine.

[0045] In this embodiment, the attributes of each class are as follows:

[0046] The model base class CEntity is the base class for all component models. It contains common attributes of some model components. The attribute table of the model base class is shown in Table 1.

[0047] GUID Component number Unique Identifier m_ControlType Control Type / ParentControlGuid Parent control number set / ChildControlGuid Child control number set / ControlBeginPoint Control Start / ControlEndPoint Control endpoint / IsSelected Selected? / Icon icon / Lable Label /

[0048] Table 1 shows the attribute table of the model base class. The pipe class CLine is used to express the parameters of the water and electricity transmission pipeline. The attribute table of the pipe class is shown in Table 2.

[0049] pipeMaterial Pipe materials / pipeSupport Support form / pipeForm Pipe wall type / m_Diameter Pipe inner diameter Unit m m_WaveSpeed Pipe wave velocity Unit m / s m_Modulus Pipe wall elastic modulus unit MPa m_Poission Poisson's ratio of pipes unit MPa m_LinerModulus Tunnel building material elastic modulus / m_WallThickness Pipe wall thickness Unit m m_sita included angle / m_Length length Unit m m_HeadLoss Head loss / BeginSectionType Front node cross section form / EndSectionType Rear node cross section form / DownRev_level water level of downstream reservoir /

[0050] Table 2. Attribute Table for Pipe Class

[0051] The Upper Reservoir class, CuperRev, is used to express the parameters of the upstream reservoir of a hydropower project. The attribute table for the Upper Reservoir class is shown in Table [Table Number Missing].

[0052] UpperLevel Upstream water level Unit m LocalLoss Localized damage at the inlet / UpperrevNo Upstream Reservoir Number / DownRev_level water level of downstream reservoir /

[0053] Table 3 shows the attribute table of the library class.

[0054] The downstream reservoir class CDownRev is used to express the parameters of the downstream reservoir of the hydropower project. The attribute table of the downstream reservoir class is shown in Table 4.

[0055] DownLevelType Lower Library Type / Level downstream constant water level Unit m LocalLoss Local loss coefficient /

[0056] Table 4 shows the attribute table of the library class.

[0057] The internal node class CNode represents a relay in the pipeline and has no extended properties;

[0058] The branch pipe class CTripipes is used to express the node parameters of pipe branching in hydropower networks. The attribute table of the branch pipe class is shown in Table 5.

[0059] PipeInNo Number of pipes flowing in / PipeOutNo Number of outflowing pipes /

[0060] Table 5. Attribute Table for Branch Pipes

[0061] The surge tank class CSurgeTank is used to express the parameters of surge tanks in hydropower networks. The attribute table of the surge tank class is shown in Table 6.

[0062] TankType Pressure regulating chamber type / isConnection Is the upper part connected? / PointNumber Elevation and area points / LocalLoss Local loss coefficient / DownRev_level water level of downstream reservoir Unit m

[0063] Table 6 Attribute Table for Pressure Regulating Chambers

[0064] The class CHydroMechine is used to express the parameters of water turbines in hydropower networks. The attribute table of the water turbine class is shown in Table 7.

[0065]

[0066]

[0067] Table 7 Attribute Table for Water Turbines

[0068] Create a Document class to store the model's topology and parameter information. See Table 8 for the attribute table of the Document class.

[0069] CEntityList Control topology information / CLineList Pipeline parameter information / CUpperRevList Upper Library Parameter Information / CDownRevList Lowering the database parameter information / CNodeList Internal section parameter information / CTripipesList Branch pipe parameter information / CSurgeTankList Pressure regulating chamber parameter information / CValveList Valve parameter information / CValveList Hydro turbine parameter information /

[0070] Table 8. Attribute Table for Document Classes

[0071] In this embodiment, the GDI+ drawing in S3 includes:

[0072] Model picking: Select a component model from the model area provided in the interface. This indicates that the component model has been picked and is ready for placement.

[0073] Placement: Place the selected component model at a specified location in the drawing area by clicking the mouse;

[0074] Drag allows you to click to select a placed component model, or select a group of placed component models by dragging;

[0075] Translation involves moving the entire placed topology horizontally or vertically.

[0076] Model parameter mounting: Double-clicking a placed component model will bring up the parameter input interface for that component model, and the parameters are bound to the component model through GUID.

[0077] In this embodiment, S4 further includes:

[0078] S41: Search for the parent node in the topology. After the component model is placed, determine whether the starting coordinates of the pipeline are located within other nodes. If so, it means that the node is the parent node of the pipeline and the parent node is recorded.

[0079] S42: Search for child nodes in the topology. After the component model is placed, determine whether the endpoint coordinates of the pipeline are located within other nodes. If so, it means that the node is a child node of the pipeline and the child node is recorded.

[0080] S43: Automatically update parent and child nodes. After completing any operation in S3, it is necessary to re-examine the parent and child node relationships of all component models.

[0081] In this embodiment, when placing the component model, it is determined whether the boundary is connected to other component models, and the parent and child components of each component model are recorded and stored. In subsequent calculations, it is not necessary to traverse the entire topology to search for parent and child nodes.

[0082] See Figure 2 This invention also provides a computer device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the above-described construction method. The steps of the construction method here can be the steps in the construction methods of the various embodiments described above.

[0083] In summary, this invention constructs the topology diagram of a hydropower pipeline network system based on C#. C# is characterized by its simple syntax and ease of learning. Combined with the visualization and speed features of WinForms software design, it enables rapid development of application software. Through simple operations such as picking, placing, and dragging, the topology layout of complex pipeline networks in hydropower stations can be generated. It can also bind parameters to each hydropower component to meet the simulation requirements of hydropower pipeline network layout. It can collect parameter information of all pipeline elements and supports the import and export of pipeline topology models and parameters, providing a data foundation for application scenarios such as layout calculation of hydropower pipeline networks.

[0084] It should be understood that the examples and embodiments described herein are for illustrative purposes only and are not intended to limit the invention. Those skilled in the art can make various modifications or changes based on them. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.

Claims

1. A method for constructing a topology graph of a pipeline system based on C#, characterized in that, Includes the following steps: S1: Using C#'s object-oriented approach, commonly used components in the water and electricity pipeline network are objectified, with each component corresponding to a C# class; S2: Automatically assign a unique GUID to each component model when it is created. The unique GUID can be used to locate the component's position in the entire topology and retrieve the component's related parameter information. S3: A WinForms application developed in C# for GDI+ drawing, which draws the topology of the entire pipeline system onto the interface. GDI+ drawing includes model picking, placement, dragging, deletion, translation, and model parameter mounting. S4: When placing component models, the parent and child components of the component models are automatically stored in the data entity according to the placement position of the component models, forming the pipeline topology relationship; S5: Use C# parameter classes to separate component models and parameters, and associate each component model and parameter with a GUID; S6: Use the Document class serialization method to save the topology and parameters of the pipeline system to a data file, and provide the ability to restore the topology and parameters of the entire pipeline after importing the data file; The commonly used components in S1 include: pipes, upper reservoir, lower reservoir, internal nodes, branch pipes, pressure regulating chambers, and water turbines; S4 further includes: S41: Search for the parent node in the topology. After the component model is placed, determine whether the starting coordinates of the pipeline are located within other nodes. If so, it means that the node is the parent node of the pipeline and the parent node is recorded. S42: Search for child nodes in the topology. After the component model is placed, determine whether the endpoint coordinates of the pipeline are located within other nodes. If so, it means that the node is a child node of the pipeline and the child node is recorded. S43: Automatically update parent and child nodes. After completing any operation in S3, it is necessary to re-examine the parent and child node relationships of all component models.

2. The method for constructing a pipeline network system topology graph based on C# as described in claim 1, characterized in that, The C# classes corresponding to the components in S1 include the model base class CEntity and various hydropower models that inherit from the model base class, including: pipe class CLine, upper reservoir class CUpperRev, lower reservoir class CDownRev, internal node class CNode, branch pipe class CTripipes, surge tank class CSurgeTank, and turbine class CHydroMechine.

3. The method for constructing a pipeline network system topology graph based on C# as described in claim 1, characterized in that, The GDI+ drawing in S3 includes: Model picking: Select a component model from the model area provided in the interface. This indicates that the component model has been picked and is ready for placement. Placement: Place the selected component model at a specified location in the drawing area by clicking the mouse; Drag and click to select a placed component model, or select a group of placed component models by dragging and clicking; Translation involves moving the entire placed topology horizontally or vertically. Model parameter mounting: Double-clicking a placed component model will bring up the parameter input interface for that component model, and the parameters are bound to the component model through GUID.

4. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method as claimed in any one of claims 1-3.

Citation Information

Patent Citations

  • General hydropower station group topological graph generation method based on improved graph theory algorithm and application

    CN111860967A

  • Topology information system for a managed world

    US20040059812A1