A method and system for constructing an early warning model for urban safety risk assessment benchmark
By building a multi-level, dynamic urban safety risk assessment benchmark warning model and utilizing historical data and optimization algorithms, the scientific and real-time problems of the assessment methods in existing technologies have been solved, and a comprehensive, accurate assessment and real-time warning of urban safety risks have been achieved.
Patent Information
- Application Number
- CN202510309945.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-03-17
AI Technical Summary
Existing urban safety risk assessment methods rely on manual experience, lack scientificity and accuracy, cannot reflect dynamic changes in real time, and ignore the correlation between risks, resulting in incomplete and in-depth assessment results and a lack of real-time monitoring and early warning capabilities for potential risks.
Construct a multi-level, dynamic urban safety risk assessment benchmark warning model. By acquiring historical data, constructing a historical data matrix and risk data, determining the assessment benchmark value, using decision trees and clustering methods to classify data, and using Bayesian theorem and Gaussian process regression to optimize model parameters, risk valuation and warning are achieved.
It improves the scientificity and accuracy of the assessment, realizes comprehensive perception and real-time warning of urban safety risks, can greatly save resources, improve work efficiency, and adapt to the management needs of different urban safety risk assessment benchmarks.
Smart Images

Figure CN120197942B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of urban safety management, and in particular to a method and system for constructing an early warning model of an urban safety risk assessment benchmark. Background Art
[0002] With the acceleration of urbanization, urban safety risks are becoming increasingly complex and diversified. At the same time, the occurrence of these risks is often sudden, complex and chain-reactive. Therefore, urban safety risk assessment has become a key link in urban management and is of great significance to the city's economic development and social stability.
[0003] Traditional urban safety risk assessment methods often rely on manual experience and qualitative analysis, lacking scientificity and accuracy. At the same time, urban safety data is massive and complex. Most existing urban safety risk assessment systems use static risk assessment models, which cannot reflect the dynamic changes of urban safety risks in real time. In addition, these systems and assessment methods are mostly based on a single indicator or simple weighted calculation, which often ignores the correlation between risks, resulting in risk assessment results that are not comprehensive and in-depth. At the same time, existing systems mostly focus on post-analysis and lack the ability to monitor and warn of potential risks in real time. Therefore, the present invention proposes a method and system for constructing an early warning model for an urban safety risk assessment benchmark. By constructing a multi-level and dynamic assessment model, it can achieve comprehensive perception, accurate assessment and real-time early warning of urban safety risks, thereby overcoming the shortcomings of existing early warning models and realizing comprehensive management and dynamic optimization of urban safety risks. Summary of the Invention
[0004] The purpose of the present invention is to provide a method and system for constructing an early warning model for urban safety risk assessment benchmarks.
[0005] To achieve the above object, the present invention is implemented according to the following technical solutions:
[0006] The present invention comprises the following steps:
[0007] Acquire city safety historical data, update the city safety historical data using the city safety historical data, determine a risk threshold, and determine risk data based on the risk threshold;
[0008] Obtaining a historical data matrix based on the city safety historical data, and determining the assessment benchmark value based on the historical data matrix and the risk data;
[0009] constructing a city safety risk assessment benchmark early warning model based on the risk data and the risk threshold, obtaining a risk valuation from the city safety risk assessment benchmark early warning model, and optimizing the city safety risk assessment benchmark early warning model based on a risk valuation deviation;
[0010] Inputting the historical urban safety data to be assessed into the optimized urban safety risk assessment benchmark warning model to obtain different risk estimates, and issuing risk warnings based on the risk estimates and the assessment benchmark values;
[0011] The method for determining the evaluation benchmark value includes:
[0012] Obtaining the city safety data to be assessed, classifying the city safety data using a decision tree, filtering the classification results according to risk thresholds of different types of city safety data to obtain risk data, and extracting historical deviations of different types of data to obtain historical deviation vectors; the historical deviations are determined by historical maximum values, historical minimum values, and historical mean values;
[0013] Constructing a historical data matrix based on the city database; the column data of the historical data matrix is used to represent different statistical forms of the same type of data; the row data of the historical data matrix is used to represent different types of data in the same statistical form;
[0014] Sort the risk data by category to obtain a risk vector, compare the risk vector with the historical data matrix to obtain a historical difference matrix, determine the risk threshold vector based on the risk thresholds of different types of urban safety data, divide each row of the historical difference matrix by the corresponding element of the risk threshold vector to obtain a weighted difference coefficient matrix, and determine the assessment benchmark value for each category based on the weighted difference coefficient matrix and the historical deviation vector.
[0015] Furthermore, the method for updating city safety history data includes:
[0016] Obtain urban safety historical data, classify the data using clustering method, partition and store the urban safety historical data according to the classification results, and segment and store the urban safety historical data in the storage partitions according to the collection time;
[0017] Set up a preliminary screening window for urban safety data, determine the parameters for the preliminary screening window, and perform sliding updates on the historical urban safety data in the city database within the preliminary screening window according to the time series; the preliminary screening window parameters include the update frequency and the window length;
[0018] Determine the update weights of various types of data, and divide each type of data into first-class data and second-class data according to the data update weights;
[0019] Acquire newly generated city safety historical data, and determine a data preliminary screening result based on a data deviation between the newly generated city safety historical data and the mean of the city safety historical data in the city safety data preliminary screening window; the data preliminary screening result includes further determining whether the data is updated or not to update the historical data;
[0020] The steps to further determine the data update status include:
[0021] Calculate the category similarity between the newly generated urban safety history data and the urban safety history data in the category in different partitions, determine the urban safety history data to be replaced in the partition based on the category similarity threshold, and extract the corresponding urban safety history data group based on the timestamp;
[0022] Calculate the overall similarity between the newly generated urban safety history data and the urban safety history data in all categories, and determine the urban safety history data update group based on the overall similarity threshold. When the number of update groups is less than 3, the newly generated urban safety history data is stored in the city database according to the rules and does not replace the urban safety history data. Otherwise, add the time series weight to calculate the overall time series similarity, and use the newly generated urban safety history data to replace the urban safety history data with the lowest overall time series similarity.
[0023] Based on the updated city database, statistical methods are used to determine the risk threshold of urban safety data.
[0024] Furthermore, the method for calculating the overall similarity between the newly generated city safety history data and the city safety history data in all categories includes:
[0025] Distinguish between numerical data and semantic data, and set semantic evaluation sets , is the evaluation set element corresponding to the semantic evaluation of semantic data, To evaluate the degree, the semantic function Perform numerical conversion to obtain semantic numerical data, determine the semantic feature vector based on the semantic numerical data, and calculate the semantic similarity between the newly generated urban safety history data and the semantic feature vector corresponding to the urban safety history data. The expression is:
[0026] ,
[0027] in is the semantic feature vector of the newly generated urban safety history data With the Semantic feature vector of city safety history data The semantic similarity of for and The Manhattan distance of for With all The maximum Manhattan distance of for The word frequency length corresponding to the semantic data, for The word frequency length corresponding to the semantic data, For all The maximum length of the word frequency corresponding to the semantic data in ;
[0028] Calculate the numerical similarity between the newly generated urban safety history data and the corresponding numerical feature vectors of the urban safety history data. The expression is:
[0029] ,
[0030] in is the numerical feature vector of the newly generated urban safety historical data With the Numerical feature vector of city safety history data The numerical similarity of 、 are the numerical feature vectors of the newly generated urban safety history data No. The value of the numerical elements and the mean of all numerical elements, 、 are the numerical feature vectors of urban safety historical data No. The value of the numerical elements and the mean of all numerical elements, is the dimension of the feature vector;
[0031] The newly generated urban safety history data is calculated and The overall similarity of the safety history data of the group of cities is , is the similarity weight.
[0032] Furthermore, the method for determining the risk valuation includes:
[0033] Calculate the average value of the correlation between risk data of the same category and risk data of other categories to obtain the risk weight;
[0034] Calculate the deviation between different categories of risk data and the corresponding risk threshold to obtain risk deviation;
[0035] Calculate the prior probability of urban safety data based on the historical data matrix and related events, and use Bayesian theorem to calculate the corresponding risk probability based on different categories of risk data and prior probabilities. Calculate the prior probability of urban safety data based on the historical data matrix and related events, and use Bayesian theorem to calculate the corresponding risk probability based on risk data and prior probabilities.
[0036] The risk valuation of different types of urban safety data is determined based on risk weight, risk deviation and risk probability. The risk valuation function expression is:
[0037] ,
[0038] in For the Risk valuation of city-like safety data, For the The bias term of the risk valuation of city-like safety data is used to adjust the valuation benchmark. For the Risk weights for class risk data, For the The risk data The risk deviation between each data indicator and the corresponding risk threshold, For the The number of risk-related data indicators, For the The risk probability of class risk data, 、 For the The mean and baseline difference of the prior probability of historical safety data of similar cities, is the regularization coefficient, is a non-zero constant.
[0039] Furthermore, the method for optimizing the model includes:
[0040] The objective function of the early warning model optimization is determined according to the risk valuation deviation, and the expression is:
[0041] ,
[0042] in is the objective function optimized by the early warning model, For the Risk valuation of city-like safety data, For the The risk data The risk deviation between each data indicator and the corresponding risk threshold, For the The assessment benchmark value of the safety data of this type of city, is the number of categories of urban safety data, For the The number of indicators of urban safety data, is the regularization parameter, is the hyperparameter of the explanatory term weight, For the model parameters, is the number of model parameters;
[0043] Gaussian process regression is used to update the existing parameter information. The expression is:
[0044] ,
[0045] in For the function The mean value at is the input point corresponding to the risk valuation function, is the nonlinear mapping of input data in high-dimensional feature space, is the covariance matrix of the training data in the feature space after mapping, which is calculated by the adaptive kernel function. is the nonlinear mapping of training data in high-dimensional feature space, is the data Gaussian noise variance, is the identity matrix, is the training data target vector, For the function The covariance of is the adaptive kernel function, is the kernel function parameter, used for adaptive adjustment;
[0046] The most promising set of hyperparameters is selected for the next evaluation according to the acquisition function, which is expressed as:
[0047] ,
[0048] in Selecting benchmarks for hyperparameters, is the objective function threshold, are the proposed hyperparameters, To use hyperparameters The actual value of the objective function when The actual value of the objective function is The probability of the surrogate model when is the objective function value Less than threshold Hyperparameters The probability of occurrence, is the objective function value Less than threshold The probability of is the objective function value Greater than threshold Hyperparameters The probability of occurrence, is a weighting function that will use hyperparameters Time target value The corresponding probability terms are mapped into real weights;
[0049] Update parameters and evaluate hyperparameters, repeat the above steps until the value of the objective function optimized by the early warning model is minimized, stop updating hyperparameters, and output the urban safety risk assessment benchmark early warning model;
[0050] The urban safety data to be assessed is input into the optimized urban safety risk assessment benchmark warning model to obtain risk valuations and corresponding assessment benchmark values for different categories of urban safety data. Risk warnings are issued based on risk valuation deviations, and the corresponding risk data, risk thresholds, assessment benchmark values, and risk valuations are used as historical assessment sets, which are then stored in partitions.
[0051] Second, an early warning system for urban safety risk assessment benchmarks includes:
[0052] City database module: used for storing city safety historical data, calculating the similarity of the city safety historical data and updating the city safety historical data, determining a historical data matrix based on the city safety historical data, determining a risk threshold, and storing a historical assessment set;
[0053] Risk identification module: used to obtain urban safety data, and screen the urban safety data according to the risk threshold to determine risk data;
[0054] An assessment benchmark value module is configured to obtain a historical data matrix based on the city database, and determine the assessment benchmark value based on the historical data matrix and the risk data;
[0055] Risk Assessment Module: used to calculate risk weights, risk deviations and risk probabilities, and determine risk valuations for different categories of urban safety data based on the risk weights, risk deviations and risk probabilities
[0056] Model optimization module: used to optimize the urban safety risk assessment benchmark warning model according to the risk valuation deviation;
[0057] Risk management module: used to view and manage the city safety historical data and the historical assessment set, and to issue risk warnings based on the risk valuation and the assessment benchmark value.
[0058] The beneficial effects of the present invention are:
[0059] The present invention is a method and system for constructing an early warning model for urban safety risk assessment benchmarks. Compared with the prior art, the present invention has the following technical effects:
[0060] The present invention solves the problems of data dispersion and update lag by constructing a unified city database and integrating multi-source data, thereby improving the data integration capability of the early warning model; the present invention dynamically determines the assessment benchmark value based on the historical data matrix and risk data, thereby improving the scientific nature and accuracy of the assessment; the present invention ensures the consistency of the assessment results with the actual risks through risk valuation deviation feedback and dynamic optimization of model parameters; in addition, a risk early warning layer is constructed to realize real-time monitoring and early warning of potential risks, which can greatly save resources and improve work efficiency, realize the management of urban safety risk assessment benchmarks, and can comprehensively, objectively and accurately obtain the safety risk status of urban areas, provide precise scientific guidance for urban safety risk management, and can adapt to the early warning systems of different urban safety risk assessment benchmarks and the terminal management needs of an early warning system of an urban safety risk assessment benchmark for different users, and has a certain degree of universality. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 This is a flowchart of the steps of a method for constructing an early warning model for a city safety risk assessment benchmark according to the present invention. DETAILED DESCRIPTION
[0062] The present invention will be further described below through specific examples. The illustrative examples and descriptions of the present invention are used to explain the present invention but are not intended to limit the present invention.
[0063] The present invention provides a method and system for constructing an early warning model for a city safety risk assessment benchmark, comprising the following steps:
[0064] like Figure 1 As shown, in this embodiment, the following steps are included:
[0065] Acquire city safety historical data, update the city safety historical data using the city safety historical data, determine a risk threshold, and determine risk data based on the risk threshold;
[0066] Obtaining a historical data matrix based on the city safety historical data, and determining the assessment benchmark value based on the historical data matrix and the risk data;
[0067] constructing a city safety risk assessment benchmark early warning model based on the risk data and the risk threshold, obtaining a risk valuation from the city safety risk assessment benchmark early warning model, and optimizing the city safety risk assessment benchmark early warning model based on a risk valuation deviation;
[0068] Inputting the historical urban safety data to be assessed into the optimized urban safety risk assessment benchmark warning model to obtain different risk estimates, and issuing risk warnings based on the risk estimates and the assessment benchmark values;
[0069] The method for determining the evaluation benchmark value includes:
[0070] Obtaining the city safety data to be assessed, classifying the city safety data using a decision tree, filtering the classification results according to risk thresholds of different types of city safety data to obtain risk data, and extracting historical deviations of different types of data to obtain historical deviation vectors; the historical deviations are determined by historical maximum values, historical minimum values, and historical mean values;
[0071] Constructing a historical data matrix based on the city database; the column data of the historical data matrix is used to represent different statistical forms of the same type of data; the row data of the historical data matrix is used to represent different types of data in the same statistical form;
[0072] Sort the risk data by category to obtain a risk vector, compare the risk vector with the historical data matrix to obtain a historical difference matrix, determine the risk threshold vector based on the risk thresholds of different types of urban safety data, divide each row of the historical difference matrix by the corresponding element of the risk threshold vector to obtain a weighted difference coefficient matrix, and determine the assessment benchmark value for each category based on the weighted difference coefficient matrix and the historical deviation vector.
[0073] In this embodiment, the method for updating city safety history data includes:
[0074] Obtain urban safety historical data, classify the data using clustering method, partition and store the urban safety historical data according to the classification results, and segment and store the urban safety historical data in the storage partitions according to the collection time;
[0075] Set up a preliminary screening window for urban safety data, determine the parameters for the preliminary screening window, and perform sliding updates on the historical urban safety data in the city database within the preliminary screening window according to the time series; the preliminary screening window parameters include the update frequency and the window length;
[0076] Determine the update weights of various types of data, and divide each type of data into first-class data and second-class data according to the data update weights;
[0077] Taking a city's urban database as an example, the classification results and corresponding weights are 0.3 for natural disasters, 0.25 for accidents and disasters, 0.2 for public health, 0.15 for social security, and 0.1 for infrastructure. Natural disaster and accident and disaster urban safety historical data are classified as first-class data, while public health, social security, and infrastructure are classified as second-class data.
[0078] Acquire newly generated urban safety historical data, calculate the first-category deviation of the newly generated urban safety historical data and the mean of the urban safety historical data in the urban safety data preliminary screening window corresponding to the first-category data, and further determine the data update status when the first-category deviation is greater than the first-category deviation threshold; conversely, calculate the second-category deviation of the newly generated urban safety historical data and the mean of the urban safety historical data in the urban safety data preliminary screening window corresponding to the second-category data, and further determine the data update status when the second-category deviation is greater than the second-category deviation threshold; otherwise, do not update the historical data;
[0079] Take the newly generated urban safety historical data of a certain city as an example: Category 1 data: 1. Natural disasters (Category 3 typhoon, typhoon impact covering 60% of the urban area, daily rainfall of 250mm, riverbed height increased by 6m, number of flooded areas 15, flood depth 0.3m), 2. Accidents and disasters (1 chemical leak in an industrial area); Category 2 data: 1. Public health (no special events), 2. Infrastructure (5 old building collapses, 10 urban elevator malfunctions, 20 power malfunctions, 2 gas leaks and explosions, 1 bridge malfunction, 5 water supply and drainage network malfunctions, normal traffic congestion index, normal number of emergency service calls, 50% increase in mobile network traffic, 1 public facility damage), 3. Public safety (10 public transportation malfunctions, 15 thefts). The first-category deviation of the newly generated urban safety historical data and the mean of the urban safety historical data in the urban safety data initial screening window corresponding to the first-category data is greater than the first-category deviation threshold, so further determination of data update is made.
[0080] The steps to further determine the data update status include:
[0081] Calculate the category similarity between the newly generated urban safety history data and the urban safety history data in the category in different partitions, determine the urban safety history data to be replaced in the partition based on the category similarity threshold, and extract the corresponding urban safety history data group based on the timestamp;
[0082] Calculate the overall similarity between the newly generated urban safety history data and the urban safety history data in all categories, and determine the urban safety history data update group based on the overall similarity threshold. When the number of update groups is less than 3, the newly generated urban safety history data is stored in the city database according to the rules and does not replace the urban safety history data. Otherwise, add the time series weight to calculate the overall time series similarity, and use the newly generated urban safety history data to replace the urban safety history data with the lowest overall time series similarity.
[0083] Based on the updated city database, statistical methods are used to determine the risk threshold of urban safety data.
[0084] In this embodiment, the method for calculating the overall similarity between the newly generated city safety history data and the city safety history data in all categories includes:
[0085] Distinguish between numerical data and semantic data, and set semantic evaluation sets , is the evaluation set element corresponding to the semantic evaluation of semantic data, To evaluate the degree, the semantic function Perform numerical conversion to obtain semantic numerical data, the expression is:
[0086] ,
[0087] in is a semantic function, is the semantic coefficient, and its value range is determined by fitting;
[0088] Determine the semantic feature vector based on the semantic numerical data, and calculate the semantic similarity between the newly generated urban safety history data and the semantic feature vector corresponding to the urban safety history data. The expression is:
[0089] ,
[0090] in is the semantic feature vector of the newly generated urban safety history data With the Semantic feature vector of city safety history data The semantic similarity of for and The Manhattan distance of for With all The maximum Manhattan distance of for The word frequency length corresponding to the semantic data, for The word frequency length corresponding to the semantic data, For all The maximum length of the word frequency corresponding to the semantic data in ;
[0091] Calculate the numerical similarity between the newly generated urban safety history data and the corresponding numerical feature vectors of the urban safety history data. The expression is:
[0092] ,
[0093] in is the numerical feature vector of the newly generated urban safety historical data With the Numerical feature vector of city safety history data The numerical similarity of 、 are the numerical feature vectors of the newly generated urban safety history data No. The value of the numerical elements and the mean of all numerical elements, 、 are the numerical feature vectors of urban safety historical data No. The value of the numerical elements and the mean of all numerical elements, is the dimension of the feature vector;
[0094] The newly generated city safety history data is calculated and The overall similarity of the safety history data of the group of cities is , is the similarity weight;
[0095] In the actual evaluation, taking the newly generated urban safety historical data of a certain city as an example, the category similarity between different types of newly generated urban safety historical data and the corresponding urban safety historical data (natural disaster category, accident and disaster category, public safety category, public health category and infrastructure category) was calculated. Urban safety historical data with category similarity less than 0.7 were screened, and 3, 2, 4, 1, and 5 groups of urban safety historical data to be replaced were obtained respectively. Other categories of data of the corresponding urban safety historical data were extracted according to the data timestamps to obtain 15 groups of complete urban safety historical data. Among them, 6 groups of data had repeated timestamps, so 9 groups of complete urban safety historical data were obtained by matching.
[0096] Calculate the overall similarity between the newly generated urban safety history data and the feature vectors of the nine sets of complete urban safety history data respectively. Take the overall similarity calculation of one pair of data as an example:
[0097] Taking the maximum Manhattan distance as 10, the word frequency length as 4, and the maximum word frequency length as 6, the semantic similarity between the newly generated semantic feature vector of urban safety history data [−0.058, −0.050, −0.033, 0.000, 1.161, 1.143, 1.386, 1.882] and the semantic feature vector of urban safety history data [−0.058, −0.050, −0.033, 0.000, 1.161, 1.143, 1.386, 1.882] is calculated to be 0.667;
[0098] The numerical similarity between the newly generated urban safety history data numerical feature vector [3.5, 12, 5.8, 23, 45, 6.7, 8.9, 10, 2.3, 34, 56, 7.8, 9.0, 1.2, 4.5, 67, 8.9, 10, 23, 45] and the urban safety history data numerical feature vector [46, 68, 9.2, 12, 24, 5.0, 1.5, 8.0, 9.5, 35, 57, 7.2, 9.3, 11, 2.5, 6.0, 15, 3.6, 24, 46] is 0.354;
[0099] Get similarity weight is 0.5, the overall similarity of the data pair is 0.511, and the overall similarities of the feature vectors of the newly generated urban safety history data and the remaining 8 groups of urban safety history data calculated by this method are 0.72, 0.53, 0.78, 0.68, 0.81, 0.36, 0.45, and 0.74 respectively;
[0100] Five groups of urban safety history data to be replaced were obtained by screening urban safety history data with an overall similarity less than 0.7. These five groups of urban safety history data to be replaced were sorted according to timestamps (0.45, 0.511, 0.53, 0.36, and 0.68), and assigned time series weights of 0.8, 0.85, 0.9, 0.95, and 1, respectively. The overall time series similarities of 0.36, 0.43435, 0.477, 0.342, and 0.68 were calculated based on the time series weights and overall similarities. The newly generated urban safety history data were used to replace the urban safety history data with an overall time series similarity of 0.342.
[0101] In this embodiment, the method for determining the evaluation benchmark value includes:
[0102] Obtaining the city safety data to be assessed, classifying the city safety data using a decision tree, filtering the classification results according to risk thresholds of different types of city safety data to obtain risk data, and extracting historical deviations of different types of data to obtain historical deviation vectors; the historical deviations are determined by historical maximum values, historical minimum values, and historical mean values;
[0103] A historical data matrix is constructed based on the city database; the column data of the historical data matrix is used to represent different statistical forms of the same type of data; the row data of the historical data matrix is used to represent different types of data in the same statistical form; the risk data is sorted by category to obtain a risk vector, the risk vector is compared with the historical data matrix to obtain a historical difference matrix, the risk threshold vector is determined based on the risk thresholds of different types of urban safety data, each row element of the historical difference matrix is divided by the corresponding element of the risk threshold vector to obtain a weighted difference coefficient matrix, and the assessment benchmark value of each category is determined based on the weighted difference coefficient matrix and the historical deviation vector;
[0104] In the actual assessment, statistical methods were used to determine the risk thresholds for urban safety data as follows: 1. Natural disasters (level 1 typhoon, typhoon impact covering 10% of the urban area, daily rainfall of 50 mm, riverbed height increased by 1.5 m, number of flooded areas 3, and flood depth of 0.1 m); 2. Accidents and disasters (no accident or disaster events); 3. Public health (no special events); 4. Infrastructure (no old building collapse events, 2 urban elevator malfunctions, 5 power malfunctions, no gas leaks and explosions, no bridge malfunctions, 1 water supply and drainage network malfunction, normal traffic congestion index, normal number of emergency service calls, 20% increase in mobile network traffic, and 1 public facility damage); 5. Public safety (3 public transportation malfunctions, 3 thefts);
[0105] The newly generated urban safety historical data is used as the input urban safety data. When constructing the historical data matrix, the column data of the historical data matrix is used to represent different statistical forms of the same type of data. Different statistical forms include median, mode, quartiles, mean, maximum, minimum, range, skewness and kurtosis. Risk data is screened and the assessment benchmark values of each category of data are obtained from the historical data matrix: 3.5, 3.5, 3, 3, 3.
[0106] In this embodiment, the method for determining the risk estimation includes:
[0107] Calculate the mean of the correlation between risk data of the same category and risk data of other categories to obtain the risk weight;
[0108] Calculate the deviation between different categories of risk data and the corresponding risk threshold to obtain risk deviation;
[0109] Calculate the prior probability of urban safety data based on the historical data matrix and related events, and use Bayesian theorem to calculate the corresponding risk probability based on different categories of risk data and prior probabilities. Calculate the prior probability of urban safety data based on the historical data matrix and related events, and use Bayesian theorem to calculate the corresponding risk probability based on risk data and prior probabilities.
[0110] The risk valuation of different types of urban safety data is determined based on risk weight, risk deviation and risk probability. The risk valuation function expression is:
[0111] ,
[0112] in For the Risk valuation of city-like safety data, For the Bias item for risk valuation of city-like safety data, used to adjust the valuation benchmark, For the Risk weights for class risk data, For the The risk data The risk deviation between each data indicator and the corresponding risk threshold, For the The number of risk-related data indicators, For the The risk probability of class risk data, 、 For the The mean and baseline difference of the prior probability of the historical safety data of similar cities, is the regularization coefficient, is a non-zero constant;
[0113] In the actual assessment, the risk weights of various types of data (natural disasters, accidents and disasters, public health, infrastructure, and public safety) were obtained by calculating the mean of data correlation: 0.4, 0.2, 0.1, 0.2, and 0.1; the mean and benchmark differences of the prior probabilities of urban safety data calculated based on the historical data matrix and related events were 0.22, 0.18, 0.20, 0.24, and 0.19 and 0.03, 0.04, 0.03, 0.02, and 0.03, respectively; the risk probabilities calculated based on Bayes' theorem were: 0.4, 0.35, 0.33, 0.33, and 0.3; the bias terms of risk valuation were 5, 4, 3, 3, and 3, respectively, and the risk valuations calculated based on the risk valuation function were: 5.898, 4.2, 3, 3.5, and 3.2.
[0114] In this embodiment, the method for optimizing the model includes:
[0115] The objective function of the early warning model optimization is determined according to the risk valuation deviation, and the expression is:
[0116] ,
[0117] in is the objective function optimized by the early warning model, For the Risk valuation of city-like safety data, For the The risk data The risk deviation between each data indicator and the corresponding risk threshold, For the The assessment benchmark value of the safety data of this type of city, is the number of categories of urban safety data, For the The number of indicators of urban safety data, is the regularization parameter, is the hyperparameter of the explanatory term weight, For the model parameters, is the number of model parameters;
[0118] Gaussian process regression is used to update the existing parameter information. The expression is:
[0119] ,
[0120] in For the function The mean value at is the input point corresponding to the risk valuation function, is the nonlinear mapping of input data in high-dimensional feature space, is the covariance matrix of the training data in the feature space after mapping, which is calculated by the adaptive kernel function. is the nonlinear mapping of training data in high-dimensional feature space, is the data Gaussian noise variance, is the identity matrix, is the training data target vector, For the function The covariance of is the adaptive kernel function, is the kernel function parameter, used for adaptive adjustment;
[0121] The most promising set of hyperparameters is selected for the next evaluation according to the acquisition function, which is expressed as:
[0122] ,
[0123] in Selecting benchmarks for hyperparameters, is the objective function threshold, are the proposed hyperparameters, To use hyperparameters The actual value of the objective function when The actual value of the objective function is The probability of the surrogate model when is the objective function value Less than threshold Hyperparameters The probability of occurrence, is the objective function value Less than threshold The probability of is the objective function value Greater than threshold Hyperparameters The probability of occurrence, is a weighting function that will use hyperparameters Time target value The corresponding probability terms are mapped into real weights;
[0124] Update parameters and evaluate hyperparameters, repeat the above steps until the value of the objective function optimized by the early warning model is minimized, stop updating hyperparameters, and output the urban safety risk assessment benchmark early warning model;
[0125] Input the city safety data to be assessed into the optimized city safety risk assessment benchmark early warning model to obtain risk valuations and corresponding assessment benchmark values for different categories of city safety data. Risk early warnings are issued based on risk valuation deviations. The corresponding risk data, risk thresholds, assessment benchmark values, and risk valuations are used as historical assessment sets, and the historical assessment sets are stored in partitions.
[0126] In actual evaluation, the hyperparameters of the explanatory term weights is 0.05, the regularization parameter The target value is 0.1, and the evaluation benchmark values are 6, 4, 3, 3.5, and 3.2. Based on the above data, the current objective function is calculated to be 0.217. Gaussian process regression is used to update the existing parameter information. When the update number is 30, the objective function is 0.112. When the update number is 45, 46, and 47, the objective function is 0.051, 0.055, and 0.056. The parameters and evaluation hyperparameters updated for the 45th time are selected to output the urban safety risk assessment benchmark warning model.
[0127] The historical safety data of the city to be evaluated was input into the optimized urban safety risk assessment benchmark warning model to obtain different risk valuations of 5.69, 4.33, 4.7, 3.5, and 3.0. The corresponding natural disaster and infrastructure categories were lower than the corresponding assessment benchmark values, and natural disaster and infrastructure risk warnings were issued.
[0128] Second, an early warning system for urban safety risk assessment benchmarks includes:
[0129] City database module: used for storing city safety historical data, calculating the similarity of the city safety historical data and updating the city safety historical data, determining a historical data matrix based on the city safety historical data, determining a risk threshold, and storing a historical assessment set;
[0130] Risk identification module: used to obtain urban safety data, and screen the urban safety data according to the risk threshold to determine risk data;
[0131] An assessment benchmark value module is configured to obtain a historical data matrix based on the city database, and determine the assessment benchmark value based on the historical matrix and the risk data;
[0132] Risk Assessment Module: used to calculate risk weights, risk deviations and risk probabilities, and determine risk valuations for different categories of urban safety data based on the risk weights, risk deviations and risk probabilities
[0133] Model optimization module: used to optimize the urban safety risk assessment benchmark warning model according to the risk valuation deviation;
[0134] Risk management module: used to view and manage the city safety historical data and the historical assessment set, and to issue risk warnings based on the risk valuation and the assessment benchmark value.
[0135] In one implementation example, based on the technical requirements of each risk assessment link in the labeled technical elements, the output requirements of the risk assessment model and the content and format requirements of the risk assessment report are refined. In combination with the risk assessment process, a model management shell is proposed for the digital benchmark to connect with the risk assessment mathematical model. Based on the terminology and knowledge / rules in the benchmarked technical elements, the knowledge and rules required for the risk assessment mathematical model are determined, and a knowledge (rule) management shell for the digital benchmark to the risk assessment knowledge and rules is proposed.
[0136] Establish the docking relationship between the model management shell, knowledge / rule management shell and digital benchmark, and realize the organic integration of digital benchmark, modular model and extension knowledge base based on the benchmark information model reorganization method. The management shell consists of two parts: directory list and component manager.
[0137] Taking the model management shell as an example, the directory list establishes the unique identification and basic description of the management shell and the model; the component manager regards the model as a component and standardizes the communication, information and functional behavior of the model.
[0138] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for constructing an early warning model for urban safety risk assessment benchmark, characterized in that: The following steps are involved: S1. Acquire city safety historical data, use the city safety historical data to update the city safety historical data, determine a risk threshold, and determine risk data based on the risk threshold; S2. Obtain a historical data matrix based on the city safety historical data, and determine an assessment benchmark value based on the historical data matrix and the risk data; S3. Constructing a city safety risk assessment benchmark warning model based on the risk data and the risk threshold, obtaining a risk valuation using the city safety risk assessment benchmark warning model, and optimizing the city safety risk assessment benchmark warning model based on a risk valuation deviation; S4. Inputting the historical urban safety data to be assessed into the optimized urban safety risk assessment benchmark warning model to obtain different risk estimates, and issuing risk warnings based on the risk estimates and the assessment benchmark values; The method for determining the evaluation benchmark value includes: Obtaining the city safety data to be assessed, classifying the city safety data using a decision tree, filtering the classification results according to risk thresholds of different types of city safety data to obtain risk data, and extracting historical deviations of different types of data to obtain historical deviation vectors; the historical deviations are determined by historical maximum values, historical minimum values, and historical mean values; Constructing a historical data matrix based on the city database; the column data of the historical data matrix is used to represent different statistical forms of the same type of data; the row data of the historical data matrix is used to represent different types of data in the same statistical form; Sort the risk data by category to obtain a risk vector, compare the risk vector with the historical data matrix to obtain a historical difference matrix, determine the risk threshold vector based on the risk thresholds of different types of urban safety data, divide each row of the historical difference matrix by the corresponding element of the risk threshold vector to obtain a weighted difference coefficient matrix, and determine the assessment benchmark value for each category based on the weighted difference coefficient matrix and the historical deviation vector.
2. The method for constructing an early warning model for an urban safety risk assessment benchmark according to claim 1, characterized in that: The method for updating city safety historical data includes: Obtain urban safety historical data, classify the data using clustering method, partition and store the urban safety historical data according to the classification results, and segment and store the urban safety historical data in the storage partitions according to the collection time; Set up a preliminary screening window for urban safety data, determine the parameters for the preliminary screening window, and perform sliding updates on the historical urban safety data in the city database within the preliminary screening window according to the time series; the preliminary screening window parameters include the update frequency and the window length; Determine the update weights of various types of data, and divide each type of data into first-class data and second-class data according to the data update weights; Acquire newly generated city safety historical data, and determine a data preliminary screening result based on a data deviation between the newly generated city safety historical data and the mean of the city safety historical data in the city safety data preliminary screening window; the data preliminary screening result includes further determining whether the data is updated or not to update the historical data; The steps to further determine the data update status include: Calculate the category similarity between the newly generated urban safety history data and the urban safety history data in the category in different partitions, determine the urban safety history data to be replaced in the partition based on the category similarity threshold, and extract the corresponding urban safety history data group based on the timestamp; Calculate the overall similarity between the newly generated urban safety history data and the urban safety history data in all categories, and determine the urban safety history data update group based on the overall similarity threshold. When the number of update groups is less than 3, the newly generated urban safety history data is stored in the city database according to the rules and does not replace the urban safety history data. Otherwise, add the time series weight to calculate the overall time series similarity, and use the newly generated urban safety history data to replace the urban safety history data with the lowest overall time series similarity. Based on the updated city database, statistical methods are used to determine the risk threshold of urban safety data.
3. The method for constructing an early warning model for an urban safety risk assessment benchmark according to claim 2, characterized in that: The method for calculating the overall similarity between the newly generated city safety history data and the city safety history data in all categories includes: Distinguish between numerical data and semantic data, and set semantic evaluation sets , is the evaluation set element corresponding to the semantic evaluation of semantic data, To evaluate the degree, the semantic function Perform numerical conversion to obtain semantic numerical data, determine the semantic feature vector based on the semantic numerical data, and calculate the semantic similarity between the newly generated urban safety history data and the semantic feature vector corresponding to the urban safety history data. The expression is: , in is the semantic feature vector of the newly generated urban safety history data With the Semantic feature vector of city safety history data The semantic similarity of for and The Manhattan distance of for With all The maximum Manhattan distance of for The word frequency length corresponding to the semantic data, for The word frequency length corresponding to the semantic data, For all The maximum length of the word frequency corresponding to the semantic data in ; Calculate the numerical similarity between the newly generated urban safety history data and the corresponding numerical feature vectors of the urban safety history data. The expression is: , in is the numerical feature vector of the newly generated urban safety historical data With the Numerical feature vector of city safety history data The numerical similarity of 、 are the numerical feature vectors of the newly generated urban safety history data No. The value of the numerical elements and the mean of all numerical elements, 、 are the numerical feature vectors of urban safety historical data No. The value of the numerical elements and the mean of all numerical elements, is the dimension of the feature vector; The newly generated city safety history data is calculated and The similarity of the safety history data of the group of cities is , is the similarity weight.
4. The method for constructing an early warning model for an urban safety risk assessment benchmark according to claim 1, characterized in that: The method for determining the risk estimate comprises: Calculate the mean of the correlation between risk data of the same category and risk data of other categories to obtain the risk weight; Calculate the deviation between different categories of risk data and the corresponding risk threshold to obtain risk deviation; Calculate the prior probability of urban safety data based on the historical data matrix and related events, and use Bayesian theorem to calculate the corresponding risk probability based on different categories of risk data and prior probabilities. Calculate the prior probability of urban safety data based on the historical data matrix and related events, and use Bayesian theorem to calculate the corresponding risk probability based on risk data and prior probabilities. The risk valuation of different types of urban safety data is determined based on risk weight, risk deviation and risk probability. The risk valuation function expression is: , in For the Risk valuation of city-like safety data, For the The bias term of the risk valuation of city-like safety data is used to adjust the valuation benchmark. For the Risk weights for class risk data, For the The risk data The risk deviation between each data indicator and the corresponding risk threshold, For the The number of risk-related data indicators, For the The risk probability of risk-like data, 、 For the The mean and baseline difference of the prior probability of historical safety data of similar cities, is the regularization coefficient, is a non-zero constant.
5. The method for constructing an early warning model for an urban safety risk assessment benchmark according to claim 1, characterized in that: Methods for optimizing the model include: The objective function of the early warning model optimization is determined according to the risk valuation deviation, and the expression is: , in is the objective function optimized by the early warning model, For the Risk valuation of city-like safety data, For the The risk data The risk deviation between each data indicator and the corresponding risk threshold, For the The assessment benchmark value of the safety data of this type of city, is the number of categories of urban safety data, For the The number of indicators of urban safety data, is the regularization parameter, is the hyperparameter of the explanatory term weight, For the model parameters, is the number of model parameters; Gaussian process regression is used to update the existing parameter information. The expression is: , in For the function The mean value at is the input point corresponding to the risk valuation function, is the nonlinear mapping of input data in high-dimensional feature space, is the covariance matrix of the training data in the feature space after mapping, which is calculated by the adaptive kernel function. is the nonlinear mapping of training data in high-dimensional feature space, is the data Gaussian noise variance, is the identity matrix, is the training data target vector, For the function The covariance of is the adaptive kernel function, is the kernel function parameter, used for adaptive adjustment; The most promising set of hyperparameters is selected for the next evaluation according to the acquisition function, which is expressed as: , in Selecting benchmarks for hyperparameters, is the objective function threshold, are the proposed hyperparameters, To use hyperparameters The actual value of the objective function when The actual value of the objective function is The probability of the surrogate model when is the objective function value Less than threshold Hyperparameters The probability of occurrence, is the objective function value Less than threshold The probability of is the objective function value Greater than threshold Hyperparameters The probability of occurrence, is a weighting function that will use hyperparameters Time target value The corresponding probability terms are mapped into real weights; Update parameters and evaluate hyperparameters, repeat the above steps until the value of the objective function optimized by the early warning model is minimized, stop updating hyperparameters, and output the urban safety risk assessment benchmark early warning model; The urban safety data to be assessed is input into the optimized urban safety risk assessment benchmark warning model to obtain risk valuations and corresponding assessment benchmark values for different categories of urban safety data. Risk warnings are issued based on risk valuation deviations, and the corresponding risk data, risk thresholds, assessment benchmark values, and risk valuations are used as historical assessment sets, which are then stored in partitions.
6. An early warning system for urban safety risk assessment benchmark, used to implement the method according to any one of claims 1 to 5, characterized in that: include: City database module: used for storing city safety historical data, calculating the similarity of the city safety historical data and updating the city safety historical data, determining a historical data matrix based on the city safety historical data, determining a risk threshold, and storing a historical assessment set; Risk identification module: used to obtain urban safety data, and screen the urban safety data according to the risk threshold to determine risk data; An assessment benchmark value module is configured to obtain a historical data matrix based on the city database, and determine the assessment benchmark value based on the historical data matrix and the risk data; Risk Assessment Module: used to calculate risk weights, risk deviations and risk probabilities, and determine risk valuations for different categories of urban safety data based on the risk weights, risk deviations and risk probabilities Model optimization module: used to optimize the urban safety risk assessment benchmark warning model according to the risk valuation deviation; Risk management module: used to view and manage the city safety historical data and the historical assessment set, and to issue risk warnings based on the risk valuation and the assessment benchmark value.
Citation Information
Patent Citations
Battery state-of-charge estimation method and system and electronic equipment
CN118641975A
Urban safety risk assessment method and system based on digital standard
CN119398525A