Scenic spot emergency dispersion route planning method based on improved A star algorithm, storage medium, equipment and computer program product
By improving the A-star algorithm, combining GIS and GeoHash algorithms, safety and time cost functions are established, and the tourist route for scenic spots is optimized, the problems of complex calculations and poor flexibility of existing algorithms are solved, and the efficiency and safety of emergency guidance in scenic spots are achieved.
Patent Information
- Application Number
- CN202411369215.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-02-14
AI Technical Summary
The existing scenic spot passenger flow guidance algorithm has problems such as high computational complexity, high spatial complexity, poor flexibility, slow convergence speed, and high calculation cost, making it difficult to effectively respond to tourist guidance in scenic spot emergency events.
The improved A-star algorithm is adopted to obtain the latitude and longitude of the scenic area through GIS, and the grid is divided using the GeoHash algorithm to establish a safety cost function, a time cost function and a heuristic function, a total cost function is constructed, and the tourist guidance route is optimized.
It has improved the safety of emergency guidance in scenic spots and the efficiency of tourists evacuation, with fast calculation speed and strong adaptability, and can quickly and safely guide tourists in emergencies.
Smart Images

Figure CN119443433A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of scenic spot passenger flow diversion, and in particular to a scenic spot emergency diversion route planning method, storage medium, device and computer program product based on an improved A-star algorithm. Background Art
[0002] The continuous progress of society has promoted the popularity of tourism as a form of leisure and entertainment, which in turn has led to a significant increase in tourism demand. However, this has also caused congestion in popular tourist attractions, posing a challenge to the tourist experience and the order of life in the local community. The prosperity of the global tourism industry has made the problem of passenger congestion in tourist attractions, city centers, and transportation hubs increasingly prominent. At present, the problem of passenger congestion is mainly solved through reservation measures, flow control measures, and staggered travel, but there are still problems such as high difficulty in implementation, tourist dissatisfaction, and limited effect.
[0003] In order to deal with the problem of tourist congestion in scenic spots, passenger flow diversion algorithms related to path planning have been widely studied, including: Dijkstra algorithm, dynamic programming algorithm, Monte Carlo tree search algorithm, ant colony algorithm, genetic algorithm and reinforcement learning algorithm. Dijkstra algorithm can find the shortest path from a single source point to all other nodes, but it needs to traverse all possible paths, the calculation complexity is high, and it cannot dynamically adapt to environmental changes; dynamic programming algorithm improves efficiency by decomposing the problem into multiple sub-problems and storing the results of the sub-problems. It can effectively solve multi-objective path planning problems, but it has high space complexity, easily occupies a large amount of memory, and has poor flexibility in dynamic environments; Monte Carlo tree search algorithm uses random sampling and tree search to simulate multiple possible future It can make decisions based on the ability to make decisions, and is suitable for application in complex and dynamic scenarios. However, it requires a lot of computing time and is inefficient for scenarios with high real-time requirements. The ant colony algorithm continuously improves path selection by simulating the process of ants looking for food. It is suitable for solving problems in multiple path selection and dynamic environments. Although it has certain adaptive capabilities, it converges slowly and is prone to falling into local optimality. It requires a large number of iterations to find a better solution. The genetic algorithm simulates natural selection and optimizes the passenger flow diversion path through continuous "evolution". It is suitable for solving complex multi-objective optimization problems, but due to its strong randomness, it has a high computational cost and a slow convergence speed. The reinforcement learning algorithm gradually learns the optimal diversion strategy through interaction with the environment. It is particularly suitable for dynamic and complex environments, but it takes a long time to train, requires a large amount of data, and may perform poorly in the early stages. Summary of the invention
[0004] In view of the problems existing in the prior art, the present invention provides a scenic spot emergency evacuation route planning method, storage medium, equipment and computer program product based on the improved A-star algorithm. When an emergency occurs in a scenic spot, a shortest evacuation route is formulated according to the location of tourists. The calculation speed is fast and the adaptability is strong, which improves the safety of emergency evacuation in the scenic spot and the evacuation efficiency of tourists.
[0005] To achieve the above technical objectives, the present invention adopts the following technical solution: a scenic area emergency evacuation route planning method based on an improved A-star algorithm, specifically comprising the following steps:
[0006] Step S1, obtaining the latitude and longitude of the scenic area through GIS, and dividing the latitude and longitude of the scenic area into grids through the GeoHash algorithm;
[0007] Step S2: When an emergency occurs, all adjacent grids are searched according to the grid where the tourist is located, and a safety cost function is established according to the distance between each adjacent grid and the area where the emergency occurs;
[0008] Step S3, calculating the time and time cost function of the tourist moving to each adjacent grid in combination with the established safety cost function;
[0009] Step S4, establishing a heuristic function according to the Euclidean distance between each adjacent grid and each exit of the scenic area;
[0010] Step S5, using the safety cost function, the time cost function and the heuristic function to jointly construct the total cost function of each adjacent grid of the grid where the tourist is located, arranging the total cost functions of the adjacent grids in order from small to large, and selecting the first several adjacent grids as the grid where the tourist is located after moving;
[0011] Step S6, for each grid where the tourist moves, repeat steps S2-S5 until the grid where the tourist moves is the exit of the scenic spot, and obtain several paths for the tourist to move from the grid where the tourist is located to the exit of the scenic spot, and take the path with the shortest time as the emergency evacuation route for the tourist.
[0012] Furthermore, the accuracy level of the GeoHash algorithm in step S1 is level 7, and the size of the divided grid is 601m×610m.
[0013] Furthermore, the process of establishing the security cost function in step S2 is:
[0014]
[0015] Among them, S i represents the safety cost of the adjacent grid i of the grid where the tourist is located, L ijrepresents the distance between the center of the grid j where the tourist is located and the center of the adjacent grid i, d is It represents the center distance between the area s where the emergency event is located and the adjacent grid i where the tourist is located, and r represents the length of the area where the emergency event is located.
[0016] Furthermore, the calculation process of the time it takes for the tourist to move to each adjacent grid is:
[0017]
[0018] Among them, T ij represents the time it takes for a tourist to move from the grid j where the tourist is located to the adjacent grid i, V0 represents the moving speed of the tourist when no emergency occurs, γ represents the difficulty of evacuation, γ=N ij / L ij , N ij Represents the total number of tourists in the grid j where the tourist is located and the adjacent grid i.
[0019] Furthermore, the calculation process of the time cost function of the tourist moving to each adjacent grid is:
[0020] C i =V0×T ij .
[0021] Furthermore, the establishment process of the heuristic function in step S4 is:
[0022]
[0023] Among them, h i represents the heuristic function of the adjacent grid i of the grid where the tourist is located, A represents the number of exits of the scenic spot, a represents the exit index of the scenic spot, (x i ,y i ) represents the center coordinate of the adjacent grid i of the grid where the tourist is located, (x a ,y a ) represents the center coordinates of the ath exit of the scenic area.
[0024] Furthermore, the process of establishing the total cost function in step S5 is:
[0025] f i =w1S i +w2C i +h i
[0026] Among them, w1 represents S i The weight coefficient of C i The weight coefficient of .
[0027] Furthermore, the present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the scenic area emergency evacuation route planning method based on the improved A-star algorithm.
[0028] Furthermore, the present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the scenic area emergency evacuation route planning method based on the improved A-star algorithm is implemented.
[0029] Furthermore, the present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the scenic area emergency evacuation route planning method based on the improved A-star algorithm.
[0030] Compared with the prior art, the present invention has the following beneficial effects: the scenic area emergency evacuation route planning method based on the improved A-star algorithm of the present invention is different from the conventional cost that only considers the length of the path. When an emergency occurs, the safety cost function and the time cost function are comprehensively considered, and high efficiency is pursued while ensuring safety, so as to more reasonably allocate resources and reduce safety risks; at the same time, the present invention aims at the situation where there are multiple exits in the scenic area, and determines the scenic area exit closest to the grid adjacent to the grid where the tourists are located by establishing a heuristic function, thereby improving the efficiency of tourists finding the scenic area exit. The present invention selects adjacent grids through the total cost function, which can effectively reduce the possibility of tourists being in danger, and avoids the local congestion or insecurity caused by over-reliance on a single shortest path strategy; in addition, the present invention uses the shortest path as the tourist emergency evacuation route, which has the advantages of effectively reducing the overall evacuation time and improving the efficiency of crowd flow. In summary, the scenic area emergency evacuation route planning method of the present invention formulates the shortest evacuation route according to the location of the tourists, thereby improving the safety of the scenic area emergency evacuation and the evacuation efficiency of the tourists. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 The present invention is a flow chart of a scenic area emergency evacuation route planning method based on the improved A-star algorithm. DETAILED DESCRIPTION
[0032] The technical solution of the present invention is further explained below in conjunction with the accompanying drawings.
[0033] like Figure 1 The flowchart of the scenic area emergency evacuation route planning method based on the improved A-star algorithm of the present invention is as follows:
[0034] Step S1, obtain the latitude and longitude of the scenic area through GIS, and divide the latitude and longitude of the scenic area into grids through the GeoHash algorithm; specifically, the accuracy level of the GeoHash algorithm is level 7, and the size of the divided grid is 601m×610m.
[0035] Step S2: When an emergency occurs, all adjacent grids are searched according to the grid where the tourist is located, and a safety cost function is established according to the distance between each adjacent grid and the area where the emergency occurs, so as to accurately quantify the safety risk of each adjacent grid.
[0036] The process of establishing the security cost function in the present invention is:
[0037]
[0038] Among them, S i represents the safety cost of the adjacent grid i of the grid where the tourist is located, L ij represents the distance between the center of the grid j where the tourist is located and the center of the adjacent grid i, d is It represents the center distance between the area s where the emergency event is located and the adjacent grid i where the tourist is located, and r represents the length of the area where the emergency event is located.
[0039] Step S3, combining the established safety cost function to calculate the time and time cost function for the tourists to move to each adjacent grid, to ensure that in the emergency evacuation process, not only the speed of evacuation, i.e., the time factor, but also the safety is taken into account, so as to minimize the evacuation time under the premise of ensuring safety. Therefore, by closely combining the "safety cost function" and the "time cost function", the total cost is calculated for each adjacent grid by comprehensively considering the two, so as to determine the optimal evacuation path.
[0040] The calculation process of the time for a tourist to move to each adjacent grid in the present invention is:
[0041]
[0042] Among them, T ij represents the time it takes for a tourist to move from the grid j where the tourist is located to the adjacent grid i, V0 represents the moving speed of the tourist when no emergency occurs, γ represents the difficulty of evacuation, γ=N ij / L ij , N ij It represents the total number of tourists in the grid j where the tourists are located and the adjacent grid i. The number of tourists in each scenic area grid is calculated by detecting the signaling data in each grid of the scenic area through the base station of the city operator.
[0043] The calculation process of the time cost function for a tourist to move to each adjacent grid in the present invention is:
[0044] Ci =V0×T ij .
[0045] Step S4: Establish a heuristic function based on the Euclidean distance between each adjacent grid and each exit of the scenic spot. The heuristic function can quickly estimate the relative distance between tourists and the exit, thereby providing a more intuitive path priority selection during the evacuation process, effectively shortening the evacuation time and improving the efficiency of path planning.
[0046] The process of establishing the heuristic function in the present invention is:
[0047]
[0048] Among them, h i represents the heuristic function of the adjacent grid i of the grid where the tourist is located, A represents the number of exits of the scenic spot, a represents the exit index of the scenic spot, (x i ,y i ) represents the center coordinate of the adjacent grid i of the grid where the tourist is located, (x a ,y a ) represents the center coordinates of the ath exit of the scenic area.
[0049] Step S5, using the safety cost function, the time cost function and the heuristic function to jointly construct the total cost function of each adjacent grid of the grid where the tourist is located, arranging the total cost functions of the adjacent grids in order from small to large, and selecting the first several adjacent grids as the grids where the tourist is located after moving; by minimizing the total cost function, safety and efficiency can be taken into account in the complex emergency evacuation of scenic spots, ensuring that tourists can evacuate quickly and safely.
[0050] The process of establishing the total cost function in the present invention is:
[0051] f i =w1S i +w2C i +h i
[0052] Among them, w1 represents S i The weight coefficient of C i The weight coefficient of .
[0053] Step S6, for each grid where a tourist moves, repeat steps S2-S5 until the grid where the tourist moves is the exit of the scenic spot, and obtain several paths for the tourist to move from the grid where the tourist is located to the exit of the scenic spot, and use the path with the shortest time as the emergency evacuation route for the tourist. Selecting the path with the shortest time as the emergency evacuation route can not only speed up the evacuation speed and improve safety, but also simplify the evacuation decision and ensure rapid and orderly evacuation.
[0054] In view of the fact that the traditional A-star algorithm itself only focuses on the results of the heuristic function but does not actually bring the fastest evacuation route, the scenic area emergency evacuation route planning method based on the improved A-star algorithm of the present invention uses the safety cost function, the time cost function and the heuristic function to jointly construct the total cost function of each adjacent grid of the grid where the tourist is located to minimize the goal, until multiple paths from the grid where the tourist is located to the exit of the scenic area are obtained. These paths comprehensively consider the safety and time of the evacuation of tourists, have the advantages of balancing safety and efficiency, effectively avoiding congestion, and dynamically adapting to environmental changes, and are more adaptable; and, the path with the shortest time is used as the tourist emergency evacuation route, ensuring that tourists can evacuate in the shortest time, thereby improving the calculation efficiency of the scenic area emergency evacuation route planning.
[0055] In a technical solution of the present invention, a computer-readable storage medium is also provided, storing a computer program, wherein the computer program enables a computer to execute the scenic area emergency evacuation route planning method based on the improved A-star algorithm.
[0056] In a technical solution of the present invention, an electronic device is also provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the scenic area emergency evacuation route planning method based on the improved A-star algorithm is implemented.
[0057] In a technical solution of the present invention, a computer program product is also provided, including a computer program, which, when executed by a processor, implements the scenic area emergency evacuation route planning method based on the improved A-star algorithm.
[0058] In the embodiments disclosed in the present application, the computer storage medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. The computer storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the above. More specific examples of computer storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0059] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0060] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.
Claims
1. A scenic area emergency evacuation route planning method based on improved A-star algorithm, characterized in that: The specific steps include: Step S1, obtaining the latitude and longitude of the scenic area through GIS, and dividing the latitude and longitude of the scenic area into grids through the GeoHash algorithm; Step S2: When an emergency occurs, all adjacent grids are searched according to the grid where the tourist is located, and a safety cost function is established according to the distance between each adjacent grid and the area where the emergency occurs; Step S3, calculating the time and time cost function of the tourist moving to each adjacent grid in combination with the established safety cost function; Step S4, establishing a heuristic function according to the Euclidean distance between each adjacent grid and each exit of the scenic area; Step S5, using the safety cost function, the time cost function and the heuristic function to jointly construct the total cost function of each adjacent grid of the grid where the tourist is located, arranging the total cost functions of the adjacent grids in order from small to large, and selecting the first several adjacent grids as the grid where the tourist is located after moving; Step S6, for each grid where the tourist moves, repeat steps S2-S5 until the grid where the tourist moves is the exit of the scenic spot, and obtain several paths for the tourist to move from the grid where the tourist is located to the exit of the scenic spot, and take the path with the shortest time as the emergency evacuation route for the tourist.
2. According to claim 1, a method for planning scenic area emergency evacuation routes based on improved A-star algorithm is characterized in that: The accuracy level of the GeoHash algorithm in step S1 is level 7, and the size of the divided grid is 601m×610m.
3. The method for planning scenic area emergency evacuation routes based on the improved A-star algorithm according to claim 1, characterized in that: The process of establishing the security cost function in step S2 is: Among them, S i represents the safety cost of the adjacent grid i of the grid where the tourist is located, L ij represents the distance between the center of the grid j where the tourist is located and the center of the adjacent grid i, d is It represents the center distance between the area s where the emergency event is located and the adjacent grid i where the tourist is located, and r represents the length of the area where the emergency event is located.
4. A scenic area emergency evacuation route planning method based on improved A-star algorithm according to claim 3, characterized in that: The calculation process of the time it takes for a tourist to move to each adjacent grid is: Among them, T ij represents the time it takes for a tourist to move from the grid j where the tourist is located to the adjacent grid i, V0 represents the moving speed of the tourist when no emergency occurs, γ represents the difficulty of evacuation, γ=N ij / L ij , N ij Represents the total number of tourists in the grid j where the tourist is located and the adjacent grid i.
5. A scenic area emergency evacuation route planning method based on improved A-star algorithm according to claim 4, characterized in that: The calculation process of the time cost function for the tourist to move to each adjacent grid is: C i =V0×T ij 。 6. A scenic area emergency evacuation route planning method based on improved A-star algorithm according to claim 5, characterized in that: The process of establishing the heuristic function in step S4 is: Among them, h i represents the heuristic function of the adjacent grid i of the grid where the tourist is located, A represents the number of exits of the scenic spot, a represents the exit index of the scenic spot, (x i ,y i ) represents the center coordinate of the adjacent grid i of the grid where the tourist is located, (x a ,y a ) represents the center coordinates of the ath exit of the scenic area.
7. A scenic area emergency evacuation route planning method based on improved A-star algorithm according to claim 6, characterized in that: The process of establishing the total cost function in step S5 is: f i =w1S i +w2C i +h i Among them, w1 represents S i The weight coefficient of C i The weight coefficient of .
8. A computer-readable storage medium storing a computer program, characterized in that: The computer program enables the computer to execute the scenic area emergency evacuation route planning method based on the improved A-star algorithm as described in any one of claims 1 to 7.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for planning a scenic area emergency evacuation route based on the improved A-star algorithm as described in any one of claims 1 to 7 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the scenic area emergency evacuation route planning method based on the improved A-star algorithm described in any one of claims 1 to 7 is implemented.