Automatic wiring method and device
By automatically calculating and filtering out the optimal path for indoor circuit wiring, the problems of quality disparity and high cost caused by traditional circuit wiring dependence are solved, and a lower cost and higher efficiency wiring process is achieved.
Patent Information
- Application Number
- CN202111593279.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2041-12-23
AI Technical Summary
Traditional circuit wiring relies on the experience of construction personnel, resulting in uneven wiring solutions quality and increasing construction costs.
An automatic wiring method is provided, by obtaining information of the connection points in the target house and two-dimensional house type information, calculating the path set in the passable area, and filtering out the target path with the lowest passing cost.
With known indoor two-dimensional room type information and information of each wiring point in the circuit to be connected, the wiring diagram of the wiring circuit is quickly designed, reducing the wiring cost during interior decoration or renovation.
Smart Images

Figure CN114491731B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of indoor decoration wiring, and in particular to an automatic wiring method and device. Background Art
[0002] With the increase of electrical appliances and the diversification of circuit equipment, the requirements for circuit construction are becoming higher and higher, and circuit wiring is becoming more and more complicated. Traditional circuit wiring relies on the experience of construction personnel and combines the on-site conditions to provide circuit wiring solutions.
[0003] However, the manual wiring method requires relevant personnel to be familiar with circuit knowledge, and due to different personal experiences, the quality of the designed wiring schemes varies, and they are usually not the circuit diagrams with the lowest wiring costs, which leads to increased construction costs. Summary of the invention
[0004] The purpose of the present application is to provide an automatic wiring method and device for automatic wiring of indoor houses, so as to reduce the circuit wiring and installation costs during indoor decoration or renovation.
[0005] The present application provides an automatic wiring method, comprising:
[0006] The point information of the points to be connected in the target house and the two-dimensional apartment type information of the target house are obtained; the projection of the target wall and the indoor floor on the two-dimensional plane is used as the passable area, and a path set consisting of the paths passing along the passable area between every two points to be connected in the points to be connected is calculated; the target path that passes through all the points to be connected and has the lowest travel cost is filtered out from the path set; wherein the target wall includes: an inner wall without doors and windows; the two-dimensional apartment type information is obtained by projecting the three-dimensional apartment type information of the target house.
[0007] Optionally, before calculating the path set formed by the paths passing through the passable area between every two of the points to be connected, the method also includes: when the passable area contains a target obstacle, determining the area where the target obstacle is located as a detour area; wherein the pass cost weight of the first passable area is greater than the pass cost weight of the second passable area; the larger the pass cost weight, the higher the pass cost of the path; the first passable area is: the projection of the inner wall excluding doors and windows and the target obstacle on the two-dimensional plane; the second passable area is: the projection of the outer wall on the two-dimensional plane.
[0008] Optionally, the calculating of the path set formed by the paths passing through the passable area between every two of the points to be connected, includes: calculating the cost path passing through the passable area between every two of the points to be connected by an Astar algorithm; wherein the cost function of the Astar algorithm is: F=w×G+H; w represents the travel cost weight, G represents the actual path cost from the starting point to the current point to be connected, H represents the estimated cost of the current point to be connected to reach the end point, and F represents the estimated total path cost of the path where the current point to be connected is located from the starting point to the end point.
[0009] Optionally, the step of selecting a target path from the path set that passes through all the points to be connected and has the lowest travel cost includes: generating a cost matrix based on the travel cost of each path in the path set, and setting the diagonal elements of the cost matrix to preset values to avoid self-connection of the points to be connected.
[0010] Optionally, after generating a cost matrix based on the travel cost of each path in the path set, the method further includes: screening out a first path passing through all the points to be connected from the path set, and obtaining a connection vector corresponding to the first path based on the cost matrix; wherein the first path starts from a starting point among the points to be connected and ends at any point to be connected other than the starting point; and the connection vector is used to indicate the connection order of each point to be connected in the first path.
[0011] Optionally, after the first path passing through all the points to be connected is screened out from the path set based on the cost matrix and the connection vector corresponding to the first path is obtained, the method further includes: converting the connection vector corresponding to the first path into a directed adjacency matrix and constructing an objective function; solving the objective function using a heuristic algorithm, and determining the first path with the lowest travel cost in the first path set as the target path; the objective function is: min(D×A), and the constraint condition is 1≤v i ≤n; wherein the first path set includes multiple first paths; D is the cost matrix of the first path, A is the directed adjacency matrix obtained by transforming the connection vector corresponding to the first path, v i is the ith point to be wired among the points to be wired, and n is the number of points to be wired among the points to be wired.
[0012] The present application also provides an automatic wiring device, comprising:
[0013] An acquisition module is used to acquire the point information of the waiting-to-be-connected points in the target house and the two-dimensional apartment type information of the target house; a calculation module is used to take the projection of the target wall and the indoor floor on the two-dimensional plane as a passable area, and calculate a path set consisting of the paths passing along the passable area between every two waiting-to-be-connected points; a path planning module is used to filter out a target path that passes through all the waiting-to-be-connected points and has the lowest travel cost from the path set; wherein the target wall includes: an inner wall without doors and windows; and the two-dimensional apartment type information is obtained by projecting the three-dimensional apartment type information of the target house.
[0014] Optionally, the device also includes: a determination module; the determination module is used to determine the area where the target obstacle is located as a detour area when the target obstacle is included in the passable area; wherein the pass cost weight of the first passable area is greater than the pass cost weight of the second passable area; the larger the pass cost weight, the higher the pass cost of the path; the first passable area is: the projection of the inner wall excluding doors and windows and the target obstacle on the two-dimensional plane; the second passable area is: the projection of the outer wall on the two-dimensional plane.
[0015] Optionally, the calculation module is specifically used to calculate the cost path between every two of the points to be connected along the passable area through the Astar algorithm; wherein the cost function of the Astar algorithm is: F=w×G+H; w represents the travel cost weight, G represents the actual path cost from the starting point to the current point to be connected, H represents the estimated cost of the current point to be connected to reach the end point, and F represents the estimated total path cost of the path where the current point to be connected is located from the starting point to the end point.
[0016] Optionally, the path planning module is specifically configured to generate a cost matrix based on the travel cost of each path in the path set, and set the diagonal elements of the cost matrix to preset values to avoid self-connection of the points to be connected.
[0017] Optionally, the path planning module is specifically used to filter out a first path passing through all the points to be connected from the path set, and obtain a connection vector corresponding to the first path based on the cost matrix; wherein the first path takes a starting point among the points to be connected as a starting point and any point to be connected other than the starting point as an end point; and the connection vector is used to indicate the connection order of each point to be connected in the first path.
[0018] Optionally, the path planning module is specifically used to convert the connection vector corresponding to the first path into a directed adjacency matrix and construct an objective function; use a heuristic algorithm to solve the objective function, and determine the first path with the lowest travel cost in the first path set as the target path; the objective function is: min(D×A), and the constraint condition is 1≤v i ≤n; wherein the first path set includes multiple first paths; D is the cost matrix of the first path, A is the directed adjacency matrix obtained by transforming the connection vector corresponding to the first path, v i is the ith point to be wired among the points to be wired, and n is the number of points to be wired among the points to be wired.
[0019] The present application also provides a computer program product, comprising a computer program / instruction, which implements the steps of any of the above-mentioned automatic wiring methods when executed by a processor.
[0020] The present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-described automatic wiring methods are implemented.
[0021] The present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above-mentioned automatic wiring methods are implemented.
[0022] The automatic wiring method and device provided by the present application first obtain the point information of the points to be wired in the target house and the two-dimensional apartment information of the target house, and use the projection of the target wall and the indoor floor on the two-dimensional plane as the passable area, and calculate the path set composed of the paths that pass along the passable area between every two points to be wired in the points to be wired. After that, the target path that passes through all the points to be wired and has the lowest travel cost is filtered out from the path set. When the indoor two-dimensional apartment information and the point information of each wiring point in the wiring loop are known, the wiring diagram of the wiring loop can be quickly designed to reduce the wiring cost during interior decoration or renovation. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0024] Figure 1It is a flowchart of the automatic wiring method provided by the present application;
[0025] Figure 2 It is a shortest path calculation schematic diagram provided by this application;
[0026] Figure 3 It is a wiring path calculation schematic diagram provided by this application;
[0027] Figure 4 It is a wiring path screening schematic diagram provided by this application;
[0028] Figure 5 It is a structural schematic diagram of the automatic wiring device provided by the present application;
[0029] Figure 6 It is a schematic diagram of the structure of the electronic device provided by this application. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0031] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0032] In the related art, the wiring method based on experience has low wiring efficiency, and due to the different experience of wiring personnel, the wiring cost cannot be controlled. Therefore, the embodiment of the present application has come up with a method that can use the Astar algorithm to find the shortest path between each wiring point to achieve automatic wiring.
[0033] Compared with traditional wiring methods, the automatic wiring method provided in the embodiment of the present application can automatically generate a wiring path when the two-dimensional house type information and wiring points are known, which not only improves the wiring efficiency but also minimizes the cost of wiring along this path.
[0034] The automatic wiring method in the embodiment of the present application can be used for automatic wiring of each wiring point in the circuit to be wired. The circuit refers to a conductor line that sends the current after energy utilization back to the power source; or a two-way communication system between two locations. The circuit can be a strong current circuit or a weak current circuit.
[0035] It is understandable that the strong circuit in the room refers to the 220V AC circuit, and the weak circuit refers to the low-voltage circuits such as telephone lines, TV lines, and network cables. Common circuits include ordinary socket circuits, air conditioning circuits, kitchen circuits, bathroom circuits, lighting circuits, refrigerator circuits, network cable circuits, and telephone circuits.
[0036] Among them, the construction of ordinary socket circuits, air conditioning circuits, network cable circuits, and telephone circuits usually adopts a concealed construction method, that is, grooves are cut on the ground and walls, wire tubes are laid, and then the circuits are inserted into the wire tubes. In order to facilitate the extraction of abnormal lines during maintenance, the construction requires that there must be no joints in the pipelines, and there can only be joints in the dark boxes (plastic boxes behind sockets or panels). We call this wiring method a junction box-free method. Air conditioning circuits, network cable circuits, and telephone circuits need to be directly connected, that is, starting from the distribution box or weak current box, through the grooves in the wall and the ground, laying wire tubes, and directly connecting the corresponding points. There must be no joints in the middle. The ordinary socket circuit includes one or more points (sockets) to be wired, and it is necessary to start from the distribution box and connect each point to be wired.
[0037] It should be noted that the automatic wiring method provided in the embodiment of the present application is a wiring path that takes the distribution box or the low-voltage box as the starting point and other points to be wired in the loop as the end points.
[0038] The automatic wiring method provided by the embodiment of the present application is described in detail below through specific embodiments and application scenarios in conjunction with the accompanying drawings.
[0039] like Figure 1 As shown, an automatic wiring method provided in an embodiment of the present application may include the following steps 101 to 103:
[0040] Step 101: Acquire the location information of the points to be connected in the target house and the two-dimensional apartment type information of the target house.
[0041] Exemplarily, the target house is a house that needs wiring, the location of the distribution box or weak current box in the target house is known, and the location of the points to be wired in the wiring circuit to be wired in the target house is known.
[0042] Exemplarily, the above-mentioned points to be wired are points to be wired in a circuit to be wired, and the circuit to be wired includes a starting point, which is a distribution box or a weak current box.
[0043] It can be understood that the above-mentioned target house may include multiple circuits to be connected. In the embodiment of the present application, only the automatic wiring method for one circuit to be connected is described. Other circuits to be connected in the target house can be automatically wired with reference to the relevant description of the automatic wiring method in the embodiment of the present application.
[0044] Step 102: The projection of the target wall and the indoor floor on the two-dimensional plane is taken as a passable area, and a path set formed by the paths passing along the passable area between every two of the points to be connected.
[0045] Wherein, the target wall includes: an inner wall without doors and windows.
[0046] It is understandable that the target house may include inner walls and outer walls. The two-dimensional plane also includes the projection of the outer wall, which can be used as a limit to the wiring area when routing point wiring. The projection of the inner wall on the two-dimensional plane, when routing, the line can pass through the projection of the inner wall on the two-dimensional plane.
[0047] Exemplarily, the above-mentioned path set includes: a path between any two of the above-mentioned points to be connected.
[0048] Exemplarily, 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, and then the three-dimensional floor plan information is projected to obtain the two-dimensional floor plan information.
[0049] Exemplarily, the three-dimensional floor plan information of the target house is known. The three-dimensional floor plan information includes information about each room of the target house; the room information may specifically include: door opening information, information about the wall where the door opening is located, information about risers, window information, and location information of each wiring point in the circuit to be wired.
[0050] Exemplarily, after obtaining the location information of the points to be connected, the three-dimensional apartment information is projected to obtain the two-dimensional apartment information. The path between any two of the points to be connected can be quickly and accurately obtained through the two-dimensional apartment information.
[0051] For example, in order to perform routing, it is necessary to determine the passable area and passable path of the line. In order to determine the priority of the line path, it is also necessary to determine the cost weights of different passable paths.
[0052] Exemplarily, before the above step 102, the automatic routing method provided in the embodiment of the present application may include the following step 104:
[0053] Step 104: When the traversable area includes a target obstacle, determine the area where the target obstacle is located as a detour area.
[0054] Among them, the travel cost weight of the above-mentioned first passable area is greater than the travel cost weight of the second passable area; the greater the travel cost weight, the higher the travel cost of the path; the first passable area is: the projection of the inner wall excluding doors and windows and the target obstacle on the two-dimensional plane; the second passable area is: the projection of the outer wall on the two-dimensional plane.
[0055] It can be understood that the line starts from the distribution box and is connected to each wiring point along the wiring tube on the wall. Therefore, when calculating the path between every two wiring points in the above-mentioned wiring points, it is necessary to consider the characteristics of the line running along the wall and the situation where it needs to pass through the wall.
[0056] Specifically, in the case of not passing through a wall, the above-mentioned passage path is a path along the surface of the wall; in the case of passing through a wall, the above-mentioned passage path is a path passing through the inside of the wall. It should be noted that the traversable wall is an indoor wall, such as a wall between two rooms; for the wiring of an indoor loop, it is impossible to pass through an external wall.
[0057] For example, the target house also includes obstacles that cannot be crossed, such as the projection of the outer wall, columns, air ducts, and vertical pipes on the ground, which are the above-mentioned target obstacles. When planning the path, it is necessary to consider bypassing the above-mentioned target obstacles.
[0058] For example, after the traversable area of the route is determined, the path between any two of the points to be connected may be calculated using the Astar algorithm.
[0059] Exemplarily, the Astar algorithm is used to calculate the shortest path between a starting point and an end point in a two-dimensional plane. The above step 102 may include the following steps 102a:
[0060] Step 102a: Calculate the cost path along the passable area between every two of the to-be-connected points by using the Astar algorithm.
[0061] Among them, the cost function of the Astar algorithm is: F=w×G+H; w represents the travel cost weight, G represents the actual path cost from the starting point to the current point to be connected, H represents the estimated cost of the current point to be connected to reach the end point, and F represents the estimated total path cost of the path where the current point to be connected is located from the starting point to the end point.
[0062] Exemplarily, after projecting the above three-dimensional house type information, the two-dimensional point information of each of the above points to be connected can be obtained. The shortest path between any two points to be connected can be calculated based on the two-dimensional point information of any two points to be connected among the above points to be connected. That is, the cost path between any two points to be connected is the path with the lowest cost between the two points to be connected.
[0063] 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. Figure 2 As shown in FIG. 1 , there are two points A and B in a two-dimensional plane. The Astar algorithm can be used to calculate the shortest path s between point A and point B. It should be noted that obstacles need to be considered when calculating the shortest path.
[0064] Step 103: Filter out a target path that passes through all the points to be connected and has the lowest travel cost from the path set.
[0065] Exemplarily, after the path with the lowest cost between any two of the points to be connected is calculated by the Astar algorithm, a path set of the paths with the lowest cost between any two of the points to be connected is obtained.
[0066] Afterwards, the optimal path in the above path set that passes through all the points to be connected and has the lowest travel cost can be obtained by solving the integer programming.
[0067] Exemplarily, for a circuit with multiple points to be connected and no junction box (the number of points>1), an integer programming algorithm may be used for calculation.
[0068] It can be understood that since there is at most one path between any two points to be connected, or there is no directly connected path, the integers in the integer planning used in the embodiment of the present application are all 0 or 1, and the above integer planning can be a 0-1 planning.
[0069] Specifically, the above step 103 may include the following steps 103a:
[0070] Step 103a: Generate a cost matrix based on the travel cost of each path in the path set, and set the diagonal elements of the cost matrix to preset values to avoid self-connection of the points to be connected.
[0071] Exemplarily, the above-mentioned Astar algorithm is first used to calculate the connection cost between any two points to be connected among the points to be connected, and a cost matrix D is obtained. The cost matrix D is a symmetric matrix. At the same time, in order to avoid the points to be connected to themselves during wiring, the diagonal elements of the cost matrix are set to a large positive number (that is, the above-mentioned preset value), such as 1000000.
[0072] Exemplarily, after obtaining the connection cost between any two points to be connected, it is necessary to obtain all possible connection paths, obtain a path set, and calculate the travel cost of each path in the path set, and then filter out the connection path with the lowest travel cost from the path set.
[0073] Specifically, after the above step 103a, the automatic wiring method provided in the embodiment of the present application may further include the following step 103b:
[0074] Step 103b: Filter out a first path passing through all the points to be connected from the path set, and obtain a connection vector corresponding to the first path based on the cost matrix.
[0075] The first path starts from a starting point among the points to be connected and ends at any point to be connected other than the starting point; the connection vector is used to indicate the connection order of each point to be connected in the first path.
[0076] Exemplarily, the first path is a connection path in the path set that passes through all the points to be connected. It is understandable that we can obtain multiple connection paths connecting all the points to be connected from the path set.
[0077] For example, for the above connection vector V = [0, v1, ..., v n ],1≤v i ≤n,v i Here, i indicates the i-th point to be wired, n indicates the number of points, and the first element is fixed to 0, indicating that the starting point is the distribution box or weak current box. For example, V = [0,2,1,3] means starting from the distribution box or weak current box, first connect to the second point to be wired, then connect to the first point to be wired from the second point to be wired, and then connect to the third point to be wired from the first point to be wired.
[0078] It should be noted that, in the embodiment of the present application, multiple connection paths connecting all the points to be connected can be obtained from the path set, that is, multiple first paths are obtained.
[0079] Exemplarily, after the first path is acquired, the total travel cost of the first path may be determined according to the travel costs of each path in the first path.
[0080] Exemplarily, before determining the total travel cost of the first path, it is necessary to determine the connection vector of each first path and convert the connection vector into a directed adjacency matrix. Then, by solving the integer programming problem, a connection path with the lowest total travel cost is obtained.
[0081] Specifically, after the above step 103b, the automatic routing method provided in the embodiment of the present application may further include the following steps 103c1 and 103c2:
[0082] Step 103c1: Convert the connection vector corresponding to the first path into a directed adjacency matrix, and construct an objective function.
[0083] Step 103c2: Use a heuristic algorithm to solve the objective function, and determine the first path with the lowest travel cost in the first path set as the target path.
[0084] For example, the objective function is: min(D×A), and the constraint is 1≤v i ≤n.
[0085] The first path set includes multiple first paths; D is the cost matrix of the first path, A is the directed adjacency matrix obtained by transforming the connection vector corresponding to the first path, v i is the ith point to be wired among the points to be wired, and n is the number of points to be wired among the points to be wired.
[0086] For example, the sequential connection vector V is converted into a directed adjacency matrix A, A ij =0 means that point i and point j are not connected, A ij =1 means point i is connected to point j. Traverse the two adjacent elements of the sequential connection vector from left to right, the first element is used as the row number of the adjacency matrix, the second element is used as the column number, and the value of the corresponding row and column number element of the adjacency matrix is assigned to 1. For example, the adjacency matrix A corresponding to V = [0, 2, 1, 3] is:
[0087]
[0088] Exemplarily, a heuristic algorithm (such as a genetic algorithm, an ant colony algorithm, etc.) can be used to solve the integer programming problem (ie, the above-mentioned objective function) to obtain the final connection method of the waiting-to-be-connected points with the lowest travel cost.
[0089] For example, Figure 3 As shown in the figure, it is a two-dimensional house type information diagram. There are 5 points to be wired in room H, and the distribution box is located outside room H. The Astar algorithm can be used to obtain the shortest path between any two points to be wired in the above 5 points to be wired and the distribution box points (the dotted line part in the figure).
[0090] Considering the actual business needs, the distribution box is usually connected to the nearest wiring point in the room. Therefore, the shortest distance between the distribution box point e and the point p in the room closest to the distribution box can be calculated first. In addition, considering the indoor wall penetration, the shortest path between point e and point p should be path a that passes through the wall, rather than path b that goes around the wall.
[0091] Afterwards, based on 0-1 planning, the best path can be selected from all the above paths. Figure 3 ,like Figure 4 As shown, Figure 4 The solid line part is the optimal path in the two-dimensional plane obtained after calculation.
[0092] The automatic wiring method provided in the embodiment of the present application first obtains the point information of the waiting wiring points in the target house and the two-dimensional apartment type information of the target house, and takes the projection of the target wall and the indoor floor on the two-dimensional plane as the passable area, and calculates the path set composed of the paths passing along the passable area between every two waiting wiring points in the waiting wiring points. Afterwards, the target path that passes through all the waiting wiring points and has the lowest travel cost is filtered out from the path set. In the case of knowing the indoor two-dimensional apartment type information and the point information of each wiring point in the waiting wiring loop, the wiring diagram of the wiring loop can be quickly designed to reduce the wiring cost during interior decoration or renovation.
[0093] It should be noted that the automatic wiring method provided in the embodiment of the present application can be executed by an automatic wiring device, or a control module in the automatic wiring device for executing the automatic wiring method. In the embodiment of the present application, the automatic wiring device provided in the embodiment of the present application is described by taking the automatic wiring device executing the automatic wiring method as an example.
[0094] It should be noted that in the embodiments of the present application, the automatic wiring methods shown in the above-mentioned method drawings are all illustrated by combining one of the drawings in the embodiments of the present application as an example. In specific implementation, the automatic wiring methods shown in the above-mentioned method drawings can also be implemented in combination with any other drawings that can be combined as shown in the above-mentioned embodiments, which will not be repeated here.
[0095] The automatic wiring device provided by the present application is described below, and the automatic wiring method described below and above can be referenced to each other.
[0096] Figure 5 A schematic diagram of the structure of an automatic wiring device provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, specifically including:
[0097] The acquisition module 501 is used to obtain the point information of the waiting-to-be-connected points in the target house and the two-dimensional apartment type information of the target house; the calculation module 502 is used to take the projection of the target wall and the indoor floor on the two-dimensional plane as the passable area, and calculate the path set formed by the paths between every two waiting-to-be-connected points along the passable area; the path planning module 503 is used to filter out the target path that passes through all the waiting-to-be-connected points and has the lowest travel cost from the path set; wherein the target wall includes: an inner wall without doors and windows; the two-dimensional apartment type information is obtained by projecting the three-dimensional apartment type information of the target house.
[0098] Optionally, the device also includes: a determination module 504; the determination module 504 is used to determine the area where the target obstacle is located as a detour area when the target obstacle is included in the passable area; wherein the pass cost weight of the first passable area is greater than the pass cost weight of the second passable area; the larger the pass cost weight, the higher the pass cost of the path; the first passable area is: the projection of the inner wall excluding doors and windows and the target obstacle on the two-dimensional plane; the second passable area is: the projection of the outer wall on the two-dimensional plane.
[0099] Optionally, the calculation module 502 is specifically used to calculate the cost path between every two of the points to be connected along the passable area through the Astar algorithm; wherein the cost function of the Astar algorithm is: F=w×G+H; w represents the travel cost weight, G represents the actual path cost from the starting point to the current point to be connected, H represents the estimated cost of the current point to be connected to reach the end point, and F represents the estimated total path cost of the path where the current point to be connected is located from the starting point to the end point.
[0100] Optionally, the path planning module 503 is specifically configured to generate a cost matrix based on the travel cost of each path in the path set, and set the diagonal elements of the cost matrix to preset values to avoid self-connection of the points to be connected.
[0101] Optionally, the path planning module 503 is specifically used to filter out a first path passing through all the points to be connected from the path set, and obtain a connection vector corresponding to the first path based on the cost matrix; wherein the first path starts from a starting point among the points to be connected and ends at any point to be connected other than the starting point; and the connection vector is used to indicate the connection order of each point to be connected in the first path.
[0102] Optionally, the path planning module 503 is specifically used to convert the connection vector corresponding to the first path into a directed adjacency matrix and construct an objective function; use a heuristic algorithm to solve the objective function, and determine the first path with the lowest travel cost in the first path set as the target path; the objective function is: min(D×A), and the constraint condition is 1≤v i ≤n; wherein the first path set includes multiple first paths; D is the cost matrix of the first path, A is the directed adjacency matrix obtained by transforming the connection vector corresponding to the first path, v i is the ith point to be wired among the points to be wired, and n is the number of points to be wired among the points to be wired.
[0103] The automatic wiring device provided by the present application first obtains the point information of the points to be wired in the target house and the two-dimensional apartment information of the target house, and takes the projection of the target wall and the indoor floor on the two-dimensional plane as the passable area, and calculates the path set composed of the paths that pass along the passable area between every two points to be wired in the points to be wired. Afterwards, the target path that passes through all the points to be wired and has the lowest travel cost is filtered out from the path set. In the case of knowing the indoor two-dimensional apartment information and the point information of each wiring point in the wiring loop to be wired, the wiring diagram of the wiring loop can be quickly designed to reduce the wiring cost during interior decoration or renovation.
[0104] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor (processor) 610, a communication interface (Communications Interface) 620, a memory (memory) 630 and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 can call the logic instructions in the memory 630 to execute the automatic wiring method, which includes: obtaining the point information of the first point in the target house; the first point includes: the distribution box point of the target house, the wiring point of the first room of the target house; based on the two-dimensional apartment information of the target house, calculating the path between every two points to be wired in the first point; from the path between every two points to be wired, screening out the first path that passes through all the points to be wired and has the shortest path; the first path is a two-dimensional plane path; based on the three-dimensional apartment information of the target house, adjusting the path between any two points to be wired in the first path to obtain a second path with the lowest wiring cost; wherein the second path is a path along the wall; the two-dimensional apartment information is obtained after the three-dimensional apartment information is projected.
[0105] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0106] On the other hand, the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the automatic wiring method provided by the above methods, and the method includes: obtaining the point information of the first point in the target house; the first point includes: the distribution box point of the target house, the wiring point of the first room of the target house; based on the two-dimensional apartment information of the target house, calculating the path between every two points to be wired in the first point; from the path between every two points to be wired, filtering out the first path that passes through all the points to be wired and has the shortest path; the first path is a two-dimensional plane path; based on the three-dimensional apartment information of the target house, adjusting the path between any two points to be wired in the first path to obtain a second path with the lowest wiring cost; wherein, the second path is a path along the wall; the two-dimensional apartment information is obtained after the three-dimensional apartment information is projected.
[0107] On the other hand, the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it is implemented to execute the automatic wiring methods provided above, the method comprising: obtaining the point information of the first point in the target house; the first point comprises: the distribution box point of the target house, the wiring point of the first room of the target house; based on the two-dimensional apartment information of the target house, calculating the path between every two points to be wired in the first point; from the path between every two points to be wired, filtering out the first path that passes through all the points to be wired and has the shortest path; the first path is a two-dimensional plane path; based on the three-dimensional apartment information of the target house, adjusting the path between any two points to be wired in the first path to obtain a second path with the lowest wiring cost; wherein, the second path is a path along the wall; the two-dimensional apartment information is obtained after the three-dimensional apartment information is projected.
[0108] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0109] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An automatic wiring method, characterized in that: include: Obtaining the location information of the points to be connected in the target house and the two-dimensional apartment information of the target house; The projections of the target wall and the indoor ground on the two-dimensional plane are taken as the passable area, and a path set consisting of paths passing along the passable area between every two of the points to be connected is calculated; the step of calculating the path set consisting of paths passing along the passable area between every two of the points to be connected is specifically comprised of: Calculate the cost path between every two of the points to be connected along the passable area by using the Astar algorithm; The cost function of the Astar algorithm is: F=w×G+H; w represents the travel cost weight, G represents the actual path cost from the starting point to the current point to be connected, H represents the estimated cost of the current point to be connected to the end point, and F represents the estimated total path cost of the path where the current point to be connected is located from the starting point to the end point; Filtering out a target path that passes through all the points to be connected and has the lowest travel cost from the path set; The target wall includes: an inner wall without doors and windows; the two-dimensional apartment type information is obtained by projecting the three-dimensional apartment type information of the target house.
2. The method according to claim 1, characterized in that Before calculating the path set formed by the paths passing along the passable area between every two of the points to be connected, the method further includes: When the target obstacle is included in the passable area, determining the area where the target obstacle is located as a detour area; Among them, the travel cost weight of the first passable area is greater than the travel cost weight of the second passable area; the greater the travel cost weight, the higher the travel cost of the path; the first passable area is: the projection of the inner wall excluding doors and windows and the target obstacle on the two-dimensional plane; the second passable area is: the projection of the outer wall on the two-dimensional plane.
3. The method according to claim 2, characterized in that The step of selecting a target path from the path set that passes through all the points to be connected and has the lowest travel cost includes: Based on the travel cost of each path in the path set, a cost matrix is generated, and the diagonal elements of the cost matrix are set to preset values to avoid self-connection of the points to be connected.
4. The method according to claim 3, characterized in that After generating the cost matrix based on the travel cost of each path in the path set, the method further includes: Filtering out a first path passing through all the points to be connected from the path set, and obtaining a connection vector corresponding to the first path based on the cost matrix; The first path starts from a starting point among the points to be connected and ends at any point to be connected other than the starting point; the connection vector is used to indicate the connection order of each point to be connected in the first path.
5. The method according to claim 4, characterized in that After the first path passing through all the to-be-connected points is screened out from the path set based on the cost matrix and a connection vector corresponding to the first path is obtained, the method further includes: Convert the connection vector corresponding to the first path into a directed adjacency matrix and construct the objective function; Solving the objective function using a heuristic algorithm, and determining the first path with the lowest travel cost in the first path set as the target path; The objective function is: min(D×A), and the constraint is 1≤v i ≤n; The first path set includes multiple first paths; D is the cost matrix of the first path, A is the directed adjacency matrix obtained by transforming the connection vector corresponding to the first path, v i is the ith point to be wired among the points to be wired, and n is the number of points to be wired among the points to be wired.
6. An automatic wiring device, characterized in that: The device comprises: An acquisition module, used to acquire the location information of the points to be connected in the target house and the two-dimensional apartment type information of the target house; A calculation module is used to take the projection of the target wall and the indoor floor on a two-dimensional plane as a passable area, and calculate a path set composed of paths passing along the passable area between every two of the points to be connected; the step of calculating the path set composed of paths passing along the passable area between every two of the points to be connected specifically includes: calculating the cost path passing along the passable area between every two of the points to be connected by the Astar algorithm; wherein the cost function of the Astar algorithm is: F=w×G+H; w represents the pass cost weight, G represents the actual path cost from the starting point to the current point to be connected, H represents the estimated cost of the current point to be connected to reach the end point, and F represents the estimated total path cost of the path where the current point to be connected is located from the starting point to the end point; A path planning module is used to select a target path that passes through all the points to be connected and has the lowest travel cost from the path set; The target wall includes: an inner wall without doors and windows; the two-dimensional apartment type information is obtained by projecting the three-dimensional apartment type information of the target house.
7. The device according to claim 6, characterized in that The device further comprises: a determination module; The determination module is used to determine the area where the target obstacle is located as a detour area when the traversable area contains the target obstacle; Among them, the travel cost weight of the first passable area is greater than the travel cost weight of the second passable area; the greater the travel cost weight, the higher the travel cost of the path; the first passable area is: the projection of the inner wall excluding doors and windows and the target obstacle on the two-dimensional plane; the second passable area is: the projection of the outer wall on the two-dimensional plane.
8. 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, the steps of the automatic wiring method according to any one of claims 1 to 5 are implemented.
9. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the automatic wiring method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Automatic wiring method and device, storage medium and electronic equipment
CN113111424A