Urban block risk assessment method and system based on spatio-temporal trajectory data

By constructing a three-dimensional analysis unit, and using the exponential distribution characteristics of historical passenger flow intervals to calculate dynamic risk thresholds based on geographical blocks, time periods, and date types, the problem of block heterogeneity and time period characteristics adaptation in urban block risk assessment is solved, and accurate and objective risk identification and assessment are achieved.

CN121481208APending Publication Date: 2026-02-06SHANGHAI JIAOTONG UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511399454.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-28
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing urban block risk assessment methods cannot adapt to the characteristics of different blocks and time periods, resulting in high false alarm rates and missed alarm risks. They also lack objective data-driven standards, making it difficult to promote and apply them on a large scale.

Method used

A three-dimensional analysis unit is constructed, which calculates dynamic risk thresholds based on geographical blocks, hourly time periods, and date types, using the exponential distribution characteristics of historical passenger flow intervals, to achieve accurate identification of abnormal passenger flow clustering risks in different blocks and at different time periods.

Benefits of technology

It improves the accuracy and adaptability of urban risk assessment, reduces the false alarm rate during peak hours, captures abnormal clusters during off-peak hours, and ensures the objectivity and reproducibility of assessment standards. It is applicable to urban public safety monitoring, traffic management, and business operation analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121481208A_ABST
    Figure CN121481208A_ABST
Patent Text Reader

Abstract

The invention discloses an urban block risk assessment method and system based on spatio-temporal trajectory data. The method comprises the following steps: constructing a three-dimensional analysis unit; historical passenger flow sample data are collected and preprocessed; sorting the preprocessed historical passenger flow samples according to numerical values, and calculating passenger flow intervals between adjacent samples to form an interval sequence; calculating a clustering radius based on the interval sequence, and performing clustering grouping on the passenger flow samples according to the clustering radius; identifying a reasonable group from the clustering group, and setting a dynamic risk threshold value of the three-dimensional analysis unit based on the reasonable group; and carrying out real-time risk early warning. The system comprises a three-dimensional analysis unit construction module, a sample processing module, an interval calculation module, a clustering radius calculation module, a threshold setting module and a real-time early warning module. According to the invention, through three-dimensional unit construction and adaptive threshold calculation, accurate identification of passenger flow abnormal risks in different areas and time periods is realized, and the accuracy and adaptive capability of urban risk assessment are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of urban management and big data analysis technology, and in particular to a method and system for risk assessment of urban blocks based on spatiotemporal trajectory data. Background Technology

[0002] With the acceleration of urbanization, urban population mobility is becoming increasingly frequent, and the resulting risks of passenger flow aggregation pose a serious threat to public safety. For example, commercial areas may experience overcrowding during holidays, and transportation hubs may be paralyzed due to surges in passenger flow during peak hours. Therefore, accurate and dynamic risk assessments of different urban areas are crucial.

[0003] Currently, most common risk assessment methods rely on static thresholds, which set a uniform risk line based on global extreme values ​​or fixed quantiles (such as the 95th percentile) of historical data. An alert is triggered when real-time passenger flow exceeds this threshold. While simple, this method has significant drawbacks:

[0004] Insufficient adaptation to heterogeneity in urban blocks: Different blocks in a city (such as commercial areas, residential areas, and industrial areas) have different functions, and their passenger flow patterns, scale, and peak and off-peak periods vary greatly. A uniform static threshold cannot adapt to these differences, resulting in oversensitivity in low-traffic areas (high false alarm rate) and sluggish response in high-traffic areas (risk of missed alarms).

[0005] Ignoring time-specific characteristics leads to misjudgments: Urban passenger flow exhibits significant intraday fluctuations (such as morning peak, evening peak, and late-night off-peak). Static thresholds, which include data from all time periods, are often lowered by the low passenger flow during off-peak periods. This results in frequent false alarms during peak hours when normally high passenger flow may occur; conversely, during off-peak periods, abnormal clusters relative to the normal level for that time period are ignored because they do not exceed the global threshold, leading to an underestimation of risk.

[0006] Subjective dependence and non-reproducibility: The thresholds of existing schemes mostly rely on human experience for adjustment, lacking objective and unified data-driven standards, resulting in poor reproducibility of evaluation results and making it difficult to promote and apply them on a large scale at the city level.

[0007] Therefore, there is an urgent need for a data-driven dynamic risk assessment solution that can automatically adapt to the characteristics of different blocks and time periods in order to improve the accuracy and efficiency of urban risk management. Summary of the Invention

[0008] In view of the above-mentioned shortcomings in the current urban management technology field, the present invention provides a method and system for urban block risk assessment based on spatiotemporal trajectory data. The method and system construct three-dimensional analysis units and adaptively calculate dynamic risk thresholds based on the exponential distribution characteristics of historical passenger flow intervals in each unit. This enables accurate and automatic identification of the risk of abnormal passenger flow aggregation in different blocks and at different times, effectively improving the accuracy, adaptability and objectivity of urban risk assessment.

[0009] To achieve the above objectives, a first aspect of the present invention provides a method for risk assessment of urban blocks based on spatiotemporal trajectory data, comprising:

[0010] Step S1: Construct a three-dimensional analysis unit, which is composed of three dimensions: geographic block, hourly time period, and date type;

[0011] Step S2: Collect historical passenger flow sample data of the three-dimensional analysis unit in a targeted manner, and preprocess the historical passenger flow sample data;

[0012] Step S3: Sort the preprocessed historical passenger flow samples according to their numerical values, and calculate the passenger flow interval between adjacent samples to form an interval sequence;

[0013] Step S4: Calculate the cluster radius based on the exponential distribution characteristics of the interval sequence, and cluster the sorted passenger flow samples according to the cluster radius;

[0014] Step S5: Identify reasonable groups with normal passenger flow fluctuations from the clustering groups, and set the dynamic risk threshold for the three-dimensional analysis unit based on the reasonable groups:

[0015] Step S6: Monitor the passenger flow data of the current 3D analysis unit in real time. If the dynamic risk threshold is exceeded, a risk warning will be triggered.

[0016] In some embodiments of the first aspect of this application, step S1, the construction of the three-dimensional analysis unit includes:

[0017] The urban area is divided into multiple geographical blocks based on Geohash6 encoding;

[0018] Divide the day into 24 consecutive short periods;

[0019] Date types are categorized into weekdays and public holidays.

[0020] In some embodiments of the first aspect of this application, step S2, preprocessing the historical passenger flow sample data, includes:

[0021] Outliers are removed, including negative values ​​and extreme values ​​that are outside the reasonable range;

[0022] Missing values ​​were filled using adjacent spatiotemporal interpolation.

[0023] In some embodiments of the first aspect of this application, step S3, which involves sorting the preprocessed historical passenger flow samples by numerical value and calculating the passenger flow interval between adjacent samples to form an interval sequence, includes:

[0024] The preprocessed historical passenger flow samples are arranged in ascending order of value to generate a strictly monotonically increasing ordered sequence.

[0025] Traverse the ordered sequence and calculate the difference between each pair of adjacent samples in the sequence to obtain a new sequence composed of interval values, ensuring that all interval values ​​are non-negative integers.

[0026] In some embodiments of the first aspect of this application, step S4, calculating the cluster radius, includes:

[0027] The rate parameter is estimated using the mean of interval samples;

[0028] The cluster radius is obtained by inverse operation of the cumulative distribution function of the exponential distribution based on a preset high cumulative probability threshold.

[0029] In some embodiments of the first aspect of this application, the formula for calculating the rate parameter using the interval sample mean is λ = Mean(k);

[0030] The formula for calculating the cluster radius, which is obtained by inverse operation of the cumulative distribution function of the exponential distribution based on the preset high cumulative probability threshold, is K = -λln(1-P), where P is the high cumulative probability threshold and λ is the rate parameter.

[0031] In some embodiments of the first aspect of this application, step S5, identifying reasonable groups of normal passenger flow fluctuations from the clustering groups, and setting the dynamic risk threshold of the three-dimensional analysis unit based on the reasonable groups, includes:

[0032] Iterate through all the groups obtained from clustering and select reasonable groups that represent the normal fluctuation range according to the preset business rules;

[0033] From all reasonable groupings, select the group with the largest passenger flow limit as the largest reasonable group;

[0034] The maximum passenger flow limit of the maximum reasonable group is set as a dynamic risk threshold.

[0035] In some embodiments of the first aspect of this application, the filtering rules used to select reasonable groups representing normal fluctuation ranges based on preset business rules include:

[0036] The proportion of the number of samples included in the group to the total number of samples in the analysis unit is not less than the lower limit threshold;

[0037] The interval between all adjacent samples in the group is no greater than the dynamic risk threshold.

[0038] In some embodiments of the first aspect of this application, step S6, which involves real-time monitoring of the current passenger flow data of the three-dimensional analysis unit and triggering a risk warning if the dynamic risk threshold is exceeded, includes:

[0039] Real-time collection of passenger flow data matching the current 3D analysis unit;

[0040] Compare real-time passenger flow values ​​with dynamic risk thresholds;

[0041] If the threshold is exceeded, an alert will be generated that includes the block location, time period, passenger flow value, threshold, and excess percentage, and will be pushed to the system.

[0042] To achieve the above objectives, a second aspect of the present invention provides an urban block risk assessment system based on spatiotemporal trajectory data, including a three-dimensional analysis unit construction module for constructing three-dimensional analysis units and executing the logical process in step S1;

[0043] The sample processing module is used to collect historical passenger flow samples for each three-dimensional analysis unit and perform preprocessing, and execute the logical process in step S2.

[0044] The interval calculation module is used to sort the preprocessed historical passenger flow quantity samples and calculate the interval between adjacent samples to obtain the interval sequence, and execute the logical process in step S3.

[0045] The cluster radius calculation module is used to determine the cluster radius based on the interval sequence, and to cluster the samples according to the cluster radius, and to execute the logical process in step S4.

[0046] The threshold setting module is used to filter reasonable groups from clustering, determine the largest reasonable group and set a dynamic risk threshold, and execute the logical process in step S5.

[0047] The real-time early warning module is used to monitor the number of passengers in real time, compare it with the dynamic risk threshold, and trigger a risk warning when the threshold is exceeded, and execute the logic process in step S6.

[0048] The advantages of this invention are as follows: First, by dividing the data into three-dimensional units based on blocks, time periods, and date types, customized risk thresholds are generated for each unique scenario. This automatically adapts to the passenger flow characteristics of different functions, such as commercial areas and residential areas, as well as the fluctuation patterns of different time periods, such as weekdays, holidays, peak hours, and off-peak hours. It has accurate scenario self-adaptation capabilities and can effectively solve the problem of block heterogeneity. Second, during peak periods, a higher threshold calculated based on its own historical data is used, avoiding being dragged down by global low values, thereby reducing false alarms during peak periods. During off-peak periods, an independent lower threshold is used, which can effectively capture abnormal passenger flow gatherings relative to that time period. This solves the hidden danger of underestimating risk during off-peak periods in traditional methods, thereby comprehensively improving the accuracy of risk assessment. Third, the entire threshold calculation process is based on the statistical patterns of historical data, requiring no manual intervention, eliminating subjective bias, ensuring the objectivity and uniformity of assessment standards and the reproducibility of results, and making it suitable for large-scale deployment. Fourth, this invention can be widely applied in multiple fields such as urban public safety monitoring, traffic management, and commercial operation analysis, with broad application prospects, providing strong data support and decision-making basis for smart cities. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0050] Figure 1 This is a flowchart illustrating a method for assessing urban block risks based on spatiotemporal trajectory data as described in this invention.

[0051] Figure 2 This is a schematic diagram of the historical passenger flow statistics distribution of the three-dimensional analysis unit of the present invention;

[0052] Figure 3 This is a schematic diagram of the historical passenger flow interval distribution of the three-dimensional analysis unit of the present invention;

[0053] Figure 4 This is a schematic diagram of the risk identification results for a city block in this invention;

[0054] Figure 5 This is a schematic diagram of the structure of an urban block risk assessment system based on spatiotemporal trajectory data according to the present invention. Detailed Implementation

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

[0056] like Figure 1 This document illustrates a flowchart of a method and system for urban block risk assessment based on spatiotemporal trajectory data, as described in this invention. Figure 1 As shown, the evaluation method includes the following procedures:

[0057] Step S1: Construct a three-dimensional analysis unit.

[0058] Specifically, this involves a refined combination of three dimensions: urban space, time, and date type, to construct the smallest analytical unit capable of accurately depicting passenger flow characteristics under different scenarios. This provides a structural framework for addressing the issues of block heterogeneity and time-of-day differences. The specific steps include:

[0059] Step S1.1: Divide geographical blocks based on Geohash6 encoding.

[0060] The Geohash geocoding system is used to divide the entire urban area into several Geohash 6-level blocks, which serve as the basic spatial units for risk assessment.

[0061] One Geohash6 block has a geographical area of ​​approximately 1.2 km (length) × 0.6 km (width) (slightly different due to latitude). This scale can accurately map the independent characteristics of different functional blocks in the city, while ensuring that each block has a sufficient number of historical passenger flow sample data. This avoids the problems of data sparsity and excessive calculation fluctuations caused by blocks that are too small, thus meeting the spatial accuracy requirements of city-level passenger flow risk assessment.

[0062] Step S1.2: Divide the day into time periods by hourly slices.

[0063] Specifically, the 24 hours of a day are divided into 24 consecutive short periods of 60 minutes each, such as "00:00-01:00", "01:00-02:00", ..., "23:00-24:00".

[0064] Hourly time-slicing can accurately capture the highly regular fluctuations in urban passenger flow throughout the day, such as the morning peak (07:00-09:00), midday off-peak, evening peak (17:00-19:00), and late-night off-peak (00:00-05:00). This refined time slicing ensures that specific risk thresholds can be calculated for each distinct time period, which is key to overcoming the false alarms during peak hours and the underreporting during off-peak hours caused by static global thresholds.

[0065] S1.3: Distinguish between weekday and holiday date types.

[0066] Specifically, date attributes are divided into two basic types: weekdays and holidays. Weekdays refer to Monday through Friday, while holidays include Saturdays, Sundays, and national statutory holidays.

[0067] Residents' travel patterns, purposes, and scale exhibit systematic and fundamental differences across different date types. For example, on weekdays, central business districts are dominated by commuters and business travelers, with peak hours concentrated in the morning and evening; while on holidays, leisure and entertainment travelers dominate, with peak hours lasting longer and occurring later in the day. By introducing a date type dimension, the analysis unit can effectively distinguish and adapt to these two distinctly different travel patterns, ensuring that the subsequently calculated thresholds conform to both weekday patterns and holiday characteristics, greatly improving the model's scenario adaptability.

[0068] Step S2: Processing historical passenger flow samples.

[0069] This step aims to prepare a high-quality, representative historical data foundation for each 3D analysis unit, which is crucial to ensuring the accuracy and reliability of subsequent dynamic threshold calculations. Its core lies in acquiring sufficient and comprehensive raw data and ensuring sample quality through data cleaning. Specifically, it includes the following steps:

[0070] Step S2.1: Collect historical passenger flow samples according to the three-dimensional analysis unit.

[0071] For each three-dimensional analysis unit determined in step S1, collect historical passenger flow data for that unit that matches the date type and time period over the past year (365 days).

[0072] Data collection must consider both time span and scenario diversity. The time span needs to cover all four seasons: spring, summer, autumn, and winter. Scenario coverage requires the sample to encompass multiple key scenarios affecting passenger flow, including different seasons (spring, summer, autumn, winter), different weather conditions (sunny, rainy, snowy, high temperature, low temperature, etc.), and different special events (such as large-scale exhibitions, sporting events, concerts, shopping mall promotions, community activities, etc. held around the block). This data collection requirement ensures that historical samples can comprehensively reflect the normal passenger flow fluctuation range of the unit under various possible conditions, avoiding threshold distortion due to sample bias. For example, for the analysis unit "Block C, 08:00-09:00, weekdays," it is necessary to collect passenger flow data for Block C during the 08:00-09:00 time period on all weekdays over the past year.

[0073] Figure 2 This diagram illustrates the historical passenger flow statistics of a three-dimensional analysis unit in this invention. The diagram shows the statistical patterns of passenger flow distribution. The horizontal axis represents the number of passengers, arranged sequentially from 1825 to 2125; the vertical axis represents probability density. The blue bars in the diagram present the probability density distribution corresponding to different passenger flow intervals, allowing a clear view of the frequency differences in passenger flow distribution across intervals. The red dashed line approximates the trend of passenger flow distribution, exhibiting a shape similar to a normal distribution. This reflects the characteristic that passenger flow is concentrated around a certain intermediate value, with fewer passengers at both ends, and can be used to analyze the central tendency and dispersion of passenger flow.

[0074] Step S2.2: Remove outliers from historical samples

[0075] The collected raw historical passenger flow data is cleaned and corrected to eliminate interference caused by data transmission or collection errors.

[0076] Outliers mainly fall into two categories: First, logical outliers, which are negative values ​​caused by data transmission errors, equipment failures, etc. (such as a passenger flow of -50). Such data violates the basic logic that passenger flow is non-negative and can be directly identified as outliers. Second, range outliers, which are extreme values ​​that far exceed the reasonable passenger flow range of the three-dimensional unit. The determination needs to be combined with the characteristics of the unit. Values ​​that clearly exceed the reasonable range can be identified as outliers.

[0077] The specific method for removing outliers is to identify and remove obviously unreasonable data points caused by data acquisition sensor failures, transmission errors, etc., such as negative passenger flow, zero passenger flow, or extremely high values ​​that far exceed the historical reasonable range of the unit.

[0078] Step S2.3: Fill in missing values ​​in historical samples

[0079] For minor data loss caused by temporary equipment failures or data transmission interruptions during sample collection, scientific methods are used to supplement the data to ensure the integrity of the samples.

[0080] Among them, the missing value filling adopts the adjacent spatiotemporal interpolation method. This method uses effective samples that are closely related to the missing time period in spatiotemporal terms to make an estimate and uses the estimate to fill the gap, ensuring that the filled data conforms to the passenger flow characteristics of the three-dimensional unit.

[0081] For example, if data for the "08:00-09:00" time period on a certain weekday is missing, the average passenger flow of adjacent time periods in the same area (such as the previous time period 07:00-08:00 and the next time period 09:00-10:00) will be used to fill the gaps, as passenger flow in adjacent time periods is influenced by the activity patterns of people in the same area and has a stronger correlation. If data for adjacent time periods is also missing, the average passenger flow of adjacent dates (such as the same time period on the same weekday in the previous week and the following week) will be used to fill the gaps.

[0082] In this embodiment of the invention, removing outliers can prevent erroneous data from contaminating subsequent calculations; while carefully filling in a small number of missing values ​​can ensure the continuity of the data sequence, avoid insufficient sample size or interval calculation errors caused by missing data, and provide high-quality data input for subsequent statistical analysis.

[0083] Step S3: Calculate passenger flow intervals.

[0084] Specifically, the ordered passenger flow sequence is transformed into an interval sequence that intuitively reflects the discrete and clustered characteristics of the data distribution, laying the foundation for subsequent cluster analysis based on statistical laws. This includes the following steps:

[0085] Step S3.1: Generate an ordered passenger flow value sequence.

[0086] After preprocessing in step S2, all historical passenger flow samples for a specific 3D analysis unit are arranged in ascending order of value, generating a strictly monotonically increasing ordered sequence, denoted as S = [x1, x2, x3, ..., x...]. n ], where n is the total number of samples in the unit.

[0087] The generated ordered sequence transforms the originally chaotic passenger flow data collected chronologically into a sequence distributed by numerical value. In this sequence, samples with similar passenger flow are grouped together, while outliers or samples with different fluctuation patterns will appear as jumps or gaps in the sequence due to their numerical differences. This presentation method is a prerequisite for subsequent analysis of densely distributed areas (i.e., normal fluctuation ranges) and sparse areas (i.e., abnormal fluctuations).

[0088] Step S3.2: Calculate the interval value between adjacent samples.

[0089] Traverse the ordered sequence S above, and calculate the difference between each pair of adjacent samples in the sequence, that is, the value of the next sample minus the value of the previous sample, thus obtaining a new sequence consisting of n-1 interval values. Define the interval k. i =x i+1 -x i (where i ranges from 1 to n-1), ultimately yielding the interval sequence K = [k1, k2, ..., k n-1 ].

[0090] The calculated interval value directly reflects the density of the orderly passenger flow sample distribution, thus effectively capturing the fluctuation range of the passenger flow sample: a small interval value k i This represents the passenger flow x of the two corresponding samples. i and x i+1 The very close proximity indicates that the sample distribution of passenger flow values ​​in this area is dense, and they are likely to belong to the same normal fluctuation pattern; a significantly larger interval value k i This means that the passenger flow value has jumped, indicating that k i and x i+1 They likely belong to different data clusters.

[0091] At the same time, it is necessary to ensure that there is no numerical deviation in the calculation process and that all interval values ​​are non-negative integers. This will provide accurate and standardized interval data for determining the cluster radius based on the exponential distribution characteristics, and ensure that subsequent cluster analysis can accurately distinguish between normal and abnormal samples.

[0092] Figure 3 This diagram illustrates the historical passenger flow interval distribution of a three-dimensional analysis unit in this invention. The diagram demonstrates the statistical regularity of the passenger flow interval distribution. The horizontal axis represents the passenger flow interval, the left side of the vertical axis represents the probability density, and the right side represents the cumulative probability. The green bars present the actual passenger flow interval distribution; the black curve is a fit to the exponential distribution of the passenger flow interval distribution, used to approximate the probability density regularity of the passenger flow interval; the blue curve represents the cumulative probability of the exponential distribution, showing the accumulation of probability as the passenger flow interval increases. The red dashed lines mark specific passenger flow interval values. These elements can be combined to analyze the distribution characteristics, fitting effect, and cumulative probability of the passenger flow interval, providing intuitive data distribution support for subsequent passenger flow interval-based analyses (such as cluster radius calculation).

[0093] Step S4: Perform clustering and grouping.

[0094] Specifically, this involves using a statistically based, objective clustering method to automatically identify reasonable data groups representing normal passenger flow fluctuations within the analysis unit from historical data, providing a basis for setting dynamic thresholds. The process includes the following steps:

[0095] S4.1: Determine the cluster radius based on the exponential distribution.

[0096] Based on the interval sequence K = [k1, k2, ..., k2] calculated in step S3, n-1 Assuming it approximately follows an exponential distribution p(k) = λe -λk (Where λ is the rate parameter of the exponential distribution). First, the rate parameter λ is estimated using the mean of the interval samples, Mean(k), i.e., λ = Mean(k). Then, a high cumulative probability threshold P is set (usually 99% or 99.9%), and the theoretical interval threshold K = -λln(1-P) is calculated by inverse operation of the cumulative distribution function of the exponential distribution. This K value is the cluster radius.

[0097] This sub-step provides an objective and quantitative criterion for the entire clustering process. The exponential distribution effectively describes the characteristic of frequent small intervals and rare large intervals. The K value, calculated using a high cumulative probability P (e.g., 99%), implies that 99% of normal data intervals should be less than or equal to K. Therefore, any interval greater than K is a low-probability event, statistically considered an anomaly, indicating a break in the data distribution and naturally separating sample groups with different fluctuation patterns. This replaces the empirical method of manually setting fixed interval thresholds.

[0098] Step S4.2: Cluster the data with K as the radius.

[0099] Specifically, the ordered passenger flow sequence S = [x1, x2, x3, ..., x2] generated in step S2 is... n Starting with the first sample x1, check the interval k between every two adjacent samples in sequence. i .

[0100] If k i If x ≤ K, then the sample x is considered to be i and x i+1 They belong to the same cluster group;

[0101] If k i If the value is greater than K, then sample x is considered to be... i and x i+1 Not belonging to the same group, in x i End the current group at x, and start from x i+1 Start a new group.

[0102] This single-pass clustering algorithm uses a calculated statistical threshold K as the sole criterion to divide the ordered sequence S into several consecutive subsequences (i.e., groups). Within each group, the interval between any two adjacent samples is no greater than K, while the interval between different groups is always greater than K. In this way, based on the data's inherent distribution density, samples with similar passenger flow values ​​are automatically grouped together.

[0103] Step S5: Identification of reasonable groups and setting thresholds.

[0104] Specifically, the core step of selecting normal fluctuation ranges from historical passenger flow samples and ultimately generating dynamic risk thresholds based on the cluster radius determined in step S4 is divided into the following steps:

[0105] Step S5.1: Select reasonable groups based on business rules.

[0106] Specifically, among all the groups obtained by traversing the clustering, reasonable groups that represent the normal fluctuation range are selected according to preset business rules.

[0107] The screening rules require that, firstly, the number of samples contained in a group should account for a proportion of the total number of samples in the analysis unit that is not less than a lower limit (e.g., ≥10%); secondly, the interval between all adjacent samples in the group must satisfy ≤K (this condition is naturally satisfied during the clustering process).

[0108] After clustering in step S4.2, multiple groups may be generated. The reasonable groups selected by the above screening rules have a minimum sample size requirement, thereby ensuring that the samples in the selected reasonable groups are statistically significant and can represent a stable and recurring pattern over a period of time, rather than a group composed of random fluctuations or a very small number of outliers.

[0109] Step S5.2: Obtain the largest reasonable group.

[0110] Specifically, from all the reasonable groups selected in step S5.1, the group with the largest upper limit value of passenger flow (i.e., the maximum passenger flow sample value within the group) is selected and determined as the largest reasonable group for this analysis unit. The upper limit value of this group is the reasonable maximum value that the passenger flow of this unit can reach under normal circumstances; exceeding this value means that an abnormal situation has occurred.

[0111] Step S5.3: Set the dynamic risk threshold of the three-dimensional analysis unit.

[0112] In this embodiment of the invention, the upper limit of passenger flow for the largest reasonable group selected (i.e., the largest passenger flow sample value within that group) is directly set as the dynamic risk threshold.

[0113] For example, if the maximum reasonable group has a passenger flow range of [520-1850], then the dynamic risk threshold of this three-dimensional analysis unit is 1850.

[0114] Step S6: Real-time risk warning.

[0115] Specifically, firstly, for each 3D analysis unit, real-time passenger flow data is collected within the corresponding geohash6 level block. The data must match the current hour and date type, and multi-source data is integrated to cover various personnel activity scenarios. Updates are made minute-by-minute to ensure timeliness.

[0116] Then, the system automatically compares the real-time passenger flow value with the dynamic risk threshold of the unit. If the real-time passenger flow is less than or equal to the threshold, it is recorded as normal; otherwise, it is judged as a risky state.

[0117] After assessing the risk, the system generates standardized warning information including the geographic information of the warning block, the current time period, real-time passenger flow value, threshold, and the excess ratio. It can set graded suggestions according to the excess ratio and push them to relevant management departments through pop-ups, text messages, etc. At the same time, it continuously tracks and monitors the passenger flow of the unit, dynamically updates the risk status, and records the entire warning process information to form an archive, providing a basis for subsequent optimization of thresholds and response plans.

[0118] Figure 4 This diagram illustrates the risk identification results for a city block. For example... Figure 4 As shown, the upper part of the graph is an overall passenger flow and risk trend chart. The horizontal axis represents time (from approximately April 17, 2024 to approximately April 24, 2024), and the left side of the vertical axis represents passenger flow (up to approximately 3200). The combination of blue bars and lines shows the changes in passenger flow at different points in time. Red markers and "Risk CNT:123" indicate potential risks. The red dashed boxes mark specific time periods, which may be periods of concentrated risk or special changes. The lower part of the graph is a detailed passenger flow data comparison chart for the specific time period (April 17, 2024 - April 19, 2024) within the red dashed box. The horizontal axis represents more detailed time, and the vertical axis represents passenger flow (up to approximately 10000). The graph contains three curves: "continuous passenger flow," "maximum passenger flow in 5 minutes," and "small passenger flow in 5 minutes," which respectively show the trend of passenger flow changes under different statistical dimensions. This allows for a clearer comparison and analysis of the continuity of passenger flow, the fluctuation of short-term maximum passenger flow and small passenger flow during this period, and helps to explore in depth the relationship between passenger flow characteristics and risk generation during this period.

[0119] Figure 5 A schematic diagram of the structure of an urban block risk assessment system 100 based on spatiotemporal trajectory data according to the present invention is shown. Figure 5 The system includes a three-dimensional analysis unit construction module 101, a sample processing module 102, an interval calculation module 103, a cluster radius calculation module 104, a threshold setting module 105, and a real-time early warning module 106.

[0120] The 3D analysis unit construction module 101 defines the most basic analysis unit by integrating three dimensions: geospatial, time, and date type. First, based on Geohash6 encoding, the module grids the urban geospatial area, discretizing continuous urban regions into multiple regular blocks of approximately 1.2 km × 0.6 km. This scale achieves an optimal balance between spatial precision and data stability. Then, in the time dimension, the module divides a day into 24 consecutive short periods at 60-minute intervals to accurately capture the intraday cyclical fluctuations in passenger flow. Finally, in the date dimension, the module distinguishes between weekdays and holidays to adapt to the drastically different passenger flow patterns on different dates. By combining the parameters of these three dimensions, the module ultimately outputs a unique 3D tuple as the basic unit for all subsequent calculations, thereby generating a highly customized dynamic risk threshold for each unique urban scenario, laying the foundation for the adaptive capability of the entire solution. This module is used to execute the logical process in step S1 above.

[0121] The sample processing module 102 is responsible for providing high-quality, high-reliability input data for risk assessment. This module cleans and enhances the initial passenger flow samples obtained from the original data source. First, it performs a rigorous data cleaning process, identifying and removing outliers based on preset business rules. It then fills in data gaps to maintain the continuity and temporal regularity of the data sequence to the greatest extent possible. Through preprocessing, this module effectively improves data quality, removes noise interference, and ensures the accuracy and robustness of subsequent statistical analysis, laying a solid data foundation for the calculation of dynamic thresholds. This module executes the logical process in step S2 above.

[0122] The interval calculation module 103 is used to transform the preprocessed static passenger flow data, thereby revealing its inherent fluctuation patterns and providing key input for subsequent cluster analysis. This module receives cleaned and imputed historical passenger flow sample sequences from the sample processing module. First, it strictly sorts these sequences according to passenger flow values ​​from smallest to largest, generating an ordered time series. Then, the module iterates through this ordered series, calculating the absolute difference between the passenger flow of every two adjacent samples, thus obtaining a complete set of interval value sequences representing the step size of passenger flow growth. The specific method for obtaining the interval value sequence is explained in detail in step S3 above.

[0123] The cluster radius calculation module 104 is used to calculate the cluster radius K to provide an objective, data-driven metric for subsequent cluster analysis. This module takes the passenger flow interval sequence k calculated by the interval calculation module 103 as input. First, it uses the maximum likelihood estimation method to calculate the sample mean of the interval sequence k, and uses this mean as an estimate of the exponential distribution rate parameter. Then, the module calls a preset high cumulative probability threshold P and substitutes it into the inverse formula of the cumulative distribution function of the exponential distribution to solve for the cluster radius K. Finally, the samples are clustered according to the calculated cluster radius K. The specific process and related formulas for calculating the cluster radius K are explained in detail in step S4 above.

[0124] Specifically, the threshold setting module 105 receives the clustering groups output by the clustering radius calculation module 104, firstly filters reasonable groups according to business rules, then iterates through the reasonable groups to obtain the largest reasonable group, and finally sets the dynamic risk threshold of the three-dimensional analysis unit based on the largest reasonable group. The specific process is explained in detail in step S5 above.

[0125] The real-time early warning module 106 is the final execution and output terminal of the entire system. It continuously receives real-time passenger flow data streams from the data access layer and calls the pre-calculated dynamic risk threshold in the threshold setting module 105 for millisecond-level comparison and judgment. Once it is found that the real-time passenger flow of a certain block exceeds the customized dynamic threshold, the module issues an alarm message. The specific alarm process is described in detail in step S6 above.

[0126] The advantages of this invention are as follows: First, by dividing the data into three-dimensional units based on blocks, time periods, and date types, customized risk thresholds are generated for each unique scenario. This automatically adapts to the passenger flow characteristics of different functions, such as commercial areas and residential areas, as well as the fluctuation patterns of different time periods, such as weekdays, holidays, peak hours, and off-peak hours. It has accurate scenario self-adaptation capabilities and can effectively solve the problem of block heterogeneity. Second, during peak periods, a higher threshold calculated based on its own historical data is used, avoiding being dragged down by global low values, thereby reducing false alarms during peak periods. During off-peak periods, an independent lower threshold is used, which can effectively capture abnormal passenger flow gatherings relative to that time period. This solves the hidden danger of underestimating risk during off-peak periods in traditional methods, thereby comprehensively improving the accuracy of risk assessment. Third, the entire threshold calculation process is based on the statistical patterns of historical data, requiring no manual intervention, eliminating subjective bias, ensuring the objectivity and uniformity of assessment standards and the reproducibility of results, and making it suitable for large-scale deployment. Fourth, this invention can be widely applied in multiple fields such as urban public safety monitoring, traffic management, and commercial operation analysis, with broad application prospects, providing strong data support and decision-making basis for smart cities.

[0127] In summary, the method of this invention solves problems such as block heterogeneity adaptation, peak false alarms, and underestimation of risk during trough periods by constructing fine-grained analysis units and automatically calculating dynamic thresholds using data statistical characteristics, thereby achieving a more accurate, objective, and comprehensive urban risk assessment and having significant practical application value.

[0128] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for risk assessment of urban blocks based on spatiotemporal trajectory data, characterized in that, The urban block risk assessment method based on spatiotemporal trajectory data includes: Step S1: Construct a three-dimensional analysis unit, which is composed of three dimensions: geographic block, hourly time period, and date type; Step S2: Collect historical passenger flow sample data of the three-dimensional analysis unit in a targeted manner, and preprocess the historical passenger flow sample data; Step S3: Sort the preprocessed historical passenger flow samples according to their numerical values, and calculate the passenger flow interval between adjacent samples to form an interval sequence; Step S4: Calculate the cluster radius based on the exponential distribution characteristics of the interval sequence, and cluster the sorted passenger flow samples according to the cluster radius; Step S5: Identify reasonable groups of normal passenger flow fluctuations from the clustering groups, and set the dynamic risk threshold of the three-dimensional analysis unit based on the reasonable groups; Step S6: Monitor the passenger flow data of the current 3D analysis unit in real time. If the dynamic risk threshold is exceeded, a risk warning will be triggered.

2. The urban block risk assessment method based on spatiotemporal trajectory data according to claim 1, characterized in that, In step S1, the construction of the three-dimensional analysis unit includes: The urban area is divided into multiple geographical blocks based on Geohash6 encoding; Divide the day into 24 consecutive short periods; Date types are categorized into weekdays and public holidays.

3. The urban block risk assessment method based on spatiotemporal trajectory data according to claim 1, characterized in that, Step S2, the preprocessing of the historical passenger flow sample data includes: Outliers are removed, including negative values ​​and extreme values ​​that are outside the reasonable range; Missing values ​​were filled using adjacent spatiotemporal interpolation.

4. The urban block risk assessment method based on spatiotemporal trajectory data according to claim 1, characterized in that, In step S3, sorting the preprocessed historical passenger flow samples by numerical value and calculating the passenger flow interval between adjacent samples to form an interval sequence includes: The preprocessed historical passenger flow samples are arranged in ascending order of value to generate a strictly monotonically increasing ordered sequence. Traverse the ordered sequence and calculate the difference between each pair of adjacent samples in the sequence to obtain a new sequence composed of interval values, ensuring that all interval values ​​are non-negative integers.

5. The urban block risk assessment method based on spatiotemporal trajectory data according to claim 1, characterized in that, In step S4, calculating the cluster radius includes: The rate parameter is estimated using the mean of interval samples; The cluster radius is obtained by inverse operation of the cumulative distribution function of the exponential distribution based on a preset high cumulative probability threshold.

6. The urban block risk assessment method based on spatiotemporal trajectory data according to claim 5, characterized in that, The formula for estimating the rate parameter using the mean of the interval samples is λ = Mean(k); The formula for calculating the cluster radius, which is obtained by inverse operation of the cumulative distribution function of the exponential distribution based on the preset high cumulative probability threshold, is K = -λln(1-P), where P is the high cumulative probability threshold and λ is the rate parameter.

7. The urban block risk assessment method based on spatiotemporal trajectory data according to claim 1, characterized in that, In step S5, identifying reasonable groups with normal passenger flow fluctuations from the clustering groups and setting the dynamic risk threshold of the three-dimensional analysis unit based on the reasonable groups includes: Iterate through all the groups obtained from clustering and select reasonable groups that represent the normal fluctuation range according to the preset business rules; From all reasonable groupings, select the group with the largest passenger flow limit as the largest reasonable group; The maximum passenger flow limit of the maximum reasonable group is set as a dynamic risk threshold.

8. The urban block risk assessment method based on spatiotemporal trajectory data according to claim 7, characterized in that, The filtering rules used to select reasonable groups representing normal fluctuation ranges based on preset business rules include: The proportion of the number of samples included in the group to the total number of samples in the analysis unit is not less than the lower limit threshold; The interval between all adjacent samples in the group is no greater than the dynamic risk threshold.

9. The urban block risk assessment method based on spatiotemporal trajectory data according to any one of claims 1 to 8, characterized in that, In step S6, the real-time monitoring of passenger flow data in the current 3D analysis unit, and triggering a risk warning if the dynamic risk threshold is exceeded, includes: Real-time collection of passenger flow data matching the current 3D analysis unit; Compare real-time passenger flow values ​​with dynamic risk thresholds; If the threshold is exceeded, an alert will be generated that includes the block location, time period, passenger flow value, threshold, and excess percentage, and will be pushed to the system.

10. A risk assessment system for urban blocks based on spatiotemporal trajectory data, characterized in that, It includes a three-dimensional analysis unit construction module (101) for constructing three-dimensional analysis units and executing the logical process in step S1 of claim 1; The sample processing module (102) is used to collect historical passenger flow samples for each three-dimensional analysis unit and perform preprocessing, and execute the logical process in step S2 of claim 1; The interval calculation module (103) is used to sort the preprocessed historical passenger flow quantity samples and calculate the interval between adjacent samples to obtain the interval sequence, and execute the logical process in step S3 of claim 1. The clustering radius calculation module (104) is used to determine the clustering radius based on the interval sequence, and to cluster the samples according to the clustering radius, and to execute the logical process in step S4 of claim 1; The threshold setting module (105) is used to filter reasonable groups from the clustering group, determine the largest reasonable group and set a dynamic risk threshold, and execute the logical process in step S5 of claim 1. The real-time early warning module (106) is used to monitor the number of passengers in real time, compare it with the dynamic risk threshold, and trigger a risk warning when the threshold is exceeded, and execute the logical process in step S6 of claim 1.