Public space dynamic risk network evaluation method fusing space-time features
By combining octrees and graph neural networks to improve the A* algorithm, adaptive grid cell division and risk propagation path calculation are achieved, solving the spatial characteristics and dynamic evolution problems of risk assessment in existing technologies, and realizing efficient and accurate risk identification and prevention and control deployment.
Patent Information
- Application Number
- CN202511014416.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2045-07-23
AI Technical Summary
Existing public space risk assessment methods fail to fully consider spatial geometric features and obstacle distribution, making it difficult to capture the dynamic evolution of risks at different times and locations. Traditional risk propagation path calculations are inefficient and cannot quickly identify key risk points and optimal prevention and control deployment locations.
An octree spatial partitioning algorithm is used to adaptively divide the grid cells. Combined with a graph neural network and an improved A* algorithm, the risk propagation probability and path are calculated. The propagation resistance is integrated into the heuristic function, and the risk assessment results are output.
It improves the accuracy and computational efficiency of risk assessment, can identify high-risk areas and provide scientific prevention and control deployment suggestions, and supports the safety management of public spaces.
Smart Images

Figure CN120765029B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to network evaluation technology, and in particular to a public space dynamic risk network evaluation method fusing space-time features. BACKGROUND
[0002] Public space safety management is an important part of urban governance. With the acceleration of urbanization and the increase in population density, safety risk problems in public places such as shopping malls, stations and airports have become increasingly prominent. In recent years, with the development of sensing technology, big data and artificial intelligence, dynamic risk assessment has gradually become a research hotspot. Through real-time data collection and analysis, the probability of risk occurrence and the possible transmission path can be more accurately predicted. However, there are the following deficiencies in the field of public space risk assessment at present:
[0003] Existing risk assessment methods often regard space as a homogeneous region, without fully considering the complex geometric features and obstacle distribution in public space, resulting in deviations between risk assessment results and actual situations.
[0004] Most evaluation models fail to effectively fuse the features of time and space dimensions, making it difficult to capture the dynamic evolution law of risk in different time periods and different locations, especially in scenes with dense crowds and strong mobility.
[0005] Traditional risk transmission path calculation methods are inefficient and fail to fully consider the resistance factors of risk transmission, making it difficult to provide timely and effective decision support for emergency management, especially in large and complex public spaces, where it is difficult to quickly identify key risk points and optimal prevention and control deployment locations.
[0006] With the increasing demand for public space safety, there is an urgent need to develop a dynamic risk assessment method that takes into account spatial geometric features, crowd distribution and historical risk data to improve the accuracy of risk warning and the pertinence of prevention and control measures. SUMMARY
[0007] The embodiment of the present application provides a public space dynamic risk network evaluation method fusing space-time features, which can solve the problems in the prior art.
[0008] In a first aspect, the embodiment of the present application provides a public space dynamic risk network evaluation method fusing space-time features, comprising:
[0009] Obtaining basic data of a public space to be evaluated, the basic data including spatial layout data, obstacle distribution data, crowd flow data and historical risk event data;
[0010] According to the spatial layout data and obstacle distribution data, the public space is adaptively divided into grid cells of different scales using an octree space division algorithm;
[0011] establish a connection relationship graph between the grid cells, and calculate risk propagation probabilities between the grid cells by using a graph neural network in combination with the people flow data and historical risk event data;
[0012] calculate a risk propagation path by using an improved A* algorithm, the improved A* algorithm being based on the risk propagation probabilities to construct a propagation resistance and integrate the propagation resistance into a heuristic function;
[0013] output a risk assessment result based on the risk propagation path, the risk assessment result including a risk level distribution, a risk change of the propagation path, and a prevention and control deployment suggestion.
[0014] In an optional implementation,
[0015] the step of adaptively dividing the public space into grid cells of different scales by using an octree space division algorithm according to the spatial layout data and the obstacle distribution data includes:
[0016] perform feature extraction on the spatial layout data to obtain spatial layout feature indexes, the spatial layout feature indexes including spatial connectivity and spatial function density, the spatial connectivity representing a passing difficulty between grid cells, and the spatial function density representing a function complexity of a grid cell;
[0017] calculate obstacle multidimensional features based on the obstacle distribution data, the obstacle multidimensional features including obstacle density, spatial occupancy rate, and distribution uniformity, the obstacle density being a ratio of a total number of obstacle occupation points to a volume of a grid cell, the spatial occupancy rate being a ratio of an actual obstacle occupation volume to the volume of the grid cell, and the distribution uniformity being a normalized value of a standard deviation of distances from the obstacle to the center of the grid cell;
[0018] perform weighted summation on the spatial layout feature indexes and the obstacle multidimensional features to obtain comprehensive feature indexes;
[0019] construct an octree division decision function based on the comprehensive feature indexes, trigger grid subdivision when a difference between a comprehensive feature index of a grid cell and a reference value is greater than a product of a basic division threshold and a feature sensitivity factor, and trigger grid merging when a difference between comprehensive feature indexes of adjacent grid cells is less than or equal to the product of the basic division threshold and the feature sensitivity factor;
[0020] adjust the grid scale after division based on a constraint of a ratio of adjacent grid scales and a feature gradient, until both a feature change rate of the grid cell and a grid division difference degree are less than corresponding preset values.
[0021] In an optional implementation,
[0022] The step of constructing an octree partitioning decision function based on the comprehensive feature index comprises:
[0023] An output value of the octree partitioning decision function is a difference between the comprehensive feature index and a reference value minus a product of a feature sensitivity factor and a basic partitioning threshold value;
[0024] The reference value is calculated based on a feature distribution in a sliding time window, and the reference value is obtained by a weighted combination of a spatiotemporal average value and a local maximum value of the comprehensive feature index, and a weight coefficient of the weighted combination is determined by a ratio of a variance to a mean value of the comprehensive feature index through an exponential function mapping;
[0025] The feature sensitivity factor is determined by a local feature gradient and a global feature gradient, the local feature gradient is a sum of variation rates of the comprehensive feature index in three spatial directions, the global feature gradient is a difference between a maximum value and a minimum value of the comprehensive feature index divided by a mean value of the comprehensive feature index, and a weight coefficient of the local feature gradient and the global feature gradient is determined by an entropy value of the feature distribution;
[0026] A dynamic update equation of the octree partitioning decision function is constructed, the dynamic update equation comprises a difference item of the decision function and a target decision value and a Laplacian item of the decision function, the difference item is used for adjusting a convergence speed of the decision function, and the Laplacian item is used for maintaining spatial continuity of the decision function.
[0027] In an optional implementation,
[0028] A connection relationship graph between grid cells is established, and a step of calculating a risk propagation probability between the grid cells by using a graph neural network in combination with the people flow data and the historical risk event data comprises:
[0029] A connection relationship graph between grid cells is established, and the connection relationship graph comprises grid cell nodes and connection edges, and a weight of the connection edge is determined by a weighted combination of a spatial distance and a passing difficulty;
[0030] A comprehensive feature vector of the grid cell is constructed, the comprehensive feature vector comprises static features, dynamic features and historical features, the static features comprise spatial scales, functional attributes and obstacle distribution features of the grid cell, the dynamic features are real-time people flow data of the grid cell, and the historical features are historical risk event statistical data of the grid cell;
[0031] A graph neural network is constructed based on a multi-head attention mechanism, for each attention head, an attention coefficient between the grid cell nodes is calculated, the attention coefficient is obtained by performing linear transformation on the comprehensive feature vector and through a leaky rectified linear unit activation function, and updated node feature representations are obtained by using the attention coefficient to perform weighted aggregation on features of neighbor nodes.
[0032] calculate a dynamic correlation strength between the grid cells using the updated node feature representation, the dynamic correlation strength representing a risk propagation difficulty between the grid cells;
[0033] calculate a risk propagation probability between the grid cells, the risk propagation probability being obtained by a combination of a basic propagation probability, a passenger flow influence factor, a historical risk influence factor, and the dynamic correlation strength.
[0034] In an optional embodiment,
[0035] The step of constructing the graph neural network based on the multi-head attention mechanism comprises:
[0036] construct a multi-layer graph attention network, each layer comprising a plurality of attention heads, each attention head independently learning different feature representations; for each attention head, apply a different weight matrix to the feature vector of the grid cell node to perform linear transformation to generate a query vector, a key vector, and a value vector; calculate an attention score based on the query vector and the key vector, the attention score being processed by a LeakyReLU activation function and then normalized by a softmax function to obtain an attention coefficient;
[0037] construct a time gating unit, the time gating unit comprising an update gate and a reset gate, the update gate controlling a retention proportion of historical features, and the reset gate adjusting a degree of feature integration; construct an edge feature enhancement module, calculate a spatial distance matrix and a topological relationship matrix between the grid cells, and combine the distance matrix and the topological relationship matrix with the attention score by weighting to generate a spatially enhanced attention coefficient; construct an adaptive loss function, the adaptive loss function comprising a prediction loss term and a spatial consistency loss term, the loss term weights being dynamically adjusted based on the performance of a verification set, wherein the prediction loss term calculates a risk prediction error using a cross-entropy loss function, and the spatial consistency loss term calculates a smoothness of predicted values of adjacent grid cells by a Laplacian matrix.
[0038] In an optional embodiment,
[0039] The step of calculating a risk propagation path using the improved A* algorithm based on the risk propagation probability and integrating the propagation resistance into a heuristic function comprises:
[0040] construct a propagation resistance matrix, each element in the propagation resistance matrix having a value being a complement of the risk propagation probability between a pair of corresponding grid cells;
[0041] The actual propagation resistance is calculated by summing the propagation resistance of the parent node of the current node and the propagation resistance from the parent node to the current node, and multiplying the spatial distance between the nodes by the corresponding propagation resistance as a propagation resistance increment; the estimated propagation resistance is calculated based on the Euclidean distance from the current node to the target node and the spatial distribution of the propagation resistance, and the estimated propagation resistance is obtained by distance weighted average and local gradient correction;
[0042] The node evaluation value is calculated based on the weighted sum of the actual propagation resistance and the estimated propagation resistance, and the node priority is calculated based on the node evaluation value, and the node priority decreases as the node evaluation value increases;
[0043] The nodes in the search queue are sorted based on the node priority, the node with the highest priority is selected as the expansion node, and the node expansion is repeatedly performed until the target node is searched, and the minimum propagation resistance path is obtained;
[0044] The characteristics of the minimum propagation resistance path are analyzed, the spatial curvature and the cumulative propagation resistance distribution of the path are calculated, the spatial curvature represents the turning characteristics of the path, and the cumulative propagation resistance distribution represents the spatial decay law of risk propagation, and the risk propagation path is determined.
[0045] In an optional embodiment,
[0046] The risk evaluation result includes a risk level distribution, a risk change of the propagation path, and a deployment suggestion of the prevention and control, and the steps include:
[0047] The risk level distribution of the grid unit is calculated based on the risk propagation path, the risk level distribution is determined by segment mapping of the cumulative propagation resistance, and the mapping threshold is dynamically adjusted according to the statistical distribution of historical risk event data;
[0048] The risk change characteristics of the risk propagation path are analyzed, the risk gradient and the risk accumulation between adjacent grid units on the path are calculated, the risk gradient represents the spatial decay rate of risk propagation, and the risk accumulation represents the aggregation degree of risk on the path;
[0049] The comprehensive risk value of each grid unit on the risk propagation path is calculated, the comprehensive risk value is obtained by weighted combination of the risk propagation probability and the cumulative propagation resistance; the grid units are sorted according to the comprehensive risk value, and the deployment priority of the grid units is determined according to the sorting result; based on the deployment priority of each grid unit and the available prevention and control resource amount, the resource allocation quantity is determined in the order from high to low according to the priority, and the prevention and control deployment suggestion containing the resource allocation quantity and the deployment priority is generated.
[0050] The second aspect of the embodiment of the application provides an electronic device, which comprises:
[0051] a processor;
[0052] a memory for storing processor-executable instructions;
[0053] wherein the processor is configured to invoke the instructions stored by the memory to perform the method as described above.
[0054] In a third aspect, the present application provides a computer-readable storage medium having stored thereon computer program instructions, which when executed by a processor implement the method as described above.
[0055] The present application uses an octree space partitioning algorithm to adaptively divide the public space into grid cells of different scales, can automatically adjust the grid density according to the spatial complexity, improves the calculation efficiency while ensuring the evaluation accuracy, and has better adaptability to public spaces with complex structures.
[0056] The present application uses a graph neural network to calculate the risk propagation probability between grid cells by combining human flow data and historical risk event data, can fully consider the influence of space-time factors on risk propagation, makes the risk assessment result more in line with the actual situation, and improves the accuracy of risk prediction.
[0057] The present application uses an improved A* algorithm to calculate the risk propagation path, constructs the risk propagation probability as a propagation resistance and integrates it into the heuristic function, which can not only effectively identify high-risk areas, but also provide risk level distribution, risk changes of propagation path and prevention and control deployment suggestions, and provides a scientific basis and decision support for safety management of public spaces. BRIEF DESCRIPTION OF DRAWINGS
[0058] Figure 1 A flowchart of the public space dynamic risk network evaluation method of the present application embodiment fusing space-time features;
[0059] Figure 2 A risk propagation probability calculation flowchart based on the graph neural network of the present application;
[0060] Figure 3 A performance comparison chart of the standard A* algorithm and the improved A* algorithm of the present application. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme of the embodiments of the present application will be described clearly and completely below with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0062] The technical solutions of the present application will be described in detail below with specific examples. The following specific examples can be combined with each other, and the same or similar concepts or processes may not be described in detail in some examples.
[0063] Figure 1 The flowchart of the public space dynamic risk network evaluation method of the embodiment of the present application fuses space-time features, as shown in Figure 1 The method comprises the following steps:
[0064] Obtain the basic data of the public space to be evaluated, wherein the basic data includes space layout data, obstacle distribution data, crowd flow data, event attitude data, and historical risk event data;
[0065] According to the space layout data and the obstacle distribution data, the public space is adaptively divided into grid cells of different scales by using an octree space segmentation algorithm;
[0066] A connection relationship diagram between the grid cells is established, and a graph neural network is used to calculate the risk propagation probability between the grid cells in combination with the crowd flow data and the historical risk event data;
[0067] An improved A* algorithm is used to calculate the risk propagation path, wherein the improved A* algorithm constructs a propagation resistance based on the risk propagation probability, and integrates the propagation resistance into a heuristic function;
[0068] The risk assessment result is output based on the risk propagation path, wherein the risk assessment result includes a risk level distribution, a risk change of the propagation path, and a prevention and control deployment suggestion.
[0069] In an optional implementation, the step of adaptively dividing the public space into grid cells of different scales according to the space layout data and the obstacle distribution data by using an octree space segmentation algorithm comprises:
[0070] Feature extraction is performed on the space layout data to obtain space layout feature indexes, wherein the space layout feature indexes include space connectivity and space function density, the space connectivity represents the difficulty of passing between grid cells, and the space function density represents the complexity of the function of the grid cells;
[0071] Obstacle multi-dimensional features are calculated based on the obstacle distribution data, wherein the obstacle multi-dimensional features include obstacle density, space occupancy rate, and distribution uniformity, the obstacle density is the ratio of the total number of obstacle occupation points to the volume of the grid cell, the space occupancy rate is the ratio of the actual volume of the obstacle to the volume of the grid cell, and the distribution uniformity is the normalized value of the standard deviation of the distance from the obstacle to the center of the grid cell;
[0072] weighting and summing the space layout feature indicators and the obstacle multi-dimensional features to obtain a comprehensive feature indicator;
[0073] constructing an octree partitioning decision function based on the comprehensive feature indicator, triggering grid subdivision when the difference between the comprehensive feature indicator of a grid cell and a reference value is greater than the product of a basic partitioning threshold and a feature sensitivity factor, and triggering grid merging when the difference between the comprehensive feature indicators of adjacent grid cells is less than or equal to the product of the basic partitioning threshold and the feature sensitivity factor;
[0074] adjusting the grid size after partitioning based on the constraint of the ratio of adjacent grid sizes and the feature gradient, until the feature variation rate of the grid cell and the grid partition difference degree are both less than the corresponding preset values.
[0075] For example, spatial layout data is obtained, including information such as the geometric shape of the space, the distribution of functional areas, and the layout of the passageway. Feature extraction is performed on this data to obtain two key space layout feature indicators: space connectivity and space functional density. Space connectivity represents the difficulty of passing between grid cells, which is determined by calculating factors such as the width of the passageway, the slope, and the height difference between adjacent cells. For example, for a shopping mall space, the space connectivity value of the escalator area may be 0.3, the value of the staircase area may reach 0.7, and the value of the ordinary corridor area is about 0.2. Space functional density represents the complexity of the function of the grid cell, which is determined by calculating the number and type diversity of functional settings per unit volume. For example, the functional density of the restaurant area of a shopping mall is about 0.8, the functional density of the ordinary shopping area is about 0.5, and the functional density of the rest area is about 0.3.
[0076] In the obstacle feature calculation step, three obstacle multi-dimensional features are calculated based on the obstacle distribution data: obstacle density, space occupancy rate, and distribution uniformity. Obstacle density is the ratio of the total number of obstacle occupation points to the volume of the grid cell. For example, if there are 500 obstacle occupation points in a 10 cubic meter grid cell, the obstacle density is 50 points per cubic meter. The space occupancy rate is the ratio of the actual volume occupied by the obstacle to the volume of the grid cell. For example, if the actual volume occupied by the obstacle in the same grid cell is 2 cubic meters, the space occupancy rate is 0.2. The distribution uniformity is the normalized value of the standard deviation of the distance from the obstacle to the center of the grid, with a value range of 0 to 1, and a smaller value indicating a more uniform distribution. For example, the distribution uniformity of a uniformly distributed shelf area is about 0.2, while the distribution uniformity of an area with large equipment placed centrally is about 0.8.
[0077] In the comprehensive feature construction step, the spatial layout feature indicators and the obstacle multi-dimensional features are weighted and summed to obtain the comprehensive feature indicators. Specifically, the spatial connectivity is assigned a weight of 0.3, the spatial functional density is assigned a weight of 0.2, the obstacle density is assigned a weight of 0.2, the spatial occupancy rate is assigned a weight of 0.2, and the distribution uniformity is assigned a weight of 0.1. For example, if the spatial connectivity of a certain grid cell is 0.4, the spatial functional density is 0.6, the obstacle density is normalized to 0.5, the spatial occupancy rate is 0.3, and the distribution uniformity is 0.4, then the comprehensive feature indicator is 0.3 x 0.4 + 0.2 x 0.6 + 0.2 x 0.5 + 0.2 x 0.3 + 0.1 x 0.4 = 0.43.
[0078] In the octree partitioning determination step, an octree partitioning determination function is constructed based on the comprehensive feature indicators. First, a reference value is determined, which can be obtained by averaging the comprehensive feature indicators of all initial grid cells in the space. For example, in a shopping mall model, the reference value is 0.4. Then, a basic partitioning threshold is set, for example, with a value of 0.1, and a feature sensitivity factor is determined according to the local feature distribution, for example, with a value of 1.5. When the difference between the comprehensive feature indicator of a grid cell and the reference value is greater than the product of the basic partitioning threshold and the feature sensitivity factor, the grid subdivision is triggered. For example, if the comprehensive feature indicator of a certain grid cell is 0.7, the reference value is 0.4, and the difference is 0.3, which is greater than the product of the basic partitioning threshold 0.1 and the feature sensitivity factor 1.5, which is 0.15, then the subdivision of the grid cell is triggered. Conversely, when the difference between the comprehensive feature indicators of adjacent grid cells is less than or equal to the product of the basic partitioning threshold and the feature sensitivity factor, the grid merging is triggered. For example, if the comprehensive feature indicators of two adjacent grid cells are 0.42 and 0.35 respectively, the difference is 0.07, which is less than 0.15, then these two grid cells can be considered for merging.
[0079] In the grid scale adjustment step, the partitioned grid scale is adjusted based on the constraints of the adjacent grid scale ratio and the feature gradient. First, the scale ratio of adjacent grids is limited to not more than 2:1 to ensure smooth transition of the grids. Second, the feature change rate of the grid cell is calculated, which is the rate of change of the comprehensive feature indicators between adjacent grid cells, for example, requiring the feature change rate to be less than 0.2. Finally, the grid division difference is calculated, which is the degree of change of the grid size within a unit distance, for example, requiring the grid division difference to be less than 0.3. Through iterative adjustment, all grid cells meet these constraints. For example, in a large sports venue, about 5000 grid cells of different sizes may be finally obtained, among which the grid size in the areas with high human flow density and complex functions is smaller, about 0.5m x 0.5m x 0.5m, and the grid size in the open space may reach 4m x 4m x 4m.
[0080] The scheme introduces a spatial layout feature index and a weighted combination of obstacle multi-dimensional features to construct an octree partitioning mechanism driven by a comprehensive feature index, and realizes adaptive identification of feature differences in different regions. By setting a constraint condition based on a feature gradient, the scale of adjacent grid cells is ensured to be smoothly transitioned, avoiding the problem that the traditional fixed-scale division method cannot accurately depict the spatial feature distribution.
[0081] In an optional embodiment, the step of constructing an octree partitioning decision function based on the comprehensive feature index comprises:
[0082] The output value of the octree partitioning decision function is the difference between the comprehensive feature index and a reference value minus the product of a feature sensitivity factor and a basic partitioning threshold value;
[0083] The reference value is calculated based on the feature distribution in a sliding time window, and is obtained by a weighted combination of the spatiotemporal average value and the local maximum value of the comprehensive feature index. The weight coefficient of the weighted combination is determined by the ratio of the variance to the mean value of the comprehensive feature index, which is mapped by an exponential function.
[0084] The feature sensitivity factor is determined by a local feature gradient and a global feature gradient. The local feature gradient is the sum of the variation rates of the comprehensive feature index in three spatial directions, and the global feature gradient is the difference between the maximum value and the minimum value of the comprehensive feature index divided by the mean value of the comprehensive feature index. The weight coefficient of the local feature gradient and the global feature gradient is determined by the entropy value of the feature distribution.
[0085] A dynamic update equation of the octree partitioning decision function is constructed, which includes a difference term of the decision function and a target decision value and a Laplacian term of the decision function. The difference term is used to adjust the convergence speed of the decision function, and the Laplacian term is used to maintain the spatial continuity of the decision function.
[0086] For example, an octree partitioning decision function is constructed, which is used to determine whether to subdivide or merge a grid cell. The output value of the decision function is calculated as the difference between the comprehensive feature index and a reference value minus the product of a feature sensitivity factor and a basic partitioning threshold value. When the output value of the decision function is greater than zero, grid subdivision is triggered; when the output value of the decision function is less than zero, grid merging is considered. For example, assuming that the comprehensive feature index of a certain grid cell is 0.65, the reference value is 0.45, the feature sensitivity factor is 1.2, and the basic partitioning threshold value is 0.15, then the output value of the decision function is (0.65-0.45)-1.2x0.15=0.02, which is greater than zero, so grid subdivision is triggered.
[0087] The calculation of the reference value adopts a sliding time window mechanism, considering the spatiotemporal distribution characteristics of the features. In specific implementation, the size of the sliding window is set to 10 time steps, and the integrated feature indicators of each region in the space are collected in each window. The reference value is obtained by the weighted combination of the spatiotemporal average value and the local maximum value of the integrated feature indicators. For example, the spatiotemporal average value of the integrated feature indicators of a region in a certain time window is 0.5, and the local maximum value is 0.8. The variance of the integrated feature indicators is 0.04, the mean value is 0.5, and the ratio is 0.08. The ratio is mapped by an exponential function (for example, the base of the exponential function is 2.7), and the weight coefficient is about 1.08. The final reference value is calculated as 0.5 x (1-1.08 / (1+1.08))+0.8 x (1.08 / (1+1.08))≈0.64. This calculation method makes the reference value of the region with larger feature fluctuation closer to the local maximum value, which helps to capture the abnormal features in the region.
[0088] The determination of the feature sensitivity factor combines the local feature gradient and the global feature gradient, reflecting the complexity of the spatial feature distribution. The local feature gradient calculates the sum of the feature change rates of the grid cell in the X, Y, and Z spatial directions. For example, the feature change rate of a certain grid cell in the X direction is 0.05, the Y direction is 0.08, and the Z direction is 0.03, and the local feature gradient is 0.16. The global feature gradient reflects the difference in the feature distribution of the entire space, and the calculation method is the difference between the maximum and minimum values of the feature divided by the mean value of the feature. For example, the maximum value of the integrated feature indicators in the space is 0.9, the minimum value is 0.2, and the mean value is 0.45, and the global feature gradient is (0.9-0.2) / 0.45≈1.56.
[0089] The weight coefficients of the local feature gradient and the global feature gradient are determined by the entropy value of the feature distribution. First, the integrated feature indicators are divided into 10 equal intervals, the number of grid cells in each interval is counted and normalized to obtain the probability distribution. The entropy value of the distribution is calculated, and the larger the entropy value, the more uniform the feature distribution, and the more attention should be paid to the local gradient; the smaller the entropy value, the more concentrated the feature distribution, and the more attention should be paid to the global gradient. For example, the calculated entropy value is 0.75 (the value range is 0-1), and the weight coefficient of the local feature gradient can be set to 0.75, and the weight coefficient of the global feature gradient is 0.25. Assuming that the local feature gradient is 0.16 and the global feature gradient is 1.56, the feature sensitivity factor is calculated as 0.16 x 0.75 + 1.56 x 0.25≈0.51.
[0090] The dynamic update of the octree partitioning decision function is the key to ensure the adaptability of the partitioning process. The dynamic update equation is constructed, which contains two main terms: the difference term of the decision function and the target decision value and the Laplacian term of the decision function. The difference term adjusts the convergence speed of the decision function, and setting an appropriate difference coefficient (such as 0.3) makes the decision function quickly approach the target value. The Laplacian term maintains the spatial continuity of the decision function, calculates the difference of the decision function values of the current grid cell and its six adjacent cells, and sets an appropriate Laplace coefficient (such as 0.1) to control the spatial smoothness.
[0091] In actual implementation, the decision function needs to be updated after each grid division. For example, the current decision function value of a grid cell is 0.05, the target decision value is 0.15, the difference term contributes 0.3×(0.15-0.05)=0.03. The decision function values of the cell and its six adjacent cells are 0.07, 0.08, 0.06, 0.04, 0.03, and 0.04, respectively, with an average of 0.053, and the Laplace operator term contributes 0.1×(0.053-0.05)=0.0003. Then the decision function value of the cell at the next time step is updated to 0.05+0.03+0.0003=0.0803. Through this dynamic update mechanism, the decision function can gradually converge to a reasonable value, which not only ensures the accuracy of grid division, but also ensures the spatial continuity.
[0092] The octree partitioning decision function proposed in the scheme has dynamic adaptive characteristics, and through the introduction of a reference value calculation mechanism based on a sliding time window and a feature sensitive factor, the effective tracking of the time variation of spatial features is realized. The weight adaptive mechanism based on local feature gradient and global feature gradient improves the robustness of the partitioning decision. By constructing a dynamic update equation containing a difference term and a Laplacian term, the convergence and spatial continuity of the decision function are guaranteed, effectively solving the problem that the traditional fixed threshold decision method is not sensitive to feature changes.
[0093] In an optional implementation, the connection relationship graph between the grid cells is established, and the step of calculating the risk propagation probability between the grid cells by using a graph neural network in combination with the people flow data, the event situation data and the historical risk event data includes:
[0094] The connection relationship graph between the grid cells is established, and the connection relationship graph includes grid cell nodes and connection edges, and the weight of the connection edge is determined by the weighted combination of the spatial distance and the passing difficulty;
[0095] construct a comprehensive feature vector of the grid cell, the comprehensive feature vector comprising static features, dynamic features and historical features, the static features comprising spatial scale, functional attribute and obstacle distribution features of the grid cell, the dynamic features being real-time crowd flow data and event situation data of the grid cell, and the historical features being historical risk event statistical data of the grid cell;
[0096] construct a graph neural network based on a multi-head attention mechanism, for each attention head, calculate an attention coefficient between nodes of the grid cell, the attention coefficient being obtained by linear transformation on the comprehensive feature vector and activation function of a leaky rectified linear unit, and use the attention coefficient to aggregate features of neighbor nodes to obtain an updated node feature representation;
[0097] calculate a dynamic correlation strength between the grid cells using the updated node feature representation, the dynamic correlation strength representing a risk propagation difficulty between the grid cells;
[0098] calculate a risk propagation probability between the grid cells, the risk propagation probability being obtained by combination of a basic propagation probability, a crowd flow influence factor, an event situation influence factor and a historical risk influence factor with the dynamic correlation strength, the basic propagation probability being exponentially attenuated over time, the crowd flow influence factor being mapped by a Sigmoid function on a difference between the crowd flow and a threshold value, the event situation influence factor being calculated based on an emergency degree and an influence range of a current event, and the historical risk influence factor being calculated based on a time decay characteristic and an event weight of a historical risk event.
[0099] For example, in combination with Figure 2 Based on the graph neural network, a risk propagation probability calculation flowchart is described: a connection relationship graph is constructed, each grid cell in the public space is taken as a node of the graph, and a connection edge is established between adjacent grid cells. The weight of the connection edge is determined by the weighted combination of the spatial distance and the passing difficulty. The spatial distance adopts the Euclidean distance between the center points of the grid cells. For example, the center point coordinates of two grid cells are (3, 4, 2) and (3, 5, 2), and the spatial distance is 1 unit length. The passing difficulty is determined according to the obstacle distribution and the spatial layout characteristics, and the value range is 0 to 1. The greater the value, the more difficult it is to pass. For example, the passing difficulty of an ordinary corridor area is 0.2, the area with steps is 0.5, and the dense obstacle area is 0.8. When calculating the weight, the spatial distance weight can be set to 0.4 and the passing difficulty weight to 0.6. Taking the above grid cells as an example, if the passing difficulty between them is 0.3, the connection edge weight is 0.4x1+0.6x0.3=0.58.
[0100] The comprehensive feature vector of the grid cell includes three parts: static features, dynamic features, and historical features. The static features include the spatial scale of the grid cell, the functional attributes, and the obstacle distribution characteristics. The spatial scale is the side length of the grid, such as 0.5 meters. The functional attributes are one-hot encoded vectors, for example, the functional types in a shopping mall can be divided into shopping area (1, 0, 0), dining area (0, 1, 0), and resting area (0, 0, 1). The obstacle distribution characteristics include the obstacle density, spatial occupancy rate, and distribution uniformity calculated in the previous step, such as (0.3, 0.25, 0.6). The dynamic features are the real-time crowd data and event situation data of the grid cell, which are obtained through cameras or sensors installed in public spaces. For example, there are 5 people per square meter, which needs to be normalized. The event situation can be represented as a vector of emergency level and impact range (0.6, 0.4). The event situation data includes abnormal or sudden situations. The historical features are the historical risk event statistical data of the grid cell, including event type, frequency, and severity. For example, a certain grid cell has experienced 2 minor congestion events and 1 safety hazard event in the past 3 months, which can be represented as (2, 1, 0).
[0101] A graph attention network with 3 layers is designed, each layer containing 8 attention heads. For each attention head, a linear transformation is performed on the comprehensive feature vector of the node, and different weight matrices can be used. For example, for the first attention head, the input feature dimension is 15 and the output dimension is 8, so the weight matrix size is 15x8. The original feature is mapped to a new feature space through this matrix.
[0102] For each pair of connected nodes, the attention coefficient between them is calculated, the transformed features of the two nodes are concatenated, then a vector is multiplied with the concatenated result, and then a leaky rectified linear unit activation function is used for processing. This activation function still has a small slope, such as 0.2, when the input is negative, to avoid gradient vanishing. Finally, the attention values of all nodes connected to the center node are normalized by the Softmax function to obtain the final attention coefficient. For example, the attention coefficients of a certain grid cell and its 6 neighbors may be (0.22, 0.18, 0.15, 0.13, 0.17, 0.15).
[0103] The features of the neighbor nodes are weighted and aggregated using the calculated attention coefficients to obtain the updated node feature representation. For example, the updated feature of the center node is the sum of the features of its 6 neighbor nodes multiplied by the corresponding attention coefficients. The output features of the 8 attention heads are concatenated to form the output of this layer. For the hidden layer, an activation function is used for processing; for the output layer, it is directly used as the new feature representation of the node.
[0104] The dynamic correlation strength between grid cells is calculated based on the updated node feature representation. The similarity between the feature representations of two adjacent grid cells is calculated, and the cosine similarity method can be used. The more similar the features are, the greater the dynamic correlation strength is, indicating that the risk is more likely to spread between the two cells. For example, if the cosine value of the feature vectors of two grid cells is 0.85, the dynamic correlation strength is 0.85.
[0105] The risk propagation probability between grid cells is calculated, with a basic propagation probability of 0.5, which decays exponentially over time with a decay coefficient of 0.1, i.e. every 1 time unit, the basic propagation probability becomes 0.9 times the original. The human flow influence factor is mapped by the Sigmoid function to the difference between the human flow and the threshold, which can be set to 3 people per square meter. When the human flow is 5 people per square meter, the influence factor is about 0.7. The historical risk influence factor is calculated based on the time decay characteristics of historical risk events and event weights. The time decay characteristics can be set to a half-life of 1 month, and the event weight is determined according to the severity, for example, the weight of a minor event is 0.3, the weight of a general event is 0.6, and the weight of a serious event is 1.0. Assuming that a grid cell had a serious risk event 2 months ago, the historical risk influence factor is 1.0 x (0.5 2 )=0.25.
[0106] The product of the above three factors and the dynamic correlation strength is combined in a ratio of 7:3. Using the above data as an example, the risk propagation probability is calculated as 0.7 x (0.5 x 0.9 3 x 0.7 x 0.25) + 0.3 x 0.85 ≈ 0.32. This indicates that the probability of risk spreading from one grid cell to an adjacent cell is 32%. By calculating all adjacent grid cell pairs, a complete risk propagation probability matrix is obtained.
[0107] The present scheme realizes the deep mining of complex correlation between grid cells. By introducing the leaky rectified linear unit activation function and the dynamic correlation strength calculation mechanism, the nonlinear expression ability of feature extraction is improved. The risk propagation probability calculation method based on the human flow influence factor and the historical risk influence factor can accurately depict the spatio-temporal evolution characteristics of risk propagation.
[0108] In an alternative embodiment, the step of constructing a graph neural network based on a multi-head attention mechanism comprises:
[0109] The multi-layer graph attention network is constructed, each layer includes multiple attention heads, and different feature representations are learned by the independent attention heads; for each attention head, different weight matrices are applied to linearly transform the feature vectors of the grid cell nodes to generate query vectors, key vectors and value vectors; attention scores are calculated based on the query vectors and the key vectors, and the attention scores are processed by a LeakyReLU activation function and normalized by a softmax to obtain attention coefficients;
[0110] A time gating unit is constructed, the time gating unit includes an update gate and a reset gate, the update gate controls the retention proportion of historical features, and the reset gate adjusts the integration degree of the features; an edge feature enhancement module is constructed, a spatial distance matrix and a topological relationship matrix between grid cells are calculated, the distance matrix and the topological relationship matrix are combined with the attention scores to generate spatially enhanced attention coefficients; an adaptive loss function is constructed, the adaptive loss function includes a prediction loss term and a spatial consistency loss term, and the loss term weights are dynamically adjusted based on the performance of a verification set, wherein the prediction loss term calculates a risk prediction error by using a cross-entropy loss function, and the spatial consistency loss term calculates the smoothness of predicted values of adjacent grid cells by using a Laplacian matrix.
[0111] For example, a multi-layer graph attention network is constructed, and a network architecture with a 3-layer structure can be designed in actual application. The first layer is an input layer, which receives the original features of the grid cells; the second layer is a hidden layer, which is responsible for feature conversion and information aggregation; and the third layer is an output layer, which generates the final node representation. Each layer includes multiple attention heads, for example, 8 attention heads are set, so that the network can learn feature representations from different angles. For example, in a shopping mall risk assessment scenario, the input feature dimension is 20 (including 12 static features, 5 dynamic features and 3 historical features), the hidden layer dimension can be set to 64, and the output layer dimension is set to 32.
[0112] Three weight matrices are assigned to each attention head for generating query vectors, key vectors and value vectors. For example, for the first attention head of the first layer network, the input feature dimension is 20, and the hidden layer dimension is 8 (the total hidden layer dimension 64 divided by the number of heads 8), so the sizes of the query matrix, the key matrix and the value matrix are all 20x8. The input features are transformed by the three matrices to generate query vectors, key vectors and value vectors, and the dimensions of each vector are all 8.
[0113] For node i and node j, the query vector of node i is dot multiplied with the key vector of node j to get the original attention score. For example, the query vector of node A is [0.5, 0.3, 0.2, 0.1, 0.4, 0.6, 0.7, 0.2], and the key vector of node B is [0.4, 0.2, 0.1, 0.3, 0.5, 0.6, 0.2, 0.3], and their original attention score is 1.25. The score is processed by a LeakyReLU activation function, which has a small slope (such as 0.2) when the input is negative, avoiding the problem of gradient disappearance. Then the attention scores of node i and all neighbor nodes are normalized by softmax to get the final attention coefficients. For example, the normalized attention coefficients of node A and its four neighbor nodes B, C, D, and E may be [0.35, 0.25, 0.2, 0.2], indicating the importance of neighbor nodes in information aggregation.
[0114] A time gating unit is constructed to enhance the network's ability to process time series data. The time gating unit includes two key components: an update gate and a reset gate. The update gate controls the retention proportion of historical features, and its value is obtained by Sigmoid function transformation on the combination of the current input features and the last time step features, with the output value between 0 and 1. For example, the update gate output is 0.7, indicating that 70% of the historical features are retained. The reset gate adjusts the degree of feature integration, also obtained by Sigmoid function. For example, the reset gate output is 0.4, indicating that only 40% of the candidate features are integrated. In actual risk assessment, the time step can be set to 1 hour, for example, the feature representation of a certain mall at 10 am is [0.5, 0.6, 0.4, 0.3], and the feature representation of the last time step (9 am) is [0.3, 0.5, 0.4, 0.2], the update gate value is calculated to be 0.7, and the reset gate value is calculated to be 0.4, then the final feature of the current time step is integrated with 70% of the historical features and a certain proportion of new features.
[0115] An edge feature enhancement module is constructed to improve the model's perception of spatial relationships. A spatial distance matrix between grid cells is calculated to record the Euclidean distance between the center points of each pair of grid cells. For example, in a 5x5 grid area, a 25x25 distance matrix is generated. Next, a topological relationship matrix is calculated to represent the connection between grid cells. The relationship value between directly adjacent cells is set to 1, the relationship value between cells separated by one cell is set to 0.5, and the rest is set to 0. The distance matrix and topological relationship matrix are combined with the previously calculated attention score to generate a spatially enhanced attention coefficient. For example, the weights can be set to attention score 0.6, distance matrix 0.2, and topological relationship matrix 0.2. For nodes A and B, if the original attention score is 0.35, the normalized distance is 0.8, and the topological relationship value is 1, then the spatially enhanced attention coefficient is 0.6x0.35+0.2x(1-0.8)+0.2x1=0.45.
[0116] An adaptive loss function is constructed to optimize the network training process. The loss function includes two parts: a prediction loss term and a spatial consistency loss term. The prediction loss term uses the cross-entropy loss function to calculate the risk prediction error, measuring the difference between the model's predicted risk level and the true risk level. For example, if the true risk level of a grid cell is [0, 0, 1, 0] (third level in four-level risk), and the model's prediction probability is [0.1, 0.2, 0.6, 0.1], then the cross-entropy loss is approximately 0.51. The spatial consistency loss term calculates the smoothness of the prediction values of adjacent grid cells through the Laplacian matrix, ensuring that similar regions in space have similar risk predictions. For example, if the prediction values of adjacent grid cells differ greatly, this loss term will increase, guiding the model to learn a smoother spatial risk distribution.
[0117] At the beginning of training, the prediction loss weight can be set to 0.8 and the spatial consistency loss weight to 0.2, focusing on the model's prediction accuracy. As training progresses, monitor the performance indicators on the validation set. If it is found that the prediction values fluctuate greatly in space, increase the weight of the spatial consistency loss, such as adjusting it to 0.6:0.4. In specific implementation, the validation set performance can be evaluated every 10 training cycles, and the weight ratio can be automatically adjusted according to the prediction accuracy and spatial smoothness indicators.
[0118] The multi-layer graph attention network structure designed in this scheme improves the model's recognition ability of complex feature patterns by having multiple attention heads independently learn different feature representations. The introduction of time gating units and edge feature enhancement modules enables selective preservation of historical information and explicit modeling of spatial relationships. By constructing an adaptive loss function that combines prediction loss and spatial consistency loss, the model's generalization ability and prediction stability are improved.
[0119] In an alternative embodiment, the improved A* algorithm is used to calculate the risk propagation path, and the step of constructing a propagation resistance based on the risk propagation probability and integrating the propagation resistance into the heuristic function comprises:
[0120] constructing a propagation resistance matrix, wherein each element in the matrix represents the propagation resistance between a pair of corresponding grid cells, and the value of each element in the matrix is the complement of the risk propagation probability between the pair of corresponding grid cells, and the propagation resistance represents the difficulty of risk propagation between adjacent grid cells;
[0121] calculating the actual propagation resistance by summing the propagation resistance of the parent node of the current node and the propagation resistance from the parent node to the current node, and multiplying the spatial distance between the nodes by the corresponding propagation resistance to obtain the propagation resistance increment; calculating the estimated propagation resistance based on the Euclidean distance from the current node to the target node and the spatial distribution of the propagation resistance, wherein the estimated propagation resistance is obtained by distance-weighted averaging and local gradient correction;
[0122] calculating the node evaluation value based on the weighted sum of the actual propagation resistance and the estimated propagation resistance, and calculating the node priority based on the node evaluation value, wherein the node priority decreases as the node evaluation value increases;
[0123] sorting the nodes in the search queue based on the node priority, selecting the node with the highest priority as the expansion node, and repeating the node expansion until the target node is found to obtain the minimum propagation resistance path;
[0124] analyzing the characteristics of the minimum propagation resistance path, calculating the spatial curvature and the cumulative propagation resistance distribution of the path, wherein the spatial curvature represents the turning characteristics of the path, and the cumulative propagation resistance distribution represents the spatial attenuation law of risk propagation, and determining the risk propagation path.
[0125] For example, the propagation resistance matrix represents the difficulty of risk propagation between different grid cells. The propagation resistance is defined as the complement of the risk propagation probability, i.e. 1 minus the risk propagation probability. For example, if the risk propagation probability from grid cell A to grid cell B is 0.7, the corresponding propagation resistance is 0.3. This definition makes the path with low resistance value easy to propagate, and the path with high resistance value difficult to propagate. In practical applications, an N x N propagation resistance matrix can be constructed, where N is the total number of grid cells. For example, in a 5 x 5 grid area, a 25 x 25 propagation resistance matrix is generated, and each element in the matrix represents the propagation resistance between a pair of corresponding grid cells. For example, the propagation resistance from grid (1, 2) to grid (1, 3) is 0.25, and the propagation resistance from grid (1, 2) to grid (3, 4) is 0.85. The propagation resistance between grid cells that are not directly adjacent can be set to positive infinity, indicating that direct propagation is not possible.
[0126] The actual propagation resistance is calculated by summing the propagation resistance of the parent node of the current node and the propagation resistance from the parent node to the current node. In actual implementation, the spatial distance between nodes is multiplied by the corresponding propagation resistance as the propagation resistance increment. For example, if the actual propagation resistance of node A is 2.5, the spatial distance from node A to node B is 2 units of length, and the propagation resistance from A to B is 0.4, then the actual propagation resistance of node B is 2.5 + 2 x 0.4 = 3.3. This calculation method ensures that the propagation resistance will accumulate and increase when propagating over a long distance, which conforms to the characteristics of actual risk propagation decay.
[0127] The estimated propagation resistance is calculated based on the Euclidean distance from the current node to the target node and the spatial distribution of the propagation resistance. The straight-line distance from the current node to the target node is calculated, for example, the coordinates of the current node are (3, 4, 2) and the coordinates of the target node are (8, 6, 3), then the Euclidean distance is about 5.39 units of length. Then the propagation resistance distribution along this straight-line direction is obtained, which can sample multiple points in this direction and calculate the average propagation resistance of these points. For example, the propagation resistances of 5 points are 0.3, 0.4, 0.5, 0.4, and 0.3, respectively, and the average propagation resistance is 0.38. Multiply the Euclidean distance by the average propagation resistance to get the preliminary estimate value 5.39 x 0.38 ≈ 2.05.
[0128] To improve the estimation accuracy, local gradient correction is introduced. The gradient of the propagation resistance around the current node is calculated to reflect the trend of resistance change. For example, if the resistance gradient of the current node in the target direction is 0.05 (indicating that the resistance increases by 0.05 per unit distance), then the estimated value is corrected to 2.05 + 5.39 x 0.05 ≈ 2.32. This estimation method takes into account the distribution characteristics of the propagation resistance in space, making the estimation more accurate and improving the efficiency of the algorithm.
[0129] The node evaluation value is calculated based on the weighted sum of the actual propagation resistance and the estimated propagation resistance. In actual application, the actual propagation resistance weight can be set to 0.6 and the estimated propagation resistance weight to 0.4. For example, the actual propagation resistance of node B is 3.3 and the estimated propagation resistance is 2.32, then the node evaluation value is 0.6 x 3.3 + 0.4 x 2.32 ≈ 2.91. The node priority decreases with the increase of the node evaluation value, i.e. the smaller the evaluation value, the higher the priority. The reciprocal of the evaluation value can be directly used as the priority, for example, the priority of node B is 1 / 2.91 ≈ 0.34.
[0130] The nodes in the search queue are sorted based on their priorities, and the node with the highest priority is selected as the expansion node. In implementation, a priority queue data structure is used, and the node with the highest priority is taken out each time for expansion. For each expansion node, all its adjacent and unvisited nodes are found, and their actual propagation resistance, estimated propagation resistance, evaluation value, and priority are calculated and then added to the priority queue. The node expansion process is repeated until the target node is found or the queue is empty (indicating no path).
[0131] For example, assume that a risk propagation path from grid cell (1, 1) to (5, 5) is searched. Initially, the starting point (1, 1) is added to the queue, with an actual propagation resistance of 0, an estimated propagation resistance of 2.83, an evaluation value of 1.13, and a priority of 0.88. Expanding (1, 1) yields adjacent nodes (1, 2) and (2, 1), with evaluation values of 1.86 and 1.74, respectively, and priorities of 0.54 and 0.57, respectively, which are added to the queue. The node with the highest priority (2, 1) is taken out for expansion, yielding new nodes (2, 2) and (3, 1), and so on, until the target node (5, 5) is found or it is determined that no path exists.
[0132] After obtaining the minimum propagation resistance path, the characteristics of the path are analyzed. The spatial curvature of the path is calculated to represent the turning characteristics of the path. The spatial curvature can be calculated by the rate of change of the included angle formed by three consecutive points on the path. For example, the coordinates of three consecutive points on the path are (2, 1, 1), (2, 2, 1), and (3, 2, 1), respectively, and the included angle formed by these three points is about 45 degrees. The included angles of all consecutive three points on the path are calculated, and the average value is taken as the overall curvature characteristic of the path. The greater the curvature, the more frequent the turning of the path, and the more obvious the change in the direction of risk propagation. The cumulative propagation resistance distribution is calculated to represent the spatial decay law of risk propagation. The cumulative propagation resistance values of each node along the path are recorded, and a curve of the cumulative propagation resistance versus the path length is drawn. For example, the cumulative resistance of the starting point is 0, the cumulative resistance of the second point on the path is 0.4, the third point is 0.9, the fourth point is 1.5, and so on. By analyzing the shape and slope change of the curve, key areas and bottleneck points of risk propagation can be identified. For example, a region with a sudden increase in slope indicates a position where risk propagation is significantly hindered, which may be a key area for prevention and control.
[0133] The final risk propagation path is determined through the above analysis, which represents the channel through which risk is most likely to propagate in space. In practical applications, there may be multiple feasible risk propagation paths, and the path with the minimum cumulative propagation resistance can be selected as the main risk propagation path, while other alternative paths can be recorded as secondary risk propagation channels.
[0134] Figure 3For the performance comparison between the standard A* algorithm and the improved A* algorithm of the present application, from the aspect of path search efficiency, the standard A algorithm reaches 54.0%, while the improved A algorithm of the present application significantly improves to 72.0%, with an efficiency increase of about 18 percentage points. This shows that the improved algorithm can converge to the optimal solution more quickly when searching for the risk propagation path. In terms of risk identification accuracy, the present application improves the accuracy by 27 percentage points, thanks to the innovative method of converting risk propagation probability into propagation resistance and integrating it into the heuristic function, which enables the algorithm to more accurately identify the actual risk propagation channel. In terms of computing resource consumption, the present application also has obvious advantages. The improved A* algorithm proposed in the present scheme integrates the risk propagation characteristics into the path search process by constructing a propagation resistance matrix based on the risk propagation probability. Combined with the actual propagation resistance and the node evaluation mechanism for estimating the propagation resistance, the search efficiency and path quality are improved. By analyzing the spatial curvature of the minimum propagation resistance path and the cumulative propagation resistance distribution characteristics, the risk propagation path characteristics are accurately described, providing a reliable spatial basis for risk prevention and control.
[0135] In an optional embodiment, the step of outputting a risk assessment result based on the risk propagation path includes:
[0136] Calculating the risk level distribution of the grid cells based on the risk propagation path, the risk level distribution being determined by the segmented mapping of the cumulative propagation resistance, and the mapping threshold being dynamically adjusted according to the statistical distribution of historical risk event data;
[0137] Analyzing the risk variation characteristics of the risk propagation path, calculating the risk gradient and the risk accumulation between adjacent grid cells on the path, the risk gradient representing the spatial decay rate of risk propagation, and the risk accumulation representing the aggregation degree of risk on the path;
[0138] Generating a prevention and control deployment suggestion based on the risk propagation probability of the grid cells, the risk propagation path, and the available prevention and control resource quantity: calculating the comprehensive risk value of each grid cell on the risk propagation path, the comprehensive risk value being obtained by the weighted combination of the risk propagation probability and the cumulative propagation resistance; sorting the grid cells according to the comprehensive risk value, and determining the deployment priority of the grid cells according to the sorting result; determining the resource allocation quantity in order of priority from high to low based on the deployment priority of each grid cell and the available prevention and control resource quantity, and generating a prevention and control deployment suggestion containing the resource allocation quantity and the deployment priority;
[0139] Another implementation is to construct a resource allocation state vector, which contains the risk propagation probability, cumulative propagation resistance and current remaining prevention and control resource amount of each grid cell; calculate the objective function value of the resource allocation scheme, which is the weighted sum of the risk propagation probability of each node on the risk propagation path, and the weight coefficient is determined by the resource utilization efficiency and the risk influence range; iteratively optimize the resource allocation scheme, and select the allocation scheme that reduces the objective function value the most each time until the relative change rate of the objective function value is less than a preset change rate threshold; generate a prevention and control deployment suggestion according to the optimal resource allocation scheme, which includes the resource allocation amount and deployment priority of each grid cell.
[0140] For example, the core idea of risk assessment based on risk propagation path is to associate the risk level of a grid cell with its position and role in the propagation path. The nodes on the propagation path not only have their own risk attributes, but also have the function of risk transmission. For example, a grid cell located at the intersection of multiple propagation paths, even if its own risk level is not high, may have important significance in the overall risk prevention and control because of its key position. By analyzing the cumulative propagation resistance, risk gradient and risk aggregation degree on the propagation path, the key nodes and bottleneck positions of risk propagation can be identified, providing accurate targets for risk prevention and control.
[0141] The risk level distribution is determined by the segmented mapping of the cumulative propagation resistance, which maps the cumulative propagation resistance value to the predefined risk level. The risk level is divided into four levels: low risk, medium-low risk, medium-high risk and high risk. In the mapping process, the smaller the cumulative propagation resistance, the easier the risk propagation, and the higher the corresponding risk level. For example, the cumulative propagation resistance in the range of 0-1.5 is set as high risk, 1.5-3.0 as medium-high risk, 3.0-4.5 as medium-low risk, and greater than 4.5 as low risk. The mapping threshold is dynamically adjusted according to the statistical distribution of historical risk event data to ensure that the risk assessment result is consistent with historical experience. Analyze the risk events that occurred in the past year and count the event frequency in different cumulative propagation resistance intervals. For example, the statistical results show that 85% of high-risk events occur in the area with cumulative propagation resistance less than 1.2, so the upper threshold of high-risk can be adjusted to 1.2. If the statistics show that 80% of medium-high-risk events occur in the range of cumulative propagation resistance 1.2-2.8, the threshold range of medium-high-risk is adjusted accordingly. In this way, the risk level distribution is more in line with the actual situation. For a specific mall space, it may be calculated that the high-risk area accounts for 15% of the total area, the medium-high-risk area accounts for 25%, the medium-low-risk area accounts for 40%, and the low-risk area accounts for 20%.
[0142] The risk change characteristics of the risk transmission path are analyzed. The risk gradient between adjacent grid cells on the path is calculated to represent the spatial decay rate of risk transmission. The risk gradient is defined as the ratio of the risk level difference between adjacent grid cells to the distance between them. For example, the risk level of grid cell A is 3.8 (close to high risk), and the risk level of adjacent grid cell B is 3.2 (medium-high risk), and the distance between them is 2 units of length, then the risk gradient is (3.8-3.2) / 2=0.3, which means the risk level decreases by 0.3 per unit distance. The risk accumulation on the path is calculated to represent the degree of risk aggregation on the path. The risk accumulation can be calculated by weighted accumulation of the risk levels of each grid cell on the path, and the weight is inversely proportional to the cumulative transmission resistance. For example, a path contains 5 grid cells, with risk levels of 4.0, 3.8, 3.5, 3.0, and 2.5, and corresponding cumulative transmission resistances of 0.0, 0.8, 1.5, 2.2, and 3.0, respectively, then the risk accumulation can be calculated as 4.0x1.0+3.8x0.8+3.5x0.7+3.0x0.6+2.5x0.5≈10.13. The greater the risk accumulation, the higher the degree of risk aggregation on the path, and more attention should be paid to the prevention and control of the path.
[0143] The comprehensive risk value of each grid cell on the risk transmission path is calculated, which is obtained by weighted combination of risk transmission probability and cumulative transmission resistance. The weight of risk transmission probability is set to 0.7, and the weight of the complement of cumulative transmission resistance is set to 0.3. For example, the risk transmission probability of grid cell A is 0.75, and the cumulative transmission resistance is 1.2, then the comprehensive risk value is 0.7x0.75+0.3x(1-1.2 / 5)=0.68 (assuming the maximum cumulative transmission resistance is 5).
[0144] The grid cells are sorted according to the comprehensive risk value to determine the deployment priority of the grid cells. The higher the comprehensive risk value, the higher the deployment priority. For example, a public space contains 100 grid cells, and the top 10 grid cells with the highest comprehensive risk values are A(0.82), B(0.78), C(0.75), D(0.73), E(0.71), F(0.68), G(0.65), H(0.63), I(0.61), and J(0.58), respectively, and their deployment priorities are 1 to 10, respectively.
[0145] Based on the deployment priority and available prevention and control resource amount of each grid cell, the resource allocation amount is determined in the order of priority from high to low. Assuming that the total amount of available prevention and control resources is 100 units, each grid cell needs to allocate different amounts of resources according to its risk level and area. For example, a high-risk grid cell needs 1 unit of resource per square meter, a medium-high-risk needs 0.7 units, a medium-low-risk needs 0.4 units, and a low-risk needs 0.2 units. If grid cell A has an area of 20 square meters and a risk level of high risk, it needs to allocate 20 units of resources; grid cell B has an area of 25 square meters and a risk level of medium-high risk, it needs to allocate 17.5 units of resources, and so on. According to the priority order, the resources are allocated until the resources are exhausted. Finally, a prevention and control deployment suggestion containing the resource allocation amount and the deployment priority is generated.
[0146] Another implementation is to obtain a resource allocation scheme through iterative optimization. A resource allocation state vector is constructed, containing the risk propagation probability, cumulative propagation resistance, and current remaining prevention and control resource amount of each grid cell. In the initial state, the resource allocation amount of all grid cells is 0, and the remaining resources are the total resource amount.
[0147] The objective function value of the resource allocation scheme is calculated, which is the weighted sum of the risk propagation probability of each node on the risk propagation path, and the weight coefficient is determined by the resource utilization efficiency and the risk influence range. The resource utilization efficiency represents the risk reduction effect of unit resource in different grid cells, which can be obtained by historical data analysis. For example, investing 1 unit of resource in a high-risk area can reduce the risk propagation probability by 0.05, in a medium-high-risk area by 0.03, in a medium-low-risk area by 0.02, and in a low-risk area by 0.01. The risk influence range represents the number of other cells that may be affected by the risk event in the grid cell, which is determined by network topology analysis.
[0148] In each iteration, a certain amount of resources is allocated to each grid cell, and the change in the objective function value under different allocation schemes is calculated. The allocation scheme that reduces the objective function value the most is selected, and the resource allocation state is updated. For example, in the first iteration, allocating 10 units of resources to grid cell A reduces the objective function value by 0.15, to grid cell B by 0.12, and to grid cell C by 0.10, so the resources are allocated to grid cell A. The iteration process is repeated until the relative change rate of the objective function value is less than a preset change rate threshold (such as 0.01) or the resources are exhausted.
[0149] According to the optimal resource allocation scheme, a prevention and control deployment suggestion is generated, which includes the number of resource allocation and deployment priority of each grid cell. For example, the final scheme may allocate 30 units of resources to grid cell A (priority 1), 25 units to B (priority 2), 20 units to C (priority 3), 15 units to D (priority 4), and 10 units to E (priority 5). In specific implementation, the allocation scheme can also be further refined according to the resource type (such as manpower, equipment, technical measures, etc.).
[0150] The scheme designs a multi-level risk assessment framework based on the risk propagation path, and realizes the accurate quantification of the spatial distribution of risk through a dynamic mapping mechanism of risk level distribution. Combined with risk gradient and risk accumulation analysis, the spatial attenuation law of risk propagation is revealed.
[0151] In an optional implementation, the steps of risk identification and assessment include:
[0152] A comprehensive risk factor library is constructed, which includes static environmental risk factors, dynamic behavior risk factors, and historical event risk factors; the grid cells are initially risk scored based on the risk factor library, and the risk score is dynamically updated according to the spatio-temporal variation characteristics of the risk factors.
[0153] For example, the comprehensive risk factor library is divided into three categories: static environmental risk factors, dynamic behavior risk factors, and historical event risk factors. Static environmental risk factors mainly include spatial structure characteristics and fixed facility attributes. Spatial structure characteristics include high-difference areas (such as steps, slopes, staircases), narrow passages, blind corner areas, and low obstacles, etc., which are prone to cause risks of falling or collision for pedestrians. Fixed facility attributes include electrical equipment (such as sockets, distribution boxes), water source areas (such as pools, fountains), glass facilities (such as glass doors, glass railings), and high-hanging objects, etc., which have potential risks of electric shock, drowning, and fragment injury, etc.
[0154] Dynamic behavior risk factors focus on personnel activity characteristics and temporary events. Personnel activity characteristics include crowd density (more than 4 people per square meter as high risk), crowd flow speed (more than 1.5 meters per second as high risk), crowd composition (more than 40% of old people and children as high risk), and crowd emotional state (irritated and panicked emotions as high risk). Temporary events include equipment maintenance, temporary construction, promotional activities, and emergency evacuation drills, etc., which will temporarily change the way of space use and crowd distribution. For example, when a promotional activity is carried out in the central area of a shopping mall, the risk score of this area is increased from 2.3 (medium-low risk) to 4.1 (high risk).
[0155] The historical event risk factor is based on the record of past risk events, including the event type (such as congestion, stampede, fall, falling objects), event frequency, event severity, and event spatiotemporal pattern. For example, the escalator exit area of a certain shopping mall has experienced 3 minor congestion events and 1 moderate stampede event in the past year, based on these historical data, the historical event risk score of this area is 3.5 points (medium-high risk).
[0156] When the grid unit is initially scored, a weighted comprehensive scoring method is used. First, each type of risk factor is scored separately. The static environment risk score ranges from 0 to 5 points, and the score is based on the severity of environmental hazards and the consequences caused; the dynamic behavior risk score ranges from 0 to 5 points, which is determined according to real-time monitoring data and preset thresholds; the historical event risk score ranges from 0 to 5 points, which is calculated based on the frequency and severity of events. Then, according to the characteristics of different scenes, the weight coefficients of the three types of risk factors are set. For example, in a crowded shopping mall, the weight of static environment risk can be set to 0.3, the weight of dynamic behavior risk to 0.5, and the weight of historical event risk to 0.2.
[0157] The risk score is dynamically updated, with a minimum update time interval (such as 5 minutes) set. In each update cycle, dynamic behavior risk data is re-collected and the score is updated. At the same time, when an abnormal event (such as a sudden increase in crowd density, a significant emotional fluctuation, or a device failure) is detected, an immediate risk score update is triggered. For example, the initial comprehensive risk score of a certain grid unit is 2.8 points (medium-low risk), when the crowd density in this area increases from 2 people per square meter to 6 people per square meter in a short time, the dynamic behavior risk score increases from 2.0 points to 4.5 points, resulting in a comprehensive risk score of 3.7 points (medium-high risk).
[0158] In combination with time sensitivity analysis, risk peaks in different time periods are identified. By analyzing historical data, it is found that 12:00-13:00 and 17:30-19:00 on weekdays are typical peak periods of shopping mall risk, and 14:00-16:00 on holidays is another high-risk period. In these time periods, the update frequency of the risk score is automatically increased, and the weight coefficient of the dynamic behavior risk is adjusted, so as to more sensitively capture the risk changes.
[0159] The present scheme realizes comprehensive identification of potential risks in public spaces by constructing a multi-dimensional risk factor library. In combination with static environment characteristics, dynamic behavior patterns and historical event data, a dynamic updating mechanism of risk score is established, which can timely reflect the changes of risk state.
[0160] In a second aspect, the embodiment of the present application provides an electronic device, comprising:
[0161] a processor;
[0162] a memory for storing processor-executable instructions;
[0163] The processor is configured to invoke the instructions stored in the memory to perform the method described above.
[0164] In a third aspect, the present application provides a computer readable storage medium, having stored thereon computer program instructions, which when executed by a processor implement the method described above.
[0165] The present application can be a method, an apparatus, a system, and / or a computer program product. The computer program product can include a computer readable storage medium having computer readable program instructions stored therein, which, when executed by a processor, perform various aspects of the present application.
[0166] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for assessing dynamic risk networks in public spaces that integrates spatiotemporal characteristics, characterized in that: include: Obtain basic data of the public space to be evaluated, including spatial layout data, obstacle distribution data, pedestrian flow data, and historical risk event data; Based on the spatial layout data and obstacle distribution data, the public space is adaptively divided into grid units of different scales using an octree spatial segmentation algorithm. Establish a connection graph between grid cells, and use a graph neural network to calculate the risk propagation probability between grid cells by combining the pedestrian flow data and historical risk event data. An improved A* algorithm is used to calculate the risk propagation path. The improved A* algorithm constructs propagation resistance based on the risk propagation probability and integrates the propagation resistance into the heuristic function. Based on the risk propagation path, a risk assessment result is output, which includes the risk level distribution, risk changes along the propagation path, and prevention and control deployment recommendations.
2. The method according to claim 1, characterized in that, Based on the spatial layout data and obstacle distribution data, the steps of adaptively dividing the public space into grid cells of different scales using the octree spatial segmentation algorithm include: Feature extraction is performed on the spatial layout data to obtain spatial layout feature indicators, which include spatial connectivity and spatial functional density. Spatial connectivity represents the difficulty of passage between grid cells, and spatial functional density represents the functional complexity of grid cells. Based on the obstacle distribution data, multidimensional features of obstacles are calculated. These multidimensional features include obstacle density, space occupancy rate, and distribution uniformity. The obstacle density is the ratio of the total number of obstacle occupancy points to the grid cell volume. The space occupancy rate is the ratio of the actual volume occupied by obstacles to the grid cell volume. The distribution uniformity is the normalized value of the standard deviation of the distance from the obstacle to the grid center. The spatial layout feature index and the obstacle multidimensional feature are weighted and summed to obtain the comprehensive feature index; An octree segmentation decision function is constructed based on the comprehensive feature index. When the difference between the comprehensive feature index of a grid cell and the benchmark value is greater than the product of the basic segmentation threshold and the feature sensitivity factor, grid subdivision is triggered. When the difference between the comprehensive feature index of adjacent grid cells is less than or equal to the product of the basic segmentation threshold and the feature sensitivity factor, grid merging is triggered. The scale of the segmented grid is adjusted based on the constraints of the scale ratio of adjacent grids and the feature gradient until the feature change rate of the grid cell and the grid division difference are both less than the corresponding preset values.
3. The method according to claim 2, characterized in that, The steps for constructing an octree segmentation decision function based on the comprehensive feature index include: The output value of the octree segmentation decision function is the difference between the comprehensive feature index and the benchmark value minus the product of the feature sensitivity factor and the basic segmentation threshold; The benchmark value is calculated based on the feature distribution within the sliding time window. The benchmark value is obtained by a weighted combination of the spatiotemporal average and local maximum values of the comprehensive feature index. The weight coefficient of the weighted combination is determined by the ratio of the variance to the mean of the comprehensive feature index through an exponential function mapping. The feature sensitivity factor is determined by local feature gradient and global feature gradient. The local feature gradient is the sum of the rates of change of the comprehensive feature index in three spatial directions. The global feature gradient is the difference between the maximum and minimum values of the comprehensive feature index divided by the mean of the comprehensive feature index. The weight coefficients of the local feature gradient and the global feature gradient are determined by the entropy value of the feature distribution. A dynamic update equation for the octree partitioning decision function is constructed. The dynamic update equation includes a difference term between the decision function and the target decision value and a Laplace operator term for the decision function. The difference term is used to adjust the convergence speed of the decision function, and the Laplace operator term is used to maintain the spatial continuity of the decision function.
4. The method according to claim 1, characterized in that, The steps of establishing a connection graph between grid cells and calculating the risk propagation probability between grid cells using a graph neural network in conjunction with the pedestrian flow data and historical risk event data include: Establish a connection graph between grid cells, which includes grid cell nodes and connecting edges. The weight of the connecting edges is determined by a weighted combination of spatial distance and passage difficulty. Construct a comprehensive feature vector for the grid cell. The comprehensive feature vector includes static features, dynamic features, and historical features. The static features include the spatial scale, functional attributes, and obstacle distribution characteristics of the grid cell. The dynamic features are the real-time pedestrian flow data of the grid cell. The historical features are the historical risk event statistics of the grid cell. A graph neural network is constructed based on a multi-head attention mechanism. For each attention head, the attention coefficient between grid cell nodes is calculated. The attention coefficient is obtained by linearly transforming the comprehensive feature vector and passing it through the leakage rectified linear unit activation function. The attention coefficient is used to weight and aggregate the features of the neighboring nodes to obtain the updated node feature representation. The updated node feature representation is used to calculate the dynamic association strength between grid cells, whereby the dynamic association strength characterizes the ease or difficulty of risk propagation between grid cells. The risk propagation probability between grid cells is calculated. This risk propagation probability is obtained by combining the product of the basic propagation probability, the pedestrian flow impact factor, and the historical risk impact factor with the dynamic correlation strength.
5. The method according to claim 4, characterized in that, The steps involved in constructing a graph neural network based on a multi-head attention mechanism include: A multi-layer graph attention network is constructed, with each layer containing multiple attention heads. Each attention head independently learns different feature representations. For each attention head, a linear transformation is performed on the feature vector of the grid cell node using different weight matrices to generate a query vector, a key vector, and a value vector. An attention score is calculated based on the query vector and the key vector. The attention score is processed by the LeakyReLU activation function and then normalized by softmax to obtain the attention coefficient. A temporal gating unit is constructed, comprising an update gate and a reset gate. The update gate controls the retention ratio of historical features, while the reset gate adjusts the integration degree of features. An edge feature enhancement module is constructed, which calculates the spatial distance matrix and topological relationship matrix between grid cells. The distance matrix and topological relationship matrix are weighted and combined with attention scores to generate spatially enhanced attention coefficients. An adaptive loss function is constructed, comprising a prediction loss term and a spatial consistency loss term. The weights of the loss terms are dynamically adjusted based on the validation set performance. The prediction loss term uses the cross-entropy loss function to calculate the risk prediction error, while the spatial consistency loss term uses the Laplacian matrix to calculate the smoothness of the predicted values of adjacent grid cells.
6. The method according to claim 1, characterized in that, The improved A* algorithm is used to calculate the risk propagation path. The improved A* algorithm constructs propagation resistance based on the risk propagation probability and integrates the propagation resistance into a heuristic function. The steps include: Construct a propagation resistance matrix, where the value of each element in the propagation resistance matrix is the complement of the risk propagation probability between the corresponding grid cell pairs; The actual propagation resistance is calculated by summing the propagation resistance of the current node's parent node and the propagation resistance from the parent node to the current node. The spatial distance between nodes is multiplied by the corresponding propagation resistance as the propagation resistance increment. The estimated propagation resistance is calculated based on the Euclidean distance from the current node to the target node and the spatial distribution of the propagation resistance. The estimated propagation resistance is obtained by distance-weighted averaging and local gradient correction. The node evaluation value is calculated based on the weighted sum of the actual propagation resistance and the estimated propagation resistance. The node priority is calculated based on the node evaluation value, and the node priority decreases as the node evaluation value increases. The nodes in the search queue are sorted based on the node priority, and the node with the highest priority is selected as the expansion node. The node expansion is repeated until the target node is found, thus obtaining the path with the least propagation resistance. The characteristics of the path with minimum propagation resistance are analyzed, and the spatial curvature and cumulative propagation resistance distribution of the path are calculated. The spatial curvature represents the turning characteristics of the path, and the cumulative propagation resistance distribution represents the spatial attenuation law of risk propagation, thereby determining the risk propagation path.
7. The method according to claim 6, characterized in that, The steps for outputting risk assessment results based on the described risk propagation path, including risk level distribution, risk changes along the propagation path, and prevention and control deployment recommendations, include: The risk level distribution of the grid cells is calculated based on the risk propagation path. The risk level distribution is determined by a segmented mapping of the cumulative propagation resistance, and the mapping threshold is dynamically adjusted according to the statistical distribution of historical risk event data. The risk change characteristics of the risk propagation path are analyzed, and the risk gradient and risk accumulation between adjacent grid cells on the path are calculated. The risk gradient represents the spatial decay rate of risk propagation, and the risk accumulation represents the degree of risk aggregation on the path. The comprehensive risk value of each grid unit along the risk propagation path is calculated. The comprehensive risk value is obtained by weighted combination of risk propagation probability and cumulative propagation resistance. The grid units are sorted according to the comprehensive risk value, and the deployment priority of the grid units is determined according to the sorting result. Based on the deployment priority and available prevention and control resources of each grid unit, the resource allocation quantity is determined in descending order of priority, and a prevention and control deployment suggestion containing the resource allocation quantity and deployment priority is generated.
8. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Point, line and plane obstacle model construction-based station real-time emergency response path planning method
CN109900276A
KR20250060686A