A method for calculating a building evacuation path
By employing a single-step breadth-first search evacuation path calculation method in industrial-grade embedded devices, a directed graph data structure is established, solving the problems of high computational complexity and large memory consumption in existing technologies. This achieves efficient, low-memory evacuation path calculation, making it suitable for evacuation monitoring systems in embedded devices.
Patent Information
- Application Number
- CN202211318462.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-26
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2042-10-26
AI Technical Summary
Existing evacuation algorithms have high computational complexity and large memory consumption in industrial embedded devices, making it difficult to process evacuation routes in large buildings in real time, and evacuation plans cannot adapt to current fire alarm situations.
A directed graph data structure is established by adopting a single-step breadth-first search method. Evacuation routes are calculated by connecting lighting fixtures and fire alarms. By utilizing breadth-first search and single-step inference, the number of function call layers is reduced, memory usage is lowered, and the system is adapted to real-time calculation of fire alarm status.
It achieves efficient, low-memory evacuation path calculation, is suitable for embedded devices, has fast calculation speed, and the results are simple and easy to use, making it suitable for evacuation monitoring systems for embedded devices.
Smart Images

Figure CN115600295B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of building information modeling technology, and in particular to a method for calculating building evacuation routes. Background Technology
[0002] Evacuation control systems are essential safety control systems in every large building. In the event of disasters such as fires, they can automatically or manually activate evacuation audio-visual indicators on each floor. While controlling the illumination of various lights, the system also provides voice guidance to occupants, guiding them to safety. Current mainstream evacuation systems mainly consist of three parts: equipment monitoring, graphical display, and evacuation algorithms. The core of such systems is the evacuation algorithm; both the graphical display and equipment monitoring need to respond accordingly based on the algorithm's output.
[0003] Most existing evacuation algorithms use shortest path and heuristic path search algorithms such as Dijkstra's algorithm and A* algorithm. The underlying ideas are mainly backtracking and recursion, which have high time and space complexity. When it is necessary to calculate the evacuation path in real time for all floors of an entire building or even all floors of multiple buildings, it will place high demands on the CPU's computing power and memory storage capacity.
[0004] Meanwhile, existing evacuation control systems calculate and generate evacuation routes by pre-editing evacuation plans. When executing an evacuation, a manual selection from the existing evacuation plans is required. However, it is impossible to predict in advance whether the evacuation plan is suitable for the actual situation of the fire.
[0005] Due to the industrial sector's requirements for temperature control and long-term stable operation, current industrial-grade embedded devices typically employ CPUs with limited computing power and memory storage capacity. Simultaneously performing equipment monitoring, 2D vector building floor visualization, and real-time evacuation route calculations puts significant strain on CPU and memory, potentially causing system lag. Embedded devices commonly run on Windows and Linux platforms. Windows platforms generally offer higher CPU and memory configurations than Linux platforms, but this also increases hardware costs. Due to these performance limitations, evacuation systems on the market primarily run on Windows platforms. However, industrial-grade embedded Linux devices offer significant cost advantages, and their excellent stability makes them ideal for long-term operation of safety control systems like evacuation systems. Furthermore, embedded Linux devices are highly customizable, allowing companies to tailor various hardware functions and configurations to their specific needs, achieving a balance between cost, functionality, and performance. Summary of the Invention
[0006] The present invention aims to provide a method for calculating building evacuation routes that meets the time and space complexity requirements of industrial-grade embedded Linux devices.
[0007] To achieve the above objectives, the technical solution of the present invention is as follows:
[0008] A method for calculating building evacuation routes, comprising:
[0009] Step S1: Create a plan view of the lighting fixtures and fire alarms, connect each pair of lighting fixtures in a directed manner, connect the fire alarms to the lighting fixtures in an undirected manner, and convert the plan view into a directed graph data structure.
[0010] Step S2: Determine which lights are prohibited from being passed;
[0011] Step S3: Create evacuation routes based on safety exits;
[0012] Step S4: Initialize the evacuation path;
[0013] Step S5: Calculate the evacuation path and perform a single-step breadth-first search inference for each branch to be searched on each evacuation path;
[0014] Step S6: Obtain the calculation results of the evacuation routes.
[0015] The above conversion to a directed graph data structure includes,
[0016] Step S11: Convert each of the lamps into a vertex in the directed graph data structure. The attributes of each vertex include: unique identification ID, 2D position coordinates, whether it is a safety exit, whether it is a two-way light, whether it is a no-passage, input edge set, output edge set, whether it is a branch vertex, and branch information.
[0017] Step S12: Convert each directed connection into one or more directed edges in the directed graph data structure. Each directed edge includes the following attributes: directed edge start point, directed edge end point, directed edge length, branch information, whether passage is prohibited, and whether it is closed.
[0018] The aforementioned branch information is an information structure, including: evacuation path number, branch number, parent branch number, current vertex, whether the branch is closed, and the distance between the safety exit and the vertex.
[0019] Step S12 above also includes: if at least one of the two lamps associated by a directed connection is a unidirectional lamp, then in the directed graph data structure it is converted into a directed edge connecting the two vertices, and the direction of the directed edge is consistent with the direction of the directed connection; if both lamps associated by a directed connection are bidirectional lamps, then in the directed graph data structure they are converted into two directed edges of equal length and opposite directions; if the vertex attribute "whether it is a safety exit" of one of the two lamps associated by a directed connection is True, then in the directed graph data structure it is converted into a directed edge pointing to that vertex.
[0020] Specifically, step S2 includes: when a fire alarm detects a fire, setting the "whether passage is prohibited" attribute of all its associated vertices to True; setting the "whether passage is prohibited" attribute of all directed edges in the input edge set of the vertex to True; if the vertex pointed to by the starting point of the directed edge in the input edge set is not a branch vertex, then continuing to set the "whether passage is prohibited" attribute of the vertex pointed to by the starting point of the directed edge to True in the current direction until a branch vertex is encountered, at which point the processing in that direction is terminated.
[0021] Step S3 above specifically includes obtaining a set of safe exit vertices in the directed graph data structure, creating an evacuation path with each safe exit vertex as a starting point, and the attributes of the evacuation path include: safe exit vertex of the evacuation path, evacuation path number, whether the search has ended, branch number, list of branches to be searched, and list of branches to be searched next.
[0022] The above step S4 specifically includes setting the attribute "whether the search is over" to False, clearing the list of branches to be searched, and constructing the first branch and adding it to the list of branches to be searched.
[0023] The above step S5 specifically includes,
[0024] Step S51: Determine if there is an evacuation path in the evacuation path set whose attribute "whether the search has ended" is False. If there is, take one out and set it as the current search path; otherwise, it means that step S5 has ended and jump to step S6.
[0025] Step S52: Determine if there is a branch to be searched in the list of branches to be searched in the current search path. If there is, take one of the branches and set it as the current search branch. If not, it means that the current evacuation path search ends in this round and jump to step S59 to continue execution.
[0026] Step S53: Determine whether the attribute "whether the branch is closed" of the branch to be searched is True. If it is, jump back to step S52 and continue execution; otherwise, continue to the following steps.
[0027] Step S54: Traverse the set of input edges of the current vertex of the branch to be searched, and determine whether the set of input edges is not empty. If it is, take out an input directed edge; if not, it means that the search of the current branch to be searched has ended, set the attribute of the branch "whether the branch is closed" to True, and jump back to step S52 to continue execution.
[0028] Step S55: Determine whether the attribute "whether passage is prohibited" of the input directed edge is True. If it is, jump back to step S54 and continue execution; otherwise, continue to the following steps.
[0029] Step S56: If the current vertex of the current search branch is not the safe exit vertex of the evacuation path and no directed edge that was last searched for the vertex can be found, then the current search branch determines that it has been terminated by other branches, sets the attribute "whether the branch is closed" of the branch to True, and jumps back to step S52 to continue execution; otherwise, continue to the following steps.
[0030] Step S57: If the current vertex of the current search branch is a branch vertex or a safe exit vertex of the current evacuation path, then create a new branch information for each input directed edge of the current vertex, including assigning a new branch number to the branch, setting the current branch number as the parent branch number of the new branch, setting the path number of the new branch as the path number of the current branch, adding the new branch information to the search branch list for the next path calculation, and jumping to step S59 to continue execution; otherwise, proceed to step S58.
[0031] Step S58: Perform path attribution determination on the starting point of the current directed edge. The determination result determines whether the branch of the current evacuation path can continue to search forward.
[0032] Step S59: If the next branch list to be searched is empty, it means that all branches of the current evacuation path have been searched. Set the attribute "whether the search is finished" of the current evacuation path to True and jump to step S51 to continue execution; otherwise, copy the next branch list to be searched to the current evacuation path's branch list to be searched, clear the next branch list to be searched, and jump to step S52 to continue execution.
[0033] The above step S58 specifically includes,
[0034] Step S581: Obtain the directed edge in the current direction;
[0035] Step S582: Obtain the directed edge in the opposite direction to the current direction;
[0036] Step S583: If the "Branch Information" attribute of the directed edge in the current direction has not yet been set with branch information, return the judgment result: continue searching forward; if the "Branch Information" attribute of the directed edge in the current direction has already saved branch information, jump to S585 to continue execution.
[0037] Step S584: If there is a directed edge in the opposite direction of the current direction and the attribute "Branch Information" of the directed edge has already saved the branch information, then jump to S586 to continue execution.
[0038] Step S585: If the shortest distance recorded in the branch information on the directed edge in the current direction is greater than the shortest path of the current branch plus the length of the directed edge, return the judgment result: the ownership of the directed edge is obtained through competition in the same direction; otherwise, return the judgment result: the competition with the branch of the same direction path fails.
[0039] Step S586: If the shortest distance recorded in the branch information on the directed edge in the opposite direction of the current direction is greater than the shortest path of the current path branch plus the length of the directed edge, return the judgment result: the ownership of the directed edge is obtained through reverse competition; otherwise, return the judgment result: the competition with the reverse path branch fails.
[0040] Step S587: The decision ends, and the direction of the current path branch is determined based on the result.
[0041] If the result is that the competition with the reverse path branch fails, the branch of the evacuation path cannot continue to search forward. Set the "Is this branch closed?" property of the current branch to True, and jump back to step S52 to continue execution.
[0042] If the result is that the competition with the branch of the same direction fails, the branch of the evacuation path cannot continue to search forward. Set the "Is this branch closed?" property of the current branch to True, and jump back to step S52 to continue execution.
[0043] If the result means continue searching forward, no further action is needed.
[0044] If the result is that ownership of the directed edge is obtained through competition in the same direction, the branch information recorded in the directed edge is retrieved, and the "whether the branch is closed" attribute of the branch is set to True;
[0045] If the result is that ownership of the directed edge is obtained through reverse competition, the branch information recorded in the directed edge in the opposite direction of the current direction is retrieved, and the "whether the branch is closed" attribute of the branch is set to True;
[0046] Step S588: Construct new branch information using the starting point of the current directed edge, the current branch number, the current parent branch number, and the distance from the current path exit to the starting point of the current directed edge. Set this branch information into the branch information attributes of the directed edge and vertex in the current direction, and add it to the search branch list when the evacuation path calculation is performed next. Then jump back to step S52 to continue execution.
[0047] The above step S6 specifically includes the calculation result of the evacuation path consisting of the directed edge set composed of directed edges whose "whether to close" is True and directed edges whose "whether to prohibit passage" is True.
[0048] Beneficial effects: This invention provides a method for calculating building evacuation routes, which boasts high calculation speed, low memory consumption, and the ability to calculate evacuation routes in real time based on the status of fire alarms. Due to the use of a method that simultaneously infers multiple evacuation routes step-by-step, the number of function call layers is reduced, making it particularly suitable for use in embedded devices. Its advantages are especially pronounced on embedded devices with limited memory capacity and sensitivity to the depth of function call stacks. The time complexity is O(E), and the space complexity is O(N(E+V)), where E is the number of directed edges, V is the number of vertices, and N is the size of the path information structure. The computational load for a single building floor can be simply understood as the sum of the number of vertices and directed edges, making it easy to deduce the computational load of the entire project and thus enabling a more accurate assessment of the performance requirements of embedded platforms.
[0049] Furthermore, the mathematical model is simple and intuitive, directly using the lighting fixtures, fire alarms, and their attributes in the building for mathematical modeling, forming a directed weighted loop graph with distance as the weight and the fire alarm as the algorithm execution trigger. The algorithm logic is simple, without complex processing methods such as recursion and backtracking that are difficult to understand. Instead, it uses easily understandable sequential processing. The entire algorithm establishes evacuation paths starting from each safety exit, and uses a breadth-first search approach to ensure that each path progresses synchronously with equal priority. Multiple paths and multiple branches of the same path compete for the ownership of directed edges and vertices according to the shortest path priority principle. The results data are simple and easy to use. The algorithm output is a set of directed edges that need to be turned off, which are closely related to the lighting control. Through a simple mapping function, it can be easily converted into lighting control commands and graphical display control commands, making it convenient to implement evacuation monitoring systems in embedded devices.
[0050] To make the above-mentioned features and advantages of the invention more apparent and understandable, specific embodiments are described below, and detailed descriptions are provided in conjunction with the accompanying drawings. Attached Figure Description
[0051] Figure 1 This is a flowchart of a method for calculating building evacuation routes according to the present invention.
[0052] Figure 2 for Figure 1 The detailed flowchart of step S5.
[0053] Figure 3 This is a schematic diagram of data modeling based on a floor plan of a single building in a specific embodiment.
[0054] Figure 4 for Figure 3 A schematic diagram of the evacuation results obtained by executing the method of this invention in the model when no light fixture vertices are set to prohibit passage.
[0055] Figure 5 for Figure 3 The diagram illustrates the evacuation results obtained by executing the method of this invention when a lamp vertex is set to "no passage" due to a fire alarm in the model.
[0056] In the accompanying drawings, similar reference numerals refer to the same elements. Detailed Implementation
[0057] To make the objectives and technical solutions of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0058] Figure 1 This is a flowchart of a method for calculating building evacuation routes according to the present invention, as shown below. Figure 1 As shown, the method for calculating building evacuation routes according to the present invention specifically includes,
[0059] Step S1: Create a floor plan of the lighting fixtures and fire alarms, and convert it into a corresponding directed graph data structure. More specifically, construct a floor plan based on the actual physical installation of the lighting fixtures that need to participate in evacuation control in the building. Connect each lighting fixture in pairs in a directed manner, with the direction of the connection determined by the order in which the two lighting fixtures are selected when creating the connection. If both lighting fixtures are bidirectional indicator lights, a bidirectional directed connection is established between them; if one of the lighting fixtures is a unidirectional indicator light, the association is established with the first selected lighting fixture as the starting point and the second selected lighting fixture as the ending point. Connect the fire alarms to the lighting fixtures; one fire alarm can be associated with multiple lighting fixtures, without a connection direction. Then, convert the floor plan into a directed graph data structure.
[0060] The conversion to a directed graph data structure specifically includes,
[0061] Step S11: Convert each light fixture into a vertex in a directed graph data structure. Each vertex includes the following attributes: unique ID, 2D position coordinates, whether it is a safety exit, whether it is a two-way light, whether it is a no-passage, input edge set, output edge set, whether it is a branch vertex, and branch information.
[0062] Each vertex has a unique identification ID, which can be manually customized. Each vertex also has 2D coordinates, representing its position within the building and on the floor plan. If the light fixture is a safety exit indicator, the vertex's attribute "Is it a safety exit?" is set to True; otherwise, it is set to False. If the light fixture is a two-way light, the vertex's attribute "Is it a two-way light?" is set to True; otherwise, it is set to False. If the vertex is associated with a fire alarm and the fire alarm is emitting an alarm signal, the vertex's attribute "Is it prohibited from passing?" is set to True; otherwise, it is set to False. The input edge set includes directed edges ending at this vertex, i.e., input directed edges. The output edge set includes directed edges starting at this vertex, i.e., output directed edges. If the vertex is connected to more than two vertices by directed edges, i.e., the number of different vertices in the input and output edge sets exceeds two, the attribute "Is it a branch vertex?" is set to True; otherwise, it is set to False.
[0063] Step S12: Convert each directed connection into one or more directed edges in the directed graph data structure. Each directed edge includes the following attributes: fromVertex, toVertex, distance, branch information, whether passage is prohibited, and whether it is closed.
[0064] Here, "fromVertex" is the unique identifier of the vertex that is the starting point of the directed edge; "toVertex" is the unique identifier of the vertex that is the ending point of the directed edge, and the directed edge is registered in both the output edge set of the starting point and the input edge set of the ending point; "distance" is the length of the directed edge; when the directed edge is closed, the attribute "whether to prohibit passage" is set to True, otherwise it is equal to False. When a directed edge is determined to be the shortest path by a path, the path to which the directed edge belongs is set to that path; when a directed edge is determined to be the shortest path by a search path, the reverse directed edge of that directed edge is determined to need to be closed by the search path, and the attribute "whether to close" of the reverse directed edge is set to True, otherwise it is equal to False. In the initial state, both the "whether to prohibit passage" and "whether to close" attributes are False.
[0065] The branch information is an information structure used to record the status of the branch of the current path to be processed. The attributes of the branch include: pathId, branchId, parentBranchId, current vertex, isClosed, and distance.
[0066] Here, "pathId" is the evacuation path number where the branch is located; "branchId" is the branch number. "Current Vertex" is the vertex currently searched by the branch. More specifically, the branch is established starting from the safety exit vertex, and then searches backward along the lighting path. The vertex that a branch finds is the current vertex of that branch. If the branch is closed, the attribute "isClosed" is set to True; otherwise, it is False. "distance" is the distance from the safety exit of the evacuation path to the current vertex. That is, for each vertex that the branch acquires, the "distance" in the "Branch Information" attribute of that vertex is equal to the "distance" in the "Branch Information" attribute of the previous vertex of the branch plus the length of the directed edge to the current vertex. "parentBranchId" is the parent branch number. For example, if the overall structure of the branches is a tree structure, the first search branch is numbered 0, the second search branch is numbered 1, and these branches created with the safety exit vertex are the top level of the tree. If the branch numbered 0 encounters a branch vertex during the search, the newly created search branch is numbered 2, and its "parentBranchId" is equal to 0 (pointing to the first search branch), and so on.
[0067] The conversion rules in step S12 are as follows: If at least one of the two lamps associated by a directed connection is a unidirectional lamp, then in the directed graph data structure, it is converted into a directed edge connecting the two vertices. The direction of the directed edge is consistent with the direction of the directed connection, and the length of the directed edge is equal to the straight-line distance between the two lamps on the planar graph. In a specific embodiment, the straight-line distance is the Euclidean distance. If both lamps associated by a directed connection are bidirectional lamps, then in the directed graph data structure, it is converted into two directed edges of equal length and opposite directions. The length of the directed edge is equal to the straight-line distance between the two lamps on the planar graph. In a specific embodiment, the straight-line distance is the Euclidean distance. If one of the two lamps associated by a directed connection has the attribute "whether it is a safety exit" equal to True, then in the directed graph data structure, it is converted into a directed edge pointing to that vertex. The length of the directed edge is equal to the straight-line distance between the two lamps on the planar graph. In a specific embodiment, the straight-line distance is the Euclidean distance.
[0068] Step S2: Set the "Does it prohibit passage?" attribute of which vertices to True. More specifically, when a fire alarm detects a fire, set the "Does it prohibit passage?" attribute of all its associated vertices to True. Simultaneously, set the "Does it prohibit passage?" attribute of all directed edges in the input edge set of that vertex to True. If the vertex pointed to by the starting point of a directed edge in the input edge set is not a branch vertex (i.e., the "Does it become a branch vertex?" attribute of that vertex is False), then continue setting the "Does it prohibit passage?" attribute of the vertices pointed to by the starting point of that directed edge to True in the current direction until a branch vertex is encountered (i.e., the "Does it become a branch vertex?" attribute is True), then the processing in that direction terminates.
[0069] Step S3: Create evacuation paths based on the exit vertices. More specifically, exit vertices are those whose "whether it is an exit" attribute is True. Obtain the set of exit vertices in the current directed graph data structure. Create an evacuation path starting from each exit vertex. Each evacuation path includes one or more branches, and each branch contains more than one vertex. When a branch is searched and encounters a branch vertex, a sub-branch is created. The attributes of each evacuation path include: exitVertex, pathId, isSearchFinished, branchId, list of branches to be searched, and list of branches to be searched next.
[0070] Here, "exitVertex" is the unique identifier of the safe exit vertex of the evacuation path; "pathId" is the evacuation path number, which is read-only and its value is the unique identifier of the safe exit vertex of the evacuation path in "exitVertex"; "branchId" is the current branch number; "list of branches to be searched" includes the branches to be searched for the evacuation path; "list of branches to be searched next" includes the new list of branches to be searched formed after the evacuation path has completed one path search; if the branch search of the evacuation path has ended, the attribute "isSearchFinished" is set to True, otherwise it is equal to False.
[0071] Step S4: Initialize evacuation paths. More specifically, before each evacuation path calculation, each evacuation path needs to be initialized. The main purpose of initialization is to set default values for the parameters of each evacuation path in the created set of evacuation paths. Setting default values for the parameters of each evacuation path includes setting the attribute "isSearchFinished" to False; clearing the list of branches to be searched; and constructing the first branch to be searched next, that is, constructing a branch with the safety exit vertex as the current vertex, the branch number "branchId" equal to 0, and the parent branch number "parentBranchId" equal to 0 as the first branch to be searched next and adding it to the list of branches to be searched for that path.
[0072] Using a list of branches to be searched is to effectively control the number of levels in the function call stack, changing the recursive execution order of the conventional algorithm to a cyclic execution order. No matter how large the number of vertices is, the number of levels in the function call stack can be kept constant, and there will be no stack overflow problem due to nested function calls. Furthermore, multi-path progressive cyclic execution is also a prerequisite for implementing breadth-first search.
[0073] Step S5: Calculate the evacuation paths. More specifically, perform a single-step breadth-first search inference for each branch to be searched on each evacuation path. That is, in each execution cycle, for each evacuation path, only calculate the endpoint of the current directed edge of all branches in the list of branches to be searched. The method for calculating the evacuation paths is to traverse and process the list of branches to be searched for all evacuation paths until the attribute "isSearchFinished" of all evacuation paths is True, such as... Figure 2 As shown, the specific steps include the following:
[0074] Step S51: Determine if there is an evacuation path in the evacuation path set whose attribute "isSearchFinished" is False. If there is, take one out and set it as the current search path. If not, it means that the path calculation algorithm has ended and jump to step S6.
[0075] Step S52: Determine if there is a branch to be searched in the list of branches to be searched in the current search path. If there is, take one of the branches and set it as the current search branch. If not, it means that the current evacuation path search ends in this round and jump to step S59 to continue execution.
[0076] Step S53: Determine whether the attribute "isClosed" of the branch to be searched is True. If it is, jump back to step S52 and continue execution; otherwise, continue with the following steps.
[0077] Step S54: Traverse the set of input edges of the current vertex of the branch to be searched, and determine whether the set of input edges is not empty. If it is, take out an input directed edge; if not, it means that the search of the current branch to be searched has ended, set the attribute "isClosed" of the branch to True, and jump back to step S52 to continue execution.
[0078] Step S55: Determine whether the attribute "whether passage is prohibited" of the input directed edge is True. If it is, jump back to step S54 and continue execution; otherwise, continue to the following steps.
[0079] Step S56: If the current vertex of the current branch is not the safe exit vertex of the evacuation path and no directed edge was found where the vertex was last searched, the current branch determines that it has been terminated by other branches, sets the branch's attribute "isClosed" to True, and jumps back to step S52 to continue execution; otherwise, continue with the following steps.
[0080] In step S56, the method for finding the directed edge that was last searched for the vertex is as follows: There exists a directed edge in the output edge set of the vertex, and the current branch belongs to the direct descendant branch of the branch information set by that directed edge. The expression for branch B being a direct descendant branch of branch A is as follows:
[0081] A branch.path number = B branch.path number and (A branch.branch number = B branch.branch number or A branch.branch number = B branch.parent branch number).
[0082] Furthermore, the occurrence of branch self-determination in step S56 is determined by the characteristics of the multi-path breadth-first search method. The distance determination result of a branch may be re-determined by different sub-branches of the same path or branches of different paths. The final assignment of directed edges and vertices is determined according to the principle of shortest distance. If a branch is terminated by other path determinations, the subsequent execution of the search is an invalid calculation. However, the termination of the branch by self-determination can reduce such invalid calculations and improve the execution efficiency of the algorithm.
[0083] Step S57: If the current vertex of the current branch is a branch vertex or a safe exit vertex of the current evacuation path, then create new branch information for each input directed edge of the current vertex. This includes assigning a new branch number to the branch, setting the current branch number as the parent branch number of the new branch, and setting the path number of the new branch as the path number of the current branch. The path number and branch number can be used to uniquely identify a branch. The parent branch number can be used to determine whether different branches of the same path are direct descendants. Additionally, the path number, branch number, and parent branch number can be used to find a list of path vertices closest to the exit from a vertex. Add the new branch information to the next searchable branch list and jump to step S59 to continue execution. Otherwise, proceed to step S58.
[0084] Step S58: Perform path attribution determination on the starting point of the current directed edge. The determination result determines whether the branch of the current evacuation path can continue to search forward. The determination process is as follows:
[0085] Step S581: Obtain the directed edge in the current direction;
[0086] Step S582: Obtain the directed edge in the opposite direction to the current direction;
[0087] Step S583: If the "Branch Information" attribute of the directed edge in the current direction has not yet been set with branch information, return the judgment result: continue searching forward; if the "Branch Information" attribute of the directed edge in the current direction has already saved branch information, jump to S585 to continue execution.
[0088] Step S584: If there is a directed edge in the opposite direction of the current direction and the attribute "Branch Information" of the directed edge has already saved the branch information, then jump to S586 to continue execution.
[0089] Step S585: If the shortest distance recorded in the branch information on the directed edge in the current direction is greater than the shortest path of the current branch plus the length of the directed edge, return the judgment result: the ownership of the directed edge is obtained through competition in the same direction; otherwise, return the judgment result: the competition with the branch in the same direction fails; where the shortest path of the current branch is the "distance" attribute in the "branch information".
[0090] Step S586: If the shortest distance recorded in the branch information on the directed edge in the opposite direction of the current direction is greater than the shortest path of the current path branch plus the length of the directed edge, return the judgment result: the ownership of the directed edge is obtained through reverse competition; otherwise, return the judgment result: the competition with the reverse path branch fails.
[0091] Step S587: The decision ends, and the direction of the current path branch is determined based on the result.
[0092] If the result is that the competition with the reverse path branch fails, the branch of the evacuation path cannot continue to search forward. Set the "isClosed" attribute of the current branch to True and jump back to step S52 to continue execution.
[0093] If the result is that the competition with the branch of the same path fails, the branch of the evacuation path cannot continue to search forward. Set the "isClosed" attribute of the current branch to True and jump back to step S52 to continue execution.
[0094] If the result means continue searching forward, no further action is needed.
[0095] If the result is that ownership of the directed edge is obtained through competition in the same direction, the branch information recorded in the directed edge is retrieved, and the "isClosed" attribute of the branch is set to True;
[0096] If the result is that ownership of the directed edge is obtained through reverse competition, the branch information recorded in the directed edge in the opposite direction of the current direction is retrieved, and the "isClosed" attribute of that branch is set to True;
[0097] Step S588: Construct new branch information using the starting point "fromVertex" of the current directed edge, the current branch number "branchId", the current parent branch number "parentBranchId", and the distance from the current path exit to the starting point "fromVertex" of the current directed edge. Set this branch information to the branch information attribute of the directed edge in the current direction and the vertex "fromVertex", and add it to the search branch list when performing the evacuation path calculation next time. Then jump back to step S52 to continue execution.
[0098] Step S59: If the next branch to be searched list is empty, it means that all branches of the current evacuation path have been searched. Set the attribute "isSearchFinished" of the current evacuation path to True and jump to step S51 to continue execution; otherwise, copy the next branch to be searched list to the current path's branch to be searched list, clear the next branch to be searched list, and jump to step S52 to continue execution.
[0099] Step S6: Obtain the calculation result. More specifically, traverse all directed edges. The set of directed edges whose "whether to close" is True and whose "whether to prohibit passage" is True is the output of the evacuation path algorithm. This result indicates which path directions need to be closed during evacuation. Based on the direction of each directed edge that needs to be closed and its attributes "fromVertex" and "toVertex", the lighting of the corresponding vertices can be accurately controlled.
[0100] In one specific embodiment, Figure 3 This is a schematic diagram of data modeling based on the floor plan of a single building, where bidirectional lights represent luminaire vertices, emergency exit lights represent emergency exit vertices, and arrows represent directed edges.
[0101] Figure 4 This is a schematic diagram of the evacuation results obtained by executing the evacuation path calculation method of the present invention when no light fixture vertex is set to prohibit passage.
[0102] Figure 5 This diagram illustrates the evacuation results obtained by applying the evacuation path calculation method of this invention when a lamp vertex is set to "no passage" due to a fire alarm. Figure 4 Compared to the schematic diagram, Figure 5 The path of the vertices of the central part of the lamps has changed according to the rule that passage to the vertices is prohibited.
[0103] Although the present invention has been disclosed above by way of embodiments, it is not intended to limit the present invention. Anyone skilled in the art can make some modifications and refinements without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A method for calculating building evacuation routes, characterized in that, include, Step S1: Create a plan view of the lighting fixtures and fire alarms, connect each pair of lighting fixtures in a directed manner, connect the fire alarms to the lighting fixtures in an undirected manner, and convert the plan view into a directed graph data structure. The process of connecting each pair of lamps in a directed manner includes: if at least one of the two lamps in a directed connection is a unidirectional lamp, then in the directed graph data structure, it is converted into a directed edge connecting the two vertices, with the direction of the directed edge consistent with the direction of the directed connection; if both lamps in a directed connection are bidirectional lamps, then in the directed graph data structure, it is converted into two directed edges of equal length and opposite directions; if one of the lamps in a directed connection has a vertex attribute "whether it is a safety exit" equal to True, then in the directed graph data structure, it is converted into a directed edge pointing to that vertex. The process of converting the planar graph into a directed graph data structure includes: Step S11: Convert each of the lamps into a vertex in the directed graph data structure. The attributes of each vertex include: unique identification ID, 2D position coordinates, whether it is a safety exit, whether it is a two-way light, whether it is a no-passage, input edge set, output edge set, whether it is a branch vertex, and branch information. Step S12: Convert each directed connection into one or more directed edges in the directed graph data structure. Each directed edge includes the following attributes: directed edge start point, directed edge end point, directed edge length, branch information, whether passage is prohibited, and whether it is closed. Step S2: Determine which lights are prohibited from passing; when a fire alarm detects a fire, set the "whether to prohibit passage" attribute of all its associated vertices to True; set the "whether to prohibit passage" attribute of all directed edges in the input edge set of the vertex to True; if the vertex pointed to by the starting point of the directed edge in the input edge set is not a branch vertex, then continue to set the "whether to prohibit passage" attribute of the vertex pointed to by the starting point of the directed edge to True in the current direction until a branch vertex is encountered, and then terminate the processing in that direction; Step S3: Create evacuation routes based on safety exits; Step S4: Initialize the evacuation path; Step S5: Calculate the evacuation path, perform a single-step breadth-first search inference for each branch to be searched on each evacuation path, determine the path affiliation of the starting point of the current directed edge based on the shortest distance in the branch information recorded on the directed edge, the shortest path of the current branch, and the length of the directed edge in the current direction, and decide whether the branch of the current evacuation path can continue to be searched forward. Step S6: Obtain the calculation results of the evacuation routes.
2. The method for calculating building evacuation routes as described in claim 1, characterized in that, The branch information is an information structure, including: evacuation path number, branch number, parent branch number, current vertex, whether the branch is closed, and the distance between the safety exit and the vertex.
3. The method for calculating building evacuation routes as described in claim 1, characterized in that, Step S3 specifically includes obtaining a set of safe exit vertices in the directed graph data structure, creating an evacuation path with each safe exit vertex as a starting point, and the attributes of the evacuation path include: safe exit vertex of the evacuation path, evacuation path number, whether the search has ended, branch number, list of branches to be searched, and list of branches to be searched next.
4. The method for calculating building evacuation routes as described in claim 3, characterized in that, Step S4 specifically includes setting the attribute "whether the search is over" to False, clearing the list of branches to be searched, and constructing the first branch and adding it to the list of branches to be searched.
5. The method for calculating building evacuation routes as described in claim 4, characterized in that, Step S5 specifically includes: Step S51: Determine if there is an evacuation path in the evacuation path set whose attribute "whether the search has ended" is False. If so, take one out and set it as the current search path; otherwise, it means that step S5 has ended and jump to step S6. Step S52: Determine if there is a branch to be searched in the list of branches to be searched in the current search path. If there is, take one of the branches and set it as the current search branch. If not, it means that the current evacuation path search ends in this round and jump to step S59 to continue execution. Step S53: Determine whether the attribute "whether the branch is closed" of the branch to be searched is True. If it is, jump back to step S52 and continue execution; otherwise, continue to the following steps. Step S54: Traverse the set of input edges of the current vertex of the branch to be searched, and determine whether the set of input edges is not empty. If it is, take out an input directed edge; if not, it means that the search of the current branch to be searched has ended, set the attribute "whether the branch is closed" of the branch to True, and jump back to step S52 to continue execution. Step S55: Determine whether the attribute "whether passage is prohibited" of the input directed edge is True. If it is, jump back to step S54 and continue execution; otherwise, continue to the following steps. Step S56: If the current vertex of the current search branch is not the safe exit vertex of the evacuation path and no directed edge that was last searched for the vertex can be found, then the current search branch determines that it has been terminated by other branches, sets the attribute "whether the branch is closed" of the branch to True, and jumps back to step S52 to continue execution; otherwise, continue to the following steps. Step S57: If the current vertex of the current search branch is a branch vertex or a safe exit vertex of the current evacuation path, then create a new branch information for each input directed edge of the current vertex, including assigning a new branch number to the branch, setting the current branch number as the parent branch number of the new branch, setting the path number of the new branch as the path number of the current branch, adding the new branch information to the list of branches to be searched when the path calculation is performed next, and jumping to step S59 to continue execution; Otherwise, proceed to step S58; Step S58: Perform path attribution determination on the starting point of the current directed edge. The determination result determines whether the branch of the current evacuation path can continue to search forward. Step S59: If the next branch list to be searched is empty, it means that all branches of the current evacuation path have been searched. Set the attribute "whether the search is finished" of the current evacuation path to True and jump to step S51 to continue execution; otherwise, copy the next branch list to be searched to the current evacuation path's branch list to be searched, clear the next branch list to be searched, and jump to step S52 to continue execution.
6. The method for calculating building evacuation routes as described in claim 5, characterized in that, Step S58 specifically includes: Step S581: Obtain the directed edge in the current direction; Step S582: Obtain the directed edge in the opposite direction to the current direction; Step S583: If the "Branch Information" attribute of the directed edge in the current direction has not yet been set with branch information, return the judgment result: continue searching forward; If the "Branch Information" attribute of the directed edge in the current direction has already saved the branch information, then jump to S585 to continue execution; Step S584: If there is a directed edge in the opposite direction of the current direction and the attribute "Branch Information" of the directed edge has already saved the branch information, then jump to S586 to continue execution. Step S585: If the shortest distance recorded in the branch information on the directed edge in the current direction is greater than the shortest path of the current branch plus the length of the directed edge, return the judgment result: the ownership of the directed edge is obtained through competition in the same direction; otherwise, return the judgment result: the competition with the branch of the same direction path fails. Step S586: If the shortest distance recorded in the branch information on the directed edge in the opposite direction of the current direction is greater than the shortest path of the current path branch plus the length of the directed edge, return the judgment result: ownership of the directed edge is obtained through reverse competition; otherwise, return the judgment result: competition with the reverse path branch fails. Step S587: The decision ends, and the direction of the current path branch is determined based on the result. If the result is that the competition with the reverse path branch fails, the branch of the evacuation path cannot continue to be searched forward. Set the "Is this branch closed?" property of the current branch to True, and jump back to step S52 to continue execution. If the result is that the competition with the branch of the same direction fails, the branch of the evacuation path cannot continue to search forward. Set the "Is this branch closed?" property of the current branch to True, and jump back to step S52 to continue execution. If the result equals the search continues, no further processing is needed; If the result is that ownership of the directed edge is obtained through competition in the same direction, the branch information recorded in the directed edge is retrieved, and the "whether the branch is closed" attribute of the branch is set to True; If the result is obtained by acquiring ownership of the directed edge through reverse competition, retrieve the branch information recorded in the directed edge in the opposite direction of the current direction, and set the "whether the branch is closed" attribute of the branch to True; Step S588: Construct new branch information using the starting point of the current directed edge, the current branch number, the current parent branch number, and the distance from the current path exit to the starting point of the current directed edge. Set this branch information into the branch information attributes of the directed edge and vertex in the current direction, and add it to the search branch list when the evacuation path calculation is performed next. Then jump back to step S52 to continue execution.
7. The method for calculating building evacuation routes as described in claim 6, characterized in that, Step S6 specifically includes the following: the set of directed edges consisting of directed edges whose "whether to close" is True and directed edges whose "whether to prohibit passage" is True is the result of calculating the evacuation path.
Citation Information
Patent Citations
Emergency evacuation automatic intelligent generation system
CN106845679A
Search engine-oriented knowledge representation learning method and knowledge reasoning method
CN113190685A
Method for alarm handling in a processing system
US20210318675A1