Drawing component automatic connection method, device, equipment and storage medium
By optimizing the connection paths of drawing components using a mixed integer programming model, the problem of connection conflicts in the automatic connection of drawing components by the A-Star algorithm is solved, thereby improving design efficiency and reducing costs.
Patent Information
- Application Number
- CN202210880018.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-25
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2042-07-25
AI Technical Summary
In existing technologies, the A-Star algorithm is prone to connection conflicts during the automatic connection of components in drawings, resulting in connection failures, low design efficiency, and high costs.
A mixed integer programming model is adopted. By processing the region in a grid, an integer programming model is established, and a mathematical solver is used to plan the connection path of each line. The optimal path and the influence of line intersection are comprehensively considered to optimize the connection path.
It has achieved the rationality and effectiveness of automatic connection of components in CAD drawings, improved design efficiency, and reduced calculation errors and design costs.
Smart Images

Figure CN115114712B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of architectural design construction, and particularly relates to a drawing component automatic connection method, device, equipment and storage medium. BACKGROUND
[0002] CAD construction drawing is a drawing made by AutoCAD software to represent the overall layout of a project, the external shape of a building, internal arrangement, structural construction, internal and external decoration, material method, and equipment and construction. In the electrical construction drawing of a building, the plan usually macroscopically describes the geographical position and main structure of a building, and highlights the description of electrical lines, while other pipelines such as water heating and gas lines do not appear on the electrical construction drawing.
[0003] The electrical plan is a plan shape, size, position and thickness of walls and columns, type of doors and windows, and plan arrangement and line direction of power distribution equipment and lighting equipment in a building, which is obtained by cutting the building along the horizontal direction of doors and windows, removing the upper part, and looking from the upper part to the lower part. According to the content represented by the plan, the plan is read along a line of power supply, incoming line, distribution box, outgoing line, and electrical appliance. In the reading process, the number, model, specification, installation position, and installation height of electrical equipment such as power supply, distribution box, socket, and switch are noted, and the laying position, laying method, laying path, and model of the wire are represented.
[0004] Path planning refers to a process of finding a motion path from a starting point to an ending point without collision around all obstacles in a working environment with obstacles, and the A-Star algorithm is an effective method commonly used to solve path planning problems. The A-Star algorithm introduces an evaluation function F(n) = G(n) + H(n) to evaluate the position node of the search, where G(n) represents the cost from the initial node to the current node n, and is called the cost function; H(n) represents the heuristic evaluation cost from the current node n to the target point, and is called the heuristic function. The key of the A-Star algorithm lies in the determination of the heuristic function, and different heuristic functions will have different effects on the A-Star algorithm. Applying the A-Star algorithm to the automatic connection of CAD drawing components can effectively solve the problems of low design efficiency, calculation error, and high design cost caused by the over-reliance of traditional drawing on the experience of electrical designers, and has high cost performance.
[0005] Although the A-Star algorithm can obtain an optimal path for automatic connection path search, the A-Star algorithm is prone to connection conflicts, which leads to the problem that subsequent connection cannot be successful. Figure 1As shown, after the first line is successfully connected, the second line cannot be connected to the target component.
[0006] The above is only used to assist in understanding the technical solutions of the present application, and does not represent the acknowledgement of the above as prior art. SUMMARY
[0007] The main purpose of the present application is to provide a drawing component automatic connection method, device, equipment and storage medium, aiming at solving the problem of connection conflict in the process of automatic connection of drawing components.
[0008] To achieve the above purpose, the present application provides a drawing component automatic connection method, which comprises the following steps:
[0009] Selecting the area to be connected, and grid processing the area to obtain grid points;
[0010] Establishing an integer programming model according to the coordinates of the grid points and the topological relationship between them, wherein the decision variable of the integer programming model is whether a directed arc of adjacent grid points is selected for a certain connection line;
[0011] Inputting parameters into the integer programming model, and using a mathematical solver to solve each connection line formed by the selected arcs.
[0012] Optionally, the objective function of the integer programming model is:
[0013]
[0014]
[0015] The constraint condition of the integer programming model is:
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
[0024] x ijkxijk represents a decision variable, k represents a route, i, j represent points on a route, and xijk takes 1 if route k is from point i to j, otherwise 0;
[0025] x jlk xil represents a decision variable, k represents a route, i, l represent points on a route, and xil takes 1 if route k is from point i to l, otherwise 0, wherein l is a neighboring point of i;
[0026] s k s represents a starting point of route k;
[0027] t k t represents a terminal point of route k;
[0028] xjs k k represents a decision variable of route k to the starting point;
[0029] xt k jk represents a decision variable of route k from the terminal point;
[0030] xs k jk represents a decision variable of route k from the starting point;
[0031] xit k k represents a decision variable of route k to the terminal point.
[0032] In addition, to achieve the above object, the application further provides a drawing component automatic connection device, which comprises:
[0033] A gridding module is configured to select a region to be connected and perform gridding processing on the region to obtain grid points;
[0034] An integer programming model establishing module is configured to establish an integer programming model according to the coordinates of the grid points and the topological relationship therebetween, wherein a decision variable of the integer programming model is a directed arc of a neighboring grid point selected by each connection line;
[0035] A connection module is configured to input parameters into the integer programming model and solve each connection line connected by each selected arc by using a mathematical solver.
[0036] Optionally, the objective function of the integer programming model is:
[0037]
[0038]
[0039] The constraint condition of the integer programming model is:
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048] wherein x ijk denotes a decision variable, k denotes a route, i, j denote points on the route, and takes 1 if route k goes from point i to j, otherwise takes 0;
[0049] x jlk denotes a decision variable, k denotes a route, i, j denote points on the route, and takes 1 if route k goes from point i to j, otherwise takes 0;
[0050] s k denotes the start point of route k;
[0051] t k denotes the end point of route k;
[0052] xjs k k denotes the decision variable of route k to the start point;
[0053] xt k jk denotes the decision variable of route k from the end point;
[0054] xs k jk denotes the decision variable of route k from the start point;
[0055] xit k k denotes the decision variable of route k to the end point.
[0056] In addition, to achieve the above object, the application further provides an automatic connection equipment for drawing components, which comprises a memory, a processor and an automatic connection program for drawing components stored in the memory and executable on the processor, and the automatic connection program for drawing components is configured to realize the method as described above.
[0057] In addition, to achieve the above object, the application further provides a storage medium, which stores an automatic connection program for drawing components, and the automatic connection program for drawing components realizes the method as described above when executed by a processor.
[0058] The automatic line connection method, device, equipment and storage medium for drawing components provided by the application propose to plan the line connection path of each line based on a mixed integer programming model, which can comprehensively consider the optimal path and the connection intersection influence, so that the automatic line connection of CAD drawing components is more reasonable and effective, and more suitable for the needs in actual engineering applications. BRIEF DESCRIPTION OF DRAWINGS
[0059] Figure 1 A schematic diagram of unsuccessful connection mentioned in the background section;
[0060] Figure 2 A structural schematic diagram of the drawing component automatic connection equipment of the hardware running environment related to the embodiment of the application;
[0061] Figure 3 A flowchart of the drawing component automatic connection method in the embodiment of the application;
[0062] Figure 4 A structural diagram of the drawing component automatic connection device in the embodiment of the application.
[0063] The implementation, functional features and advantages of the application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0064] It should be understood that the specific embodiments described herein are only used to explain the application, and are not used to limit the application.
[0065] Reference Figure 1 , Figure 1 A structural schematic diagram of the drawing component automatic connection equipment of the hardware running environment related to the embodiment of the application.
[0066] As Figure 2As shown in the figure, the drawing component automatic wiring device can include a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between the components. The user interface 1003 can include a display, an input unit such as a keyboard, and can also include a standard wired interface and a wireless interface. The network interface 1004 can optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wi-Fi) interface). The memory 1005 can be a high-speed random access memory (RAM) memory or a stable non-volatile memory (NVM) such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.
[0067] Those skilled in the art can understand that Figure 2 The structure shown in the figure does not constitute a limitation on the drawing component automatic wiring device, and can include more or fewer components than the figure, or combine certain components, or different component arrangements.
[0068] As Figure 2 As shown, the memory 1005 as a storage medium can include an operating system, a network communication module, a user interface module, and a drawing component automatic wiring program.
[0069] In Figure 2 In the drawing component automatic wiring device shown, the network interface 1004 is mainly used for data communication with the data multi-end synchronization processing device; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the drawing component automatic wiring device can be arranged in the drawing component automatic wiring device, and the drawing component automatic wiring device calls the drawing component automatic wiring program stored in the memory 1005 through the processor 1001, and executes the drawing component automatic wiring method provided by the embodiment of the application.
[0070] Based on the above hardware structure, the drawing component automatic wiring method embodiment of the application is proposed.
[0071] Referring to Figure 3 , Figure 3 is a flowchart of the drawing component automatic wiring method of the application.
[0072] The drawing component automatic wiring method includes the following steps:
[0073] S10, select the area to be connected, and grid the area to obtain grid points;
[0074] It should be noted that first, the area to be connected is selected and gridded, and all obstacles and start and end points of the to-be-connected line can be represented by coordinates on the grid points, and the topological relationship between the grid points is different in different scenarios, because the grid points in the connectable area are interconnected and have optional directed arcs, while the grid points in the area with obstacles cannot be interconnected. These coordinates and topological relationships between each other are the parameters of the integer programming model.
[0075] S20, establishing an integer programming model according to the coordinates of the grid points and the topological relationship therebetween, the decision variable of the integer programming model being whether a directed arc of adjacent grid points is selected for a line;
[0076] It should be noted that the integer programming model is established according to the coordinates of the grid points and the topological relationship therebetween, and the decision variable is whether a directed arc of adjacent grid points is selected for a line. The integer programming model ensures that each line is connected and does not cross each other through the constraint condition, and optimizes the line length and the number of turns of the line through the objective function.
[0077] S30, inputting the parameters into the integer programming model and using a mathematical solver to solve each line connected by the selected arcs.
[0078] It should be noted that the parameters including the decision variable, the constraint condition, and the target are input into the integer programming model to obtain each line connected by the selected arcs by using a mathematical solver.
[0079] The embodiment proposes to plan the line connection path of each line based on a mixed integer programming model, which can comprehensively consider the optimal path and the influence of line crossing, so that the automatic line connection of the CAD drawing component is more reasonable and effective, and is more suitable for the needs in actual engineering applications.
[0080] In an embodiment, the objective function of the integer programming model is:
[0081] Turn number optimization objective function:
[0082]
[0083] Total line length optimization objective function:
[0084]
[0085] The constraint condition of the integer programming model is:
[0086] (1) A grid point can flow in at most once
[0087]
[0088] (2) A grid point can only flow out at most once
[0089]
[0090] (3) An arc can only be used at most once
[0091]
[0092] (4) The inflow of a grid point is equal to the outflow
[0093]
[0094] (5) The start point has no inflow
[0095]
[0096] (6) The end point has no outflow
[0097]
[0098] (7) Each start point must have outflow
[0099]
[0100] (8) Each end point must have inflow
[0101]
[0102] where x ijk represents the decision variable, k represents the route, i and j represent the points on the route, and if the route k goes from point i to j, then it takes 1, otherwise it takes 0;
[0103] x jlk represents the decision variable, k represents the route, i and l represent the points on the route, and if the route k goes from point i to l, then it takes 1, otherwise it takes 0, where l is the adjacent point of i;
[0104] s k represents the start point of route k;
[0105] t k represents the end point of route k;
[0106] xjs k k represents the decision variable of route k to the start point;
[0107] xt k jk represents the decision variable of route k from the end point;
[0108] xsk jk represents a decision variable of route k from the starting point;
[0109] xit k k represents a decision variable of route k to the ending point.
[0110] The connection method based on the mixed integer programming model proposed in the embodiment can comprehensively consider the optimal path and the connection intersection influence, so that the automatic connection of the CAD drawing components is more reasonable and effective.
[0111] In addition, with reference to Figure 4 , the embodiment of the present application further provides a drawing component automatic connection device, which comprises:
[0112] A gridding module 10 is configured to select a region to be connected and perform gridding processing on the region to obtain grid points.
[0113] An integer programming model establishing module 20 is configured to establish an integer programming model according to the coordinates of the grid points and the topological relationship therebetween, wherein a decision variable of the integer programming model is a directed arc of a neighboring grid point selected by a certain connection line.
[0114] A connection module 30 is configured to input parameters into the integer programming model and solve each connection line connected by each selected arc by using a mathematical solver.
[0115] In an embodiment, an objective function of the integer programming model is:
[0116] A turning number optimization objective function is:
[0117]
[0118] A bus length optimization objective function is:
[0119]
[0120] A constraint condition of the integer programming model is:
[0121] (1) A grid point can flow in at most once
[0122]
[0123] (2) A grid point can flow out at most once
[0124]
[0125] (3) An arc can be used at most once
[0126]
[0127] (4) The inflow of the grid point is equal to the outflow
[0128]
[0129] (5) There is no inflow at the starting point
[0130]
[0131] (6) There is no outflow at the ending point
[0132]
[0133] (7) There is outflow at each starting point
[0134]
[0135] (8) There is inflow at each ending point
[0136]
[0137] wherein x ijk represents a decision variable, k represents a route, i and j represent points on a line, and if the route k is from point i to j, 1 is taken, otherwise 0 is taken;
[0138] x jlk represents a decision variable, k represents a route, i and j represent points on a line, and if the route k is from point i to j, 1 is taken, otherwise 0 is taken;
[0139] s k represents the starting point of the route k;
[0140] t k represents the ending point of the route k;
[0141] xjs k k represents the decision variable of the route k to the starting point;
[0142] xt k jk represents the decision variable of the route k from the ending point;
[0143] xs k jk represents the decision variable of the route k from the starting point;
[0144] xit k k represents the decision variable of the route k to the ending point.
[0145] The connection method based on the mixed integer programming model proposed in the embodiment can comprehensively consider the optimal path and the connection cross influence, so that the automatic connection of the CAD drawing components is more reasonable and effective.
[0146] In addition, technical details not described in detail in the present embodiment can be found in the automatic connection method of drawing components provided by any embodiment of the present application, which will not be described here.
[0147] In addition, the present embodiment also proposes a storage medium, wherein the storage medium stores the automatic connection program of drawing components, and the automatic connection program of drawing components is executed by the processor to realize the method as described above.
[0148] Since the present storage medium adopts all the technical solutions of the above-mentioned embodiments, it at least has all the beneficial effects brought by the technical solutions of the above-mentioned embodiments, which will not be described here.
[0149] In addition, it should be noted that in this paper, the term "includes", "contains" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or system including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or system. Without more limitations, the element defined by the sentence "includes a" does not exclude the presence of other identical elements in the process, method, article or system including the element.
[0150] The above-mentioned embodiment numbers of the present application are only for description, not representing the advantages and disadvantages of the embodiments.
[0151] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and necessary general hardware platform, of course, they can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application or the part that contributes to the prior art can be embodied in the form of software product, which is stored in a storage medium (such as read only memory (Read Only Memory, ROM) / RAM, magnetic disk, optical disk), including a plurality of instructions to make a terminal device (which can be a mobile phone, computer, node packaging device, or network device, etc.) execute the method described in each embodiment of the present application.
[0152] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent flow transformation made by using the content of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method of automatically linking drawing components, comprising: The method comprises the following steps: selecting a region to be connected, and griding the region to obtain grid points; establishing an integer programming model according to coordinates of the grid points and topological relations therebetween, a decision variable of the integer programming model being whether a directed arc of adjacent grid points is selected for a connecting line; inputting parameters into the integer programming model, and solving each connecting line connected by each selected arc by using a mathematical solver; a target function of the integer programming model being: a constraint condition of the integer programming model being: wherein, denotes a decision variable, denotes a route, , denotes a point on a route, if the route from point to then 1, otherwise 0; denotes a decision variable, denotes a route, , denotes a point on a route, if the route goes from point to , then take 1, otherwise take 0, where, is a neighbor of i; representing a route of the origin; representing a route of the end point; representing a route decision variable to the start point; representing a route decision variable from end point; representing a route decision variable from a start point; representing a route decision variable to end point.
2. An automatic drawing component linking apparatus, characterized by comprising: The device comprises: a griding module configured to select a region to be connected, and grid the region to obtain grid points; an integer programming model establishing module configured to establish an integer programming model according to coordinates of the grid points and topological relations therebetween, a decision variable of the integer programming model being whether a directed arc of adjacent grid points is selected for a connecting line; a connecting line module configured to input parameters into the integer programming model, and solve each connecting line connected by each selected arc by using a mathematical solver; a target function of the integer programming model being: a constraint condition of the integer programming model being: wherein, represents a route, , represents a point on the route, if the route from the point to then 1, otherwise 0; denotes a route, , denotes a point on the route, if the route from point to then 1, otherwise 0, where, is a neighbor of i; representing a route of the start point; representing a route of the end point; representing a route decision variable to the start point; representing a route decision variable from end point; representing a route decision variable from the start point; representing a route decision variable to end point.
3. An automatic blueprint assembly line apparatus, characterized by comprising: The drawing component automatic connecting equipment comprises a memory, a processor and a drawing component automatic connecting program stored on the memory and executable on the processor, and the drawing component automatic connecting program is configured to implement the method in claim 1.
4. A storage medium, characterized by The storage medium has the drawing component automatic connecting program stored thereon, and the drawing component automatic connecting program is implemented when executed by the processor to implement the method in claim 1.
Citation Information
Patent Citations
Automatic power grid thematic map model generating method based on multi-objective optimization
CN105138764A
Urban power distribution network line planning method and system considering real demand guidance
CN113343426A