Automatic wiring method and device
By obtaining location information during interior decoration and using the Astar algorithm to calculate two-dimensional plane paths, and then adjusting the paths in combination with three-dimensional apartment layout information, the high cost problem caused by relying on experience in existing technologies is solved, and efficient and low-cost wiring design is achieved.
Patent Information
- Application Number
- CN202111590579.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2041-12-23
AI Technical Summary
Current indoor wiring methods rely on personal experience, leading to increased installation costs and low efficiency.
By acquiring the location information within the target house, the Astar algorithm is used to calculate the two-dimensional planar path, and the path is adjusted in conjunction with the three-dimensional house layout information to obtain the lowest cost wiring route.
It enables the rapid design of the lowest-cost wiring path when the three-dimensional floor plan and wiring point information are known, thereby improving wiring efficiency and reducing circuit wiring and installation costs.
Smart Images

Figure CN114329706B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of interior wiring, and more particularly to an automatic wiring method and apparatus. Background Technology
[0002] With the booming real estate industry, the interior decoration industry is also thriving. Quickly designing interior wiring diagrams can not only improve the efficiency of interior design, but also reduce customer waiting time and increase customer satisfaction.
[0003] In related technologies, wiring points are typically designed first, and then a wiring diagram connecting these points is designed based on experience. However, this wiring method relies heavily on personal experience, and the resulting wiring diagram is usually not the one with the lowest wiring cost, leading to increased circuit installation costs. Summary of the Invention
[0004] The purpose of this application is to provide an automatic wiring method and apparatus for automatic wiring of indoor buildings, thereby reducing the cost of circuit wiring and installation during interior decoration or renovation.
[0005] This application provides an automatic routing method, including:
[0006] Obtain the location information of each point in a first set of locations within the target house; the first set of locations includes: the electrical distribution box location of the target house, and the wiring location of the first room of the target house; based on the two-dimensional floor plan information of the target house, calculate the path between every two points in the first set of locations; from the paths between every two points, select the first path that passes through all locations and has the shortest path; the first path is a two-dimensional planar path; based on the three-dimensional floor plan information of the target house, adjust the paths between every two points in the first path to obtain the second path with the lowest wiring cost; wherein, the second path is a path that travels along the wall; the two-dimensional floor plan information is obtained by projecting the three-dimensional floor plan information.
[0007] Optionally, the step of calculating the path between every two points in the first set of points based on the two-dimensional floor plan information of the target house includes: projecting the three-dimensional floor plan information into the two-dimensional floor plan information; obtaining the point information of each point in the first set of points indicated by the two-dimensional floor plan information on the two-dimensional plane, and calculating the path between every two points in the first set of points on the two-dimensional plane using the Astar algorithm.
[0008] Optionally, the step of selecting the shortest path from the paths between every two points includes: calculating the shortest path in a two-dimensional plane between every two points in the first set of points based on 0-1 programming.
[0009] Optionally, the step of calculating the shortest path between every two points in the first set of points on a two-dimensional plane based on 0-1 programming includes: determining the shortest path from the distribution box point to the second point along the wall on the two-dimensional plane, considering the existence of a target wall and the need to cross the target wall; wherein the second point is the point among the wiring points of the first room that has the shortest path to the distribution box point; the target wall is the wall where the door of the first room is located; in the weakly connected graph to which the first path belongs, the out-degree of the distribution box point is 1 and the in-degree is 0; there is one and only one path between any two points in the weakly connected graph.
[0010] Optionally, adjusting the path between every two points in the first path based on the three-dimensional floor plan information of the target house to obtain the second path with the lowest wiring cost includes: converting the path between every two points in the first path from a path on a two-dimensional plane to a path in three-dimensional space.
[0011] Optionally, adjusting the path between every two points in the first path based on the three-dimensional floor plan information of the target house to obtain the second path with the lowest wiring cost includes: if the turning point of the fourth path between the third and fourth points in the first path is greater than the turning point of the third path, then the third path is replaced with the fourth path; wherein the third and fourth points are two points in the first set of points; and the fourth path is the path after the third path between the third and fourth points on the two-dimensional plane is projected onto the three-dimensional space.
[0012] Optionally, adjusting the path between every two points in the first path based on the three-dimensional floor plan information of the target house to obtain the second path with the lowest wiring cost includes: in the case of the existence of the target wall and considering crossing the target wall, obtaining the fifth point where the path between the distribution box point and the second point crosses the target wall; converting the shortest path from the distribution box point to the second point along the wall on the two-dimensional plane into the fifth path in three-dimensional space; wherein, the fifth path is the shortest path between the distribution box point, the second point, and the fifth point in three-dimensional space.
[0013] This application also provides an automatic wiring device, comprising:
[0014] An acquisition module is used to acquire the location information of each location in a first set of locations within the target house; the first set of locations includes: the electrical distribution box location of the target house, and the wiring location of the first room of the target house; a calculation module is used to calculate the path between every two locations in the first set of locations based on the two-dimensional floor plan information of the target house; a path selection module is used to filter out the first path that passes through all locations and has the shortest path from the paths between every two locations; the first path is a two-dimensional planar path; a path adjustment module is used to adjust the path between every two locations in the first path based on the three-dimensional floor plan information of the target house to obtain a second path with the lowest wiring cost; wherein, the second path is a path that travels along the wall; the two-dimensional floor plan information is obtained by projecting the three-dimensional floor plan information.
[0015] Optionally, the calculation module is specifically used to project the three-dimensional apartment information into the two-dimensional apartment information; the calculation module is also specifically used to obtain the point information of each point in the first point set indicated by the two-dimensional apartment information on the two-dimensional plane, and to calculate the path between every two points in the first point set on the two-dimensional plane using the Astar algorithm.
[0016] Optionally, the path selection module is specifically used to calculate the shortest path between every two points in the first set of points on a two-dimensional plane based on 0-1 planning.
[0017] Optionally, the path selection module is specifically used to determine the shortest path on a two-dimensional plane from the distribution box point to the second point along the wall, considering the existence of a target wall and the need to pass through the target wall; wherein, the second point is the point among the wiring points of the first room that has the shortest path to the distribution box point; the target wall is the wall where the door of the first room is located; in the weakly connected graph to which the first path belongs, the out-degree of the distribution box point is 1 and the in-degree is 0; there is one and only one path between any two points in the weakly connected graph.
[0018] Optionally, the path adjustment module is specifically used to convert the path between every two points in the first path from a path on a two-dimensional plane to a path in three-dimensional space.
[0019] Optionally, the path adjustment module is specifically used to replace the third path with the fourth path if the turning point of the fourth path between the third and fourth points in the first path is greater than the turning point of the third path; wherein the third and fourth points are two points in the first set of points; and the fourth path is the path after the third path between the third and fourth points on the two-dimensional plane is projected onto the three-dimensional space.
[0020] Optionally, the acquisition module is further configured to acquire, when the target wall exists and crossing the target wall is considered, a fifth point on the path between the distribution box location and the second location that crosses the target wall; the path adjustment module is specifically configured to convert the shortest path on the two-dimensional plane from the distribution box location to the second location along the wall into a fifth path in three-dimensional space; wherein, the fifth path is the shortest path in three-dimensional space between the distribution box location, the second location, and the fifth location.
[0021] This application also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of any of the above-described automatic routing methods.
[0022] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the above-described automatic wiring methods.
[0023] This application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described automatic routing methods.
[0024] The automatic wiring method and apparatus provided in this application first acquire the point information of each point in a first set of points within a target house, and calculates the path between every two points in the first set of points based on the two-dimensional floor plan information of the target house. Then, from the paths between every two points, a first path that passes through all points and has the shortest path is selected. Finally, based on the three-dimensional floor plan information of the target house, the paths between every two points in the first path are adjusted to obtain a second path with the lowest wiring cost. This allows for the rapid design of the indoor wiring layout given the known three-dimensional floor plan information and the point information of the indoor wiring points, thereby reducing the cost of electrical wiring and installation during interior decoration or renovation. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a flowchart illustrating the automatic routing method provided in this application;
[0027] Figure 2This is a schematic diagram of the shortest path calculation provided in this application;
[0028] Figure 3 This is a schematic diagram of the wiring path calculation provided in this application;
[0029] Figure 4 This is a schematic diagram of the wiring path selection provided in this application;
[0030] Figure 5 This is a schematic diagram of the wiring path adjustment provided in this application;
[0031] Figure 6 This is a schematic diagram of the automatic wiring device provided in this application;
[0032] Figure 7 This is a schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0034] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0035] In related technologies, wiring methods based on experience are inefficient, and the cost cannot be controlled due to varying experience levels among wiring personnel. Therefore, this application proposes a method that utilizes the Astar algorithm to find the shortest path between various connection points to achieve automatic wiring.
[0036] Compared to traditional wiring methods, the automatic wiring method provided in this application embodiment can automatically generate wiring paths when the three-dimensional floor plan information of the house and the wiring points are known. This not only improves wiring efficiency but also minimizes the cost of wiring according to this path.
[0037] The automatic routing method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0038] like Figure 1 As shown in the embodiment of this application, an automatic routing method is provided, which may include the following steps 101 to 104:
[0039] Step 101: Obtain the location information of each point in the first set of locations within the target house.
[0040] The first set of locations includes: the electrical distribution box location of the target house, and the wiring location of the first room of the target house.
[0041] For example, the target house is a house that needs to be wired, the location of the distribution box in the target house is known, and the location of the wiring in the first room of the target house is known.
[0042] Step 102: Based on the two-dimensional floor plan information of the target house, calculate the path between every two points in the first set of points.
[0043] For example, before obtaining the two-dimensional floor plan information of the target house, it is necessary to obtain the three-dimensional floor plan information of the target house. Then, the three-dimensional floor plan information is projected to obtain the two-dimensional floor plan information.
[0044] For example, the three-dimensional floor plan information of the target house is known. This three-dimensional floor plan information includes information about each room of the target house; the room information may specifically include: doorway information, information about the wall where the doorway is located, information about pipe enclosures, window information, and information about the location of wiring points, etc.
[0045] For example, after obtaining the point information of the points that need to be connected, the three-dimensional floor plan information is projected to obtain the two-dimensional floor plan information. The path between any two points in the first point set can be quickly and accurately obtained through the two-dimensional floor plan information.
[0046] Specifically, the Astar algorithm can be used to calculate the two-dimensional path between any two points in the first set of points mentioned above.
[0047] For example, step 102 above may include steps 102a1 and 102a2:
[0048] Step 102a1: Project the three-dimensional apartment information into the two-dimensional apartment information.
[0049] Step 102a2: Obtain the point information of each point in the first point set indicated by the two-dimensional apartment information on the two-dimensional plane, and calculate the path between every two points in the first point set on the two-dimensional plane using the Astar algorithm.
[0050] For example, after projecting the above-mentioned three-dimensional apartment information, the two-dimensional point information of each point in the first point set can be obtained. The path between any two points can be calculated based on the two-dimensional point information of any two points in the first point set.
[0051] For example, to calculate the shortest path between any two points in a two-dimensional plane, you can refer to... Figure 2 The calculation is performed using the method shown. For example... Figure 2 As shown, there are two points A and B in a two-dimensional plane. The shortest path s between points A and B can be calculated using the Astar algorithm. It's understandable that obstacles need to be considered when calculating the shortest path.
[0052] Step 103: From the paths between every two points, select the first path that passes through all points and has the shortest path.
[0053] The first path is a two-dimensional planar path.
[0054] For example, after calculating the shortest path between any two points in the first set of points using the Astar algorithm, a path set of the shortest paths between any two points in the first set of points is obtained.
[0055] Then, by solving the integer rule, we can obtain the optimal solution in the above path set that passes through all points and has the shortest path.
[0056] For example, step 103 above may include step 103a:
[0057] Step 103a: Calculate the shortest path between every two points in the first set of points on the two-dimensional plane based on 0-1 programming.
[0058] It is understood that, since there is at most one path between any two points, or no directly connected path, the integers in the integer rules mentioned in this application embodiment are all 0 or 1, and the above integer rules can be 0-1 rules.
[0059] For example, considering the practicalities of wiring, the wires from the distribution box to the room can pass through the interior walls to reduce the amount of wiring used.
[0060] For example, step 103a above may specifically include the following step 103a1:
[0061] Step 103a1: Given the existence of a target wall and considering the need to cross the target wall, determine the shortest path from the distribution box location to the second location along the wall on the two-dimensional plane.
[0062] Wherein, the second point is the point in the first room whose path is shortest to the distribution box point; the target wall is the wall where the door of the first room is located; in the weakly connected graph to which the first path belongs, the out-degree of the distribution box point is 1 and the in-degree is 0; there is one and only one path between any two points in the weakly connected graph.
[0063] It's important to note that graphs can generally be categorized into directed and undirected graphs. In a directed graph, all edges have a direction, meaning each vertex points in a direction to the next. In an undirected graph, all edges are bidirectional, meaning the two vertices connected by an undirected edge can reach each other. In some problems, an undirected graph can be considered as consisting of two directed edges, one with positive directions and the other with negative directions. The degree of a vertex refers to the number of edges connected to that vertex. Specifically, for directed graphs, the number of outgoing edges to a vertex is called its out-degree, and the number of incoming edges is called its in-degree.
[0064] For example, in the weakly connected graph above, the distribution box serves as the power supply, and all lines originate from the distribution box. Therefore, the out-degree of the distribution box is 1, and the in-degree is 0.
[0065] In this embodiment of the application, in a two-dimensional plane, assume there are four points in the first set of points, and the distance between any two points is known. Then, we need to select some edges from the edges connecting each pair of points (i.e., the edges in the weakly connected graph generated by the first set of points), such that the total length of these edges is minimized, and they must satisfy the following formula:
[0066]
[0067] st(1)w i,j ∈{0,1},d i,j ∈D
[0068] Since each edge is selected only once, the variable corresponding to each edge is either 0 or 1, corresponding to the constraint conditions in the above formula. In addition, some business requirements for water and electricity wiring must also be met, such as no points cannot be unconnected (i.e., all points in the first set of points above are weakly connected), and the distribution box point has only one out-degree and no in-degree.
[0069] For example, such as Figure 3The diagram shows a two-dimensional floor plan of a house. There are 5 wiring points inside room H, and the distribution box is located outside room H. The shortest path between any two of the 5 wiring points and the distribution box point can be obtained using the Astar algorithm (the dashed line in the diagram).
[0070] Considering actual business needs, the distribution box is usually connected to the nearest wiring point in the room. Therefore, we can first calculate the shortest distance between point e of the distribution box and the nearest point p in the room. Furthermore, considering that the circuit passes through walls, the shortest path between point e and point p should be path a through the wall, not path b that goes around the wall.
[0071] Then, based on the 0-1 rule, the optimal path can be selected from all the paths mentioned above. Figure 3 ,like Figure 4 As shown, Figure 4 The solid line in the middle represents the optimal path in the two-dimensional plane obtained after calculation.
[0072] Step 104: Based on the three-dimensional floor plan information of the target house, adjust the path between every two points in the first path to obtain the second path with the lowest wiring cost.
[0073] The second path is the path along the wall; the two-dimensional apartment information is obtained by projecting the three-dimensional apartment information.
[0074] For example, after obtaining the first path through any point in the first set of points based on the 0-1 rule, it is necessary to convert the two-dimensional spatial path into a three-dimensional spatial path.
[0075] Specifically, step 104 above may include step 104a:
[0076] Step 104a: Convert the path between every two points in the first path from a path on a two-dimensional plane to a path in three-dimensional space.
[0077] For example, for any of the first paths mentioned above, after converting from a two-dimensional path to a three-dimensional path, the path needs to be recalculated.
[0078] Specifically, for a path between two points on the same wall (or the same plane), it is only necessary to convert the two-dimensional path into a three-dimensional path using the Pythagorean theorem. For a path between two points on two adjacent walls, since the first path mentioned above is a path along the wall, it is also possible to convert the two-dimensional path into a three-dimensional path using the Pythagorean theorem.
[0079] For paths between two points on a wall and a roof, or between a wall and the ground, after converting a two-dimensional path into a three-dimensional path, since the two points change from being on the same plane to being on two perpendicular planes, it is necessary to add a new point at the intersection of the two perpendicular planes.
[0080] It should be noted that the first path mentioned above is a two-dimensional spatial path obtained through the A* algorithm. Since actual wiring is done in three-dimensional space, all sub-paths in the above two-dimensional spatial path need to be converted into three-dimensional spatial paths, i.e., the second path mentioned above. The path between any two points in the first path can be used as a sub-path of the first path. For example, step 104 above may include the following step 104b:
[0081] Step 104b: If the turning point of the fourth path between the third and fourth points in the first path is greater than the turning point of the third path, then the third path is replaced by the fourth path.
[0082] Wherein, the third point and the fourth point are two points in the first point set; the fourth path is the path between the third point and the fourth point after the third path on the two-dimensional plane is projected onto the three-dimensional space.
[0083] Understandably, for the path between two points on the wall and the roof, or between the wall and the ground, since a new point has been added at the intersection of the two vertical planes, it is necessary to recalculate the optimal path between the two points and the newly added point.
[0084] For example, the fourth path can be obtained by projecting the third path between the third and fourth points onto the two perpendicular and intersecting planes.
[0085] For example, based on Figure 4 ,like Figure 5 As shown, Figure 4 The path d shown is the path between a point on the indoor roof and a point on the adjacent wall. After converting the two-dimensional path to a three-dimensional path, it becomes as follows: Figure 5 The path d shown is used. At this point, the path d can be projected onto the roof and the path d' on the wall adjacent to the roof as the paths of the two points in three-dimensional space.
[0086] For example, in cases where there is a path through a wall, since the path inside the wall is always horizontal, after the path between the distribution box point and the second point is converted from a two-dimensional path to a three-dimensional path, two additional points need to be added, that is, two additional points are added on both sides of the target wall.
[0087] For example, step 104 above may include steps 104c1 and 104c2:
[0088] Step 104c1: Given the existence of the target wall and considering the possibility of crossing the target wall, obtain the fifth point where the path between the distribution box location and the second location crosses the target wall.
[0089] Step 104c2: Convert the shortest path from the distribution box location on the two-dimensional plane to the second location along the wall into a fifth path in three-dimensional space.
[0090] The fifth path is the shortest path in three-dimensional space between the distribution box location, the second location, and the fifth location.
[0091] For example, the fifth point mentioned above is a point in three-dimensional space where the path between the distribution box point and the second point passes through the target wall. This point can be on the same horizontal plane as either the distribution box point or the second point mentioned above.
[0092] For example, when a power distribution box point enters the first room through a wall, after converting the two-dimensional path to a three-dimensional path, the corresponding points need to be added on the wall it passes through (i.e., the target wall mentioned above). Taking the first room as a bathroom as an example, assuming the bathroom height is 270: there is a section in the two-dimensional path that passes through a wall, and the coordinates of the power distribution box point and the point inside the bathroom are (0, 0) and (0, 200) respectively. The actual points that pass through the wall are (0, 100) and (0, 110), so the path in the two-dimensional plane is (0, 0)-(0, 100)-(0, 110)-(0, 200). After the two-dimensional path is converted to a three-dimensional path, the three-dimensional coordinates of the above four points are (0, 0, 0), (0, 100, 0), (0, 110, 270), and (0, 200, 270). Since the first two points are outside the bathroom and the last two points are inside the bathroom, but these four points are not continuous, two additional points (0, 80, 270) and (0, 100, 270) need to be added, taking into account the wall thickness.
[0093] If the path between the distribution box point and the second point enters the room through the wall, it is a half-wall pass. The way to add the point is: the wire first climbs the wall from the outer wall of the target area to the height of the point, then passes through the wall and connects to this point (at this time it is already in the room of the target area), and continues to climb the wall to the fixed point. Then the remaining path is on the roof. By running along the roof, it connects to all other points.
[0094] If the path between the distribution box and the second point enters through the wall from the top, this is relatively simple. The method for adding points is as follows: the wire starts climbing the wall from the base, passes through the wall at the top, and then connects to the other locations from the roof. In this case, the path between the distribution box and the second point only needs to add the following: add the 3D coordinates of the distribution box at the beginning of the path, add the 3D coordinates of the point where the wire begins to climb the wall and then passes through the wall from the roof, and add the 3D coordinates of the first point to be connected at the end of the path.
[0095] For example, after obtaining the second path in the aforementioned three-dimensional space, wiring can be performed according to the wiring path indicated by the second path.
[0096] The automatic wiring method provided in this application first obtains the point information of each point in a first set of points within a target house, and calculates the path between every two points in the first set of points based on the two-dimensional floor plan information of the target house. Then, from the paths between every two points, a first path that passes through all points and has the shortest path is selected. Finally, based on the three-dimensional floor plan information of the target house, the paths between every two points in the first path are adjusted to obtain a second path with the lowest wiring cost. This allows for the rapid design of the indoor wiring layout given the known three-dimensional floor plan information and the point information of the indoor wiring points, thereby reducing the cost of electrical wiring and installation during interior decoration or renovation.
[0097] It should be noted that the automatic routing method provided in this application embodiment can be executed by an automatic routing device or a control module within that automatic routing device for executing the automatic routing method. This application embodiment uses an automatic routing device executing the automatic routing method as an example to illustrate the automatic routing device provided in this application embodiment.
[0098] It should be noted that, in the embodiments of this application, the automatic routing methods shown in the accompanying drawings are all illustrated by way of example with reference to one of the accompanying drawings in the embodiments of this application. In specific implementation, the automatic routing methods shown in the accompanying drawings of the above methods can also be implemented in conjunction with any other accompanying drawings that can be combined with the above embodiments, which will not be elaborated here.
[0099] The automatic wiring apparatus provided in this application is described below, and the automatic wiring method described below can be referred to in correspondence with the automatic wiring method described above.
[0100] Figure 6 A schematic diagram of the structure of an automatic wiring device provided in an embodiment of this application is shown below. Figure 6 As shown, it specifically includes:
[0101] The acquisition module 601 is used to acquire the point information of each point in a first set of points within the target house; the first set of points includes: the distribution box point of the target house, and the wiring point of the first room of the target house; the calculation module 602 is used to calculate the path between every two points in the first set of points based on the two-dimensional floor plan information of the target house; the path selection module 603 is used to filter out the first path that passes through all points and has the shortest path from the paths between every two points; the first path is a two-dimensional planar path; the path adjustment module 604 is used to adjust the path between every two points in the first path based on the three-dimensional floor plan information of the target house to obtain the second path with the lowest wiring cost; wherein, the second path is a path that travels along the wall; the two-dimensional floor plan information is obtained by projecting the three-dimensional floor plan information.
[0102] Optionally, the calculation module 602 is specifically used to project the three-dimensional apartment information into the two-dimensional apartment information; the calculation module 602 is also specifically used to obtain the point information of each point in the first point set indicated by the two-dimensional apartment information on the two-dimensional plane, and to calculate the path between every two points in the first point set on the two-dimensional plane using the Astar algorithm.
[0103] Optionally, the path selection module 603 is specifically used to calculate the shortest path between every two points in the first set of points on a two-dimensional plane based on 0-1 planning.
[0104] Optionally, the path selection module 603 is specifically used to determine the shortest path on a two-dimensional plane from the distribution box point to the second point along the wall, considering the existence of a target wall and the need to pass through the target wall; wherein, the second point is the point among the wiring points of the first room that has the shortest path to the distribution box point; the target wall is the wall where the door of the first room is located; in the weakly connected graph to which the first path belongs, the out-degree of the distribution box point is 1 and the in-degree is 0; there is one and only one path between any two points in the weakly connected graph.
[0105] Optionally, the path adjustment module 604 is specifically used to convert the path between every two points in the first path from a path on a two-dimensional plane to a path in three-dimensional space.
[0106] Optionally, the path adjustment module 604 is specifically used to replace the third path with the fourth path if the turning point of the fourth path between the third point and the fourth point in the first path is greater than the turning point of the third path; wherein the third point and the fourth point are two points in the first set of points; and the fourth path is the path after the third path between the third point and the fourth point on the two-dimensional plane is projected onto the three-dimensional space.
[0107] Optionally, the acquisition module 601 is further configured to acquire, when the target wall exists and crossing the target wall is considered, a fifth point on the path between the distribution box location and the second location that crosses the target wall; the path adjustment module 604 is specifically configured to convert the shortest path on the two-dimensional plane from the distribution box location to the second location along the wall into a fifth path in three-dimensional space; wherein, the fifth path is the shortest path in three-dimensional space between the distribution box location, the second location, and the fifth location.
[0108] The automatic wiring device provided in this application first acquires the point information of each point in a first set of points within a target house, and calculates the path between every two points in the first set of points based on the two-dimensional floor plan information of the target house. Then, it selects the shortest path from the paths between every two points, passing through all points. Finally, based on the three-dimensional floor plan information of the target house, it adjusts the paths between every two points in the first path to obtain the second path with the lowest wiring cost. This allows for the rapid design of the indoor wiring layout given the known three-dimensional floor plan information and the point information of the indoor wiring points, thereby reducing the cost of electrical wiring and installation during interior decoration or renovation.
[0109] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other through the communication bus 740. The processor 710 can call logic instructions in the memory 730 to execute an automatic wiring method, which includes: acquiring point information of each point in a first set of points within a target house; the first set of points includes: the electrical distribution box point of the target house, and the wiring point of the first room of the target house; calculating the path between every two points in the first set of points based on the two-dimensional floor plan information of the target house; selecting the first path that passes through all points and has the shortest path from the paths between every two points; the first path is a two-dimensional planar path; adjusting the path between every two points in the first path based on the three-dimensional floor plan information of the target house to obtain a second path with the lowest wiring cost; wherein, the second path is a path that travels along the wall; the two-dimensional floor plan information is obtained by projecting the three-dimensional floor plan information.
[0110] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion 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 this application. 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.
[0111] On the other hand, this application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can execute the automatic wiring method provided by the above methods. The method includes: acquiring the point information of each point in a first set of points in a target house; the first set of points includes: the distribution box point of the target house, and the wiring point of the first room of the target house; calculating the path between every two points in the first set of points based on the two-dimensional floor plan information of the target house; selecting the first path that passes through all points and has the shortest path from the paths between every two points; the first path is a two-dimensional planar path; adjusting the path between every two points in the first path based on the three-dimensional floor plan information of the target house to obtain a second path with the lowest wiring cost; wherein the second path is a path that travels along the wall; the two-dimensional floor plan information is obtained by projecting the three-dimensional floor plan information.
[0112] Furthermore, this application also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, performs the aforementioned automatic wiring methods. The method includes: acquiring point information for each point in a first set of points within a target house; the first set of points includes: the distribution box point of the target house, and the wiring point of the first room of the target house; calculating the path between every two points in the first set of points based on two-dimensional floor plan information of the target house; selecting a first path from the paths between every two points that passes through all points and has the shortest path; the first path is a two-dimensional planar path; adjusting the path between every two points in the first path based on three-dimensional floor plan information of the target house to obtain a second path with the lowest wiring cost; wherein the second path is a path traveling along a wall; the two-dimensional floor plan information is obtained by projecting the three-dimensional floor plan information.
[0113] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0114] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0115] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application 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 this application.
Claims
1. An automatic wiring method, characterized in that, include: Obtain the location information of each point in the first set of locations within the target house; The first set of locations includes: the electrical distribution box location of the target house, and the wiring location of the first room of the target house; Based on the two-dimensional floor plan information of the target house, calculate the path between every two points in the first set of points; From the paths between every two points, select the shortest path that passes through all points in the first set of points; the first path is a two-dimensional planar path. Based on the three-dimensional floor plan information of the target house, the path between every two points in the first path is adjusted to obtain the second path with the lowest wiring cost. Wherein, the second path is the path along the wall; the two-dimensional apartment information is obtained by projecting the three-dimensional apartment information; The step of selecting the shortest path from the paths between every two points, which passes through all points in the first set of points, includes: Given the existence of a target wall and considering the need to pass through it, determine the shortest path from the distribution box location to the second location along the wall on a two-dimensional plane. The second point is the point in the first room whose path to the distribution box is the shortest among the wiring points; the target wall is the wall where the door of the first room is located.
2. The method according to claim 1, characterized in that, The step of calculating the path between every two points in the first set of points based on the two-dimensional floor plan information of the target house includes: Project the three-dimensional apartment layout information into the two-dimensional apartment layout information; Obtain the point information of each point in the first point set indicated by the two-dimensional apartment information on the two-dimensional plane, and calculate the path between every two points in the first point set on the two-dimensional plane using the Astar algorithm.
3. The method according to claim 2, characterized in that, The step of selecting the shortest path from the paths between every two points includes: The shortest path between any two points in the first set of points is calculated using 0-1 programming.
4. The method according to claim 3, characterized in that, In the weakly connected graph to which the first path belongs, the out-degree of the distribution box is 1 and the in-degree is 0; there is one and only one path between any two points in the weakly connected graph.
5. The method according to claim 4, characterized in that, The step of adjusting the path between every two points in the first path based on the three-dimensional floor plan information of the target house to obtain the second path with the lowest wiring cost includes: In the first path, the path between every two points is transformed from a path on a two-dimensional plane into a path in three-dimensional space.
6. The method according to claim 4, characterized in that, The step of adjusting the path between every two points in the first path based on the three-dimensional floor plan information of the target house to obtain the second path with the lowest wiring cost includes: If, in the first path, the turning point of the fourth path between the third and fourth points is greater than the turning point of the third path, then the third path is replaced by the fourth path. Wherein, the third point and the fourth point are two points in the first point set; the fourth path is the path between the third point and the fourth point after the third path on the two-dimensional plane is projected onto the three-dimensional space.
7. The method according to claim 4, characterized in that, The step of adjusting the path between every two points in the first path based on the three-dimensional floor plan information of the target house to obtain the second path with the lowest wiring cost includes: Given the existence of the target wall and considering the possibility of passing through the target wall, obtain the fifth point where the path between the distribution box location and the second location passes through the target wall; The shortest path from the distribution box location on the two-dimensional plane to the second location along the wall is converted into a fifth path in three-dimensional space. The fifth path is the shortest path in three-dimensional space between the distribution box location, the second location, and the fifth location.
8. An automatic wiring device, characterized in that, The device includes: The acquisition module is used to acquire the location information of each point in the first set of locations within the target house; the first set of locations includes: the electrical distribution box location of the target house, and the wiring location of the first room of the target house; The calculation module is used to calculate the path between every two points in the first set of points based on the two-dimensional floor plan information of the target house. The path selection module is used to filter out the shortest path from the paths between every two points, which passes through all points; the first path is a two-dimensional planar path. The path adjustment module is used to adjust the path between every two points in the first path based on the three-dimensional floor plan information of the target house, so as to obtain the second path with the lowest wiring cost. Wherein, the second path is the path along the wall; the two-dimensional apartment information is obtained by projecting the three-dimensional apartment information; The calculation module is specifically used to determine the shortest path from the distribution box location to the second location along the wall on a two-dimensional plane, given the existence of a target wall and considering the need to pass through the target wall. The second point is the point in the first room whose path to the distribution box is the shortest among the wiring points; the target wall is the wall where the door of the first room is located.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the automatic routing method as described in any one of claims 1 to 7.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the automatic routing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Automatic wiring method and device, storage medium and electronic equipment
CN113111424A