A public facility layout optimization method based on crowd behavior analysis and related products

By using crowd behavior analysis, video surveillance networks, and AI optimization models, the problem of relying on experience and incomplete data in the layout of urban public facilities has been solved, enabling intelligent and dynamic optimization of facilities and improving resource utilization and citizen satisfaction.

CN122222281APending Publication Date: 2026-06-16ZKTECO CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZKTECO CO LTD
Filing Date
2026-03-16
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

The existing layout of urban public facilities lacks scientific basis, and planning relies heavily on human experience, resulting in uneven allocation of facility resources, lagging dynamic demand response, high and incomplete data collection costs, lack of spatial correlation analysis, and low efficiency in optimization decision-making.

Method used

By deploying a scenario-based video surveillance network to collect crowd behavior data, generating heat maps of dwell times and walking paths, and combining reinforcement learning optimization models and multi-objective optimization functions, facility layout problems are diagnosed and adjusted to achieve dynamic allocation and real-time response.

Benefits of technology

It has improved the utilization rate of public facilities and the service experience for citizens, optimized the efficiency of resource allocation, enhanced the ability to respond to dynamic demands, and improved the accuracy of planning and the level of intelligence in facility layout.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122222281A_ABST
    Figure CN122222281A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of smart cities, and provides a public facility layout optimization method based on crowd behavior analysis and related products.The method comprises the following steps: based on crowd behavior data, generating a stay heat map and a walking path heat map, performing time-space dynamic analysis on the stay heat map and the walking path heat map, and obtaining heat distribution data; based on the heat distribution data and a public facility utilization rate, identifying facility layout problem diagnosis results through three-dimensional cross analysis; constructing a reinforcement learning optimization model and a multi-objective optimization function, combining the facility layout problem diagnosis results, solving the target optimization function, generating a target facility adjustment strategy, and visually displaying a public facility layout result optimized according to the target facility adjustment strategy; based on dynamic changes of crowds, dynamically adjusting and responding to the public facility layout result, and obtaining a final public facility layout strategy.The application can realize intelligent layout optimization of public facilities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart city technology, and in particular to a method for optimizing the layout of public facilities based on crowd behavior analysis and related products. Background Technology

[0002] The scientific layout of urban public facilities (such as trash cans and rest seats) is an important guarantee for improving the quality of urban public services and residents' travel experience.

[0003] Current urban public facility planning and configuration primarily rely on traditional experience, standards, and basic data collection methods. Specific approaches include: experience-based layout, where planners determine facility locations based on personal experience and simple on-site observations, such as placing a trash can every 50 meters; and standard-based layout, configuring facilities according to the density specified in national or local standards, such as every 500 square meters. 2 The requirement to equip green spaces with 2-3 seats is being implemented; simple questionnaire surveys are being conducted to collect opinions on facility needs from citizens, but these generally suffer from small sample sizes and insufficient data representativeness; fixed-point manual statistics involve assigning personnel to record facility usage at specific times, but this has the drawbacks of short time spans and narrow monitoring coverage; IoT sensor monitoring, which involves installing pressure or weight sensors on facilities such as seats and trash cans, can only achieve monitoring of the status of individual facilities and lacks systematic analysis of spatial correlations. Therefore, existing urban public facility layout technologies lack scientific basis, and planning relies heavily on subjective decisions based on human experience, which is not conducive to the intelligent realization of public facility layout. Summary of the Invention

[0004] This application provides a method and related products for optimizing the layout of public facilities based on crowd behavior analysis. It can form a closed-loop solution from data collection, AI intelligent optimization, dynamic adaptation to iterative evaluation, and realize the intelligent layout optimization of public facilities.

[0005] In one aspect, this application provides a method for optimizing the layout of public facilities based on crowd behavior analysis, the method comprising:

[0006] By deploying a scenario-based video surveillance network, target detection and multi-target tracking algorithms are used to detect crowd behavior data and monitor the utilization rate of public facilities in real time.

[0007] Based on crowd behavior data, a heat map of dwell time and a heat map of walking paths are generated. Spatiotemporal dynamic analysis is performed on the heat map of dwell time and the heat map of walking paths to obtain heat distribution data.

[0008] Based on the thermal distribution data and the utilization rate of public facilities, the diagnostic results of facility layout problems are identified through three-dimensional cross-analysis.

[0009] By constructing a reinforcement learning optimization model and a multi-objective optimization function, and combining the diagnostic results of the facility layout problem, the objective optimization function is solved to generate a target facility adjustment strategy, and the public facility layout results optimized according to the target facility adjustment strategy are visualized.

[0010] Based on the dynamic changes in the needs of the population, the layout results of the public facilities are dynamically adjusted and responded to in real time to obtain the final public facility layout strategy.

[0011] On the other hand, this application provides a public facility layout optimization device based on crowd behavior analysis, the device comprising:

[0012] The crowd behavior data acquisition module is used to detect crowd behavior data through the deployed scenario-based video surveillance network using target detection and multi-target tracking algorithms, and to monitor the utilization rate of public facilities in real time.

[0013] The crowd activity heat map generation module is used to generate a dwelling heat map and a walking path heat map based on crowd behavior data, and to perform spatiotemporal dynamic analysis on the dwelling heat map and the walking path heat map to obtain heat distribution data;

[0014] The facility layout problem diagnosis module is used to identify facility layout problem diagnosis results through three-dimensional cross-analysis based on the thermal distribution data and the utilization rate of public facilities.

[0015] The layout optimization strategy generation module is used to construct a reinforcement learning optimization model and a multi-objective optimization function, and combine the facility layout problem diagnosis results to solve the objective optimization function, generate the objective facility adjustment strategy, and visualize the public facility layout results optimized according to the objective facility adjustment strategy.

[0016] The dynamic adjustment and real-time optimization module is used to dynamically adjust and respond in real time to the public facility layout results based on the dynamic changes in the needs of the population, so as to obtain the final public facility layout strategy.

[0017] In another aspect, this application also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements any of the public facility layout optimization methods based on crowd behavior analysis.

[0018] In another aspect, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements any of the public facility layout optimization methods based on crowd behavior analysis.

[0019] In another aspect, this application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the public facility layout optimization method based on crowd behavior analysis described in the above aspects.

[0020] The public facility layout optimization method and related products based on crowd behavior analysis provided in this application utilize a deployed scenario-based video surveillance network with target detection and multi-target tracking algorithms to obtain crowd behavior data and monitor the utilization rate of public facilities in real time. Then, based on the crowd behavior data, dwell time heatmaps and walking path heatmaps are generated, and spatiotemporal dynamic analysis is performed on these heatmaps to obtain heat distribution data. Based on the heat distribution data and the utilization rate of public facilities, three-dimensional cross-analysis is used to identify facility layout problem diagnostic results. Furthermore, a reinforcement learning optimization model and multi-objective optimization function are constructed, and combined with the facility layout problem diagnostic results, the objective optimization function is solved to generate a target facility adjustment strategy. The optimized public facility layout results are visualized and displayed according to the target facility adjustment strategy. Finally, based on the dynamic changes in crowd demand, the public facility layout results are dynamically adjusted and responded to in real time to obtain the final public facility layout strategy. This approach, based on crowd behavior analysis, optimizes the layout of public facilities, forming a closed-loop solution encompassing data collection, AI-powered intelligent optimization, dynamic adaptation, and iterative evaluation. AI optimizes facility locations and removes inefficient or idle facilities, improving the utilization rate of public facilities. Furthermore, by using crowd behavior data as the basis for planning, it enables data-driven scientific planning decisions, replacing experience-based blind planning and improving the efficiency of urban public resource allocation. Moreover, by leveraging multi-objective optimization to balance coverage, cost, aesthetics, and other needs, and by continuously training AI models with historical data, the accuracy of planning improves with data accumulation. Dynamically adjusting and responding in real-time to the changing needs of the population significantly enhances the ability to respond to dynamic demands, thereby achieving intelligent optimization of public facility layout. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of the architecture of an intelligent layout system for public facilities provided in an embodiment of this application;

[0022] Figure 2 This is a flowchart illustrating the steps of a public facility layout optimization method based on crowd behavior analysis provided in an embodiment of this application.

[0023] Figure 3 This is a schematic diagram illustrating the process of generating a population heatmap provided in an embodiment of this application;

[0024] Figure 4 This is a visual diagram of the comparative analysis results provided in the embodiments of this application;

[0025] Figure 5 This is a schematic diagram illustrating the implementation process of the dynamic adjustment mechanism provided in the embodiments of this application;

[0026] Figure 6 This is a schematic diagram of the interface of the public facility layout optimization backend provided in the embodiments of this application;

[0027] Figure 7 This is a structural block diagram of a public facility layout optimization device based on crowd behavior analysis provided in an embodiment of this application;

[0028] Figure 8 This is a structural block diagram of an electronic device provided in an embodiment of this application;

[0029] Figure 9 This is a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation

[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0031] Existing urban public facility layout technologies have significant defects and shortcomings in practical application: First, the layout lacks scientific basis, with planning relying heavily on subjective decisions based on human experience, failing to consider actual activity patterns such as dwell time, walking paths, and activity types. Existing standards and specifications only limit quantity and density, neglecting the rationality of spatial distribution, leading to prominent issues of localized clustering and localized gaps in facilities. Second, resource allocation is severely unbalanced, with a large number of facilities remaining idle and wasted for extended periods. In some parks, over 60% of benches are used for less than one hour daily, resulting in an idle rate exceeding 80%. Meanwhile, high-demand areas such as commercial streets suffer from insufficient facility supply, with over 70% of trash cans overflowing and long queues for seats being common. In medium-sized cities, the utilization rate of public benches is only 35% to 45%, yet the annual maintenance cost of over 20 million yuan yields low returns. Third, dynamic demand response is lagging, with fixed facility layouts failing to adapt to seasonal changes, weekdays versus weekends, and large-scale events. The changing demands brought about by population aging are difficult to adjust dynamically; fourth, data collection is costly and incomplete, manual statistics require significant manpower and have poor sample representativeness, questionnaire surveys have a sample size of less than 0.1% of the total population, resulting in large statistical biases, IoT sensor deployment is expensive (a single smart seat costs 5,000 to 8,000 yuan, and city-wide deployment requires an investment of over 100 million yuan), and can only monitor whether facilities are occupied, but cannot analyze the causes of usage behavior; fifth, there is a lack of spatial correlation analysis, single-point facility data cannot reveal spatial layout patterns, it is difficult to clarify the causal relationship between population behavior and facility layout, cross-facility correlation has not been studied, and the optimal layout scheme cannot be quantitatively evaluated; sixth, optimization decision-making lacks efficient tools, planning adjustments still rely on meetings and discussions, which are time-consuming and inefficient, physical facility relocation trial and error costs are high, it is difficult to balance multiple objectives such as coverage, cost, and aesthetics, and advanced technologies such as AI have not been effectively applied in facility planning.

[0032] This application's embodiments achieve significant multi-dimensional technical effects through a public facility layout optimization method based on crowd behavior analysis. From data collection, AI-powered intelligent optimization, dynamic adaptation to iterative evaluation, a closed-loop solution is formed, resulting in: First, a substantial increase in public facility utilization. By optimizing facility locations and removing inefficient and idle facilities using AI, the average utilization rate of public seating has increased from 40%-45% to 65%-70%, a 55% increase. The proportion of high-utilization facilities has increased from 15% to 60%, while the proportion of inefficient facilities has decreased from 45% to 8%. Through eliminating inefficient facilities and precise maintenance, the city's 3,000 seats can save 4.5 million yuan in maintenance costs annually. Second, a significant improvement in citizens' public service experience. Facility coverage in high-demand areas has increased from 70%-75% to 90%-95%, completely eliminating facility gaps and reducing queuing for seats by 75%. Through location and capacity optimization, the overflow rate of trash cans has decreased from 30%-40% to 5%-10%. Citizen satisfaction has increased from 3.5 / 5 to 4.3 / 5, and the number of public facility-related complaints received through the citizen hotline has decreased by 60%. Third, the efficiency of urban public resource allocation has been significantly improved. Data-driven approaches have replaced experience-based blind planning, reducing new facility investment by 30%. Through optimized allocation via "addition + removal," the total number of facilities has increased by 5%, and the return on investment has increased by 50%. In medium-sized cities, this can save 8-12 million yuan in fiscal expenditure annually. Fourth, dynamic demand response capabilities have been greatly enhanced. Through seasonally differentiated allocation, the matching degree of facilities between peak and off-peak seasons has increased by 40%. For large-scale events such as marathons and music festivals, temporary facilities can be accurately predicted with an allocation error of less than 10%. The response time for emergencies has been shortened from 2 hours to 15 minutes, and differentiated allocation between weekends and weekdays can achieve energy savings of 20%. Fifth, data-driven scientific planning and decision-making have been achieved. The traditional "gut feeling" decision-making model has been abandoned. Planning is based on population behavior data, and the effectiveness of optimization schemes is verified through A / B testing (commonly known as control testing / group control experiments), resulting in a 18-27% improvement in core indicators. By leveraging multi-objective optimization to balance multiple needs such as coverage, cost, and aesthetics, and relying on historical data to continuously train AI models, the accuracy of planning continues to improve with data accumulation. Sixth, it has broad cross-domain promotion value. The embodiments of this application can be quickly reused to optimize the layout of various public facilities such as bicycle parking racks, charging piles, and public toilets. At the same time, it can be extended to commercial scenarios such as shopping mall rest areas and restaurant seats, as well as transportation scenarios such as bus stops and shared bicycle deployment, and has benchmark demonstration value for smart city construction.

[0033] Reference Figure 1 This diagram illustrates the architecture of an intelligent layout system for public facilities provided in an embodiment of this application. Figure 1 As shown, the intelligent layout system for public facilities may include a video acquisition layer 101, a behavior recognition layer 102, a data analysis layer 103, an AI optimization layer 104, and an execution management layer 105.

[0034] The video acquisition layer 101 can be used to deploy a scenario-based video surveillance network. Optionally, the deployed scenario-based video surveillance network can take the form of a camera network, IoT (Internet of Things) sensors, etc. The specific deployment strategy of the video surveillance network is not limited in this embodiment.

[0035] The behavior recognition layer 102 can be used to collect crowd behavior data, specifically involving crowd detection, trajectory tracking, and behavior analysis. Optionally, crowd detection can be achieved through target detection; trajectory tracking can be achieved through multi-target tracking; behavior analysis is manifested as behavior pattern recognition, and the recognized behavior patterns may include stationary behavior detection, walking path analysis, and group behavior recognition, etc., which are not limited in this embodiment.

[0036] The data analysis layer 103 can be used for heat map generation, facility utilization statistics, and facility layout problem diagnosis. Optionally, heat map generation involves generating dwell heat maps and walking path heat maps; facility utilization monitoring and statistics can be achieved through video analysis or detection by deployed IoT sensors; facility layout problem diagnosis results can be obtained through three-dimensional cross-analysis, and the identified facility layout problem diagnosis results can include problems such as inefficient facilities, facility blank areas, and uneven spatial distribution, which are not limited in this embodiment.

[0037] The AI ​​optimization layer 104 can be used for reinforcement learning, multi-objective optimization, and facility adjustment strategy generation. Optionally, reinforcement learning involves constructing a reinforcement learning optimization model; multi-objective optimization involves constructing a multi-objective optimization function; the generation of the facility adjustment strategy is achieved by solving the constructed objective optimization function using the constructed reinforcement learning optimization model and multi-objective optimization function, combined with the facility layout problem diagnosis results; the generated facility adjustment strategy can be used to indicate the number of new facilities, the number of facilities removed, and the number of facilities moved, which is not limited in this embodiment.

[0038] The executive management layer 105 can be used to dynamically adjust the layout of public facilities, evaluate the optimization effect, and continuously iterate. Optionally, the dynamic adjustment of the layout of public facilities is specifically manifested in dynamic allocation and real-time response based on the dynamic changes in the needs of the population. The dynamic changes in the needs of the population can be such as seasonal changes, large-scale events, differences between weekdays and weekends, and emergencies. This application embodiment does not limit the specific dynamic adjustment strategy. The optimization effect evaluation and continuous iteration can be manifested in verifying the optimization effect through A / B testing, collecting feedback from citizens through multiple channels, and completing the iterative optimization of the layout plan on a monthly, quarterly, or annual basis. This application embodiment does not limit the specific effect evaluation and continuous iteration process.

[0039] This application embodiment achieves intelligent layout optimization of public facilities by forming a closed-loop solution from data collection, AI intelligent optimization, dynamic adaptation to iterative evaluation.

[0040] Reference Figure 2 This document illustrates a flowchart of a public facility layout optimization method based on crowd behavior analysis, as provided in an embodiment of this application. The method may specifically include the following steps:

[0041] Step S201: The deployed scenario-based video surveillance network uses target detection and multi-target tracking algorithms to detect crowd behavior data and monitor the usage rate of public facilities in real time.

[0042] Data acquisition is the basic input link of the closed-loop solution proposed in the embodiments of this application. In some embodiments of this application, a video surveillance network can be deployed in a scenario-based manner, and computer vision algorithms can be used to complete the comprehensive collection of crowd behavior data and facility usage data, providing data support for subsequent analysis and optimization, and avoiding the problems of incomplete and insufficient representativeness of traditional data acquisition.

[0043] Specifically, the first step is to deploy a scenario-based video surveillance network. Then, through the deployed scenario-based video surveillance network, target detection and multi-target tracking algorithms are used to complete pedestrian detection, trajectory recording and re-identification, identify pedestrian stopping, walking and group behavior patterns, and thus obtain crowd behavior data.

[0044] Optionally, video surveillance networks involve differentiated deployment and technical parameter limitations.

[0045] Differentiated deployment refers to deploying video surveillance networks according to different scenarios. Specifically, it can be combined with the population density and spatial characteristics of different public scenarios to set differentiated deployment standards to ensure that the cameras cover the entire area without blind spots, while avoiding waste of resources. The camera deployment density, coverage area, and installation requirements will vary for different scenarios.

[0046] For example, the camera deployment strategy in parks and squares can be represented as every 5000m 2 For a commercial street, the camera layout strategy could be 2-3 cameras every 200 meters, covering high-traffic areas, public seating areas, and trash can locations. For a transportation hub waiting room, the camera layout strategy could be 3 cameras every 1000 meters. The installation height of the cameras should be 5-8 meters, with a downward angle of 60-80°. 2Configure 4-6 cameras to cover waiting areas, ticket areas, entrances and exits, and transfer passages. Specifically, parks and squares should focus on covering activity areas, commercial streets should focus on densely populated areas and facilities, and transportation hubs should focus on passenger transfer areas.

[0047] Technical parameter limitations refer to the parameterization of camera resolution, frame rate, field of view, and night vision capabilities to ensure clear and real-time capture of pedestrian behavior, meeting the accuracy requirements for subsequent target detection and trajectory tracking. For example, the camera resolution can be 1080P~4K to ensure clear identification of people at a distance, the frame rate can be 25~30fps for smooth tracking, the field of view can be 90-120°, and the deployed camera must have infrared / starlight level 24-hour night vision capabilities.

[0048] In this embodiment of the application, the video surveillance network deployment implemented according to the above-mentioned differentiated deployment and technical parameter limitations can ensure the accuracy and comprehensiveness of the collection of crowd behavior data, provide high-quality data support for subsequent analysis, and avoid data deviations caused by unreasonable monitoring deployment or substandard parameters.

[0049] Optionally, for object detection, YOLOv8 (a single-stage object detection model) or Faster R-CNN (Faster Region-based Convolutional Neural Networks, a two-stage object detection model) algorithms can be selected, with limitations on detection accuracy (>95%), false negative rate (<5%), real-time processing speed (supporting 30fps), and adaptability to crowded scenes (e.g., 100+ people in a single frame) to ensure accurate and fast identification of all pedestrians in the scene and adaptability to public scenes with different crowd densities. For multi-object tracking, DeepSORT (SimpleOnline and Realtime Tracking with a Deep Association Metric) or ByteTrack (Simple Online and Realtime Tracking with...) can be selected. ByteAssociation (a simple online real-time tracking based on byte association) uses DeepSORT / ByteTrack to continuously track each person and generate a trajectory ID (such as Person_001, Person_002, etc.). Re-identification is completed through pedestrian feature vector matching (accuracy > 85%). The tracking time for a single target is limited (such as continuous tracking of a single target for 5 to 10 minutes) to ensure continuous tracking of the trajectory of a single pedestrian and avoid trajectory breaks caused by pedestrian movement or temporary departure, thus providing complete trajectory data for subsequent behavior pattern recognition.

[0050] Re-identification refers to the ability to correctly match a pedestrian who leaves and then re-enters the area. The core of re-identification is feature vector matching, which involves first training a model offline to generate a pedestrian's feature identity, and then comparing the similarity between the old and new feature vectors online. To ensure a re-identification accuracy >85%, data augmentation and metric learning can be used to optimize feature extraction, while setting a reasonable similarity threshold. To adapt to public spaces, the feature library can be retained for a period of time (e.g., 5-60 minutes), support cross-camera matching, and prioritize the extraction of stable features, thus ensuring that a pedestrian can still be matched with the original trajectory ID after leaving and re-entering. It should be noted that each pedestrian has a unique feature identity. If a pedestrian leaves and enters within the detection range, as long as the camera performs feature identity matching, it can be determined that they are the same pedestrian. This application does not impose any limitations on this.

[0051] In some embodiments of this application, the recording of trajectories involves setting the trajectory acquisition frequency, coordinate transformation method, and data storage volume.

[0052] Optionally, the acquisition frequency can be set to acquire pedestrian coordinates (x, y, timestamp) once per second to ensure the continuity of trajectory data and accurately reflect the pedestrian's movement path and dwell time. Coordinate transformation can be achieved by converting the pixel coordinates acquired by the camera into GPS or planar spatial coordinates through a homography transformation matrix, thereby giving the trajectory data actual spatial meaning and ensuring the accuracy of subsequent heat map generation and facility location matching. The data storage setting is mainly used to determine the amount of trajectory data stored per person per hour (approximately 200KB), thereby providing a basis for the design of the system's data storage scheme and ensuring the rationality and feasibility of data storage.

[0053] In the coordinate transformation process, the core of pixel coordinate construction is camera image calibration, which involves determining the origin / coordinate axes, associating physical feature points, and establishing a benchmark for trajectory acquisition. The key to trajectory acquisition is center coordinate sampling at 1 second / time, which involves taking the center of the pedestrian detection box, binding a timestamp, and associating it with the pedestrian's feature identification to form a trajectory sequence. The core of coordinate mapping is the homography transformation matrix, which converts pixel coordinates into meter-level planar coordinates / GPS coordinates, thereby ensuring the physical meaning of the trajectory. Simply put, the entire process involves first drawing pixel grids on the camera image, then recording the pedestrian's position within the grids every second, and finally converting the grid positions into meters / latitude and longitude in the real world. This ensures both real-time trajectory acquisition and accurate mapping to actual public space locations. This application's embodiments do not impose limitations on this.

[0054] In some embodiments of this application, behavioral pattern recognition includes dwell behavior detection, walking path analysis, and group behavior recognition.

[0055] Optionally, the dwell behavior detection can use a continuous movement distance of less than 1 meter for 5 seconds as the criterion for determining stillness, record the dwell time (i.e., the time from being still to leaving) and the dwell location (i.e., the coordinates of the dwell point). In addition, the reason for dwelling (such as rest, shopping, facility use) can be inferred from the dwell location, accurately identifying different types of dwelling needs, and making recommendations for rest, shopping, and facility use behaviors, providing a basis for facility optimization.

[0056] Walking path analysis can record pedestrians' starting / ending points (i.e., the location of entering / leaving public space), the route taken (i.e., the complete trajectory sequence), walking speed (e.g., normal walking speed is 1.2-1.5m / s on average, the walking speed of the elderly / children is <0.8m / s on average, and the walking speed when rushing is >2m / s on average), and path preferences (e.g., main road / side path, straight line / detour, etc.), clarifying the main activity routes and movement patterns of the population, and providing support for the generation of walking path heat maps and the adjustment of facility layout (e.g., trash cans, streetlights).

[0057] Group behavior identification can be achieved by clearly defining the identification criteria for individuals, groups, gatherings, and queues. For example, the identification criterion for an individual is detecting a pedestrian moving alone; the identification criterion for groups of two or more is determining that they are in a group if at least two pedestrians are detected within 5 meters of each other and their trajectories are identical; the identification criterion for gatherings is 5 or more people within 10 meters of each other. 2 Staying inside for more than 2 minutes; queuing behavior is identified as three or more people waiting in a linear queue. By capturing the characteristics of group activities, we can provide a basis for the configuration of facilities in areas with group activities. For example, by identifying scenarios of gathering behavior, we can accurately locate the location, scale, and duration of group activities such as square dancing and street performances; by identifying scenarios of queuing behavior, we can quickly locate areas with congested crowds and insufficient facilities, thus providing accurate group behavior data for adjusting the layout of facilities. At the same time, it can help improve thermal analysis, so that the configuration of facilities such as seats and trash cans can meet the actual needs of the groups, taking into account both the comfort of people's activities and the efficiency of public space management.

[0058] In some embodiments of this application, the monitoring of public facility usage includes seat occupancy detection, trash can overflow detection, and street light usage efficiency assessment.

[0059] As an example, seat occupancy detection can employ two methods: video analysis and pressure sensors. This involves detecting occupancy status through video analysis of the seat's Region of Interest (ROI) or pressure sensors, and calculating the occupancy duration (from sitting down to leaving) and occupancy rate (occupancy duration / total duration × 100%). Specifically, ROI video analysis is implemented through human detection; if someone is detected on the seat, it is considered occupied; if no one is detected, it is considered vacant. Pressure sensor detection is achieved by installing a pressure pad under the seat; if the detected weight is greater than 10kg, the seat is considered occupied. It should be noted that while pressure sensors offer 100% accuracy, they require hardware modifications to the seat. To balance detection accuracy and implementation cost, pressure sensors are an optional solution.

[0060] As another example, for trash can overflow detection, two methods can be provided: video analysis and ultrasonic / infrared sensors. This involves analyzing the percentage of trash pile in the video or detecting the height of the trash using ultrasonic / infrared sensors to generate an overflow warning, providing a basis for trash collection. Specifically, video analysis is achieved by analyzing the image above the trash can. The overflow judgment standard can be set to generate an overflow warning when the trash pile reaches 80% of the can's opening. The accuracy of this detection method is affected by lighting and angle, and is approximately 85%. Ultrasonic / infrared sensors are implemented by installing distance sensors inside the can. The overflow judgment standard can be set to determine if the trash is less than 10cm from the can's opening. This detection method allows for real-time data upload.

[0061] As another example, the effectiveness of streetlights can be evaluated by combining nighttime pedestrian traffic with lighting hours. This allows for the assessment of the rationality of streetlight use and the optimization of lighting strategies in low-traffic areas to achieve energy conservation and consumption reduction. For instance, if the lighting hours are from 6:00 PM to 6:00 AM the next day, nighttime pedestrian traffic in the area can be statistically analyzed. If the pedestrian traffic is less than 5 people per hour and lasts for more than 2 hours, it can be recommended to delay turning on or turn off the streetlights in that area earlier.

[0062] Step S202: Based on the crowd behavior data, generate a residence heat map and a walking path heat map, and perform spatiotemporal dynamic analysis on the residence heat map and the walking path heat map to obtain heat distribution data.

[0063] In some embodiments of this application, after obtaining crowd behavior data, the abstract pedestrian trajectories and dwell information can be transformed into a visualized crowd activity heat map, and spatiotemporal dynamic analysis can be performed to accurately capture the temporal and spatial distribution patterns of crowd activities and clarify the differences in facility needs in different scenarios and at different times.

[0064] Specifically, based on the collected crowd behavior data, heat maps of dwell time and walking paths can be generated, and spatiotemporal dynamic analysis can be carried out by time period, season, and cycle.

[0065] Reference Figure 3 The illustration shows a schematic diagram of the crowd heat map generation process provided in this application embodiment. First, spatial grid division can be performed, which involves dividing the entire public monitoring area (such as parks, squares, commercial streets, transportation hubs, etc.) into grids of uniform size. Then, the dwell time / number of people passing through each grid can be counted, and after normalization processing, a visualized heat map is generated. For example, to adapt to the scale of public spaces and ensure accurate and non-redundant heat distribution, the grid standard can be 10m × 10m.

[0066] In practical applications, each grid can be uniquely identified. This grid identifier can be used to indicate the spatial range of the corresponding grid, which corresponds to the actual spatial coordinates, thus laying the foundation for subsequent data statistics.

[0067] Optionally, crowd behavior data may include pedestrian dwelling behavior data and pedestrian walking behavior data.

[0068] The pedestrian dwelling behavior data can include the pedestrian's dwelling location and dwelling duration. The pedestrian dwelling location can be used to indicate the actual spatial coordinates of each pedestrian's dwelling point, which can be obtained by converting the pixel coordinates in the trajectory record into GPS or planar coordinates through a homography transformation matrix; the dwelling duration can be used to indicate the cumulative dwelling duration at each dwelling point, which is the complete duration from when the pedestrian comes to a standstill to when they leave, as recorded during dwelling behavior detection.

[0069] Pedestrian walking behavior data can include walking trajectories, which can specifically include each pedestrian's trajectory ID and a sequence of actual spatial coordinates (x, y, timestamp) collected per second. The trajectory data must cover the complete path of the pedestrian from entering the monitoring area to leaving, without any trajectory breaks.

[0070] In some embodiments of this application, a dwelling heatmap can be generated based on pedestrian dwelling behavior data and the spatial extent of each grid.

[0071] Specifically, the dwell time heatmap uses the location and duration of people's stay as the core data source, and is realized through four steps: grid division, data statistics, normalization processing, and hierarchical visualization.

[0072] Optionally, after dividing the data into grids, the pedestrian dwelling behavior data can be traversed, and the dwelling point of each pedestrian can be matched to the corresponding grid according to the spatial range of each grid. The cumulative dwelling time within the corresponding spatial range of each grid can be counted, and then the cumulative dwelling time of all grids can be normalized to obtain the normalized grid heat value. Based on the normalized grid heat value, a visualized dwelling heat map can be generated.

[0073] The cumulative dwell time within the corresponding spatial range of each grid refers to the sum of the dwell time of all pedestrians within that grid. For example, if there are 150 people staying in grid A, the cumulative dwell time is 18,000 seconds (5 hours); if there are 80 people staying in grid B, the cumulative dwell time is 9,600 seconds (2.7 hours). In practical applications, statistics can be completed grid by grid to form a grid-cumulative dwell time correspondence table.

[0074] The purpose of normalizing the cumulative dwell time of all grids is to map the dwell time of different grids to a uniform value range of 0-100, eliminate differences in data magnitude, and ensure comparability of thermal values. Specifically, the processing method can be expressed as follows: using the highest cumulative dwell time among all grids as the benchmark (assuming it is set to 100), the thermal value of other grids = (cumulative dwell time of that grid ÷ highest cumulative dwell time) × 100. For example, grid A has the highest cumulative dwell time, and its normalized thermal value is 100; the normalized thermal value of grid B = (9600 ÷ 18000) × 100 ≈ 53.

[0075] In a visualized heatmap of dwell time, different colors can be used to correspond to different heat levels. Specifically, gradient colors can be used to correspond to different heat levels, clearly indicating the intensity of dwell time demand in each area. For example, heat level classification can be represented as follows: red (heat value 80-100) corresponds to high dwell time areas, corresponding to areas with high rest demand (such as park rest areas and commercial street rest points); orange (heat value 60-79) corresponds to relatively high dwell time areas, corresponding to moderate dwell time demand; yellow (heat value 40-59) corresponds to medium dwell time areas, corresponding to general dwell time demand; green (heat value 20-39) corresponds to low dwell time areas, corresponding to a small amount of dwell time demand; and blue (heat value 0-19) corresponds to extremely low dwell time areas, mostly transit routes with no significant dwell time demand. This application's embodiments do not impose any limitations on this.

[0076] In some embodiments of this application, a heatmap of walking paths can be generated based on pedestrian walking behavior data and the spatial extent of each grid.

[0077] Specifically, the walking path heatmap uses the complete walking trajectory of pedestrians as the core data source and is realized through three steps: trajectory segmentation, grid traversal count, and visualization.

[0078] Optionally, the walking trajectory of each pedestrian can be segmented into linear trajectories. Then, using the 10m×10m grid as described above, the linear trajectories of all pedestrians can be traversed, and the total number of times the linear trajectories pass through the corresponding spatial range of each grid can be counted to obtain the number of times the trajectory passes through each grid. Based on the number of times the trajectory passes through each grid, a visual walking path heatmap can be generated.

[0079] The segmentation standard can be 1 meter as a segment, so as to divide the continuous trajectory coordinate sequence into several continuous line segments, ensuring that each segment of the trajectory can accurately correspond to the actual spatial path and avoid path deviation caused by trajectory sampling interval.

[0080] The total number of times a line segmented trajectory passes through the corresponding spatial range of each grid refers to the total number of times all pedestrian trajectories pass through that grid. For example, grid C is passed through by 5000 people and grid D is passed through by 200 people. In practical applications, the statistics can be completed grid by grid to form a grid-time correspondence table.

[0081] In a visualized heatmap of walking paths, different colors can be used to correspond to different heat levels. Specifically, gradient colors can be used to correspond to different path heat levels, clearly indicating the main walking routes and preferences of the population. For example, the heat level can be represented as follows: dark red corresponds to main passages with more than 3,000 people passing through per day, corresponding to high-frequency routes; red corresponds to secondary passages with 1,000-3,000 people passing through per day, corresponding to medium-frequency routes; yellow corresponds to general paths with 300-1,000 people passing through per day, corresponding to regular routes; and green corresponds to less frequently used paths with less than 300 people passing through per day, corresponding to low-frequency routes. This application does not limit this.

[0082] It should be noted that the dwell time heatmap divides the area into 10m×10m grids, calculates the cumulative dwell time in each grid and normalizes it, and classifies the area according to heat value, intuitively presenting the spatial distribution of people's dwell time needs. This provides a direct basis for optimizing rest facilities such as seats. For example, if there are no seats in the red area, seats will be added; if there are seats in the blue area (but the usage rate is low), they will be considered for removal. The walking path heatmap is generated by counting the number of times each grid is traversed, accurately identifying main channels, secondary paths, and less-used paths. This provides a basis for optimizing facilities such as trash cans and streetlights along the paths. For example, the dark red channel has a high demand for trash cans (people bring trash), the green path can have fewer streetlights (fewer people save energy), and when the planned path does not match the actual path, the design will be optimized to identify shortcuts. If it is necessary to merge the stationary heatmap and the walking path heatmap into a comprehensive heatmap, the two types of data can be standardized and scaled to the same range first, then merged according to preset weights and normalized a second time, finally mapped to heat values ​​in the range of 0 to 100, ensuring that the two types of heat indicators are comparable and can be superimposed.

[0083] In some embodiments of this application, spatiotemporal dynamic analysis of dwell heatmaps and walking path heatmaps includes time-segment analysis, seasonal difference analysis, and periodic pattern analysis.

[0084] The time-segmented analysis includes heat map analysis for the morning peak, lunch break, evening, and night, covering four core time periods and capturing differences in pedestrian flow patterns at different times. For example, during the morning peak (e.g., 07:00~09:00), commuter routes are busy, and the demand for seating is low; during the lunch break (e.g., 12:00~14:00), rest areas are busy, and the demand for seating is high; during the evening (18:00~20:00), parks are busy, and the demand for comprehensive facilities is high; during the night (21:00~23:00), commercial areas are busy, and parks are quiet. This application embodiment does not impose any limitations on this.

[0085] Seasonal variation analysis includes seasonal variation analysis for summer / winter / rainy season, which can capture changes in pedestrian flow distribution caused by seasonal changes in summer, winter, and rainy season. For example, in summer, the demand for seats increases by 30% in shady areas (for cooling off); in winter, the demand for seats decreases by 50% in sunny areas (for sunbathing); and the demand for seats near rain shelters surges during the rainy season. This application embodiment does not limit this.

[0086] Periodic pattern analysis includes the periodic pattern analysis of weekdays / weekends / holidays, which can compare the differences in pedestrian flow between weekdays and weekends / holidays. For example, CBDs are hot on weekdays, parks are cold on weekdays, and scenic spots are hot twice as much on holidays (due to high demand for temporary facilities), providing a basis for dynamic adjustments.

[0087] In some embodiments of this application, after performing spatiotemporal dynamic analysis on the heat map of crowd activity, thermal distribution data that indicates the thermal activity of crowds at different times can be obtained, that is, the thermal distribution data is spatiotemporal dynamic data.

[0088] Step S203: Based on thermal distribution data and public facility utilization rates, identify facility layout problems and diagnostic results through three-dimensional cross-analysis.

[0089] In this embodiment, thermal distribution data (demand side) and facility utilization data (supply side) can be integrated. Through three-dimensional cross-analysis, the core problems existing in the current facility layout can be accurately located, the facility layout problem diagnosis can be realized, and a clear optimization direction can be provided for subsequent AI optimization, avoiding blind adjustments.

[0090] Specifically, the diagnostic method can be implemented through a three-dimensional cross-analysis of "demand-supply-utilization efficiency," integrating three types of data: heat map (demand), facility location (supply), and utilization rate (utilization efficiency) to ensure the comprehensiveness and accuracy of problem diagnosis. The diagnostic content can be manifested by identifying facility clustering areas through K-means clustering, quantifying the facility gap in high-demand areas, locating inefficient facilities and analyzing their causes (location, orientation, capacity, etc.), providing clear problem guidance for subsequent AI optimization.

[0091] Optional, facility layout problem diagnosis results, including inefficient facilities, facility gaps, and uneven spatial distribution.

[0092] Among them, the identification of inefficient facilities is a core foundational step in multi-objective optimization. Its core function is to provide accurate initial data, constraints, and optimization directions for the optimization function, so that the subsequent AI optimization model does not need to blindly traverse all facilities, but focuses on "disposal of inefficient facilities and replenishment in high-demand areas" to make accurate calculations, which greatly improves optimization efficiency and strategy implementation. If this step is missing, multi-objective optimization will become a pure numerical calculation without any direction, and the generated strategies are likely to be detached from reality and unable to be implemented.

[0093] Inefficient facility identification involves analyzing seat utilization rates, analyzing the causes of inefficiency, and detecting frequent overflowing trash cans.

[0094] For example, seat utilization analysis could involve statistically analyzing 3,000 public seats across the city, yielding the following results: high utilization (occupancy > 60%): 450 seats (15%), medium utilization (30-60%): 1,200 seats (40%), and low utilization (< 30%): 1,350 seats (45%). Inefficiency analysis could focus on seat A (average daily occupancy 8%), assuming its location is in a remote corner of the park with a heat map value < 10. The analysis could suggest that the inefficiency is due to its remote location and poor placement, recommending its relocation to an area with a heat map value > 60. Similarly, analysis could focus on seat B (average daily occupancy 12%), assuming its location... Located next to the main passageway, with a pedestrian heat value of 80, the inefficiency analysis suggests that the orientation might be unfavorable (due to loud noise from the road) and the lack of shade nearby. Adjusting the orientation and adding shade could be suggested. For example, trash can X (which overflows even after being emptied 5 times daily) could be tested. Assuming its location at the entrance of the food street, with a pedestrian heat value of 95, the inefficiency analysis suggests that the trash can's capacity might be insufficient (50L, 100L required). Replacing it with a larger capacity can or adding another one could be suggested. Similarly, trash can Y (which only overflows once every 3 days) could be tested. Assuming its location in a sparsely populated area, with a heat value of 15, it could be suggested that this inefficient facility be moved to a high-demand area.

[0095] Identifying facility gaps involves demand-supply gap analysis. Taking seating shortage as an example, assuming a high-demand area (heat value > 70) has demand in 15 areas, and existing seating covers 8 areas, then there is a gap of 7 areas without seating (gap rate 47%). For example, area M has a dwell time heat value of 85 (belonging to a high-demand area), with an average of 600 people per day and an average dwell time of 15 minutes. Currently, there are 0 seats. Area M is a severely deficient area, with a demand of 600 people × 15 minutes ÷ (8 hours × 60 minutes) = 19 people simultaneously. Therefore, it is recommended to configure 20 seats (4 sets of benches for 10 people per group). Taking trash can shortage as an example, assuming area N has a population heat value of 90, a daily population flow of 8000 people, and an estimated trash generation of 8000 × 0.2L / person = 1600L, and currently has 3 trash cans × 100L = 300L (meeting only 19% of the demand), then it is recommended to add 10 100L trash cans.

[0096] Uneven spatial distribution can be identified through cluster analysis, specifically K-means clustering to identify areas with clustered facilities. For example, if a 500m² area on the west side of the park has 12 seats (density 24 / 1000m²) and a pedestrian heat index of 35 (low to medium), this area is considered over-saturated with crowded seats. Conversely, if a 2000m² area on the east side of the park has 5 seats (density 2.5 / 1000m²) and a pedestrian heat index of 80 (high), this area is considered severely under-saturated with sparse seating. Therefore, it is recommended to move 5 seats from the west side to the east side. After this adjustment, the density on the west side will be 14 seats / 1000m², and on the east side 5 seats / 1000m², resulting in a more balanced distribution of facilities.

[0097] Step S204: By constructing a reinforcement learning optimization model and a multi-objective optimization function, and combining the facility layout problem diagnosis results, the objective optimization function is solved to generate the objective facility adjustment strategy, and the public facility layout results optimized according to the objective facility adjustment strategy are visualized.

[0098] AI-optimized layout scheme generation is the core optimization step in the embodiments of this application. In some embodiments of this application, a reinforcement learning model and a multi-objective optimization function can be constructed, and the target facility adjustment strategy (such as adding facilities, removing facilities, or moving facilities) can be solved by combining the problem diagnosis results. The optimization effect can be presented intuitively through visualization and comparative analysis, providing support for the implementation of the scheme.

[0099] The target facility adjustment strategy is the optimal facility adjustment strategy, specifically the optimized scheme for adding, removing, and moving facilities.

[0100] Specifically, reinforcement learning optimization models can define the model's state and actions, construct a reward function, and select the PPO (Proximal Policy Optimization) algorithm to maximize long-term cumulative rewards, ensuring that the optimization scheme takes into account coverage, efficiency, cost, and balance.

[0101] In some embodiments of this application, the reinforcement learning optimization model can take facility location, population heat distribution, and facility utilization rate as states, add, remove, and move facilities as actions, and construct a reward function using facility coverage, facility utilization rate, cost, and imbalance degree.

[0102] For example, the State includes the current facility location: S={(x1,y1),(x2,y2),...,(xn,yn)}; the population heat distribution: H={h1,h2,...,hm} (m grid heat values); the current utilization rate: U={u1,u2,...,un} (n facility utilization rates); and the Action includes adding a facility: A_add(x,y), removing a facility: A_remove(i), and moving a facility: A_move(i,x_new,y_new).

[0103] It should be noted that the states (facility location S, population heat map H, and utilization rate U) in problem modeling are the core inputs and decision-making basis of the reinforcement learning optimization model. In practical applications, this means that the model perceives these three types of state data in real time, judges the matching degree of the current facility layout, and then selects the optimal action of adding / removing / moving facilities. The three types of states together constitute the environmental perception dimension of the model, ensuring that every decision is in line with the actual scenario of "population demand-facility supply-utilization efficiency" rather than pure theoretical calculation.

[0104] For example, the constructed reward function can be expressed as: R = α × coverage rate + β × utilization rate + γ × cost savings - δ × imbalance, where α, β, γ, and δ are the corresponding weights of different parameters, and typically α + β + γ + δ = 1. In practical applications, coverage rate refers to the percentage of high-heat areas (>60) within 50 meters of the facility; utilization rate refers to the average occupancy rate of all facilities; cost refers to the total number of facilities (the fewer the better); and imbalance refers to the variance of facility distribution (the smaller the variance, the more uniform the distribution). Typically, the weight settings can be expressed as α = 0.4 (prioritizing coverage), β = 0.3 (utilization efficiency), γ = 0.2 (achieving cost control), and δ = 0.1 (achieving balance), but this embodiment does not impose any limitations on this.

[0105] In some embodiments of this application, the multi-objective optimization function can be constructed using facility coverage, facility utilization, and cost, and constraints can be set. Genetic Algorithm (GA), Particle Swarm Optimization (PSO), or Simulated Annealing (SA) can be used to solve the problem to ensure that the optimization scheme meets the actual application requirements.

[0106] For example, the constructed objective function can be expressed as: MaxF = w1 × coverage + w2 × utilization - w3 × cost, where w1, w2, and w3 are the corresponding weights of different parameters. Usually, w1 + w2 + w3 = 1. The specific weights can be set according to actual needs, and this application embodiment does not limit this.

[0107] Optionally, the constraints may include constraints on the number of facilities, the service radius of facilities, the coverage of high heat zones, and aesthetic constraints.

[0108] For example, the constraint on the number of facilities can be expressed as the total number of seats ≤ the budget limit (e.g., 1000 seats); the constraint on the service radius of facilities can be expressed as the service radius of each seat ≤ 100 meters; the constraint on the coverage rate of high heat areas can be expressed as high heat areas (>80) must be covered, which is a hard constraint; the constraint on aesthetics can be expressed as ≤ 5 seats within the main landscape view. This application does not impose any limitations on these.

[0109] Optionally, during the solution process, the genetic algorithm can be represented by a population size of 1000 and 500 iterations; the particle swarm optimization can be represented by a particle number of 500 and 300 iterations; and the simulated annealing can be represented by an initial temperature of 1000 and a cooling coefficient of 0.95.

[0110] It is important to note that the reward function is the core evaluation criterion for reinforcement learning model decision-making. Its role is involved throughout the entire process of "model training - action selection - policy iteration". Specifically, every time the model performs the action of adding / removing / moving facilities, it calculates the reward value using this formula and prioritizes the action that maximizes the reward value. Ultimately, the optimized policy simultaneously meets the multi-objective requirements of wide coverage, high utilization, low cost, and even distribution. If this reward function is missing, the model will not be able to determine "which action is better", and the optimization will fall into aimless random attempts.

[0111] The optimization process of the objective function is essentially to iterate through and evaluate the impact of all candidate action strategies (adding / removing / moving) on ​​the objective function value, and finally select the action combination that maximizes F. The core logic is to transform actions into numerical changes that the function can calculate, and find the optimal action set through mathematical solutions, rather than generating strategies out of thin air, to ensure that each action (adding / removing / moving) corresponds to a clear objective of improving the F value.

[0112] In some embodiments of this application, to address the problems of inefficient facilities, facility gaps, and uneven spatial distribution, a target facility adjustment strategy can be obtained by maximizing the reward value R of the reward function and the value F of the multi-objective optimization function, which includes the number of new facilities, the number of removed facilities, and the number of moved facilities, thereby improving coverage, utilization, and reducing costs.

[0113] Specifically, this can be reflected in the following ways: increasing coverage / usage, saving costs, and reducing imbalance will result in bonus points, while decreasing them will result in deduction points. The model will continuously learn and select the action combination with the highest score, and finally generate the optimal layout scheme. Additionally, it will consider whether adding actions can improve coverage / usage with controllable costs, removing actions to see if costs can be reduced without significantly losing coverage / usage, and moving actions to see if coverage / usage can be improved with zero additional cost. Finally, the action combination with the largest F-value will be selected.

[0114] For example, the generated target layout adjustment strategy can be as follows: Option A: Add 18 seats, remove 12, move 25, coverage 92%, utilization 68%, cost +6 seats; Option B: Add 10, remove 15, move 30, coverage 89%, utilization 71%, cost -5 seats; Option C: Add 25, remove 8, move 20, coverage 96%, utilization 65%, cost +17 seats. This application embodiment does not limit this.

[0115] In some embodiments of this application, the comparative analysis results before and after optimization can also be visualized to intuitively present the optimization effect.

[0116] Optionally, visualization can be achieved through 3D layout display. Specifically, 3D layout display can be represented by overlaying a heat map layer, an existing facility layer, and an optimized facility layer on a base map, and using different symbols to mark addition, removal, and movement operations, intuitively presenting the changes in facility layout before and after optimization. For example, using a park plan as the base map, the heat map layer can be represented by overlaying a pedestrian flow heat map in a semi-transparent gradient, the existing facility layer can be represented by overlaying the locations of existing facilities in blue icons, and the optimized layer can be represented by overlaying the locations of recommended facilities in green icons; operation markers can, for example, use a green "+" sign to mark addition operations, a red "×" sign to mark removal operations, and a yellow arrow to mark movement operations. This application embodiment does not limit this.

[0117] Comparative analysis can be demonstrated by comparing core metrics such as coverage, utilization, cost, and return on investment, thereby visually presenting the optimization results and providing support for solution decision-making and implementation. For example, ... Figure 4 As shown, the comparative analysis results of the current situation and the optimization plan can be expressed as follows: the coverage rate increased from 75% to 92%, an increase of 17%; the utilization rate increased from 42% to 68%, an increase of 26%; the total number of seats increased from 280 to 286, an increase of 6, an increase of 2%; the annual maintenance cost increased from 1.12 million to 1.144 million, an increase of 24,000; and the return on investment (ROI) increased by 45%.

[0118] Step S205: Based on the dynamic changes in the needs of the population, the layout results of public facilities are dynamically adjusted and responded to in real time to obtain the final public facility layout strategy.

[0119] In some embodiments of this application, the layout of facilities can be flexibly adjusted to meet the dynamic changes in the needs of the population (such as seasons, large-scale events, weekdays / weekends, emergencies, etc.), thereby breaking the limitations of the traditional fixed layout of facilities and improving the matching degree between facilities and dynamic needs.

[0120] Optionally, seasonal adjustments can be made to adjust seating to areas with high demand (such as shady or sunny areas) in response to changes in pedestrian flow during summer and winter, and to add or temporarily store facilities to improve seasonal adaptability.

[0121] For example, such as Figure 5 As shown, seasonal changes can be monitored. Taking summer optimization (June to August) as an example, a heat map of pedestrian flow for three months of summer can be input. If changes are found: the heat value in the shaded area changes from 45 to 75 (+67%), and the heat value in the sun-exposed area changes from 60 to 30 (-50%), a facility adjustment strategy can be generated for dynamic adjustment. For example, 20 seats can be moved from the sun-exposed area to the shaded area, and 5 temporary sunshades (removable) can be added. The specified adjustment time is to be completed by the end of May (preparation in advance). Taking winter optimization (December to February) as an example, if changes are found: the heat value in the sunny area changes from 40 to 65 (+63%), and the heat value in the cool and shady area changes from 50 to 20 (-60%), a facility adjustment strategy can be generated for dynamic adjustment. For example, seats can be moved from the cool and shady area to the sunny area, and the configuration can be reduced: the overall demand is reduced by 40%, and 30% of the seats are temporarily stored. This application embodiment does not limit this.

[0122] Optionally, temporary configuration for large-scale events can be manifested in setting up temporary facilities before the event and removing them after the event for large-scale events such as marathons and music festivals, so as to achieve precise configuration and avoid waste.

[0123] For example, taking a marathon (5000 participants) as an example, 100 temporary seats can be provided at the start / finish line, and 20 additional temporary seats (6 stations = 120) can be added at aid stations (every 5km). The density of trash cans can also be increased, such as adding 10 additional aid stations (6 stations = 60) and 30 portable toilets. These can be deployed one day before the race and removed one day after. For a music festival (20000 participants) as an example, 500 temporary seats can be provided at the main venue, and 300 additional seats can be added in the surrounding rest areas. 200 additional trash cans (100L capacity) can also be provided. Dynamic adjustments can be made based on time periods, such as the performance period (18:00~22:00) when demand is highest. AI prediction can recommend the optimal layout based on historical data, and this application does not limit this approach.

[0124] Optionally, weekday / weekend adjustments can manifest as cross-regional facility relocation to adapt to the differences in pedestrian flow between weekdays and weekends, achieving energy conservation and consumption reduction. For example, differences in pedestrian flow patterns between Monday to Friday and Saturday to Sunday can be detected, and some facilities can be moved to high-demand areas on Friday evenings. For instance, if demand for CBD seating decreases by 60% on weekends, it can be temporarily moved to a park. This application does not limit this approach.

[0125] Optionally, emergency response can manifest as real-time push of handling instructions to address emergencies such as rainstorms and equipment failures, rapidly deploying facilities and improving response efficiency.

[0126] For example, taking a rainstorm as an example, if a crowd is detected gathering near a rain shelter (the heat value instantly changes from 20 to 90), a notification can be sent to nearby sanitation workers that a certain area's trash cans need urgent emptying. Rapid deployment can also be achieved by adding mobile trash cans (with wheels). Similarly, in the case of equipment malfunction, if a trash can's pressure sensor reports overflow, a garbage truck within 500 meters can be prioritized for handling the overflow, and citizens can be notified of the nearest available trash can (achieved through a temporary push notification from the app). This application's embodiments do not impose any limitations on these aspects.

[0127] In some embodiments of this application, after on-site implementation according to the final public facility layout strategy, the embodiments of this application can also conduct effect evaluation and continuous iteration. Specifically, the optimization effect can be monitored, and feedback information can be collected for iterative optimization of the public facility layout strategy, ensuring that the layout scheme continuously adapts to changes in urban development and population needs, and achieving long-term optimization.

[0128] Optionally, the optimization effect can be verified through A / B testing, feedback from citizens can be collected through multiple channels, and the layout plan can be iterated and optimized on a monthly, quarterly, and annual basis.

[0129] The effectiveness evaluation uses A / B testing, which involves setting up an optimized experimental group and a control group with the original layout, and comparing core indicators (such as coverage, usage, overflow rate, citizen satisfaction, maintenance cost, etc.) to verify the effectiveness of the optimization plan.

[0130] For example, assuming area A is used as the experimental group, where AI is applied to optimize the layout, and area B is used as the control group, maintaining the original layout, after a 3-month experimental period, indicators such as coverage, usage rate, and citizen satisfaction can be evaluated. The optimization results are shown in Table 1 below:

[0131] Table 1 Optimization Results

[0132]

[0133] As shown in Table 1 above, the optimized plan is significantly better than the original layout, and it is recommended to promote it throughout the city.

[0134] Feedback can be collected comprehensively through facilities QR codes, citizen hotlines, social media, and other channels to provide a basis for iterative optimization.

[0135] For example, app reviews can be conducted via QR codes next to facilities, allowing users to scan the codes to rate usability. In practical applications, collected data can include satisfaction / dissatisfaction and reasons (multiple selections). Reasons for satisfaction can include convenient location, sufficient quantity, and cleanliness, while reasons for dissatisfaction can include insufficient quantity, poor location, and unrepaired damage. Complaints from citizen hotlines can be categorized; for example, complaints about insufficient seating in a certain park can be marked as requiring additional seating in that area, and then complaints can be clustered to identify high-frequency complaint areas for priority optimization. Social media feedback can be collected by crawling information mentioning public seats / trash cans, performing sentiment analysis (positive / negative emotions), and identifying specific locations for location extraction; for example, "There are no seats at XX park" can be recorded as negative feedback. This application does not limit these aspects.

[0136] Continuous iteration can be manifested in establishing an iterative mechanism of monthly fine-tuning, quarterly algorithm comparison, and annual overall planning. By implementing monthly fine-tuning, quarterly algorithm comparison, and annual overall planning, continuous iterative optimization can be achieved, thereby ensuring that the layout plan continues to adapt to changes in urban development and population needs.

[0137] For example, monthly optimization can be manifested in updating the pedestrian flow heat map monthly (incorporating the latest month's data), identifying newly added high-demand areas (such as increased pedestrian flow due to the opening of new shopping malls), and fine-tuning facility locations (such as moving 2-5 facilities); quarterly evaluation can be manifested in A / B testing of new optimization algorithms every quarter, contrasting reinforcement learning, genetic algorithms and rule engines, and selecting the optimal algorithm for application; annual planning can be manifested in generating an annual optimization plan based on the year's data, combining urban development plans (such as building new subway lines or commercial districts), and budget applications (such as the number of new facilities and the renovation of old facilities). This application's embodiments do not impose any limitations on these aspects.

[0138] Reference Figure 6 The diagram illustrates the interface of the public facility layout optimization backend provided in this embodiment. By employing the public facility layout optimization method based on crowd behavior analysis provided in this embodiment, information such as the city's facility overview, AI-recommended adjustments, and summer temporary configuration reminders can be directly displayed on the interface, achieving intelligent layout optimization of public facilities.

[0139] In this embodiment, a scenario-based video surveillance network is deployed, employing target detection and multi-target tracking algorithms to detect crowd behavior data and monitor the utilization rate of public facilities in real time. Then, based on the crowd behavior data, a dwelling heatmap and a walking path heatmap are generated. These heatmaps undergo spatiotemporal dynamic analysis to obtain heat distribution data. Based on the heat distribution data and the utilization rate of public facilities, a three-dimensional cross-analysis is used to identify facility layout problems. Furthermore, a reinforcement learning optimization model and a multi-objective optimization function are constructed, and combined with the facility layout problem diagnosis results, the objective optimization function is solved to generate a target facility adjustment strategy. The optimized public facility layout results, based on the target facility adjustment strategy, are then visualized. Finally, based on the dynamic changes in crowd demand, the public facility layout results are dynamically adjusted and responded to in real time to obtain the final public facility layout strategy. This approach, based on crowd behavior analysis, optimizes the layout of public facilities, forming a closed-loop solution encompassing data collection, AI-powered intelligent optimization, dynamic adaptation, and iterative evaluation. AI optimizes facility locations and removes inefficient or idle facilities, improving the utilization rate of public facilities. Furthermore, by using crowd behavior data as the basis for planning, it enables data-driven scientific planning decisions, replacing experience-based blind planning and improving the efficiency of urban public resource allocation. Moreover, by leveraging multi-objective optimization to balance coverage, cost, aesthetics, and other needs, and by continuously training AI models with historical data, the accuracy of planning improves with data accumulation. Dynamically adjusting and responding in real-time to the changing needs of the population significantly enhances the ability to respond to dynamic demands, thereby achieving intelligent optimization of public facility layout.

[0140] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.

[0141] Reference Figure 7 The diagram illustrates a structural block diagram of a public facility layout optimization device based on crowd behavior analysis provided in an embodiment of this application, which may specifically include the following modules:

[0142] The crowd behavior data acquisition module 701 is used to detect crowd behavior data through a deployed scenario-based video surveillance network using target detection and multi-target tracking algorithms, and to monitor the utilization rate of public facilities in real time.

[0143] The crowd activity heat map generation module 702 is used to generate a dwelling heat map and a walking path heat map based on crowd behavior data, and to perform spatiotemporal dynamic analysis on the dwelling heat map and the walking path heat map to obtain heat distribution data;

[0144] The facility layout problem diagnosis module 703 is used to identify facility layout problem diagnosis results through three-dimensional cross-analysis based on thermal distribution data and public facility utilization rate.

[0145] The layout optimization strategy generation module 704 is used to construct a reinforcement learning optimization model and a multi-objective optimization function, and combine the facility layout problem diagnosis results to solve the objective optimization function, generate the objective facility adjustment strategy, and visualize the public facility layout results optimized according to the objective facility adjustment strategy.

[0146] The dynamic adjustment and real-time optimization module 705 is used to dynamically adjust and respond in real time to the layout results of public facilities based on the dynamic changes in the needs of the population, so as to obtain the final public facility layout strategy.

[0147] In some embodiments of this application, the crowd behavior data includes pedestrian stopping behavior data and pedestrian walking behavior data; the crowd activity heatmap generation module 702 may include the following sub-modules:

[0148] The spatial grid division submodule is used to divide the entire public monitoring area into grids of uniform specifications and to identify each grid; the grid identifier is used to indicate the spatial range of the corresponding grid.

[0149] The crowd activity heatmap generation submodule is used to generate a dwelling heatmap based on pedestrian dwelling behavior data and the spatial range of each grid; and / or, to generate a walking path heatmap based on pedestrian walking behavior data and the spatial range of each grid.

[0150] In some embodiments of this application, pedestrian dwelling behavior data includes pedestrian dwelling location and dwelling duration, where pedestrian dwelling location indicates the dwelling point of each pedestrian, and dwelling duration indicates the cumulative dwelling duration at each dwelling point; the crowd activity heatmap generation submodule may include the following units:

[0151] The dwell time heatmap generation unit is used to traverse pedestrian dwell time behavior data, match each pedestrian's dwell time point to the corresponding grid according to the spatial range of each grid, and calculate the cumulative dwell time within the corresponding spatial range of each grid; normalize the cumulative dwell time of all grids to obtain the normalized grid heatmap value; generate a visualized dwell time heatmap based on the normalized grid heatmap value; and use different colors to correspond to different heat levels in the visualized dwell time heatmap.

[0152] In some embodiments of this application, pedestrian walking behavior data includes walking trajectories; the crowd activity heatmap generation submodule may include the following units:

[0153] The walking path heatmap generation unit is used to decompose the walking trajectory of each pedestrian into line segments to obtain line segments; it traverses the line segments of all pedestrians, counts the total number of times the line segments pass through the corresponding spatial range of each grid, and obtains the number of times the trajectory passes through each grid; based on the number of times the trajectory passes through each grid, a visual walking path heatmap is generated; in the visual walking path heatmap, different colors are used to correspond to different heat levels.

[0154] In some embodiments of this application, spatiotemporal dynamic analysis of dwell heatmaps and walking path heatmaps includes time-segment analysis, seasonal difference analysis, and periodic pattern analysis.

[0155] In some embodiments of this application, the facility layout problem diagnosis results include inefficient facilities, facility gaps, and uneven spatial distribution; the layout optimization strategy generation module 704 may include the following sub-modules:

[0156] The reinforcement learning optimization model construction submodule is used to construct a reinforcement learning optimization model with facility location, population heat distribution, and facility utilization rate as states, and adding, removing, and moving facilities as actions. The reward function of the reinforcement learning optimization model is constructed using facility coverage, facility utilization rate, cost, and imbalance degree.

[0157] The multi-objective optimization function construction submodule is used to construct multi-objective optimization functions based on facility coverage, facility utilization, and cost. The constraints of the multi-objective optimization function include constraints on the number of facilities, facility service radius, high-heat zone coverage, and aesthetics.

[0158] The objective solution submodule is used to solve the problems of inefficient facilities, facility gaps, and uneven spatial distribution. It aims to maximize the reward value of the reward function and the value of the multi-objective optimization function, and solves the objective facility adjustment strategy, which includes the number of new facilities, the number of facilities removed, and the number of facilities moved.

[0159] In some embodiments of this application, the apparatus provided in this application may further include the following modules:

[0160] The effect evaluation and iterative optimization module is used to monitor the optimization effect after the final public facility layout strategy is implemented on-site, and to collect feedback information for iterative optimization of the public facility layout strategy.

[0161] In this embodiment, a scenario-based video surveillance network is deployed, employing target detection and multi-target tracking algorithms to detect crowd behavior data and monitor the utilization rate of public facilities in real time. Then, based on the crowd behavior data, a dwelling heatmap and a walking path heatmap are generated. These heatmaps undergo spatiotemporal dynamic analysis to obtain heat distribution data. Based on the heat distribution data and the utilization rate of public facilities, a three-dimensional cross-analysis is used to identify facility layout problems. Furthermore, a reinforcement learning optimization model and a multi-objective optimization function are constructed, and combined with the facility layout problem diagnosis results, the objective optimization function is solved to generate a target facility adjustment strategy. The optimized public facility layout results, based on the target facility adjustment strategy, are then visualized. Finally, based on the dynamic changes in crowd demand, the public facility layout results are dynamically adjusted and responded to in real time to obtain the final public facility layout strategy. This approach, based on crowd behavior analysis, optimizes the layout of public facilities, forming a closed-loop solution encompassing data collection, AI-powered intelligent optimization, dynamic adaptation, and iterative evaluation. AI optimizes facility locations and removes inefficient or idle facilities, improving the utilization rate of public facilities. Furthermore, by using crowd behavior data as the basis for planning, it enables data-driven scientific planning decisions, replacing experience-based blind planning and improving the efficiency of urban public resource allocation. Moreover, by leveraging multi-objective optimization to balance coverage, cost, aesthetics, and other needs, and by continuously training AI models with historical data, the accuracy of planning improves with data accumulation. Dynamically adjusting and responding in real-time to the changing needs of the population significantly enhances the ability to respond to dynamic demands, thereby achieving intelligent optimization of public facility layout.

[0162] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0163] This application also provides an electronic device, which is described in reference to... Figure 8 The provided electronic device 800 includes a memory 810, a processor 820, and a computer program 811 stored in the memory 810 and capable of running on the processor 820. When the computer program 811 is executed by the processor, it implements the various processes of the above-described embodiment of the public facility layout optimization method based on crowd behavior analysis and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0164] This application also provides a computer-readable storage medium, see embodiments thereof. Figure 9 The computer-readable storage medium 900 provided stores a computer program 811. When the computer program 811 is executed by the processor, it implements the various processes of the above-described embodiment of the public facility layout optimization method based on crowd behavior analysis and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0165] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0166] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of the embodiments of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to these processes, methods, products, or devices. The division of modules in the embodiments of this application is merely a logical division; in actual applications, there may be other division methods. For example, multiple modules may be combined into or integrated into another system, or some features may be ignored or not performed. Additionally, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interface, and the indirect coupling or communication connection between modules may be electrical or other similar forms, none of which are limited in the embodiments of this application. Furthermore, the modules or sub-modules described as separate components may or may not be physically separate, may or may not be physical modules, or may be distributed among multiple circuit modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of this application.

[0167] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0168] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0169] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or modules through some interfaces, and may be electrical, mechanical, or other forms.

[0170] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0171] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0172] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0173] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

[0174] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0175] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes; these computer program instructions may also be loaded onto a computer or other programmable data processing terminal equipment to cause a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0176] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0177] Finally, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0178] The technical solutions provided in the embodiments of this application have been described in detail above. Specific examples have been used in the embodiments of this application to illustrate the principles and implementation methods of the embodiments of this application. The description of the above embodiments is only for the purpose of helping to understand the methods and core ideas of the embodiments of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the embodiments of this application. Therefore, the content of this specification should not be construed as a limitation on the embodiments of this application.

Claims

1. A method for optimizing the layout of public facilities based on crowd behavior analysis, characterized in that, The method includes: By deploying a scenario-based video surveillance network, target detection and multi-target tracking algorithms are used to detect crowd behavior data and monitor the utilization rate of public facilities in real time. Based on crowd behavior data, a heat map of dwell time and a heat map of walking paths are generated. Spatiotemporal dynamic analysis is performed on the heat map of dwell time and the heat map of walking paths to obtain heat distribution data. Based on the thermal distribution data and the utilization rate of public facilities, the diagnostic results of facility layout problems are identified through three-dimensional cross-analysis. By constructing a reinforcement learning optimization model and a multi-objective optimization function, and combining the diagnostic results of the facility layout problem, the objective optimization function is solved to generate a target facility adjustment strategy, and the public facility layout results optimized according to the target facility adjustment strategy are visualized. Based on the dynamic changes in the needs of the population, the layout results of the public facilities are dynamically adjusted and responded to in real time to obtain the final public facility layout strategy.

2. The method according to claim 1, characterized in that, The crowd behavior data includes pedestrian stopping behavior data and pedestrian walking behavior data; The generation of dwell time heatmaps and walking path heatmaps based on crowd behavior data includes: The entire public monitoring area is divided into grids of uniform specifications, and each grid is marked with a grid identifier; the grid identifier is used to indicate the spatial range of the corresponding grid. Based on the pedestrian dwelling behavior data and the spatial range of each grid, a dwelling heatmap is generated; and / or, based on the pedestrian walking behavior data and the spatial range of each grid, a walking path heatmap is generated.

3. The method according to claim 2, characterized in that, The pedestrian stopping behavior data includes the pedestrian stopping location and stopping duration. The pedestrian stopping location is used to indicate the stopping point of each pedestrian, and the stopping duration is used to indicate the cumulative stopping duration at each stopping point. The step of generating a dwelling heatmap based on the pedestrian dwelling behavior data and the spatial range of each grid includes: Iterate through the pedestrian dwelling behavior data, match the dwelling point of each pedestrian to the corresponding grid according to the spatial range of each grid, and count the cumulative dwelling time within the corresponding spatial range of each grid; The cumulative dwell time of all grids is normalized to obtain the normalized grid thermal value; Based on the normalized grid thermal values, a visualized residence heatmap is generated; in the visualized residence heatmap, different colors are used to correspond to different thermal levels.

4. The method according to claim 2, characterized in that, The pedestrian walking behavior data includes walking trajectories; the generation of a walking path heatmap based on the pedestrian walking behavior data and the spatial range of each grid includes: The walking trajectory of each pedestrian is broken down into linear segments to obtain the linearized trajectory. Traverse all the linear trajectories of pedestrians, count the total number of times the linear trajectories pass through the corresponding spatial range of each grid, and obtain the number of times the trajectory passes through each grid. Based on the number of times the trajectory passes through each grid, a visual heatmap of the walking path is generated; different colors are used in the visual heatmap of the walking path to correspond to different heat levels.

5. The method according to claim 1, characterized in that, The spatiotemporal dynamic analysis of the stationary heatmap and the walking path heatmap includes time-segmented analysis, seasonal difference analysis, and periodic pattern analysis.

6. The method according to claim 1, characterized in that, The facility layout problem diagnosis results include inefficient facilities, facility gaps, and uneven spatial distribution. The process involves constructing a reinforcement learning optimization model and a multi-objective optimization function, and then solving the objective optimization function based on the facility layout problem diagnosis results to generate a target facility adjustment strategy, including: Using facility location, population heat distribution, and facility utilization rate as states, and adding, removing, and moving facilities as actions, a reinforcement learning optimization model is constructed. The reward function of the reinforcement learning optimization model is constructed using facility coverage, facility utilization rate, cost, and imbalance degree. A multi-objective optimization function is constructed using facility coverage, facility utilization, and cost; wherein the constraints of the multi-objective optimization function include facility quantity constraints, facility service radius constraints, high heat zone coverage constraints, and aesthetic constraints. To address the issues of inefficient facilities, facility gaps, and uneven spatial distribution, a target facility adjustment strategy is derived by maximizing the reward value of the reward function and the value of the multi-objective optimization function. This strategy includes the number of new facilities, the number of facilities removed, and the number of facilities moved.

7. The method according to claim 1, characterized in that, The method further includes: After the final public facility layout strategy is implemented on-site, the optimization effect is monitored, and feedback information is collected for iterative optimization of the public facility layout strategy.

8. A public facility layout optimization device based on crowd behavior analysis, characterized in that, The device includes: The crowd behavior data acquisition module is used to detect crowd behavior data through the deployed scenario-based video surveillance network using target detection and multi-target tracking algorithms, and to monitor the utilization rate of public facilities in real time. The crowd activity heat map generation module is used to generate a dwelling heat map and a walking path heat map based on crowd behavior data, and to perform spatiotemporal dynamic analysis on the dwelling heat map and the walking path heat map to obtain heat distribution data; The facility layout problem diagnosis module is used to identify facility layout problem diagnosis results through three-dimensional cross-analysis based on the thermal distribution data and the utilization rate of public facilities. The layout optimization strategy generation module is used to construct a reinforcement learning optimization model and a multi-objective optimization function, and combine the facility layout problem diagnosis results to solve the objective optimization function, generate the objective facility adjustment strategy, and visualize the public facility layout results optimized according to the objective facility adjustment strategy. The dynamic adjustment and real-time optimization module is used to dynamically adjust and respond in real time to the public facility layout results based on the dynamic changes in the needs of the population, so as to obtain the final public facility layout strategy.

9. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the public facility layout optimization method based on crowd behavior analysis as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the public facility layout optimization method based on crowd behavior analysis as described in any one of claims 1 to 7.