A dynamic partitioned canteen passenger flow density monitoring method and system
Patent Information
- Application Number
- CN202511464564.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-14
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2045-10-14
AI Technical Summary
[0004]本申请提供一种动态分区的食堂人流密度监测方法及系统,针对现有客流预测粒度不足、空间关系建模缺失、上下文信息利用不足及分区调度缺乏动态性等问题
本发明提出一种基于改进型时空图神经网络(ST-GNN)的食堂客流量预测与动态分区管理方法,将餐桌、区域或动态分区作为图节点,综合历史客流量、座位利用率和外部上下文特征进行时空建模,并在模型中引入动态邻接矩阵更新机制、图注意力机制和上下文特征嵌入模块。通过上述技术手段,本方法能够:
Smart Images

Figure CN121329222B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent catering management and people flow analysis, specifically to a technology for predicting and dynamically zoning canteen customer flow based on spatiotemporal graph neural networks, which is used to achieve intelligent perception, prediction and scheduling of table, area and personnel resources in catering establishments. Background Technology
[0002] Currently, large canteens, corporate canteens, and university restaurants mainly rely on manual patrols, fixed camera statistics, or simple sensor aggregation for passenger flow monitoring and area management. For area division and the scheduling of cleaning and service personnel, fixed zoning or experience-based manual arrangements are commonly used. Although time-series-based passenger flow prediction algorithms and traditional clustering-based zoning methods have been introduced in recent years, the overall approach still lacks refinement and intelligent capabilities.
[0003] This current technological state leads to several adverse consequences: insufficient prediction accuracy, making it difficult to meet the needs of precise predictions at the table or area level; unscientific zoning methods, potentially resulting in uneven task allocation due to long-term fixed dispatching, or creating disconnected or inaccessible zones, thus affecting the actual execution paths and efficiency of cleaning and service personnel; furthermore, existing systems have limited ability to capture periodic and sudden patterns, easily leading to significant underestimation or overestimation during holidays, severe weather, or other special circumstances, resulting in misjudgments. Overall, existing methods have significant shortcomings in terms of accuracy, robustness, and operational adaptability, making it difficult to meet the real-time, refined management needs of modern catering establishments. Summary of the Invention
[0004] This application provides a method and system for monitoring canteen crowd density through dynamic zoning, addressing issues such as insufficient granularity in existing crowd flow prediction, lack of spatial relationship modeling, inadequate utilization of contextual information, and lack of dynamism in zoning scheduling. The method collects real-time table occupancy and seating behavior data through multi-source sensors and video fusion, digitizes the canteen floor plan, and generates table attribute and state matrices. A scoring model is constructed based on static and dynamic features to generate a cleaning load score. Approximate rectangular zones are dynamically divided according to the number of available personnel using constrained clustering and optimization algorithms. Short-term crowd flow prediction is performed based on an improved spatiotemporal graph neural network (ST-GNN), which incorporates dynamic adjacency matrices, graph attention, and contextual embedding to improve spatiotemporal modeling accuracy. When a full-capacity risk is predicted, an early warning is triggered, and cleaning and scheduling instructions are generated according to zone priority.
[0005] This method can achieve short-term high-precision prediction, real-time partition adjustment and automated scheduling at the table / area level, improve the empty table recovery rate and seat turnover efficiency, reduce manual intervention and manpower waste, and avoid scheduling mismatch and low operational efficiency caused by unreasonable partitioning or prediction lag.
[0006] In view of the above problems, this application provides a method and system for monitoring the flow density of people in a canteen by dynamic zoning, the method comprising: The S100 acquires real-time feature data for each table and generates a restaurant status matrix that can be used for scoring and zoning. The feature data includes table coordinates, geometry, number of seats and customer flow, seating time, number of people, seating frequency, etc. The step S100 further includes: The S110 collects real-time data on passenger flow, seating time, number of people, and seating frequency. S120 digitizes the restaurant floor plan, recording the location coordinates, table type, number of seats, and historical usage frequency of each table, forming a basic table or database; The S130 performs noise reduction, outlier processing, and time synchronization on the collected data to ensure a unified timeline across all data sources, generating a complete restaurant status matrix that combines table distribution and customer flow data.
[0007] The S200 calculates a comprehensive score for each table's feature data according to preset weights, and stores the score in association with the table ID and coordinates to form a score database that can be used for dynamic partitioning and scheduling. The step S200 further includes: S210 categorizes each table into static and dynamic features based on its characteristic data, and then establishes a scoring model based on these features. S220 calculates a weighted score for each table using a scoring model; S230 stores the scoring results in the dining table database; Based on the number of staff and table rating data, S300 uses a clustering algorithm with shape constraints or an improved segmentation algorithm to divide all tables into several rectangular regions, making the total rating of tables in each region as similar as possible, and outputs the partitioning results. The step S300 further includes: S310 sets the number of zones based on the actual number K of available cleaning staff groups; S320 uses constrained clustering to generate an initial partition of approximately rectangles on the restaurant floor plan; S330 adjusts the scoring weights to make the total score of each area as balanced as possible while maintaining the rectangular shape. The S340 associates zoning information with the dining table database and updates it dynamically when the restaurant layout or personnel changes.
[0008] Based on the results of dynamic zoning, S400 summarizes the occupancy status of tables in each area, the number of empty tables and the number of uncleaned empty tables in real time, and predicts when the canteen will reach full capacity, providing early warning information for scheduling decisions. The step S400 further includes: S410 obtains the occupancy status of each table in real time; The S420 uses models such as LSTM, Transformer, or ST-GNN to make short-term predictions of table occupancy data. The S430 triggers an alert when it predicts that at least one person will be seated at any of the tables for less than a preset threshold time.
[0009] After receiving the early warning information, the S500 identifies the clusters of undisturbed empty tables in each area, and generates a scheduling method based on the zoning and prediction results to dynamically schedule cleaning staff to prioritize the handling of undisturbed empty tables.
[0010] A second aspect of this application provides a dynamic zoning system for monitoring the flow of people in a canteen, the system comprising: Data acquisition module: used to acquire real-time raw data from multiple sources, such as customer flow, seat occupancy, and spatial layout inside and outside the restaurant, to provide basic data for subsequent analysis; Dining table database and status management module: used for unified storage and time synchronization management of the static attributes and dynamic status of dining tables, forming a structured data interface; Scoring and Dynamic Zoning Module: Calculates weights based on table characteristics and usage and automatically divides areas to achieve dynamic and balanced management of restaurant space; Real-time status monitoring module: Provides continuous summary and display of the real-time occupancy, vacancy, and clearance status of seats in each area, providing the current operational status; Passenger flow prediction module: Utilizes spatiotemporal graph neural networks to fuse historical, spatial, and contextual features to predict future passenger flow trends for each table or area; Scheduling Decision and Early Warning Module: Based on the forecast results, it assesses the risk of full occupancy and optimizes cleaning and personnel scheduling, supporting timely early warning and efficient operational decisions.
[0011] One or more technical solutions provided in this application have at least the following technical effects or advantages: This invention proposes a method for predicting cafeteria customer flow and managing dynamic zoning based on an improved spatiotemporal graph neural network (ST-GNN). It treats tables, areas, or dynamic zones as graph nodes, and performs spatiotemporal modeling by integrating historical customer flow, seat utilization, and external contextual features. The model incorporates a dynamic adjacency matrix update mechanism, a graph attention mechanism, and a contextual feature embedding module. Through these techniques, this method can: To improve the accuracy and timeliness of passenger flow forecasting, while capturing the periodic fluctuations in passenger flow, the edge weights between nodes are dynamically adjusted to reflect the real-time passenger flow characteristics. Automatically focus on key tables or important areas to improve spatial feature modeling capabilities and prediction reliability; By integrating contextual features such as date, time period, holidays, and weather, the prediction results are made more consistent with actual operational patterns. It supports dynamic partitioning and personnel scheduling based on prediction results, thereby achieving balanced service resources and improved operational efficiency.
[0012] Through the above improvements, the present invention can provide precise and real-time passenger flow forecasting and zoning management decision support in canteen operations, overcoming the shortcomings of existing technologies such as coarse forecasting granularity, lack of spatial features, insufficient utilization of context, and rigid scheduling. Attached Figure Description
[0013] Figure 1 A schematic diagram of a dynamic zoning method for monitoring the flow density of people in a canteen, provided in this application; Figure 2 A schematic diagram illustrating the process of predicting when the overall canteen will reach its full capacity threshold in a dynamic zoning canteen crowd density monitoring method provided in this application. Figure 3 A flowchart illustrating a dynamic zoning canteen crowd density monitoring system provided in this application; Figure labeling: Data acquisition module 10, table database and status management module 20, rating and dynamic zoning module 30, real-time status monitoring module 40, passenger flow prediction module 50, scheduling decision and early warning module 60. Detailed Implementation
[0014] This application provides a method and system for monitoring the flow density of people in a canteen through dynamic zoning. It addresses the objective technical problems existing in the prior art, such as insufficient granularity of passenger flow prediction, lack of spatial relationship modeling, insufficient utilization of contextual information, and lack of dynamism in areas and scheduling. It constructs a method that can achieve short-term accurate prediction at the table / zone level, real-time dynamic zoning, and automated scheduling. This method digitizes the restaurant floor plan and forms a matrix of table attributes and states by fusing multi-source sensor and visual data (entrance counter, seat pressure / occupancy sensor, video recognition, etc.) (S100-S130); it constructs and updates a scoring model online based on static and dynamic features to generate cleaning difficulty / load scores for each table (S200); it uses a clustering and optimization algorithm with shape constraints to achieve approximately rectangular dynamic partitioning based on the number of available cleaning staff (S300); on this basis, it constructs a passenger flow prediction module with an improved spatiotemporal graph neural network (ST-GNN) as the core (S420), which introduces dynamic adjacency matrix updates to reflect time-varying spatial dependence, uses graph attention mechanism in the spatial layer to automatically allocate neighborhood influence weights, and embeds contextual features such as date / time period / holiday / weather to improve the model's adaptability to periodic and external driving events; the model outputs the occupancy probability of each table or area and the overall full occupancy prediction for a short period of time (e.g., 5–30 minutes) (S430). When the prediction reaches the preset threshold, the system automatically identifies the area where empty tables are not cleaned and generates a dynamic scheduling scheme (S500) based on the partition load, and issues priority tasks and path instructions to cleaning and service personnel.
[0015] Through the aforementioned technical means, this method can significantly improve the accuracy and robustness of short-term passenger flow forecasting, accurately characterize the spatiotemporal propagation and local load distribution within the restaurant, enhance the responsiveness to traffic fluctuations during holidays or emergencies, and achieve dynamic and balanced allocation of zoning and human resources. This avoids several undesirable consequences common in existing technologies, such as scheduling mismatch and response lag caused by coarse-grained forecasting, unreachable or inefficient execution paths due to unreasonable zoning, significant underestimation / overestimation in special circumstances due to lack of context, and uneven task allocation and wasted manpower caused by long-term fixed dispatching. This reduces operating costs, improves seat turnover and customer experience, and enhances the fairness and scheduling efficiency of cleaning and service personnel.
[0016] Furthermore, the acquisition, storage, use, and processing of data in the technical solution of this invention all comply with the relevant provisions of national laws and regulations.
[0017] The technical solutions of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. It should be understood that the present invention is not limited to the exemplary embodiments described herein. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention. It should also be noted that, for ease of description, only the parts related to the present invention are shown in the accompanying drawings, not all of them.
[0018] Example 1: like Figure 1 As shown, this application provides a method for monitoring the flow density of people in a canteen through dynamic zoning, the method comprising: A method for monitoring crowd density in a canteen with dynamic zoning, the method comprising: S100 acquires real-time feature data for each table, including table coordinates, geometry, number of seats and customer flow, seating time, number of people, seating frequency, etc., and generates a restaurant status matrix that can be used for scoring and zoning. The step S100 further includes: The S110 collects real-time data on passenger flow, seating time, number of people, and seating frequency. Among them, passenger flow data can be obtained by installing counting sensors (infrared / pressure / visual counting) at the entrance of the canteen; Seating behavior can be detected through video surveillance to obtain data on the number of people seated at each table, the time of seating, and the frequency of seating. It can also be achieved by equipping each dining chair with a pressure sensor, seat occupancy sensor, or low-cost seat pressure pad.
[0019] Sensors record the time each person sits in and leaves their seat.
[0020] If the dining table is unoccupied, it is recorded as an empty table.
[0021] S120 digitizes the restaurant floor plan, recording the location coordinates, table type, number of seats, and historical usage frequency of each table, forming a basic table or database; Specifically, it can obtain a restaurant floor plan (CAD drawing or photograph) and convert it into a two-dimensional coordinate system; For each dining table, mark its center coordinates (x, y), table type (round / square / rectangular), and number of seats on the floor plan; Create a table for the dining table database, with each record containing: Table ID Coordinates (x, y) Table type Number of seats Historical number of times seated, average dining time Rating field (used in subsequent step S200).
[0022] The S130 performs noise reduction, outlier processing, and time synchronization on the collected data to ensure a unified timeline across all data sources, generating a complete restaurant status matrix that combines table distribution and customer flow data.
[0023] Specifically, the data collected in step S100 can be synchronized to a unified time axis using a unified clock or NTP to ensure that the table occupancy status at the same moment can be directly mapped to the corresponding number of seated people. Convert the data from different data sources into a unified table or matrix format, for example: Timestamp | Table Number | Number of Seated People | Seating Time | Seating Time | Occupancy Status; Table number | x-coordinate | y-coordinate | Current number of occupants | Historical average dining time | Historical seating frequency.
[0024] The S200 categorizes the feature data of each collected table into static and dynamic features, calculates a comprehensive score according to preset weights, and stores the score in association with the table ID and coordinates to form a score database that can be used for dynamic partitioning and scheduling. The step S200 further includes: S210 categorizes each table into static and dynamic features based on its characteristic data, and then establishes a scoring model based on these features. Specifically: the data used to build the scoring model can be divided into static features and dynamic features, among which: The static feature extraction content is as follows: Table types: round tables, square tables, rectangular tables, etc. Different table types may have different cleaning difficulties (e.g., it is difficult to wipe the edges of a round table at the same time).
[0025] Number of seats: The more seats there are, the greater the frequency of use and the greater the amount of cleaning work.
[0026] Location characteristics: Tables placed against walls, in corners, or next to passageways may have limited cleaning space.
[0027] Neighboring table density: If the surrounding tables are too densely packed, it will increase the difficulty of cleaning.
[0028] Dynamic feature extraction Seating capacity: The actual number of people using the service on the day or during each recent meal period.
[0029] Seating frequency: The average number of times the same table is occupied during a specific time period based on historical statistics.
[0030] Average meal duration: The longer the table is used, the more garbage may accumulate after cleaning or the longer it may take to clean.
[0031] Peak usage: Tables used during peak dining hours are usually more difficult to clean.
[0032] Based on the static and dynamic characteristics of each table, a regression model is used to obtain the cleaning difficulty score W. i ; Specifically, its cleaning difficulty rating is W. i Although the weighted summation method can be used to directly assign weights to each feature (number of people, meal duration, table clutter, number of cutlery, etc.) and obtain the total score by linear weighting, the inventor found that although this method is simple, the weights are fixed and it does not have adaptability, and the effect may be poor as the scene changes. Therefore, after multiple adjustments by the inventor, this application uses a regression model method to determine the cleaning difficulty score W for each table as the preferred option. i This allows for the training of linear or nonlinear regression models using historical cleaning data (such as cleaning time and staff feedback) to predict the workload required to clean each table, which is then used as a score. This is achieved by using the feature vector F of each table... i The input is given to a regression model (such as linear regression, XGBoost, or a neural network), and the resulting scores are normalized. This involves normalizing the scores for all tables (e.g., min-max normalization or Z-score standardization), mapping the scores to a uniform interval (e.g., [0,1] or [0,100]), and outputting the cleaning difficulty score W. i .
[0033] S220 calculates a weighted score for each table using a scoring model, which is essentially the feature vector F of each table. i Mapped to a cleanup difficulty rating W i ; Specifically, its scoring model can be trained based on historical data (cleaning time, manual feedback, etc.), and its weights and non-linear relationships are automatically learned by the model, making the results more accurate and more adaptable to different scenarios.
[0034] S230 stores the scoring results in the dining table database; Specifically, it is achieved by assigning a final score W to each table. i Write the data to the dining table database, with the corresponding field being "cleaning difficulty score"; The database structure example is as follows: Table number | x-coordinate | y-coordinate | number of seats | table type | historical average dining time | cleaning difficulty rating | update time; Once the data for a preset time period (which can be one day or more, and the specific time period can be set as needed) is acquired, the table's score can be regenerated and updated. The final score can be the average of all scores for the table over a certain period of time (which can be half a month or a month, and can be adjusted as needed), which will be used as the table's score. Based on the number of staff and table rating data, S300 uses a clustering algorithm with shape constraints or an improved segmentation algorithm to divide all tables into several rectangular regions, making the total rating of tables in each region as similar as possible, and outputs the partitioning results. The step S300 further includes: S310 sets the number of zones based on the actual number K of available cleaning staff groups; Specifically: taking one person per group as an example, it can obtain the total number of available cleaning personnel K, which is used as the number of partitions, so that each cleaning personnel corresponds to one partition, ensuring that personnel and areas are matched one-to-one.
[0035] S320 uses constrained clustering (COP-KMeans) to generate approximately rectangular initial partitions on the restaurant floor plan; Specifically, it can obtain the two-dimensional coordinate position (x, y) of each table by reading the table database, and divide the restaurant floor plan into a coordinate grid as the basic spatial feature; Read the table cleaning difficulty score W for each dining table calculated in the previous step S220. i ; Each table is represented as a feature vector F. i = (x i , y i W i This includes spatial coordinates and scoring information; The location coordinates and scores are numerically normalized to avoid any one dimension (such as coordinates) having too much influence on the clustering results; Construct a set of must-link and cannot-link constraints based on prior knowledge; The "must-link" setting can be determined based on management experience or waiter operating habits. This includes identifying pairs of tables that must be grouped into the same area, such as two adjacent small tables or large tables that are often combined. These table pairs are recorded in the system to form a "must-link" list.
[0036] The "cannot-link" setting can be configured to specify table pairs that must belong to different zones, based on restaurant management needs. For example: The table at the entrance and exit should be separate from the table next to the kitchen; The aisle areas that different service staff are responsible for must not overlap.
[0037] Record these table pairs in the system to form a list of cannot-links.
[0038] Constraint storage: All constraints are saved as rule files for the clustering algorithm to use during operation.
[0039] K initial cluster centers are selected randomly or based on heuristic methods; That is, set the target number of clusters K based on the number of restaurant staff or the number of managed areas; K tables are randomly selected from the table set as initial cluster centers, and must-link and cannot-link rules are loaded simultaneously; The sample is assigned to the nearest cluster center in turn, but the must-link and cannot-link constraints must be met; if the constraints are violated, the sample is assigned to the next best center. That is, assign each table to the nearest cluster center; If a constraint conflict is encountered during the allocation process (such as must-links being separated or cannot-links being placed in the same category), the allocation result will be forcibly adjusted to satisfy the constraint.
[0040] The positions of each cluster center are recalculated, that is, the mean of the samples within the cluster is taken as the new center; That is, the mean point (weighted mean of location and score) of the tables in each partition is recalculated as the new cluster center; Repeat sample assignment and center update until the clustering results converge or the upper limit of the number of iterations is reached; That is, repeat the "assign-update" process until the clustering results no longer change significantly or the set maximum number of iterations is reached; Extract representative features (such as cluster center, feature distribution parameters, and intra-cluster variance) from each cluster to form a new set of clustering features, which will serve as input for subsequent task assignment. That is, based on the clustering results, the boundary region of each cluster is automatically drawn (using Voronoi diagram method or convex hull algorithm) to obtain the actual partitioning line; If partition boundaries intersect or have unreasonable overlap, the system will fine-tune the boundaries again based on must-link and cannot-link. The final output includes the table number, area of each zone, and its corresponding total cleaning difficulty score, providing input for subsequent task allocation.
[0041] The inventors discovered that commonly used K-Means constrained clustering relies entirely on the similarity between data points (such as the "feature vector" of each table) to divide them into several classes. Without any prior constraints, the result depends entirely on the distance calculation between points, but its partitioning results often do not meet the actual needs of a restaurant. Unlike traditional K-Means constrained clustering, this application adopts COP-KMeans constrained clustering, which adds two types of constraints to K-Means constrained clustering: must-link: Some points must belong to the same category (e.g., table A and table B must be placed in the same partition); cannot-link: Some points must belong to different categories (e.g., the table at the kitchen entrance and the table next to the exit must be separate). This allows the algorithm to consider not only the "similarity between table features" during the clustering process, but also the "prior business logic or management rules." In other words, during the partitioning process, the business requirement of "must be together / must be separated" is added, thereby obtaining a partitioning result that better meets the actual needs of the restaurant.
[0042] S330 adjusts the scoring weights to make the total score of each area as balanced as possible while maintaining the rectangular shape. Specifically, it can adjust the size of its partitions through table ratings or weights, and it can choose to update at fixed times, such as once every six months or quarterly. It can also make temporary adjustments when its table ratings or weights fluctuate too much. It can use simulated annealing or genetic algorithms, and by defining a fitness function: overall score balance + shape regularity, it can achieve a globally optimal or near-optimal partition by iteratively optimizing the allocation of boundary tables; Specifically, let's take the genetic algorithm as an example: It represents a subset of features as chromosomes and uses binary string encoding, where each bit represents whether a feature is selected (1 indicates selection, 0 indicates non-selection). A certain number of chromosomes are randomly generated as the initial population to ensure solution space coverage; Construct a fitness function that uses the performance metrics of the classification or regression model in cross-validation (such as accuracy, mean squared error, etc.) as the evaluation standard. A feature count penalty term can also be introduced to avoid redundant features. Chromosomes with high fitness values are selected for the next generation using either roulette wheel selection or tournament selection. By exchanging segments of selected chromosomes with a set crossover probability, new offspring individuals are generated, thereby achieving information recombination. Gene positions on chromosomes are randomly flipped with a small probability (i.e., a feature changes from 0 to 1 or from 1 to 0) to increase the diversity of the solution space; The process of repeated selection, crossover, and mutation is used to optimize the feature subset generation by generation. Evolution stops when the set number of iterations is reached or the population fitness converges. Select the feature subset corresponding to the chromosome with the highest fitness as the final result, and use it for subsequent scoring model or optimization model construction; This allows it to effectively avoid getting trapped in local optima through global search and evolution mechanisms, achieving the best combination that balances prediction performance and feature simplicity.
[0043] In addition, the zoning optimization must ensure the integrity of the dining tables, with each table belonging to only one zoning. For multi-story restaurants or situations with obstacles, the optimization algorithm should consider accessibility to avoid generating unreachable areas.
[0044] The S340 associates zoning information with the dining table database and updates it dynamically when the restaurant layout or personnel changes.
[0045] Specifically: it first stores the information of each partition into a database, which includes: Partition Number Table list within each zone Overall score Region center coordinates and boundary coordinates The database structure example is as follows: Partition ID | Table List | Overall Score | Region Center (x,y) | Boundary Coordinates; When certain conditions are met, such as reaching the recalculation cycle, restaurant layout adjustments, changes in the number of cleaning staff, or significant fluctuations in ratings, the zones are recalculated.
[0046] Its system can also automatically trigger a re-partitioning algorithm to ensure balanced overall scores and regularity of shapes in each partition.
[0047] Based on the results of dynamic zoning, S400 summarizes the occupancy status of tables in each area, the number of empty tables and the number of uncleaned empty tables in real time, and predicts when the canteen will reach full capacity, providing early warning information for scheduling decisions. The step S400 further includes: S410 obtains the occupancy status of each table in real time; That is, to obtain the real-time occupancy status of each table, including: Current number of occupants Seating time Is cleaning complete? The data sources primarily utilize sensors (pressure / seat occupancy), entrance counters, and video recognition algorithms; This allows it to determine the occupancy of each dining table: Occupied: At least one person is eating; Empty table not cleared: No one is at the table, but the clearing status has not been updated; Empty tables have been cleared: No one is present and the tables have been cleared. Time alignment of data from different sensors and video systems.
[0048] The following is an example of generating a real-time occupancy status matrix: Table number | Current number of occupants | Seating time | Seating time | Cleaning status.
[0049] The S420 uses models such as LSTM, Transformer, or ST-GNN to make short-term predictions of table occupancy data. It can obtain the periodic characteristics of dining at a table by the number of people who have not yet dined and the table's historical dining information, such as the frequency of occupancy, the number of people occupying the table, and the average dining time in the past. Choose one of the following models to construct the passenger flow prediction model: As a preferred option, it can construct a passenger flow prediction model using ST-GNN (Spatio-Temporal Graph Neural Network) to model the topological relationship between tables and zones as a graph structure and predict the future occupancy status of each table; The construction method of the spatiotemporal graph neural network (ST-GNN) model used for predicting cafeteria customer flow is as follows: The various monitoring units (tables, areas, or dynamic zones) in the cafeteria are abstracted as graph nodes. Historical passenger flow and seat utilization rates of each node at different time periods are collected as temporal features of the node. At the same time, external contextual information (such as date, time period, holidays, weather, and special events) is collected separately to form an independent contextual feature set, providing external environment information for the model.
[0050] An initial adjacency matrix is constructed based on the physical distance between tables or areas, travel paths, and customer flow history. The matrix elements represent the connection strength between nodes. Initial edges can be defined using physical proximity or preset partitioning rules to characterize the spatial topology.
[0051] During model training and prediction, passenger flow correlation indicators between nodes are calculated in real time, and the edge weights of the adjacency matrix are dynamically adjusted accordingly: for example, strengthening the connection between adjacent areas during peak hours and reducing the influence of distant nodes during off-peak hours. Through this dynamic update mechanism, the model can capture passenger flow and diffusion characteristics over time, thereby improving the adaptability and real-time performance of predictions.
[0052] In the spatial modeling layer, a graph attention network (GAT) is used instead of a traditional graph convolution. Learnable weights are assigned to the neighbors of each node, and the most valuable neighbor nodes for predicting the current node are automatically identified, thereby focusing on key tables or key areas and improving the spatial feature modeling capability and prediction accuracy. The historical passenger flow sequence of each node is input into the time modeling module, preferably using a Temporal Convolutional Network (TCN). TCN can capture long-term and short-term time dependencies, periodic fluctuations, trend changes, and the impact of sudden events while maintaining parallel computing capabilities; it can also achieve multi-timescale feature extraction through dilated convolutions. The temporal features output by TCN are concatenated or weighted with the output of the aforementioned spatial modeling layer (graph attention network) to form a spatiotemporal joint representation of the nodes, comprehensively depicting the spatial distribution and temporal evolution of passenger flow. External contextual information such as date, time period, holidays, weather, and events is mapped into low-dimensional embedding vectors and concatenated or weighted with the spatiotemporal features of nodes. This enables the model to explicitly reflect changes in the external environment and periodic patterns during prediction, thereby further improving the accuracy and generalization ability of prediction. The fused comprehensive features are input into the fully connected prediction layer, which outputs the predicted passenger flow values for each node at several future times. Dynamic passenger flow heatmaps can be generated by node or zone, providing intuitive decision support for operations personnel. Historical data is divided into training samples using a sliding time window, and end-to-end training is performed using a multi-step prediction loss function. In actual operation, the model parameters and adjacency matrix are updated periodically or in real time to adapt to the continuous changes in passenger flow patterns.
[0053] The core of this step lies in constructing an improved spatiotemporal graph neural network (ST-GNN) passenger flow prediction model to address the dynamic changes in passenger flow across different areas of the cafeteria. Compared to the traditional ST-GNN, this approach makes the following improvements in graph structure, spatial feature modeling, and external feature fusion: First, the inventors discovered that traditional ST-GNN typically uses a static adjacency matrix (based on physical distance or fixed connectivity). However, when applied to a cafeteria scenario, the static adjacency matrix fails to reflect these time-varying relationships due to the time-varying nature of customer flow distribution and movement (crowding at the entrance / queue area during peak hours, and different patterns on holidays). This leads to inaccurate spatial information propagation. To address this issue, the inventors employ a dynamic adjacency matrix update mechanism. This mechanism adjusts the edge weights between nodes based on real-time changes in customer flow. By dynamically adjusting the edge weights to determine "who influences whom," the short-term prediction adaptability and accuracy are improved.
[0054] Second, the inventors discovered that existing fixed graph convolution (GCN) can not distinguish which neighbors are more important for predicting the current node by averaging or aggregating neighbor information with fixed weights. In order to solve this technical problem, the inventors introduced graph attention (such as GAT / GATv2) into the spatial modeling layer, which allows the model to automatically focus on key tables or important areas, especially beneficial for the accurate prediction of key nodes such as "large table / near window / near aisle".
[0055] Third, the inventors discovered that cafeteria customer flow is strongly affected by time, calendar, holidays, weather, and external activities. Therefore, the inventors added a context feature embedding module to map external features such as date, time period, holidays, and weather into embedding vectors and input them into the model. This allows the model to learn periodicity and environmental dependence, thereby improving the adaptability, real-time performance, and accuracy of predictions.
[0056] In addition, the training data of this application includes input feature vectors and actual occupancy labels (occupied / empty tables), and its output is the occupancy probability or status of each table in the next 5–30 minutes.
[0057] The S430 triggers an alert when it predicts that at least one person will be seated at any of the tables for less than a preset threshold time.
[0058] The definition of a full table can be that each table is occupied by at least one person. You can also set a threshold: for example, 95% occupancy of the tables is considered full seating; The future occupancy status output by the S420 model is used to predict the time T_full when the restaurant will reach full capacity.
[0059] Determine the difference between the current time and T_full: If the occupancy time is less than a preset threshold (e.g., 10 minutes), a full occupancy warning is triggered, and warning data is output. An example of the warning data is as follows: Full capacity prediction time | Current occupancy rate | Predicted empty table distribution | Zone number.
[0060] After receiving the early warning information, the S500 identifies the clusters of undisturbed empty tables in each area, and generates a scheduling method based on the zoning and prediction results to dynamically schedule cleaning staff to prioritize the handling of undisturbed empty tables.
[0061] That is, by using the early warning data, the number of uncleaned empty tables N_empty is calculated for each zone, and the coordinates or table numbers of the uncleaned empty tables in each zone are counted to identify the clusters of uncleaned empty tables in each zone, and the cleaning load information of each zone is output. Prioritize cleaning tasks based on the regional load matrix and the density of uncleaned empty tables, so that cleaning personnel can be dispatched to high-load areas first, ensuring that empty tables are available as soon as possible; The area load data should be updated in real time, with the frequency synchronized with the occupancy status update (e.g., every 1–2 minutes), so that it can be combined with the prediction results to predict the load trend in the next few minutes and optimize the scheduling of cleaning personnel. Example
[0062] Based on the same inventive concept as the dynamic zoning method for monitoring cafeteria crowd density in the foregoing embodiments, such as Figure 3 As shown, this application provides a dynamic zoning system for monitoring the flow of people in a canteen, wherein the system includes: Data acquisition module 10: Used to acquire real-time raw data from multiple sources, such as customer flow, seat occupancy, and spatial layout inside and outside the restaurant, to provide basic data for subsequent analysis; The data acquisition module 10 includes: Passenger Flow Counting Unit 11: Infrared / pressure / visual counters installed at the entrance and exit to acquire the number of people entering and exiting in real time and output passenger flow data.
[0063] Seat occupancy sensing unit 12: It can obtain the real-time number of people seated at each table, the time of sitting, the time of leaving the table, and the frequency of sitting by each table through pressure sensors or seat occupancy sensors equipped on each dining chair or through video monitoring algorithms.
[0064] Floor plan digitization unit 13: Import restaurant CAD drawings or on-site images, label the location, geometry, number of seats, and other static information of each table and convert it into two-dimensional coordinate data.
[0065] The collected data is output to the dining table database and status management module after being calibrated with a unified timestamp (NTP synchronization).
[0066] Table Database and Status Management Module 20: Used for unified storage and time synchronization management of table static attributes and dynamic status, forming a structured data interface; The dining table database and status management module 20 includes: Attribute database unit 21: Stores static information such as table ID, coordinates, table type, number of seats, historical number of times seats are used, and average dining time.
[0067] Status matrix generation unit 22: Synchronizes dynamic information such as occupancy status, number of seated people, seating time, departure time, and cleaning status obtained from sensors and video recognition to a unified timeline, generating a matrix of "timestamp-table number-number of seated people-occupancy status".
[0068] Scoring and Dynamic Zoning Module 30: Calculates weights based on table characteristics and usage and automatically divides areas to achieve dynamic and balanced management of restaurant space; The scoring and dynamic partitioning module 30 includes: Rating Model Unit 31: Input static features (table type, number of seats, location features, density of adjacent tables) and dynamic features (number of occupants, seating frequency, average dining time, peak usage) into a regression model (such as XGBoost, neural network) to obtain the cleaning difficulty or weighted score for each table. i And perform normalization processing; Partitioning Algorithm Unit 32: Read the position (x, y) and rating w of each table. i The restaurant is divided into K approximately rectangular regions using a clustering algorithm with shape constraints, so that the total score of the tables in each region is as balanced as possible while maintaining connectivity. Partition Information Storage Unit 33: Writes the partition number, the list of tables in the partition, the total score, the coordinates of the area center and the boundary coordinates into the database for real-time monitoring and scheduling.
[0069] Real-time status monitoring module 40: Provides continuous summary and display of the real-time occupancy, empty tables, and clearance status of seats in each area, providing the current operational status; The real-time occupancy status acquisition unit 41: summarizes the occupancy status of tables in each area in real time (current number of seated people, seating time, and cleaning status), performs time alignment, and generates a real-time occupancy status matrix.
[0070] Status visualization unit 42: Displays the real-time status matrix as a heatmap showing three statuses on the backend interface or large screen: empty table, empty table not cleared, and occupied. Status monitoring module 40 includes: Passenger flow prediction module 50: Utilizes a spatiotemporal graph neural network to fuse historical, spatial, and contextual features to predict future passenger flow trends for each table or area; The passenger flow prediction module 50 includes: Graph structure modeling unit 51: Abstract each monitoring unit (table, area or dynamic partition) into a graph node and establish an initial adjacency matrix based on physical distance, travel path or historical correlation; Dynamic Adjacency Update Unit 52: During training and prediction, edge weights are dynamically adjusted based on real-time passenger flow correlation indicators, enhancing the connection between adjacent areas during peak periods and reducing the influence of distant nodes during off-peak periods. Spatial feature extraction unit 53: Introduces a graph attention network (GAT) into the spatial modeling layer to assign learnable weights to the neighbors of each node, focusing on key tables or key areas; Temporal Feature Modeling Unit 54: Inputs the historical passenger flow sequence of each node into the Temporal Convolutional Network (TCN) to capture long-term and short-term dependencies, periodic fluctuations, trend changes and the impact of sudden events; Spatiotemporal feature fusion unit 55: concatenates or weights the temporal features output by TCN with the spatial features output by GAT to form a spatiotemporal joint representation; then maps external contextual information such as date, time period, holidays, weather, and activities into embedding vectors and fuses them; Prediction output unit 56: Inputs the fused features into the fully connected prediction layer, outputs the passenger flow prediction value of each node at several future times, and can generate dynamic passenger flow heat maps by node or partition, providing a basis for early warning and scheduling.
[0071] Dispatch Decision and Early Warning Module 60: Based on the forecast results, it judges the risk of full occupancy and optimizes cleaning and personnel scheduling, supporting timely early warning and efficient operational decision-making; The scheduling decision and early warning module 60 includes: Early warning judgment unit 61: Based on the predicted occupancy status output by S420, calculate the time T_full for the restaurant to reach full capacity. When the difference between the current time and T_full is less than a preset threshold (such as 10 minutes), trigger a full capacity warning and output warning data (predicted full capacity time, current occupancy rate, predicted empty table distribution, and zone number).
[0072] Task load analysis unit 62: Identify clusters of undisturbed empty tables in each region, count the number and coordinates of undisturbed empty tables in each region, and form a regional load matrix.
[0073] Scheduling optimization unit 63: Based on the regional load matrix and future load trends, dynamically sort the priority of cleaning tasks and generate personnel scheduling instructions to prioritize the dispatch of cleaning personnel to high-load areas, ensuring that empty desks are available as soon as possible.
[0074] In summary, any of the methods or steps described above can be stored as computer instructions or programs in various types of computer memory, and the computer instructions or programs can be recognized by various types of computer processors to implement any of the above methods or steps.
[0075] Based on the above specific embodiments of the present invention, any improvements and modifications made to the present invention by those skilled in the art without departing from the principle of the present invention shall fall within the patent protection scope of the present invention.
Claims
1. A dynamic partitioned canteen crowd density monitoring method, characterized in that, The method includes: Acquire feature data of each table in real time and generate a restaurant status matrix that can be used for scoring and zoning; For each table, the collected feature data includes table coordinates, geometry, number of seats, customer flow, seating time, number of people, and seating frequency. A comprehensive score is calculated according to a preset weight, and the score is associated with the table ID and coordinates and stored to form a score database that can be used for dynamic partitioning and scheduling. The method for creating a scoring database that can be used for dynamic partitioning and scheduling is as follows: Based on the characteristic data of each table, it is divided into static characteristics and dynamic characteristics, and a scoring model is built on this basis. A weighted score is calculated for each table using a scoring model; The scoring results are stored in the dining table database, and the corresponding field of the scoring results is the cleaning difficulty score; Based on the number of staff and table rating data, all tables are divided into several rectangular regions using a clustering algorithm with shape constraints or an improved segmentation algorithm, so that the total rating of the tables in each region is as similar as possible, and the partitioning results are output. The method for obtaining the partitioning results is as follows: The number of zones is determined based on the actual number of available cleaning staff groups, K. Constrained clustering is used on the restaurant floor plan to generate initial partitions that are approximately rectangular. Adjustments are made based on the scoring weights to ensure that the total score for each region is as balanced as possible while maintaining the rectangular shape. Link the zoning information with the table database and update it dynamically when the restaurant layout or personnel changes. Based on the results of dynamic zoning, the occupancy status of tables in each area, the number of empty tables and the number of uncleaned empty tables are summarized in real time, and the prediction model predicts when the canteen will reach the full capacity threshold, providing early warning information for scheduling decisions; After receiving the early warning information, the system identifies the clusters of undisturbed empty tables in each area, and generates a scheduling method based on the zoning and prediction results to dynamically schedule cleaning staff to prioritize the handling of undisturbed empty tables.
2. The method according to claim 1, characterized in that, The method for generating a restaurant state matrix that can be used for rating and zoning is as follows: Real-time collection of data such as passenger flow, seating time, number of people, and seating frequency; The restaurant floor plan is digitized, and the location coordinates, table type, number of seats, and historical usage frequency of each table are recorded to form a basic table or database; The collected data is denoised, outliers are processed, and time is synchronized to ensure that all data sources have a unified timeline, generating a complete restaurant status matrix that combines table distribution and customer flow data.
3. The method according to claim 1, characterized in that, The method for obtaining the early warning information is as follows: Get the occupancy status of each table in real time; Use models such as LSTM, Transformer, or ST-GNN to make short-term predictions on table occupancy data; An alert is triggered when it is predicted that at least one person will occupy a seat at any of the tables for less than a preset threshold time.
4. A dynamic zoning canteen crowd density monitoring system, applied to the dynamic zoning canteen crowd density monitoring method according to any one of claims 1-3, characterized in that, include: Data acquisition module: used to acquire real-time raw data from multiple sources, such as customer flow, seat occupancy, and spatial layout inside and outside the restaurant, to provide basic data for subsequent analysis; Dining table database and status management module: used for unified storage and time synchronization management of the static attributes and dynamic status of dining tables, forming a structured data interface; Scoring and Dynamic Zoning Module: Calculates weights based on table characteristics and usage and automatically divides areas to achieve dynamic and balanced management of restaurant space; Real-time status monitoring module: Provides continuous summary and display of the real-time occupancy, vacancy, and clearance status of seats in each area, providing the current operational status; Passenger flow prediction module: Utilizes spatiotemporal graph neural networks to fuse historical, spatial, and contextual features to predict future passenger flow trends for each table or area; Scheduling Decision and Early Warning Module: Based on the forecast results, it assesses the risk of full occupancy and optimizes cleaning and personnel scheduling, supporting timely early warning and efficient operational decisions.
Citation Information
Patent Citations
Catering service management method and system based on dynamic thermodynamic diagram full-process scheduling
CN121390815A