Method, device and storage medium for automatically drawing electrical drawings
By using the ring, chain and tree connection method combined with icons of different installation methods, and using algorithms to optimize the path, the drawing efficiency and error problems caused by complex line connections in electrical design are solved, and efficient automatic drawing of electrical drawings is achieved.
Patent Information
- Application Number
- CN202111350758.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-15
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2041-11-15
AI Technical Summary
In traditional electrical design, the complex circuit connection structure leads to low drawing efficiency and error-prone, and the existing methods are not applicable in complex circuit connections.
The ring connection method, chain connection method and tree connection method are used to combine multiple sets of icons with different installation methods to automatically draw electrical drawings, and the path is optimized using TSP, ant colony, genetic, annealing and particle group algorithms.
The efficiency and accuracy of electrical drawings are improved, and the floor wiring of electrical drawings and automatic drawing of system drawings is realized.
Smart Images

Figure CN114445518B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electrical design, and more particularly to a method, device and storage medium for automatically drawing electrical drawings. Background Art
[0002] In building electrical design, electrical system diagrams and electrical floor plans are common types of electrical drawings. An electrical floor plan shows the layout of electrical equipment and wiring on the building surface, including the location of electrical equipment and the routing of cables. An electrical system diagram is a schematic diagram that depicts the relationships between various cables and electrical equipment (including the components within those equipment).
[0003] Traditional electrical design drawings are manually created using computer-aided design software. This involves drawing icons for each electrical device and the wiring between them. However, in real-world projects, the sheer number of electrical devices, the complex design and construction specifications, and the complex wiring connections make drawing a labor-intensive process, prone to errors, and inefficient.
[0004] Existing technology discloses a method that includes determining a device object and creating an EPLAN drawing template for the device object; creating a device tree specification and EPLAN drawing conversion rules based on the EPLAN drawing template for the device object; converting project planning content into a device tree; and generating electrical drawings for the devices in the device tree based on the EPLAN drawing conversion rules. Applying the drawing template only allows for the creation of drawings in a fixed format, making this method unsuitable for complex circuit connection structures. Summary of the Invention
[0005] The present invention provides a method, device and storage medium for automatically drawing electrical drawings to solve the technical defects of the existing drawing work being prone to errors and low drawing efficiency when the circuit connection structure is complex.
[0006] In order to achieve the above invention objectives, the technical solution adopted is:
[0007] A method for automatically drawing electrical drawings comprises the following steps:
[0008] S1: Create icons of multiple electrical devices to form an icon group;
[0009] S2: Apply the ring connection method, chain connection method, and tree connection method to the icon group and come up with three connection schemes;
[0010] S3: Automatically draw electrical drawings based on three connection schemes.
[0011] In the above scheme, different connection schemes are obtained for the equipment icons in the electrical drawings using the ring connection method, chain connection method, and tree connection method respectively. Moreover, for the same connection method, multiple groups of icons with different installation methods are combined to realize the automatic drawing of the plane wiring and system diagram of the electrical drawings, greatly improving the efficiency and accuracy of the drawing.
[0012] Preferably, in step S1, icons of different types are created and divided into different icon groups according to different installation methods.
[0013] Preferably, in step S2, the ring connection method includes the following steps:
[0014] S211: Select several icon groups that need to be connected in a ring;
[0015] S212: using the shortest path algorithm of TSP, determining a first ring connection scheme between the first icon groups;
[0016] S213: Determine the first icon of the first ring connection scheme, and start sorting the icons one by one until the connection returns to the first icon, record the code of each icon, and generate a first icon sorting table;
[0017] S214: traverse each icon in the second icon group and record the third icon code of each icon closest to the first icon group;
[0018] S215: Duplicate the code of the third icon in the first icon sorting table into two, insert the code of the second icon between the two identical codes, to form a second icon sorting table, and so on;
[0019] S216: Counting the number of icons in the second sorting table in order, and adding a code of an isolation module after a certain number of icons, to form a third sorting table of ring wiring;
[0020] S217: Each icon records where it comes from and where it leads to, and obtains a first connection plan.
[0021] Preferably, in step S212, the shortest path algorithm of the TSP includes but is not limited to ant colony algorithm, annealing algorithm, genetic algorithm and particle ensemble algorithm.
[0022] Preferably, in step S2, the chain connection method includes the following steps:
[0023] S221: Select several icon groups that need to be connected in a chain;
[0024] S222: Determine the first root icon of the chain line in the icon group, search for and record the second root icon closest to the first root icon, then search for the third root icon closest to the second root icon, and so on;
[0025] S223: Each icon records where it comes from and where it leads to, and obtains a second connection plan.
[0026] Preferably, in step S2, the tree connection method includes the following steps:
[0027] S231: Determine a number of icon groups that need to be connected in a tree-like manner;
[0028] S232: Determine the root icon of the chain connection in the icon group, and perform tree connection using the shortest path solution of the tree connection obtained by the minimum spanning tree algorithm;
[0029] S233: Each icon records where it comes from and where it leads to, and a third connection plan is obtained.
[0030] Preferably, in step S232, the minimum spanning tree algorithm includes but is not limited to Kruskal algorithm and Prim algorithm.
[0031] Preferably, in step S3, electrical drawings are automatically drawn according to the first, second and third connection schemes. Specifically, when a system diagram is generated according to the first connection scheme, icons of the system diagram are generated in sequence according to the arrangement table, and the same blocks are merged and counted when drawing the system diagram; the second and third connection schemes draw a short line above the icon to connect to the respective system main lines.
[0032] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the method when executing the computer program.
[0033] A computer-readable storage medium stores a computer program, which implements the steps of the method when executed by a processor.
[0034] Compared with the prior art, the present invention has the following beneficial effects:
[0035] The present invention provides a method, device and storage medium for automatically drawing electrical drawings. Different connection schemes are obtained for device icons in the electrical drawings using a ring connection method, a chain connection method and a tree connection method. For the same connection method, multiple groups of icons with different installation methods are combined to achieve automatic drawing of plane wiring and system diagrams of electrical drawings, greatly improving drawing efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1is a flow chart of the method of the present invention;
[0037] Figure 2 is a flow chart of the ring connection method of the present invention;
[0038] Figure 3 is a flow chart of the chain connection method of the present invention;
[0039] Figure 4 A flowchart of the tree connection method of the present invention;
[0040] Figure 5 This is a schematic diagram of icon classification of the present invention;
[0041] Figure 6 A schematic diagram of an area of an icon group according to the present invention;
[0042] Figure 7 Schematic diagram of the shortest path algorithm of TSP of the present invention;
[0043] Figure 8 This is a schematic diagram of a first annular connection solution of the present invention;
[0044] Figure 9 A first schematic diagram of a first annular connection solution of the present invention;
[0045] Figure 10 This is a schematic diagram of the icon code of the present invention;
[0046] Figure 11 This is a schematic diagram of the isolation module of the present invention;
[0047] Figure 12 Insert a flow chart for the isolation module of the present invention;
[0048] Figure 13 An icon search diagram for the chain connection method of the present invention;
[0049] Figure 14 It is a minimum spanning tree algorithm flow chart of the present invention;
[0050] Figure 15 This is a schematic diagram of a third connection solution of the present invention;
[0051] Figure 16 This is a diagram of a fire alarm system according to the present invention. DETAILED DESCRIPTION
[0052] The accompanying drawings are for illustrative purposes only and are not to be construed as limiting this patent;
[0053] The present invention is further described below with reference to the accompanying drawings and embodiments.
[0054] Example 1
[0055] like Figure 1 、 Figure 2 、 Figure 3 and Figure 4 As shown, a method for automatically drawing electrical drawings includes the following steps:
[0056] S1: Create icons of multiple electrical devices to form an icon group;
[0057] S2: Apply the ring connection method, chain connection method, and tree connection method to the icon group and come up with three connection schemes;
[0058] S3: Automatically draw electrical drawings based on three connection schemes.
[0059] In the above scheme, different connection schemes are obtained for the equipment icons in the electrical drawings using the ring connection method, chain connection method, and tree connection method respectively. Moreover, for the same connection method, multiple groups of icons with different installation methods are combined to realize the automatic drawing of the plane wiring and system diagram of the electrical drawings, greatly improving the efficiency and accuracy of the drawing.
[0060] Preferably, in step S1, icons of different types are created and divided into different icon groups according to different installation methods; the icons are classified into at least:
[0061] A first icon group in a first electrical system with installation mode one (e.g., ceiling installation);
[0062] A second icon group in the first electrical system with installation mode two (e.g., wall installation);
[0063] The Nth icon group in the first electrical system with installation method N (e.g., ground installation);
[0064] The second electrical system, the third electrical system and so on.
[0065] Preferably, in step S2, the ring connection method includes the following steps:
[0066] S211: Select several icon groups that need to be connected in a ring;
[0067] S212: using the shortest path algorithm of TSP, determining a first ring connection scheme between the first icon groups;
[0068] S213: Determine the first icon of the first ring connection scheme, and start sorting the icons one by one until the connection returns to the first icon, record the code of each icon, and generate a first icon sorting table;
[0069] S214: traverse each icon in the second icon group and record the third icon code of each icon closest to the first icon group;
[0070] S215: Duplicate the code of the third icon in the first icon sorting table into two, insert the code of the second icon between the two identical codes, to form a second icon sorting table, and so on;
[0071] S216: Counting the number of icons in the second sorting table in order, and adding a code of an isolation module after a certain number of icons, to form a third sorting table of ring wiring;
[0072] In the above scheme, the connection requirements of certain electrical equipment require the addition of some safety devices, such as the isolation module of the automatic fire alarm system. It is required that an isolation module be added for no more than 32 devices on the connection line. In this way, when the fire alarm connection line is short-circuited in some devices, one end can be isolated, and the host communicates through the line at the other end to ensure that the entire line is not affected.
[0073] S217: Each icon records where it comes from and where it leads to, and obtains a first connection plan.
[0074] Preferably, in step S212, the shortest path algorithm of the TSP includes but is not limited to ant colony algorithm, annealing algorithm, genetic algorithm and particle ensemble algorithm.
[0075] Preferably, in step S2, the chain connection method includes the following steps:
[0076] S221: Select several icon groups that need to be connected in a chain;
[0077] S222: Determine the first root icon of the chain line in the icon group, search for and record the second root icon closest to the first root icon, then search for the third root icon closest to the second root icon, and so on;
[0078] S223: Each icon records where it comes from and where it leads to, and obtains a second connection plan.
[0079] Preferably, in step S2, the tree connection method includes the following steps:
[0080] S231: Determine a number of icon groups that need to be connected in a tree-like manner;
[0081] S232: Determine the root icon of the chain connection in the icon group, and perform tree connection using the shortest path solution of the tree connection obtained by the minimum spanning tree algorithm;
[0082] S233: Each icon records where it comes from and where it leads to, and a third connection plan is obtained.
[0083] Preferably, in step S232, the minimum spanning tree algorithm includes but is not limited to Kruskal algorithm and Prim algorithm.
[0084] Preferably, in step S3, electrical drawings are automatically drawn according to the first, second and third connection schemes. Specifically, when a system diagram is generated according to the first connection scheme, icons of the system diagram are generated in sequence according to the arrangement table, and the same blocks are merged and counted when drawing the system diagram; the second and third connection schemes draw a short line above the icon to connect to the respective system main lines.
[0085] Example 2
[0086] like Figure 5 As shown, the icons on the diagram are classified using the legend table. This example is divided into four categories:
[0087] The first category is for ceiling installation, which requires ring wiring icon category;
[0088] The second category is for wall mounting, which requires ring wiring icon category;
[0089] The third category is the icon category that requires chain wiring;
[0090] The fourth category is the icon category that requires tree wiring;
[0091] Specific connection method:
[0092] 1) If Figure 6 As shown, select the icon group of a certain area
[0093] like Figure 7 and Figure 8 As shown, by grouping icons in advance, the first icon group that needs to be connected in a ring is connected using the shortest path algorithm of TSP (such as ant colony algorithm, annealing algorithm, genetic algorithm, particle group algorithm, etc.) to determine the first ring connection scheme between the first icon groups;
[0094] like Figure 9 As shown, a first icon of a first ring connection scheme is determined;
[0095] Sort the icons one by one starting from the first icon until the line returns to the first icon, record the code of each icon, and generate the first icon sorting table (a1, a2, a3, a4...);
[0096] Traverse each icon in the second icon group and record the third icon code (b1) of each icon (second icon a2) closest to the first icon group, such as Figure 10 As shown;
[0097] Duplicate the code of the third icon in the first icon sorting table into two, and insert the second icon code (b1) between the two identical codes to form the second icon sorting table (a1, a2, b1, a2, a3, a4...)
[0098] And so on.
[0099] Each icon records where it comes from (icon additional code 1) and where it leads to (icon additional code 2) to obtain the first connection plan.
[0100] The connection requirements for some electrical equipment also require the addition of some safety devices, such as the isolation module of the automatic fire alarm system. It is required that an isolation module be added for no more than 32 devices on the connection line. In this way, when the fire alarm connection line is short-circuited in some devices, one end can be isolated, and the host communicates through the line at the other end to ensure that the entire line is not affected.
[0101] like Figure 11 and Figure 12 As shown, therefore, in the second sorting table, the number of icons is counted in order, and an isolation module code is added after a certain number of icons (for example, 25), and at the same time, a corresponding isolation module icon is added to the plan view.
[0102] In this way, the third sorting table of the final ring connection is formed.
[0103] (g1, a1, a2, b1, a2, a3, a4…a24, g2, a25…)
[0104] 2) If Figure 13 As shown, determine the icon group that needs chain connection. In this case, the icon group for tree connection is the third icon group.
[0105] Determine the root icon (fourth icon) of the chain connection scheme in the third icon group, search for and record the fifth icon closest to the fourth icon, then search for the sixth icon closest to the fifth icon... and so on;
[0106] Each icon records where it comes from (icon additional code 1) and where it leads to (icon additional code 2) to obtain the second connection plan.
[0107] 3) If Figure 14 and Figure 15 As shown, determine the icon group that needs tree wiring. In this case, the icon group for tree wiring is the fourth icon group.
[0108] Determine the root icon (the seventh icon) of the chain connection scheme in the fourth icon group, and use the minimum spanning tree algorithm (such as Kruskal algorithm, Prim algorithm, etc.) to obtain the overall shortest path scheme of the tree connection to perform tree connection; each icon records where it comes from (icon additional code 1) and where it leads to (icon additional code 2) to derive the third connection scheme.
[0109] like Figure 16 As shown, a fire alarm system diagram is automatically drawn according to the first, second and third connection schemes.
[0110] Among them, when generating a system diagram according to the first connection scheme, the system diagram icons are generated in sequence according to the arrangement table. Due to industry habits, the same blocks are merged and counted when drawing the system diagram, so a simple cumulative merging calculation is required.
[0111] The third connection solution only requires drawing a short line above the icon and connecting it to the respective system main line.
[0112] Example 3
[0113] This embodiment provides an electronic device, comprising: a memory storing executable program code; a processor coupled to the memory;
[0114] Among them, the processor calls the executable program code stored in the memory to execute a method for automatically drawing electrical drawings described in the above embodiments. It should be noted that the electronic device may also include a speaker module, a camera module, a display screen, a light projection module, a battery module, a wireless communication module (such as a mobile communication module, a Wi-Fi module, an RF circuit, a Bluetooth module, etc.), a sensor module (such as a proximity sensor, a pressure sensor, etc.), an input module (such as a microphone, an input button), and a user interface module (such as a charging interface, an external power supply interface, a card slot, a wired headphone interface, etc.) and other components not shown, which are not described in detail in this embodiment. The embodiment of the present application discloses a computer-readable storage medium that stores a computer program, wherein the computer program enables a computer to execute a method for automatically drawing electrical drawings described in the above embodiments.
[0115] Obviously, the above embodiments of the present invention are merely examples for the purpose of clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Those skilled in the art will appreciate that other variations or modifications can be made based on the above description. It is not necessary and impossible to enumerate all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the claims of the present invention.
Claims
1. A method for automatically drawing electrical drawings, characterized in that: The following steps are involved: S1: Create multiple icons of electrical devices to form an icon group; in step S1, create icons of different types and divide them into different icon groups according to different installation methods; S2: Apply the ring connection method, chain connection method, and tree connection method to the icon group to obtain three connection schemes; the first connection scheme is obtained according to the ring connection method, the second connection scheme is obtained according to the chain connection method, and the third connection scheme is obtained according to the tree connection method; In step S2, the ring connection method includes the following steps: S211: Select several icon groups that need to be connected in a ring; S212: using the shortest path algorithm of TSP, determining a first ring connection scheme between the first icon groups; S213: Determine the first icon of the first ring connection scheme, and start sorting the icons one by one until the connection returns to the first icon, record the code of each icon, and generate a first icon sorting table; S214: traverse each icon in the second icon group and record the third icon code of each icon closest to the first icon group; S215: Duplicate the code of the third icon in the first icon sorting table into two, insert the code of the second icon between the two identical codes, to form a second icon sorting table, and so on; S216: Counting the number of icons in the second sorting table in order, and adding a code of an isolation module after a certain number of icons, to form a third sorting table of ring wiring; S217: Each icon records where it comes from and where it leads to, and obtains a first connection plan; S3: Automatically draw electrical drawings according to three connection schemes; in step S3, automatically draw electrical drawings according to the first, second, and third connection schemes. When generating a system diagram according to the first connection scheme, the icons of the system diagram are generated in sequence according to the arrangement table, and the same blocks are merged and counted when drawing the system diagram; the second and third connection schemes draw a short line above the icon to connect to the respective system main lines.
2. A method for automatically drawing electrical drawings according to claim 1, characterized in that: In step S212, the shortest path algorithm of the TSP includes but is not limited to ant colony algorithm, annealing algorithm, genetic algorithm and particle ensemble algorithm.
3. The method for automatically drawing electrical drawings according to claim 1, wherein: In step S2, the chain connection method includes the following steps: S221: Select several icon groups that need to be connected in a chain; S222: Determine the first root icon of the chain line in the icon group, search for and record the second root icon closest to the first root icon, then search for the third root icon closest to the second root icon, and so on; S223: Each icon records where it comes from and where it leads to, and obtains a second connection plan.
4. A method for automatically drawing electrical drawings according to claim 3, characterized in that: In step S2, the tree connection method includes the following steps: S231: Determine a number of icon groups that need to be connected in a tree-like manner; S232: Determine the root icon of the chain connection in the icon group, and perform tree connection using the shortest path solution of the tree connection obtained by the minimum spanning tree algorithm; S233: Each icon records where it comes from and where it leads to, and a third connection plan is obtained.
5. The method for automatically drawing electrical drawings according to claim 4, characterized in that: In step S232, the minimum spanning tree algorithm includes but is not limited to Kruskal algorithm and Prim algorithm.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.