Automatic Calculation Methods, Systems, Equipment, and Media for the Number of Conductors in Lighting Systems
By automatically calculating the number of wires in a lighting system using tree structure modeling and path optimization algorithms, the problem of low efficiency and poor accuracy of manual calculation in existing technologies is solved, and wire calculation is made fast, accurate and economical.
Patent Information
- Application Number
- CN202611313074.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-27
- Publication Date
- 2026-11-17
AI Technical Summary
In existing lighting systems, wire calculations require extensive manual intervention, have long design cycles, are prone to errors, and are difficult to adapt to dynamic design changes.
It employs tree structure modeling and path optimization algorithms to automatically calculate the number of neutral, ground, live, and control wires. It constructs a tree structure using breadth-first or depth-first algorithms and calculates control wire paths using greedy algorithms and path optimization algorithms, supporting both manual intervention and dynamic updates.
It enables fast and accurate calculation of the number of conductors, reduces design errors, lowers material costs and construction difficulty, adapts to complex design changes, and supports BIM models of different sizes.
Smart Images

Figure CN123116992A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electrical automation design technology, and in particular to a method, system, device, and medium for automatically calculating the number of wires in a lighting system. Background Technology
[0002] In existing lighting systems, wire counting (including neutral, ground, live, and control wires) is typically done manually by designers based on circuit diagrams or BIM models, counting the number of wires in the circuit. Specifically, designers need to identify terminal wires, luminaires, switches, and other components in the circuit, calculate the paths and number of neutral, ground, live, and control wires one by one, accumulate the results, and mark the number of wires on the drawing.
[0003] The existing technical solutions have the following technical defects: (1) Manual calculation requires a lot of human intervention, especially in complex circuits (such as multiple switches controlling multiple lamps). Designers need to spend a lot of time tracing paths and counting wires, resulting in a long design cycle. (2) Manual calculation is prone to errors due to human factors (such as omissions or repeated calculations). (3) Existing methods are difficult to adapt to dynamic design changes. For example, when the circuit structure in the BIM model is adjusted, manual calculation needs to be restarted. Summary of the Invention
[0004] The purpose of this invention is to provide a method, system, device and medium for automatically calculating the number of wires in a lighting system. Through tree structure modeling and path optimization, it can quickly and accurately calculate the number of neutral, ground, live and control wires in a lighting system.
[0005] The technical solution adopted in this invention is:
[0006] A method for automatically calculating the number of wires in a lighting system includes the following steps:
[0007] Import the electromechanical building information model and analyze the electrical components within the target lighting circuit;
[0008] Select the terminal wire of the target lighting circuit as the root node; according to the electrical connection relationship of the target lighting circuit, connect the electrical components, including lamps and switches, in series to form a tree structure using the wire as the connecting edge;
[0009] First, initialize the number of each wire to 0, then traverse the tree structure to calculate the number of wires for the neutral wire, ground wire, live wire, and control wire respectively;
[0010] When calculating the number of neutral and ground wires, the tree structure is traversed and the number of all wires on the path from the root node to each lamp node is incremented by 2, including 1 neutral wire and 1 ground wire.
[0011] When calculating the number of live wires, traverse the tree structure to find all wires on the path from the root node to each switch node. If it is a standby lighting system, add 2 to the number of live wires for each system. If it is a normal lighting system, add 1 to the number of live wires for each system.
[0012] When calculating the number of control wires, the calculation is performed independently in each room. Within the same room, each light fixture node is covered only once by the control wire path of a switch node. If multiple switches control the same light fixture, the allocation is determined according to preset rules or manually. A control subtree covering the light fixtures within the control range of the corresponding switch node is constructed with each switch node as a child root node. The path set from the switch node to each light fixture node in the control subtree is recorded. Based on the path set, a path optimization algorithm is used to determine the optimal control wire path with the goal of covering the most light fixture nodes and minimizing the total path length, and the number of wires on the corresponding path is increased. When there is a double-control switch in the room, the other double-control switch in the room is searched in the tree structure with one of the double-control switches as the reference, the number of wires traversed is increased by 2, and the associated double-control switches are considered as a child root node to confirm the control wire path and calculate the number of wires on the control wire path.
[0013] Record or mark the number of neutral, ground, live, and control wires on each conductor.
[0014] Furthermore, the technical solution of the present invention uses breadth-first traversal or depth-first traversal algorithms to construct a tree structure.
[0015] Furthermore, the implementation of determining control line paths and increasing the number of conductors on the corresponding paths using a path optimization algorithm based on the path set includes:
[0016] Determine the number of control line paths n corresponding to the switch node, where n is a positive integer. If it is a single switch, n is 1; if it is a double switch, n is 2; if it is a triple switch, n is 3; and if it is a quadruple switch, n is 4.
[0017] A greedy algorithm or set covering algorithm is used to select n paths from the path set, such that the number of lamp nodes covered by the n paths is maximized and the same lamp node is not covered repeatedly; the number of wires on the selected n paths is increased by 1 to become control lines.
[0018] Furthermore, when calculating the number of control lines, a greedy algorithm is used to select n paths from the path set, including the following steps:
[0019] Calculate the number of lighting nodes that each path in the current path set can cover but are not yet covered by the selected paths;
[0020] Select the path with the most covered lighting nodes.
[0021] Furthermore, when calculating the number of control lines, the following steps are also included: when the n paths selected in the path set cannot cover all the lamp nodes in the control subtree, the wires in the control subtree that are not connected to the uncovered lamp nodes in the n paths are added to the path set as path branches, and the number of wires in each branch path is increased by 1.
[0022] Furthermore, the method of the present invention also includes:
[0023] It provides a user interface with manual selection mode, and receives manual selection instructions from users for control line paths;
[0024] Based on the user's manual selection instructions, replace or correct the automatically determined control line path and adjust the number of control lines on the corresponding path.
[0025] Furthermore, the method of the present invention also includes:
[0026] Dynamic update steps:
[0027] Listen for changes in the building information model; when a change in the loop structure is detected, trigger the reconstruction of the tree structure and the recalculation of the number of wires.
[0028] Furthermore, the present invention also discloses an automatic wire count calculation system for a lighting system. Based on the aforementioned automatic wire count calculation method for a lighting system, the system includes:
[0029] The model import module is used to import electromechanical building information models and analyze the electrical components within the target lighting circuit;
[0030] The topology building module is used to connect all components in the target lighting circuit, including wires, lamps, and switches, in series to form a tree structure that reflects the electrical connection topology, with the terminal wire of the target lighting circuit as the root node.
[0031] The calculation module is used to traverse the tree structure to calculate the number of wires for the neutral wire, ground wire, live wire, and control wire respectively.
[0032] The calculation module includes the following units:
[0033] The zero-ground calculation unit is used to traverse the tree structure and set the number of all wires on the path from the root node to each lamp node to 2.
[0034] The live wire calculation unit is used to traverse the tree structure and count all wires on the path from the root node to each switch node. If it is a standby lighting system, the number of live wires is increased by 2, and if it is a normal lighting system, the number of live wires is increased by 1.
[0035] The control line calculation unit calculates independently within each room, constructing a control subtree covering the lighting fixtures within the control range of each switch node in the corresponding room, with each switch node as its child root node. It records the set of paths from the switch node to each lighting fixture node in the control subtree. Based on the path set, a path optimization algorithm is used to determine the optimal control line path and the number of wires on the corresponding path is increased. If a double-pole switch exists in the room, the unit searches for the other double-pole switch in the tree structure (a room can only have two double-pole switches or no double-pole switches), increases the number of wires traversed by 2, and then, using only one double-pole switch as its child root node, calculates the number of wires using the same method.
[0036] Furthermore, the present invention also discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that the processor executes the program to implement the steps of the automatic calculation method for the number of wires in a lighting system.
[0037] Furthermore, the present invention also discloses a computer-readable storage medium storing a computer program thereon, characterized in that the computer program, when executed by a processor, implements the steps of the automatic calculation method for the number of wires in a lighting system.
[0038] The present invention adopts the above technical solution and has the following beneficial effects compared with the prior art:
[0039] (1) This invention automatically constructs a tree structure and optimizes paths, eliminating the need for manual tracing of wire paths one by one. This significantly improves calculation speed, especially in large-scale loops. (2) This invention uses a tree structure to accurately represent the loop topology, ensuring that the calculation of the number of neutral, ground, live, and control wires is based on complete paths, avoiding omissions or duplications. The control wire calculation is optimized through path set optimization, ensuring that each luminaire is covered and there are no duplicate calculations, reducing design errors. (3) In the control wire calculation, this invention prioritizes the minimum path set that covers all luminaires. If this is not met, it maximizes coverage and adjusts uncovered paths, thereby minimizing the total length and number of wires, reducing material costs and construction difficulty. (4) The method of this invention supports manual intervention, allowing designers to customize control wire paths in complex scenarios to adapt to special design needs. At the same time, the algorithm can handle various loop structures, such as dual-control switch control, backup lighting and general lighting conditions, and has good versatility. (5) The tree structure of the present invention is applicable to BIM models of different sizes, from simple residential buildings to large commercial buildings, and can run stably. It is easy to integrate into existing BIM software and supports real-time updates and dynamic calculations.
[0040] This invention not only solves the problems of low efficiency and poor accuracy, but also introduces an intelligent path selection mechanism, which achieves the economy and optimization of traverse calculation while ensuring the integrity of the functions. Attached Figure Description
[0041] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments;
[0042] Figure 1 This is a flowchart illustrating an automatic calculation method for the number of wires in a lighting system according to the present invention. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0044] like Figure 1 As shown, this invention discloses an automatic calculation method for the number of wires in a lighting system, the method comprising the following steps:
[0045] Import the electromechanical building information model and analyze the electrical components within the target lighting circuit; the electrical components include at least wires, lamps, and switches.
[0046] The terminal wire of the target lighting circuit is selected as the root node. Based on the electrical connection relationships of the target lighting circuit, electrical components, including lamps and switches, are connected in series using wires as connecting edges to form a tree structure. Nodes represent components, and edges represent wire connections. The tree structure is constructed using either a breadth-first or depth-first search algorithm to ensure that all components are included and there are no loops.
[0047] First, initialize the number of each wire to 0, then traverse the tree structure to calculate the number of wires for the neutral wire, ground wire, live wire, and control wire respectively;
[0048] When calculating the number of neutral and ground wires, the tree structure is traversed and the number of all wires on the path from the root node to each lamp node is incremented by 2, including 1 neutral wire and 1 ground wire.
[0049] When calculating the number of live wires, the tree structure is traversed to include all wires on the path from the root node to each switch node. If it is a standby lighting system, the number of live wires is increased by 2, and if it is a normal lighting system, the number of live wires is increased by 1, representing the number of live wires.
[0050] When calculating the number of control wires, the calculation is performed independently in each room. Within the same room, each light fixture node is covered only once by the control wire path of a switch node. If multiple switches control the same light fixture, the allocation is determined according to preset rules or manually. A control subtree covering the light fixtures within the control range of the corresponding switch node is constructed with each switch node as a child root node. The path set from the switch node to each light fixture node in the control subtree is recorded. Based on the path set, a path optimization algorithm is used to determine the optimal control wire path with the goal of covering the most light fixture nodes and minimizing the total path length, and the number of wires on the corresponding path is increased. When there is a double-control switch in the room, the other double-control switch in the room is searched in the tree structure with one of the double-control switches as the reference, the number of wires traversed is increased by 2, and the associated double-control switches are considered as a child root node to confirm the control wire path and calculate the number of wires on the control wire path.
[0051] Record or mark the number of neutral, ground, live, and control wires on each conductor.
[0052] Furthermore, the implementation of determining control line paths and increasing the number of conductors on the corresponding paths using a path optimization algorithm based on the path set includes:
[0053] Determine the number of control line paths n corresponding to the switch node, where n is a positive integer. If it is a single switch, n is 1; if it is a double switch, n is 2; if it is a triple switch, n is 3; and if it is a quadruple switch, n is 4.
[0054] A greedy algorithm or set covering algorithm is used to select n paths from the path set, such that the number of lamp nodes covered by the n paths is maximized and the same lamp node is not covered repeatedly; the number of wires on the selected n paths is increased by 1 to become control lines.
[0055] Furthermore, when calculating the number of control lines, a greedy algorithm is used to select n paths from the path set, including the following steps:
[0056] Calculate the number of lighting nodes that each path in the current path set can cover but are not yet covered by the selected paths;
[0057] Select the path with the most covered lighting nodes.
[0058] Furthermore, when calculating the number of control lines, the method also includes: when the n paths selected in the path set cannot cover all the lamp nodes in the control subtree, the wires in the control subtree that do not connect to the uncovered lamp nodes in the n paths are added to the path set as path branches, and the number of wires in each branch path is increased by 1.
[0059] Specifically, for each switch, a new tree structure called the "control tree" is constructed with that switch as the root node, covering all circuits in the room, ensuring that each leaf node is a light fixture. This control tree contains only possible paths from the switch to the light fixture. A set m of paths from the switch to each light fixture is recorded, where each path contains a series of wires. The number n of control line paths corresponding to the switch is read, where n is determined by the switch type: n=1 for a single-pole switch, n=2 for a double-pole switch, n=3 for a triple-pole switch, and n=4 for a quadruple-pole switch; it can also be determined by design specifications or user input. n paths are selected from the path set m such that all light fixtures in the room are included without duplicates. If such a combination exists, the number of wires recorded in each of these n paths is incremented by 1, representing control lines. If no such combination exists, meaning the n paths cannot cover all light fixtures, n paths are selected from the set m such that as many light fixtures as possible are included without duplicates. Increment the number of wires recorded in each of these n paths by 1. At the same time, add the wire paths in the room loop tree that are not in these n paths but connect to the uncovered light fixture nodes as branch paths into the path set, and increment the number of wires in each of these branch paths by 1 to ensure that the uncovered light fixtures can also be controlled through other paths.
[0060] Furthermore, as an optional implementation, for rooms with a large number of switches and light fixtures, a manual selection mode is provided, allowing users to manually specify the control line path, and then adjusting the number of wires based on the user's selection. Specifically, a user interface for the manual selection mode is provided, which receives the user's manual selection command for the control line path; based on the user's manual selection command, the control line path is determined and the number of control wires on the corresponding path is adjusted.
[0061] Furthermore, the method of the present invention also includes:
[0062] Dynamic update steps:
[0063] Listen for changes in the building information model; when a change in the loop structure is detected, trigger the reconstruction of the tree structure and the recalculation of the number of wires.
[0064] Furthermore, the present invention also discloses an automatic wire count calculation system for a lighting system, used to execute the aforementioned automatic wire count calculation method for a lighting system, the system comprising:
[0065] The model import module is used to import electromechanical building information models and analyze the electrical components within the target lighting circuit;
[0066] The topology building module is used to connect all components in the target lighting circuit, including wires, lamps, and switches, in series to form a tree structure that reflects the electrical connection topology, with the terminal wire of the target lighting circuit as the root node.
[0067] The calculation module is used to traverse the tree structure to calculate the number of wires for the neutral wire, ground wire, live wire, and control wire respectively.
[0068] The calculation module includes the following units:
[0069] The zero-ground calculation unit is used to traverse the tree structure and set the number of all wires on the path from the root node to each lamp node to 2.
[0070] The live wire calculation unit is used to traverse the tree structure and count all wires on the path from the root node to each switch node. If it is a standby lighting system, the number of live wires is increased by 2, and if it is a normal lighting system, the number of live wires is increased by 1.
[0071] The control line calculation unit calculates independently within each room, constructing a control subtree covering the lighting fixtures within the control range of each switch node in the corresponding room, with each switch node as its child root node. It records the set of paths from the switch node to each lighting fixture node in the control subtree. Based on the path set, a path optimization algorithm is used to determine the optimal control line path and the number of wires on the corresponding path is increased. If a double-pole switch exists in the room, the unit searches for the other double-pole switch in the tree structure (a room can only have two double-pole switches or no double-pole switches), increases the number of wires traversed by 2, and then, using only one double-pole switch as its child root node, calculates the number of wires using the same method.
[0072] Furthermore, the present invention also discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that the processor executes the program to implement the steps of the automatic calculation method for the number of wires in a lighting system.
[0073] Furthermore, the present invention also discloses a computer-readable storage medium storing a computer program thereon, characterized in that the computer program, when executed by a processor, implements the steps of the automatic calculation method for the number of wires in a lighting system.
[0074] This invention utilizes a tree-like data structure to abstract the electrical connections of circuits, making path traversal and calculation highly efficient. The root node serves as the starting point of the circuit, while lamps and switches act as leaf nodes or intermediate nodes, ensuring the completeness of the calculation. In control line calculation, a set-covering algorithm (such as a greedy algorithm) is used to select paths. The number of control line circuits is determined based on the switches, and the shortest path covering the most lamps is used as a constraint to select control line circuits. Lamp paths not on control line circuits are supplemented into the tree structure as branch paths to ensure control reliability, demonstrating the algorithm's robustness. This invention supports real-time updates of the tree structure and the number of wires based on BIM model changes, ensuring that calculation results are synchronized with the design. The final output includes a count of the number of wires for each line, which can be directly used for BIM model annotation, bill of materials generation, or construction guidance.
[0075] The present invention adopts the above technical solution and has the following beneficial effects compared with the prior art:
[0076] (1) This invention automatically constructs a tree structure and optimizes paths, eliminating the need for manual tracing of wire paths one by one. Especially in large-scale loops, the calculation speed is significantly improved. For example, in the test case, for a loop containing 100 lamps and 20 switches, the calculation time was reduced from several hours of manual calculation to a few minutes. (2) This invention uses a tree structure to accurately represent the loop topology, ensuring that the calculation of the number of neutral, ground, live, and control wires is based on the complete path, avoiding omissions or duplications. The control wire calculation is optimized through path set optimization, ensuring that each lamp is covered and there is no duplicate calculation, reducing design errors. (3) In the control wire calculation, this invention prioritizes the minimum path set that covers all lamps. If this is not met, it maximizes the coverage and adjusts the uncovered paths, thereby minimizing the total length and number of wires, reducing material costs and construction difficulty. (4) The method of this invention supports manual intervention, allowing designers to customize control wire paths in complex scenarios to adapt to special design needs. At the same time, the algorithm can handle various loop structures, such as multi-switch control and cross-room loops, and has good versatility. (5) The tree structure of the present invention is applicable to BIM models of different sizes, from simple residential buildings to large commercial buildings, and can run stably. It is easy to integrate into existing BIM software and supports real-time updates and dynamic calculations.
[0077] This invention not only solves the problems of low efficiency and poor accuracy, but also introduces an intelligent path selection mechanism, which achieves the economy and optimization of traverse calculation while ensuring the integrity of the functions.
[0078] Obviously, the described embodiments are only a part of the embodiments of this application, not all of them. Without conflict, the embodiments and features in the embodiments of this application can be combined with each other. The components of the embodiments of this application described and illustrated herein can generally be arranged and designed in various different configurations. Therefore, the detailed description of the embodiments of this application is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
Claims
1. A method for automatically calculating the number of wires in a lighting system, characterized in that, Includes the following steps: Import the electromechanical building information model and analyze the electrical components within the target lighting circuit; Select the terminal wire of the target lighting circuit as the root node; according to the electrical connection relationship of the target lighting circuit, connect the electrical components, including lamps and switches, in series to form a tree structure using the wire as the connecting edge; First, initialize the number of wires in each wire to 0, then traverse the tree structure to calculate the number of wires in the neutral wire, ground wire, live wire, and control wire respectively; When calculating the number of neutral and ground wires, the tree structure is traversed, and the number of all wires on the path from the root node to each lamp node is incremented by 2, including 1 neutral wire and 1 ground wire. When calculating the number of live wires, traverse the tree structure and count all wires on the path from the root node to each switch node. If it is a standby lighting system, add 2 to the number of live wires for each system; if it is a normal lighting system, add 1 to the number of live wires for each system. When calculating the number of control wires, the calculation is performed independently in each room. Within the same room, each light fixture node is covered only once by the control wire path of a switch node. If multiple switches control the same light fixture, the allocation is determined according to preset rules or manually. A control subtree covering the light fixtures within the control range of the corresponding switch node is constructed with each switch node as a child root node. The path set from the switch node to each light fixture node in the control subtree is recorded. Based on the path set, a path optimization algorithm is used to determine the optimal control wire path with the goal of covering the most light fixture nodes and minimizing the total path length, and the number of wires on the corresponding path is increased. When there is a double-control switch in the room, the other double-control switch in the room is searched in the tree structure with one of the double-control switches as the reference, the number of wires traversed is increased by 2, and the associated double-control switches are considered as a child root node to confirm the control wire path and calculate the number of wires on the control wire path. Record or mark the number of neutral, ground, live, and control wires on each conductor.
2. The method for automatically calculating the number of wires in a lighting system according to claim 1, characterized in that, The implementation of determining control line paths and increasing the number of conductors on corresponding paths using a path optimization algorithm based on path sets includes: Determine the number of control line paths n corresponding to the switch node, where n is a positive integer. If it is a single switch, n is 1; if it is a double switch, n is 2; if it is a triple switch, n is 3; and if it is a quadruple switch, n is 4. A greedy algorithm or set covering algorithm is used to select n paths from the path set, such that the number of lamp nodes covered by the n paths is maximized and the same lamp node is not covered repeatedly; the number of wires on the selected n paths is increased by 1 to become control lines.
3. The method for automatically calculating the number of wires in a lighting system according to claim 2, characterized in that, When calculating the number of control lines, a greedy algorithm is used to select n paths from the path set. The following steps are repeated until n paths are selected: Calculate the number of lighting nodes that each path in the current path set can cover but are not yet covered by the selected paths; The path with the most covered lighting nodes is selected as the chosen path.
4. The method for automatically calculating the number of wires in a lighting system according to claim 2, characterized in that, When calculating the number of control lines, the following steps are also taken: when the n paths selected in the path set cannot cover all the lamp nodes in the control subtree, the wires in the control subtree that do not connect to the uncovered lamp nodes in the n paths are added to the path set as path branches, and the number of their wires is increased by 1.
5. The method for automatically calculating the number of wires in a lighting system according to claim 1, characterized in that, The method also includes: It provides a user interface for manual selection mode, and receives manual selection commands from users for control line paths; Based on the user's manual selection instructions, replace or correct the automatically determined control line path and adjust the number of control lines on the corresponding path.
6. The method for automatically calculating the number of wires in a lighting system according to claim 1, characterized in that, The method also includes: Dynamic update steps: Listen for changes in the building information model; when a change in the loop structure is detected, trigger the reconstruction of the tree structure and the recalculation of the number of wires.
7. The method for automatically calculating the number of wires in a lighting system according to claim 1, characterized in that, Record or mark the number of neutral, ground, live, and control wires on each conductor. Recording includes recording the data in the conductor's attributes, extended data, and tables. Marking refers to the explicit display of the data using marker families, text, or labels.
8. An automatic wire count calculation system for a lighting system, used to execute the automatic wire count calculation method for a lighting system according to any one of claims 1 to 7, characterized in that, The system includes: The model import module is used to import electromechanical building information models and analyze the electrical components within the target lighting circuit; The topology building module is used to connect all components in the target lighting circuit, including wires, lamps, and switches, in series to form a tree structure that reflects the electrical connection topology, with the terminal wire of the target lighting circuit as the root node. The calculation module is used to traverse the tree structure to calculate the number of wires for the neutral wire, ground wire, live wire, and control wire respectively; The calculation module includes the following units: The zero-ground calculation unit is used to traverse the tree structure and set the number of all wires on the path from the root node to each lamp node to 2. The live wire calculation unit is used to traverse the tree structure and count all wires on the path from the root node to each switch node. If it is a standby lighting system, the number of live wires is increased by 2, and if it is a normal lighting system, the number of live wires is increased by 1. The control line calculation unit is used to calculate independently in each room. It constructs a control subtree covering the lighting fixtures within the control range of the corresponding switch node in the room, with each switch node as the child root node. It records the set of paths from the switch node to each lighting fixture node in the control subtree. Based on the path set, it uses a path optimization algorithm to determine the optimal control line path and increases the number of wires on the corresponding path. If there is a double-control switch in the room, it searches for the other double-control switch in the room in the tree structure with one of the double-control switches, increases the number of wires traversed by 2, and then uses only one double-control switch as the child root node to process and calculate the number of wires in the same way as above.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the program, it implements the steps of the automatic calculation method for the number of wires in a lighting system according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When a computer program is executed by a processor, it implements the steps of an automatic calculation method for the number of wires in a lighting system according to any one of claims 1 to 7.
