Residential switch socket wiring design method, device, equipment and storage medium
By performing semantic recognition and geometric analysis on residential building drawings, a cabling channel network is constructed, path costs are calculated, and cabling schemes are generated and optimized. This solves the problem of low efficiency in traditional cabling design and enables fast and efficient cabling design.
Patent Information
- Application Number
- CN202611628956.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-21
- Publication Date
- 2026-11-24
AI Technical Summary
Traditional residential switch and socket wiring design methods are inefficient and cannot meet the needs of projects requiring rapid delivery.
By performing semantic recognition and geometric analysis on residential building drawings, a cabling channel network is constructed, path costs are calculated, multiple candidate cabling schemes are generated, and rule conflict detection and path adjustment are performed to optimize the cabling scheme.
Significantly shorten the design cycle, ensure that the solution meets engineering specifications, provide multiple options for decision-making, and improve design efficiency.
Smart Images

Figure CN123159249A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, equipment, and storage medium for designing wiring for residential switches and sockets. Background Technology
[0002] In the field of residential electrical detailed design, the wiring design of switches and sockets is a crucial step in the preparation of architectural electrical construction drawings. Traditional wiring design methods mainly rely on designers using CAD or BIM software for manual drawing. Designers need to manually plan the route from the distribution box to each switch and socket device based on the architectural drawings, manually mark the device locations, calculate cable usage, and draw construction drawings.
[0003] However, this manual design method is inefficient. Designers need to determine the route of each line one by one and repeatedly check whether it meets the engineering specifications such as door and window avoidance and cable spacing. Designing a wiring scheme for an ordinary residential house often takes several hours, which is difficult to meet the needs of projects with fast delivery. Summary of the Invention
[0004] The main objective of this invention is to solve the technical problem of low efficiency in existing residential switch and socket wiring design methods; This invention provides a residential switch and socket wiring design method, the method comprising: The input residential building drawings are subjected to semantic recognition and geometric analysis to obtain structured spatial data; Based on the wall locations and room boundaries in the structured spatial data, a wiring channel network containing a set of nodes and a set of edges is constructed; Based on the cabling channel network and preset cabling constraints, calculate the path cost from the power distribution equipment to each switch and socket device, and generate multiple candidate cabling schemes based on the path cost. The multiple candidate routing schemes are subjected to rule conflict detection, and the path adjustment processing is performed on the candidate routing schemes with conflicts based on the detection results, so as to obtain multiple optimized routing schemes and corresponding project files.
[0005] The present invention also provides a residential switch and socket wiring design device, the residential switch and socket wiring design device comprising: The drawing parsing module is used to perform semantic recognition and geometric analysis on the input residential building drawings to obtain structured spatial data; The channel construction module is used to construct a wiring channel network containing a set of nodes and a set of edges based on the wall locations and room boundaries in the structured spatial data. The path planning module is used to calculate the path cost from the power distribution equipment to each switch and socket device based on the wiring channel network and preset wiring constraints, and generate multiple candidate wiring schemes based on the path cost. The conflict handling module is used to perform rule conflict detection on the multiple candidate routing schemes, and to perform path adjustment processing on the candidate routing schemes with conflicts based on the detection results, so as to obtain multiple optimized routing schemes and corresponding project files.
[0006] The present invention also provides a residential switch and socket wiring design device, comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a line; the at least one processor invokes the instructions in the memory to cause the residential switch and socket wiring design device to perform the steps of the above-described residential switch and socket wiring design method.
[0007] The present invention also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the steps of the above-described residential switch and socket wiring design method.
[0008] The aforementioned residential switch and socket wiring design method, device, equipment, and storage medium obtain structured spatial data by performing semantic recognition and geometric analysis on residential building drawings; construct a wiring channel network based on the wall locations and room boundaries in the structured spatial data; calculate the path cost from the power distribution equipment to each switch and socket device based on the wiring channel network and preset wiring constraints, and generate multiple candidate wiring schemes based on the path cost; perform rule conflict detection on the multiple candidate wiring schemes, and adjust the paths of conflicting candidate wiring schemes according to the detection results, resulting in multiple optimized wiring schemes and corresponding engineering documents. This invention automatically weighs multiple engineering constraints through path cost calculation, generates multiple optional schemes for comparison and decision-making, and ensures that the schemes meet the specifications through automatic conflict detection and adjustment processing, significantly shortening the design cycle.
[0009] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0010] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0011] Figure 1This is a schematic diagram of the first embodiment of the residential switch and socket wiring design method in this invention; Figure 2 This is a schematic diagram of a second embodiment of the residential switch and socket wiring design method according to the present invention; Figure 3 This is a schematic diagram of one embodiment of the residential switch and socket wiring design device according to the present invention; Figure 4 This is a schematic diagram of one embodiment of the residential switch and socket wiring design device according to the present invention. Detailed Implementation
[0012] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. 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.
[0013] The terms "comprising" and "having," and any variations thereof, used in the embodiments of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0014] To facilitate understanding of this embodiment, a detailed description of a residential switch and socket wiring design method disclosed in this embodiment of the invention will be provided first. For example... Figure 1 As shown, this method includes the following steps: 101. Perform semantic recognition and geometric analysis on the input residential building drawings to obtain structured spatial data; In this embodiment, the step of performing semantic recognition and geometric analysis on the input residential building drawings to obtain structured spatial data includes: identifying and classifying the graphic elements in the residential building drawings, extracting wall elements, door and window elements, room area elements, and equipment annotation elements to obtain a classified set of elements; extracting geometric information from each element in the set to obtain the position coordinates and thickness parameters of the walls, the position coordinates and width parameters of the doors and windows, the boundary coordinates of the room areas, and the point coordinates of the switches and sockets to obtain element data containing geometric attributes; and establishing spatial relationships between the walls, doors and windows, room areas, and switches and sockets based on the element data to obtain structured spatial data.
[0015] Specifically, in this embodiment, the residential building drawings can be drawing files created using computer-aided design (CAD) technology. The drawing input process includes preliminary format verification and unit standardization. For example, if the dimensions in the input drawing are in inches, they will be automatically converted to millimeters to ensure that the geometric parameters of each element are calculated within the same measurement system.
[0016] After the drawing preprocessing is completed, the graphic elements in the drawing are identified and classified. Specifically, this process traverses all graphic entities in the drawing, including basic graphic elements such as lines, polylines, arcs, and text annotations, and determines their category based on the combination characteristics of these graphic elements.
[0017] The identification of wall elements is primarily based on the thickness characteristics of closed line segments. In this embodiment, the wall thickness identification range is set to 80mm to 300mm, covering the thicknesses of common interior walls, exterior walls, and load-bearing walls. When a closed shape matching this thickness range is detected, it is classified as a wall element. By analyzing the connection relationships of the walls, load-bearing and non-load-bearing walls can be further distinguished, because load-bearing walls are often connected to structural columns, while partition walls are relatively independent.
[0018] The identification of door and window elements is based on opening features. In architectural drawings, doors and windows are usually represented as breaks in the wall. This embodiment detects the interruption position of the wall line segment and combines it with the opening width for identification: when the opening width is greater than or equal to 600mm, it is identified as a door; when the opening width is less than 600mm, it is identified as a window. For openings marked with a fan-shaped arc, the opening direction of the door can be further determined, which is of practical significance for avoiding the door's moving area when planning wiring paths.
[0019] Identifying room area elements is relatively complex. A room is typically enclosed by multiple walls, forming a closed polygonal area. This embodiment uses topological analysis to analyze the connection relationships of the endpoints of adjacent walls, identify all closed areas, and mark these areas as independent rooms. Furthermore, the functional attributes of a room can be inferred based on its size, length-to-width ratio, and relative position to other rooms. For example, a room with an area between 10 and 20 square meters and located near the entrance is usually identified as a bedroom; while a smaller room near the kitchen is likely a bathroom.
[0020] The identification of equipment annotation elements mainly targets the locations of electrical equipment such as switches, sockets, and light fixtures already marked on the drawings. These devices are usually represented by specific block symbols in CAD drawings. This embodiment identifies the location and type of various devices by matching them with a preset block library. For example, a symbol labeled "five-hole socket" will be extracted as a socket device, and its coordinate position in the drawing will be recorded. Through the above identification process, a set of elements categorized by type can be obtained.
[0021] After classifying the elements, geometric information needs to be extracted from each type of element. For wall elements, the extracted information includes the coordinates of the wall's centerline, wall thickness, wall length, and wall orientation angle. The wall centerline typically extends along the middle of the wall's thickness; after extracting the coordinate sequence of the centerline, the starting point, ending point, and corner positions of the wall can be calculated.
[0022] The geometric information of door and window elements includes the center coordinates of the opening, the opening width, the wall number where the opening is located, and the opening direction. These parameters are used to determine clearance distances when planning wiring paths. For example, according to engineering specifications, wiring needs to leave at least a 50mm clearance distance at the edges of doors and windows to avoid interference between conduits and door / window frames.
[0023] The geometric information for a room area includes the room's boundary coordinate sequence, room area, geometric center point, and functional label. The boundary coordinate sequence is used to determine walkable areas when constructing the cabling network, while the room area and functional label help determine the rationality of equipment placement. The geometric information for switches and sockets includes the equipment's location coordinates, equipment type, and room number. By extracting this geometric information, element data containing detailed parameters for each element can be obtained.
[0024] After obtaining the geometric information of each element, it is also necessary to establish the spatial relationships between the elements. The relationship between walls and rooms is determined by whether the wall boundary constitutes part of a room. For example, if a section of wall belongs to two rooms, it means that it is a partition wall between the two rooms, and wiring can extend from one room to the other along this section of wall. The relationship between doors and windows and walls requires recording the wall number and the relative position of the doors and windows on the wall, so as to accurately determine the areas that need to be avoided during wiring planning.
[0025] The association between devices and rooms is determined by the coordinates of the device location and the room boundaries to identify which room each device belongs to. This association helps in dividing cabling tasks by room. In addition, since switches and sockets are usually installed on walls, it is necessary to determine which section of wall each device location is closest to and record the distance between the device and the wall. This association is used to determine the connection method between device nodes and corner nodes when constructing the cabling channel network.
[0026] 102. Based on the wall locations and room boundaries in the structured spatial data, construct a wiring channel network containing a set of nodes and a set of edges; In this embodiment, constructing a cabling channel network containing a set of nodes and a set of edges based on the wall locations and room boundaries in the structured spatial data includes: extracting wall corner locations along the wall edges based on the wall locations in the structured spatial data, and generating nodes at each wall corner location and the coordinates of the switch and socket devices to obtain a set of nodes; performing connectivity checks on each node in the set of nodes to determine whether there are walls, doors, windows, or other obstacles obstructing adjacent nodes, and establishing connecting edges between unobstructed adjacent nodes to obtain a set of edges; and labeling each connecting edge with height and channel attributes based on the spatial location of each connecting edge in the set of edges to obtain the cabling channel network.
[0027] Specifically, nodes represent key locations in the cabling path, including wall corners and equipment locations; edges represent walkable pathways between nodes. During the construction process, the wall edge information must first be extracted from the structured spatial data. Wall edges refer to line segments formed by offsetting the wall's centerline along the inner side of the room; these segments constitute the walkable path for cabling. In residential cabling design, conduits are typically laid along wall edges, therefore wall edges are a major component of the cabling pathway.
[0028] By tracing the wall edges, the corner positions can be identified. These corner positions are the intersections of two adjacent wall edges; at these corners, the wiring path needs to change direction. In this embodiment, each corner position is treated as a node, recording its coordinate information. For example, a rectangular room typically has four corners, and a node is generated for each corner.
[0029] In addition to wall corners, the coordinates of switch and socket locations also need to be added to the node set as nodes. These device nodes represent the start or end points of wiring; lines originating from the distribution box ultimately need to connect to these devices. It's important to note that device nodes are typically not located directly at wall corners, but rather at a midpoint along the wall's edge. Therefore, during actual construction, device nodes are associated with the nearest wall edge, forming short branches from the device location to the wall edge. This method yields a node set containing both corner nodes and device nodes.
[0030] After obtaining the set of nodes, it is necessary to determine which nodes can be connected by edges. The basic principle of connectivity determination is: an edge can only be established between two nodes if there are no walls, doors, windows, or other obstacles obstructing their path.
[0031] For adjacent corner nodes, the determination method is relatively simple. If two corner nodes are located on the same wall edge and there are no doors or windows in between, a connection edge can be directly established. For example, for a wall with a length of 3 meters, a connection edge can be established between the corner nodes at both ends. If there is a window on this wall that divides the wall into two sections, then a direct connection cannot be established between the nodes on both sides of the window.
[0032] For node connections that span across rooms, more caution is needed. In open-plan spaces, such as when there is no wall between the living room and dining room, a connecting edge can be established between the corner nodes of the two rooms. However, if there is a wall separating the two rooms, a connection cannot be established even if the straight-line distance between the two nodes is very short.
[0033] In addition, the opening area of the door also needs to be considered. Although the doorway itself is an opening, in actual wiring, to avoid affecting the opening and closing of the door, exposed wiring is usually not laid within the door's moving area. Therefore, when determining connectivity, it is necessary to appropriately avoid the door's moving area based on the door's opening direction. By determining the connectivity between node pairs one by one, the edge set can be obtained.
[0034] After obtaining the edge set, it is also necessary to label each connecting edge with its height and channel attributes. The height attribute is used to distinguish different wiring levels. In residential wiring, common wiring levels include floor, wall, and ceiling. Floor wiring refers to burying conduits in the floor leveling layer; wall wiring refers to laying conduits in grooves within the walls, which is the most common wiring method; ceiling wiring refers to laying conduits within the suspended ceiling, suitable for rooms with suspended ceilings.
[0035] Different height levels correspond to different construction difficulties and costs. Floor wiring requires damaging the floor, making construction more complex; in-wall wiring requires creating grooves, causing some damage to the wall; ceiling wiring is relatively flexible, but requires the room to have a suspended ceiling. This embodiment labels the corresponding height attribute based on the spatial location of the connecting edge.
[0036] The passage attribute describes the access conditions of the connecting edges. For example, some walls are load-bearing walls with limited groove depth; connecting edges on such walls are marked as "restricted passages," while connecting edges on ordinary partition walls are marked as "normal passages." This attribute information affects cost calculation during path planning; the construction cost of restricted passages is usually higher than that of normal passages.
[0037] 103. Based on the cabling channel network and the preset cabling constraints, calculate the path cost from the power distribution equipment to each switch and socket device, and generate multiple candidate cabling schemes based on the path cost; In this embodiment, the step of calculating the path cost from the power distribution equipment to each switch and socket device based on the wiring channel network and preset wiring constraints, and generating multiple candidate wiring schemes based on the path cost, includes: constructing a path cost function containing distance cost, construction cost, and safety cost terms based on the preset wiring constraints; calculating candidate paths from the power distribution equipment nodes to each switch and socket device node using a path search algorithm based on the node set and edge set in the wiring channel network, and calculating the cost value of each candidate path using the path cost function to obtain a candidate path set corresponding to each switch and socket device; combining the candidate path sets corresponding to each switch and socket device, and sorting and filtering them according to the total cost value after combination to obtain the multiple candidate wiring schemes.
[0038] Specifically, evaluating the merits of different paths requires comprehensive consideration of various engineering constraints. In traditional manual design, designers often rely on experience to determine which path is more reasonable, but this judgment is difficult to quantify and objectively compare between different solutions. This embodiment constructs a path cost function to transform various engineering constraints into calculable costs, thereby achieving a quantitative evaluation of the path.
[0039] The path cost function comprises three main cost terms: distance cost, construction cost, and safety cost. The distance cost term reflects the cable length; the longer the cable, the higher the material cost, therefore the distance cost is directly proportional to the path length. In practical calculations, the lengths of all connecting edges along the path can be summed to obtain the total length as the base value for the distance cost.
[0040] The construction cost item reflects the difficulty of constructing the path. Different passage types have different construction difficulties. For example, it is significantly more difficult to cut grooves in a load-bearing wall than in a regular partition wall because the groove depth in a load-bearing wall is strictly limited, requiring more careful construction. In this embodiment, different construction cost coefficients are set for different types of passages based on the passage attributes of the connecting edges. Restricted passages have higher cost coefficients, while regular passages have lower cost coefficients. Furthermore, the construction costs of each connecting edge on the path can be summed to obtain the total construction cost.
[0041] The safety cost term measures the proximity of a path to restricted or high-risk areas. In residential wiring, certain areas are unsuitable for wiring, such as the edges of doors and windows, near gas pipelines, and damp areas. Although these areas are avoided when constructing the routing network, the safe distance from these areas still needs to be considered in actual path selection. The closer to a restricted area, the higher the safety risk and the greater the corresponding safety cost. This embodiment calculates the distance between each point on the path and the nearest restricted area and sets a decreasing safety cost based on the distance, with the cost increasing the closer the distance.
[0042] It should be noted that these three cost items are not of equal importance and need to be weighed according to the specific needs of the project in practical applications. For example, for cost-sensitive projects, the distance cost should have a higher weight; for projects with tight schedules, the construction cost should have a higher weight. This embodiment introduces weighting coefficients α and β to adjust the degree of influence of different cost items, and the total path cost can be expressed as: C_total = α × C_distance + β × C_constraint Where C_distance represents the distance cost, C_constraint represents the combined construction cost and safety cost, α is the distance weighting coefficient, and β is the constraint weighting coefficient. The weighting coefficients typically range from 0.1 to 1.0 and can be adjusted based on historical project data or user preferences.
[0043] After constructing the path cost function, a path search algorithm can be used to calculate candidate paths from the power distribution equipment nodes to each switch and socket equipment node. The goal of the path search algorithm is to find the path with the minimum cost in the cabling channel network, which is a typical graph theory problem. This embodiment uses the A* algorithm for path search, which guides the search direction through a heuristic function and can efficiently find the optimal path.
[0044] During the search process, the algorithm starts from the power distribution equipment node and gradually expands to adjacent nodes. For each new node reached, the cumulative cost from the starting point to that node is calculated. When the target equipment node is reached, the path with the minimum cumulative cost is the optimal path. It should be noted that, to increase the diversity of solutions, this embodiment not only retains the path with the minimum cost but also retains several paths with the second-lowest cost as candidates. For example, for each switch and socket device, the top 3 to 5 cost-ranked paths can be retained to form a candidate path set for that device.
[0045] After obtaining the candidate path set for each switch and socket device, these paths need to be combined to form a complete cabling scheme. A complete cabling scheme includes paths from the distribution box to all switch and socket devices. Each device selects one candidate path, and different combinations of selections constitute different schemes.
[0046] For example, in a residence with 10 switch and socket devices, if each device has 3 candidate paths, theoretically there are 3 to the power of 10 possible combinations. Clearly, this number of combinations is too large to calculate entirely. This embodiment uses a greedy strategy for combination selection: it prioritizes selecting the optimal paths for each device to obtain the solution with the lowest total cost; based on this, it gradually replaces the paths of some devices to generate solutions with the second-lowest cost. In this way, 3 to 5 candidate wiring schemes can be generated with a reasonable amount of computation.
[0047] Furthermore, these solutions can be ranked based on their total cost after combination. Total cost is the sum of the costs of all paths within a solution; a lower cost indicates a better solution considering distance, construction difficulty, and safety. The ranked solution set can then be provided to the user for selection, allowing them to choose the most suitable solution based on their actual needs, such as prioritizing cost or ease of construction.
[0048] 104. Perform rule conflict detection on the multiple candidate routing schemes, and adjust the paths of the candidate routing schemes with conflicts according to the detection results to obtain multiple optimized routing schemes and corresponding project files.
[0049] In this embodiment, after performing rule conflict detection on the multiple candidate cabling schemes and adjusting the paths of conflicting candidate cabling schemes according to the detection results to obtain multiple optimized cabling schemes and corresponding project files, the method further includes: when the structured spatial data or cabling constraints change, parsing the changed content to determine the spatial range affected by the change and the affected switch and socket equipment nodes to obtain sensitive update areas; based on the sensitive update areas, locally replanning the cabling paths in the multiple optimized cabling schemes located within the sensitive update areas while keeping the cabling paths in non-sensitive update areas unchanged to obtain updated cabling schemes; and incrementally updating the project files and bill of materials based on the differences between the updated cabling schemes and the original cabling schemes, and marking the change locations and content in the project files.
[0050] Specifically, the conflict detection process involves performing rule verification on each path in the candidate cabling scheme. This embodiment pre-defines a series of conflict detection rules, which are derived from national building electrical design codes and industry-standard construction practices.
[0051] The door and window clearance rules require that wiring paths maintain a minimum distance of 50mm from the edges of doors and windows. During inspection, each point on the path is traversed, and the distance from that point to the nearest door or window edge is calculated. If the distance is found to be less than 50mm, a door / window clearance conflict is recorded at that location. The strong and weak current cable spacing rules require a minimum spacing of 300mm between strong and weak current cables to avoid electromagnetic interference. Spacing conflicts occur when two separate strong and weak current paths are too close together in a certain area. The voltage drop rules require that the voltage drop on the line from the distribution box to the electrical equipment not exceed 3% of the rated voltage. If the voltage drop exceeds this limit, a voltage drop exceeding the limit conflict is recorded for that path.
[0052] By traversing and detecting each path, conflict detection results can be obtained. These results include the type, location, and severity of conflicts on each path. It should be noted that not all candidate solutions will have conflicts; some solutions may fully comply with the specifications. However, in most cases, at least some solutions will have some degree of conflict and require adjustment.
[0053] For wiring paths with conflicts, this embodiment employs a hierarchical adjustment strategy. The choice of adjustment strategy depends on the type and severity of the conflict; different conflicts require different adjustment methods.
[0054] For conflicts in clearance distances between doors and windows, if the conflict point is only a few millimeters to a dozen millimeters away from the edge of the door or window, a fine-tuning of the endpoint position can be used. Specifically, the conflict point on the path is shifted a small distance away from the door or window, usually within 50mm.
[0055] For conflicts between power and data cabling distances, if two paths are parallel and close to each other in a certain area, a wiring channel switching method can be used. For example, one path can be switched from an in-wall channel to a ceiling channel, using vertical spatial separation to increase the spacing. This adjustment method changes the height hierarchy of the path but keeps the basic planar orientation unchanged.
[0056] For voltage drop exceeding the limit, it is usually necessary to upgrade the cable specifications. For example, upgrading the originally planned 2.5 square millimeter copper wire to 4 square millimeter copper wire can effectively reduce the line resistance and thus reduce the voltage drop.
[0057] In some cases, if conflicts cannot be resolved using the above methods, partial path termination can be chosen, i.e., abandoning the path and selecting another path from the candidate path set to replace it. After the adjustment is completed, the adjusted path needs to be re-checked for conflicts to determine if the adjustment is effective. If conflicts still exist after the adjustment, the next level of adjustment strategy needs to be selected for reprocessing. Through this iterative adjustment method, an optimized routing scheme can be obtained.
[0058] After obtaining the optimized cabling plan, the corresponding project files need to be generated. The project files include two parts: construction drawings and a bill of materials. The construction drawings are output in DWG format and contain information such as cabling path layers and equipment label layers. The cabling path layer shows the route of each circuit, with different circuits distinguished by different colors; the equipment label layer indicates the location, model, and circuit number of switches and sockets.
[0059] The bill of materials lists the specifications and quantities of all materials required in the plan. For example, it specifies the required lengths of 2.5 square millimeter copper wire, 4 square millimeter copper wire, PVC conduit, and 86-type sockets. This data is automatically calculated by traversing all paths and equipment nodes in the plan, providing a basis for material procurement.
[0060] In addition, this embodiment also supports incremental updates after the cabling plan is completed. When the building plan is partially adjusted, such as the location of a door in a room changing, it is not necessary to replan the cabling plan for the entire residence. Only the sensitive update areas affected by the change need to be identified, and the cabling paths in those areas are locally replanned, while the paths in other areas remain unchanged. This incremental update mechanism improves the responsiveness to design changes.
[0061] In this embodiment, structured spatial data is obtained by semantic recognition and geometric analysis of residential building drawings. A wiring channel network is constructed based on the wall locations and room boundaries in the structured spatial data. The path cost from the power distribution equipment to each switch and socket device is calculated based on the wiring channel network and preset wiring constraints, and multiple candidate wiring schemes are generated based on the path cost. Rule conflict detection is performed on the multiple candidate wiring schemes, and path adjustment processing is applied to conflicting candidate wiring schemes based on the detection results, resulting in multiple optimized wiring schemes and corresponding engineering documents. This invention automatically weighs various engineering constraints through path cost calculation, generates multiple optional schemes for comparison and decision-making, and ensures that the schemes meet the specifications through automatic conflict detection and adjustment processing, significantly shortening the design cycle.
[0062] Please see Figure 2 Another embodiment of the residential switch and socket wiring design method in this application includes: 201. Perform semantic recognition and geometric analysis on the input residential building drawings to obtain structured spatial data; 202. Based on the wall locations and room boundaries in the structured spatial data, construct a wiring channel network containing a set of nodes and a set of edges; 203. Based on the cabling channel network and the preset cabling constraints, calculate the path cost from the power distribution equipment to each switch and socket device, and generate multiple candidate cabling schemes based on the path cost; In this embodiment, steps 201-203 are similar to steps 101-103 in the first embodiment, and will not be described again here.
[0063] 204. According to the preset conflict detection rules, each wiring path in the multiple candidate wiring schemes is traversed and detected to determine whether each wiring path meets the conflict detection rules, and the conflict detection result is obtained. In this embodiment, conflict detection rules can be divided into several categories. The first category is distance-based rules, which mainly involve the spacing requirements between the wiring path and building elements. For example, the door and window avoidance distance rule requires that the wiring maintain a distance of not less than 50mm from the edge of the door or window. This is to avoid interference between the conduit and the door or window frame, and also to reserve necessary operating space for construction. During detection, each coordinate point on the path is extracted, and the distance value from that point to the nearest door or window edge is calculated. Once a point is found to be less than 50mm away, that point is marked as a conflict point, and the conflict type is recorded as "insufficient door and window avoidance distance".
[0064] The second category is spacing rules, mainly addressing the spatial relationships between different types of cables. In residential electrical design, high-voltage and low-voltage circuits need to maintain sufficient spacing to avoid electromagnetic interference. This embodiment sets the minimum spacing between high-voltage and low-voltage cables at 300mm, a value derived from relevant design specifications. During testing, the paths of different circuits need to be compared to identify locations where they are close to or intersect in space. For each such location, the shortest distance between the two paths is calculated; if the distance is less than 300mm, it is recorded as a high-voltage / low-voltage spacing conflict. It should be noted that this testing requires traversing all pairwise combinations of circuits, resulting in a relatively large computational load.
[0065] The third category is electrical parameter rules, which mainly focus on whether the electrical performance of the line meets the requirements for safe use. Voltage drop is an important indicator. A certain voltage loss occurs in the line from the distribution box to the electrical equipment. If the loss is too large, it will affect the normal operation of the equipment. This embodiment stipulates that the voltage drop must not exceed 3% of the rated voltage. During testing, the voltage drop value will be estimated based on the path length, cable cross-sectional area, and load current. The estimation formula can be simplified to: voltage drop is directly proportional to path length and inversely proportional to cable cross-sectional area. When the estimated value exceeds the 3% limit, a voltage drop exceeding the limit conflict is recorded for that path.
[0066] The detection process employs a traversal approach. For each candidate routing scheme, each routing path is extracted sequentially, and the aforementioned conflict detection rules are applied to each path. When applying each rule, all critical locations on the path are scanned, including the start point, end point, corner points, and intersections with other paths, to determine whether these locations violate the rule requirements.
[0067] By traversing the detection process, a complete conflict detection result can be obtained. This result is organized in list form, with each item recording detailed information about a conflict, including the scheme number where the conflict occurs, the path number where the conflict occurs, the specific location coordinates of the conflict, the type of conflict (e.g., door / window avoidance, strong / weak current distance, excessive voltage drop), and the severity of the conflict. The severity of the conflict can be measured by the deviation from the required standard. For example, if a point is only 30mm from the edge of a door or window, while the standard requires 50mm, the deviation is 20mm. This deviation can be used as a basis for assessing the severity of the conflict.
[0068] After obtaining the conflict detection results, a preliminary assessment of the quality of each solution can be conducted. Solutions with no conflicts can be directly considered acceptable; solutions with a few minor conflicts can be eliminated through simple adjustments; while solutions with a large number of serious conflicts may need to be abandoned or significantly modified.
[0069] 205. Based on the conflict location and conflict type in the conflict detection results, select the corresponding adjustment strategy for the conflicting wiring paths to process them and obtain the optimized wiring scheme. In this embodiment, the step of selecting corresponding adjustment strategies for conflicting cabling paths based on the conflict location and conflict type in the conflict detection results to obtain an optimized cabling scheme includes: assessing the severity of each conflict type in the conflict detection results; determining the adjustment priority based on the distance between the conflict location and the device location and the degree of conflict, resulting in a conflict list sorted by priority; selecting corresponding adjustment strategies sequentially based on the type and severity of each conflict in the conflict list to obtain the adjusted cabling path; and verifying the conflict rules of the adjusted cabling path to determine whether conflicts still exist after adjustment. If no conflicts exist, the adjustment result is retained; if conflicts still exist, the next level adjustment strategy is selected for reprocessing to obtain the optimized cabling scheme.
[0070] Specifically, the severity of all detected conflicts needs to be assessed first. The severity of a conflict depends not only on its deviation from the specification but also on the importance of its location. For example, conflicts closer to equipment locations are often more difficult to handle because the location of equipment is fixed, with limited room for adjustment. This embodiment calculates the distance between the conflict location and the nearest equipment location, and combines this with the degree of deviation of the conflict itself to arrive at a comprehensive severity score.
[0071] After completing the severity assessment, all conflicts are sorted from highest to lowest score, resulting in a conflict list. This list determines the priority for handling conflicts, prioritizing those with high severity and wide impact. This prioritization strategy ensures a more efficient adjustment process.
[0072] After determining the processing order, adjustments are made to each conflict in the conflict list sequentially. The choice of adjustment strategy depends on the type and severity of the conflict. This embodiment pre-sets four adjustment strategies.
[0073] Fine-tuning the endpoint position is the first-level adjustment strategy, suitable for distance-related conflicts with small deviations. When the difference between the conflict location and the edge of the door or window is within 50mm, it can be resolved by fine-tuning the position of the conflict point on the path. Specifically, the conflict point is shifted away from the door or window, and the shift distance is usually controlled within a range where neither Δx nor Δy exceeds 50mm.
[0074] Switching cabling paths is a second-level adjustment strategy, applicable to spatial obstruction conflicts or conflicts in the spacing between strong and weak current wires. When two paths are too close together in a certain area, and fine-tuning cannot resolve the issue, consider changing the height level of one of the paths. For example, change the original path running along the wall to running along the ceiling, thus increasing the vertical distance.
[0075] Upgrading cable specifications is the third-level adjustment strategy, specifically designed to resolve voltage drop issues. When the voltage drop in a path exceeds the 3% limit, the line resistance can be reduced by increasing the cable cross-sectional area. For example, upgrading from 2.5 square millimeter copper wire to 4 square millimeter wire can reduce resistance by approximately 37%.
[0076] Local path termination is the last-level adjustment strategy used to handle severe conflicts that cannot be resolved through the methods described above. If there are too many conflict points on a path, the path can be abandoned, and other alternative paths can be selected from the device's candidate path set.
[0077] After applying an adjustment strategy to a conflict, the adjusted path needs to be re-validated for conflict rules. The validation process re-checks whether a conflict still exists on the path. If the conflict has been eliminated after adjustment and no new conflicts have been introduced, the adjustment result is retained, and the process continues with the next conflict in the list.
[0078] If the conflict persists after adjustment, it indicates that the current adjustment strategy is insufficient. In this case, a next-level adjustment strategy needs to be selected for reprocessing. For example, if endpoint fine-tuning cannot resolve a door / window avoidance conflict, try channel switching; if channel switching is still ineffective, local path termination may ultimately be necessary.
[0079] By using this step-by-step trial and verification method, conflicts on the path can be eliminated one by one. Once all conflicts in the conflict list have been resolved, an optimized cabling scheme is obtained. This scheme is not only superior in terms of path cost, but also fully complies with all the requirements of the engineering specifications.
[0080] 206. Extract data and convert the format of the optimized wiring scheme to generate an engineering file containing a wiring path layer, an equipment label layer, and a bill of materials.
[0081] In this embodiment, generating the engineering file first requires extracting data from the cabling scheme. The scheme contains a large amount of data such as path coordinates, node information, and equipment parameters. This data is stored in a structured form and needs to be reorganized according to the standards of engineering drawings. For example, path data needs to be converted into polylines or splines that can be recognized by CAD software, and equipment information needs to be converted into blocks and their attribute annotations.
[0082] After data extraction, format conversion and layer division begin. This example divides the project file into multiple layers, each carrying different types of information. The wiring path layer is the core layer, showing the route of all circuits. To facilitate differentiation, different circuits are identified by different colors; for example, lighting circuits are yellow, socket circuits are red, and low-voltage circuits are blue. Circuit numbers, cable specifications, and other information are also marked on the path segments.
[0083] The equipment label layer displays the location and attributes of all switch and socket equipment. Each device is represented by a standard block, with the device model, installation height, and circuit number next to the block. For example, a five-hole socket will be labeled "5K-1.3m-C1", indicating that it is a five-hole socket, installed at a height of 1.3 meters, and belongs to circuit C1.
[0084] In addition, the project documents also include a bill of materials (BOM). The BOM is calculated by traversing all paths and devices in the plan to determine the usage of various materials. For example, to calculate the total length of 2.5 square millimeter copper wire, the length of all paths using this cable specification needs to be summed; to calculate the number of 86-type sockets, all device nodes need to be traversed, the socket type devices need to be selected, and the quantities counted. The BOM is presented in tabular form, including material name, specifications, unit, quantity, etc., and can be directly used for material procurement and cost estimation.
[0085] The project files are ultimately output in DWG format, which can be opened and edited by mainstream CAD software. In addition to DWG, this embodiment can also output SVG format for web browsing and PDF format for printing and archiving. This multi-format output method meets the needs of different usage scenarios.
[0086] In this embodiment, structured spatial data is obtained by semantic recognition and geometric analysis of residential building drawings. A wiring channel network is constructed based on the wall locations and room boundaries in the structured spatial data. The path cost from the power distribution equipment to each switch and socket device is calculated based on the wiring channel network and preset wiring constraints, and multiple candidate wiring schemes are generated based on the path cost. Rule conflict detection is performed on the multiple candidate wiring schemes, and path adjustment processing is applied to conflicting candidate wiring schemes based on the detection results, resulting in multiple optimized wiring schemes and corresponding engineering documents. This invention automatically weighs various engineering constraints through path cost calculation, generates multiple optional schemes for comparison and decision-making, and ensures that the schemes meet the specifications through automatic conflict detection and adjustment processing, significantly shortening the design cycle.
[0087] The above describes the residential switch and socket wiring design method in the embodiments of the present invention. The following describes the residential switch and socket wiring design device in the embodiments of the present invention. Please refer to the description of this residential switch and socket wiring design device. Figure 3 One embodiment of the residential switch and socket wiring design device of the present invention includes: The drawing parsing module 301 is used to perform semantic recognition and geometric parsing on the input residential building drawings to obtain structured spatial data; The channel construction module 302 is used to construct a wiring channel network containing a set of nodes and a set of edges based on the wall positions and room boundaries in the structured spatial data. The path planning module 303 is used to calculate the path cost from the power distribution equipment to each switch and socket device according to the wiring channel network and the preset wiring constraints, and generate multiple candidate wiring schemes based on the path cost. The conflict handling module 304 is used to perform rule conflict detection on the multiple sets of candidate routing schemes, and to perform path adjustment processing on the candidate routing schemes with conflicts according to the detection results, so as to obtain multiple optimized routing schemes and corresponding project files.
[0088] In this embodiment of the invention, the residential switch and socket wiring design device operates the aforementioned residential switch and socket wiring design method. The device obtains structured spatial data by performing semantic recognition and geometric analysis on residential building drawings; constructs a wiring channel network based on wall locations and room boundaries in the structured spatial data; calculates the path cost from the power distribution equipment to each switch and socket device based on the wiring channel network and preset wiring constraints, and generates multiple candidate wiring schemes based on the path cost; performs rule conflict detection on the multiple candidate wiring schemes, and adjusts the paths of conflicting candidate wiring schemes according to the detection results, resulting in multiple optimized wiring schemes and corresponding engineering documents. This invention automatically weighs multiple engineering constraints through path cost calculation, generates multiple optional schemes for comparison and decision-making, and ensures that the schemes meet specification requirements through automatic conflict detection and adjustment processing, significantly shortening the design cycle.
[0089] above Figure 3 The residential switch and socket wiring design device in this embodiment of the invention is described in detail from the perspective of unitized functional entities. The residential switch and socket wiring design equipment in this embodiment of the invention is described in detail from the perspective of hardware processing.
[0090] Figure 4 This is a schematic diagram of a residential switch and socket wiring design device 400 provided in an embodiment of the present invention. The residential switch and socket wiring design device 400 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 410 (e.g., one or more processors) and a memory 420, and one or more storage media 430 (e.g., one or more mass storage devices) storing application programs 433 or data 432. The memory 420 and storage media 430 can be temporary or persistent storage. The program stored in the storage media 430 may include one or more units (not shown in the diagram), each unit may include a series of instruction operations on the residential switch and socket wiring design device 400. Furthermore, the processor 410 may be configured to communicate with the storage media 430 and execute the series of instruction operations in the storage media 430 on the residential switch and socket wiring design device 400 to implement the steps of the aforementioned residential switch and socket wiring design method.
[0091] The residential switch and socket wiring design device 400 may also include one or more power supplies 440, one or more wired or wireless network interfaces 450, one or more input / output interfaces 460, and / or one or more operating systems 431, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 4 The illustrated residential switch and socket wiring design device structure does not constitute a limitation on the residential switch and socket wiring design device provided by the present invention. It may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0092] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of the residential switch and socket wiring design method.
[0093] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0094] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0095] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A residential switch and socket wiring design method, characterized in that, The residential switch and socket wiring design method includes: The input residential building drawings are subjected to semantic recognition and geometric analysis to obtain structured spatial data; Based on the wall locations and room boundaries in the structured spatial data, a wiring channel network containing a set of nodes and a set of edges is constructed; Based on the cabling channel network and preset cabling constraints, calculate the path cost from the power distribution equipment to each switch and socket device, and generate multiple candidate cabling schemes based on the path cost. The multiple candidate routing schemes are subjected to rule conflict detection, and the path adjustment processing is performed on the candidate routing schemes with conflicts based on the detection results, so as to obtain multiple optimized routing schemes and corresponding project files.
2. The residential switch and socket wiring design method according to claim 1, characterized in that, The process of semantic recognition and geometric analysis of the input residential building drawings to obtain structured spatial data includes: The graphic elements in the residential building drawings are identified and classified, and wall elements, door and window elements, room area elements and equipment label elements are extracted to obtain a classified set of elements; Geometric information is extracted from each element in the element set to obtain the position coordinates and thickness parameters of the wall, the position coordinates and width parameters of the doors and windows, the boundary coordinates of the room area, and the point coordinates of the switch and socket devices, thus obtaining element data containing geometric attributes. Based on the element data, the spatial relationships between walls, doors and windows, room areas and switch and socket devices are established to obtain structured spatial data.
3. The residential switch and socket wiring design method according to claim 1, characterized in that, The step of constructing a cabling channel network containing a set of nodes and a set of edges based on the wall locations and room boundaries in the structured spatial data includes: Based on the wall positions in the structured spatial data, the corner positions of the walls are extracted along the wall edges, and nodes are generated at each wall corner position and the coordinates of the switch and socket devices to obtain a node set; For each node in the node set, a connectivity judgment is made to determine whether there are walls, doors, windows or other obstacles blocking the way between adjacent nodes. Connecting edges are established between adjacent nodes without obstruction to obtain an edge set. Based on the spatial location of each connecting edge in the edge set, the height and channel attributes are labeled for each connecting edge to obtain the cabling channel network.
4. The residential switch and socket wiring design method according to claim 1, characterized in that, The step of calculating the path cost from the power distribution equipment to each switch and socket device based on the wiring channel network and preset wiring constraints, and generating multiple candidate wiring schemes based on the path cost, includes: Based on the preset wiring constraints, a path cost function is constructed that includes distance cost, construction cost, and safety cost. Based on the set of nodes and edges in the cabling channel network, a path search algorithm is used to calculate candidate paths from the power distribution equipment nodes to each switch and socket equipment node, and the cost value of each candidate path is calculated using the path cost function to obtain the candidate path set corresponding to each switch and socket equipment. The candidate path sets corresponding to each switch and socket device are combined, and sorted and filtered according to the total value of the combined paths to obtain the multiple candidate wiring schemes.
5. The residential switch and socket wiring design method according to claim 1, characterized in that, The process of performing rule conflict detection on the multiple candidate routing schemes and adjusting the paths of conflicting candidate routing schemes based on the detection results to obtain multiple optimized routing schemes and corresponding project files includes: According to the preset conflict detection rules, each wiring path in the multiple candidate wiring schemes is traversed and detected to determine whether each wiring path meets the conflict detection rules, and the conflict detection result is obtained. Based on the conflict location and conflict type in the conflict detection results, the corresponding adjustment strategy is selected for the conflicted wiring paths to process them and obtain the optimized wiring scheme. The optimized cabling scheme is subjected to data extraction and format conversion to generate an engineering file containing a cabling path layer, an equipment label layer, and a bill of materials.
6. The residential switch and socket wiring design method according to claim 5, characterized in that, The step of selecting corresponding adjustment strategies for conflicting cabling paths based on the conflict location and conflict type in the conflict detection results to obtain an optimized cabling scheme includes: The severity of each conflict type in the conflict detection results is assessed, and the adjustment priority is determined based on the distance between the conflict location and the equipment location and the degree of conflict, resulting in a conflict list sorted by priority. Based on the type and severity of each conflict in the conflict list, the corresponding adjustment strategies are selected sequentially for processing to obtain the adjusted wiring path. The adjusted cabling path is verified for conflict rules to determine whether conflicts still exist after the adjustment. If there are no conflicts, the adjustment result is retained; if there are still conflicts, the next level adjustment strategy is selected for reprocessing to obtain the optimized cabling scheme.
7. The residential switch and socket wiring design method according to claim 1, characterized in that, After performing rule conflict detection on the multiple candidate routing schemes and adjusting the paths of conflicting candidate routing schemes based on the detection results to obtain multiple optimized routing schemes and corresponding project files, the method further includes: When the structured spatial data or wiring constraints change, the changes are analyzed to determine the spatial range affected by the changes and the affected switch and socket equipment nodes, thus obtaining the sensitive update area. Based on the sensitive update area, the wiring paths located in the sensitive update area in the multiple optimized wiring schemes are locally replanned, while the wiring paths in the non-sensitive update area remain unchanged, to obtain the updated wiring scheme. Based on the differences between the updated cabling scheme and the original cabling scheme, the project documents and bill of materials are incrementally updated, and the changed locations and contents are marked in the project documents.
8. A wiring design device for residential switches and sockets, characterized in that, The residential switch and socket wiring design device includes: The drawing parsing module is used to perform semantic recognition and geometric parsing on the input residential building drawings to obtain structured spatial data; The channel construction module is used to construct a wiring channel network containing a set of nodes and a set of edges based on the wall locations and room boundaries in the structured spatial data. The path planning module is used to calculate the path cost from the power distribution equipment to each switch and socket device based on the wiring channel network and preset wiring constraints, and generate multiple candidate wiring schemes based on the path cost. The conflict handling module is used to perform rule conflict detection on the multiple candidate routing schemes, and to perform path adjustment processing on the candidate routing schemes with conflicts based on the detection results, so as to obtain multiple optimized routing schemes and corresponding project files.
9. A residential switch and socket wiring design device, characterized in that, The residential switch and socket wiring design device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor invokes the instructions in the memory to cause the residential switch and socket wiring design device to perform the steps of the residential switch and socket wiring design method as described in any one of claims 1-7.
10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instruction is executed by the processor, it implements the steps of the residential switch and socket wiring design method as described in any one of claims 1-7.
