Smart campus safety management method and system based on big data analysis

The smart campus security management system, which utilizes big data analytics, achieves spatiotemporal alignment of multi-source data and dynamic threshold generation, solving the data fusion and response lag problems of existing systems and improving the initiative and accuracy of campus security management.

CN121190283APending Publication Date: 2025-12-23CHONGQING YUYI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511361582.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-23
Publication Date
2025-12-23

AI Technical Summary

Technical Problem

Existing smart campus security management systems cannot effectively integrate multi-dimensional data, resulting in blind spots in the identification of security risks. Static threshold rules cannot adapt to complex scenario changes and lack the ability to proactively predict risks, only able to respond after the fact.

Method used

The smart campus security management system based on big data analytics achieves spatiotemporal alignment of multi-source data, generation of dynamic thresholds, and risk prediction through data processing and extraction modules, key parameter optimization modules, dynamic threshold generation modules, and campus risk prediction modules. It utilizes an improved dung beetle optimization algorithm and a Transformer model for parameter optimization and risk prediction.

Benefits of technology

It enables automatic association of multi-source data and removal of abnormal data, real-time adaptability of dynamic thresholds, and transforms risk identification from post-event response to pre-event intervention, significantly improving the efficiency and accuracy of safety management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121190283A_ABST
    Figure CN121190283A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of safety management, in particular to a smart campus safety management method and system based on big data analysis. The system comprises a data processing and extraction module, a key parameter optimization module, a dynamic threshold generation module and a campus risk prediction module. The method comprises the following steps: firstly, collecting campus multi-source data and carrying out space-time alignment, and then carrying out data preprocessing and multi-source data feature extraction; secondly, acquiring historical campus scene data, performing campus core scene classification, setting dynamic threshold key parameters, and performing parameter optimization by using an improved dung beetle optimization algorithm; a compensation factor is calculated for dynamic offset correction, a campus scene dynamic threshold value is obtained, risk marking is carried out, and a risk index is output; and finally, establishing a campus risk prediction model to predict a campus risk, outputting a campus safety early warning value, and generating a campus safety management strategy. By analyzing and processing the campus multi-source data, the purpose of intelligent campus safety management is achieved, and the method is accurate and objective.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of security management, specifically to a smart campus security management method and system based on big data analysis. Background Technology

[0002] With the rapid development of IoT, cloud computing, and mobile internet technologies, smart campuses have become a core direction for digital transformation in the education sector. Campus security management, a key area of ​​smart campus construction, primarily relies on independent subsystems such as video surveillance, access control systems, and fire alarms, initially achieving passive monitoring of the physical environment. However, campus security incidents are becoming increasingly diverse and complex (such as sudden violent incidents, mental health crises, and public health risks), and single-dimensional security measures are insufficient to meet the dynamic early warning needs across all scenarios. Existing systems generally suffer from data fragmentation and delayed response, necessitating intelligent upgrades to build a proactive security and prevention system.

[0003] Traditional campus security management methods mainly rely on the independent operation of systems such as video surveillance, electronic fences, access control cards, and fire sensors. For situations such as excessive smoke concentration or unauthorized entry into areas, an alarm mechanism based on rule thresholds is established. Security personnel then monitor multiple platforms in real time, manually assess the authenticity of alarms, and allocate resources accordingly.

[0004] Traditional campus safety management methods rely on heterogeneous data formats and incompatible protocols across various systems, making it impossible to integrate and analyze multi-dimensional information such as environment, behavior, and equipment. This results in blind spots in the identification of safety hazards. At the same time, static threshold rules cannot adapt to complex changes in scenarios and can only respond after the fact, lacking the ability to proactively predict risks. Summary of the Invention

[0005] In response to the problems in related technologies, this invention provides a smart campus security management method and system based on big data analysis to overcome the aforementioned technical problems in existing related technologies.

[0006] To solve the aforementioned technical problem, the present invention is achieved through the following technical solution:

[0007] This invention is a smart campus security management system based on big data analysis, specifically including: a data processing and extraction module, a key parameter optimization module, a dynamic threshold generation module, and a campus risk prediction module;

[0008] The data processing and extraction module is used to collect multi-source campus data and align it in time and space, then perform data preprocessing and multi-source data feature extraction to obtain a set of campus scene data features.

[0009] The key parameter optimization module is used to acquire historical campus scene data and classify core campus scenes, set dynamic threshold key parameters, use an improved dung beetle optimization algorithm to optimize parameters, and output the optimal dynamic threshold key parameters.

[0010] The dynamic threshold generation module is used to calculate the compensation factor for dynamic offset correction based on the set of campus scene data features and the key parameters of the optimal dynamic threshold, to obtain the dynamic threshold of the campus scene and mark the risk, and output the risk index.

[0011] The campus risk prediction module is used to set labels based on risk indices, establish a campus risk prediction model to predict campus risks, output campus safety early warning values, and generate campus safety management strategies.

[0012] Preferably, the collection and spatiotemporal alignment of multi-source campus data includes:

[0013] Collect multi-source campus data and campus time series, perform clock calibration, and synchronize the time base; then divide the campus into grid units, generate grid unit codes based on campus geographic information, aggregate campus scene data, and generate an initial campus scene data set.

[0014] Preferably, the data preprocessing and multi-source data feature extraction include:

[0015] Set cleaning rules for the initial campus scene dataset, mark and remove invalid and abnormal data;

[0016] Calculate the upward and downward trends of continuous data to be filled in the initial campus scene dataset;

[0017] When consecutive data to be filled have the same trend or the number of consecutive data to be filled is less than 2, linear interpolation is used to fill in the consecutive data to be filled.

[0018] When the trends of consecutive data to be filled are different, find the turning point, divide the previous reference interval and the next reference interval, and fill in the data considering the upward and downward trends to obtain the processed campus scene data set.

[0019] Multi-source data features are extracted from the processed campus scene data set to form a campus scene data feature set.

[0020] Preferably, the step of acquiring historical campus scene data and classifying core campus scenes includes:

[0021] Historical campus scene data is acquired and historical data features are extracted. Core campus scenes are marked, and historical data features within campus grid units are statistically analyzed and assigned to the core campus scenes to form a set of historical campus scene data features.

[0022] Preferably, the parameter optimization using the improved dung beetle optimization algorithm includes:

[0023] Set key parameters for dynamic thresholds, calculate the risk underreporting rate and risk false alarm rate, and establish an objective function based on the minimum error;

[0024] The objective function is used as the fitness function, and a search space is set. A dung beetle population exists in the search space. Each dung beetle in the population represents a key parameter of the dynamic threshold. The process of updating the position of the dung beetle is regarded as the parameter optimization process.

[0025] Initialize the dung beetle population, adjust the upper and lower bounds of the search space, and update the individual dung beetle positions;

[0026] Compare the fitness function values, select the one with the smaller fitness function value to proceed to the next iteration, and stop iterating when the current iteration reaches the maximum number of iterations to obtain the final dung beetle population. Find the dung beetle individual corresponding to the best fitness function value to obtain the optimal dynamic threshold key parameter.

[0027] Preferably, the calculation of the compensation factor for dynamic offset correction includes:

[0028] Based on the data feature set of campus scenarios and the key parameters of the optimal dynamic threshold, the upper limit and lower limit of the initial threshold are calculated for the core campus scenarios.

[0029] Calculate the time compensation amount, establish an environmental compensation mechanism, obtain the compensation factor, perform dynamic offset correction, and obtain the final upper limit and the final lower limit of the threshold to form a dynamic threshold for the campus scene.

[0030] Preferably, the output risk index includes:

[0031] When the campus scene data features in the set of campus scene data features are within the dynamic threshold range of the campus scene, the corresponding campus scene data features are marked as 0; otherwise, the corresponding campus scene data features are marked as 1, and the risk index is output.

[0032] Preferably, the establishment of a campus risk prediction model to predict campus risks includes:

[0033] Obtain the risk index of the historical campus scene data feature set, use the risk index as a label, mark it in the grid cell of each core campus scene, and generate a campus risk sample tensor;

[0034] The campus risk prediction model adopts a transformer layered processing mechanism, including an encoder layer and a decoder layer. In the encoder layer, a multi-head attention mechanism is used to learn network dependencies and output a risk correlation matrix. In the decoder layer, a masked multi-head attention mechanism is used to output the risk probability of grid cells in each core campus scene in the future, thus establishing the campus risk prediction model.

[0035] The campus risk prediction model is trained using the campus risk sample tensor to obtain the final campus risk prediction model; the campus risk tensor of the campus scene data feature set is extracted and then input into the final campus risk prediction model to output the campus safety warning value.

[0036] Preferably, the generation of campus security management strategies includes:

[0037] Campus safety warning values ​​are marked in grid cells of each core campus scene, and warning thresholds are set. When a campus safety warning value exceeds the warning threshold, a campus safety warning is triggered, the corresponding campus location is located, preset operations are executed, and a campus safety management strategy is generated.

[0038] The present invention has the following beneficial effects:

[0039] 1. This invention collects multi-source data from the campus and aligns it in time and space. Then, it performs data preprocessing and multi-source data feature extraction. It automatically associates heterogeneous data from environmental sensors, cameras, equipment monitors, etc., under a unified time and space benchmark. It automatically identifies and removes invalid and abnormal data, significantly reducing noise and error interference. It also performs adaptive interpolation based on the trends before and after, effectively maintaining data continuity and trend authenticity, which is convenient for the subsequent establishment of risk assessment models and early warning rules.

[0040] 2. This invention acquires historical campus scene data and classifies core campus scenes, subdivides them into sub-scenes by function, and allows different areas to adopt differentiated parameter strategies, making alarms more consistent with actual risk patterns and significantly reducing overall error. At the same time, it integrates reduction factors (accelerating convergence) and boundary adjustment mechanisms (dynamically shrinking the search space) to improve the algorithm, achieving efficient parameter optimization. Compared with traditional algorithms, it avoids parameter tuning getting stuck in local optima, making the threshold adaptable in real time and reducing the cost of manual intervention.

[0041] 3. This invention sets an initial threshold and calculates a compensation factor for dynamic offset correction. By using a dynamic threshold correction mechanism, it overcomes the shortcomings of traditional fixed thresholds in adapting to complex scene changes. Based on a lightweight risk index with 0 / 1 risk marking, it intuitively locates high-risk areas while filtering out low-risk interference, thus avoiding response fatigue and resource waste caused by traditional methods.

[0042] 4. This invention establishes a campus risk prediction model based on spatiotemporal location coding to predict campus risks. It uses a Transformer model to integrate spatiotemporal coding for prediction and an attention mechanism to accurately capture spatial correlations. This transforms risk identification from traditional post-event response to pre-event intervention, simultaneously covering related areas to achieve precise spatial collaborative prevention and control, effectively avoiding the occurrence of risks and significantly improving safety management efficiency. Attached Figure Description

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

[0044] Figure 1 A flowchart of a smart campus security management system based on big data analysis is provided for this invention;

[0045] Figure 2 A flowchart illustrating the smart campus security management method based on big data analysis provided by this invention;

[0046] Figure 3 This invention provides a flowchart illustrating the parameter optimization process using an improved dung beetle optimization algorithm. Detailed Implementation

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

[0048] Traditional campus safety management methods rely on heterogeneous data formats and incompatible protocols across various systems, making it impossible to integrate and analyze multi-dimensional information such as environment, behavior, and equipment. This results in blind spots in the identification of safety hazards. At the same time, static threshold rules cannot adapt to complex changes in scenarios and can only respond after the fact, lacking the ability to proactively predict risks.

[0049] To solve the above technical problems, such as Figure 1As shown, this embodiment of the invention provides a smart campus security management system based on big data analysis, specifically including: a data processing and extraction module, a key parameter optimization module, a dynamic threshold generation module, and a campus risk prediction module; the data processing and extraction module is used to collect multi-source campus data and align it spatiotemporally, then perform data preprocessing and multi-source data feature extraction to obtain a set of campus scene data features; the key parameter optimization module is used to acquire historical campus scene data and classify core campus scenes, set dynamic threshold key parameters, use an improved dung beetle optimization algorithm to optimize parameters, and output the optimal dynamic threshold key parameters; the dynamic threshold generation module is used to calculate compensation factors for dynamic offset correction based on the set of campus scene data features and the optimal dynamic threshold key parameters, obtain dynamic thresholds for campus scenes, mark risks, and output a risk index; the campus risk prediction module is used to set labels based on the risk index, establish a campus risk prediction model to predict campus risks, output campus safety warning values, and generate campus safety management strategies.

[0050] A specific example is a comprehensive university library with a daily visitor flow exceeding 8,000 people. During peak periods such as breaks between classes and exam weeks, there are frequent risks of entrance congestion and stampedes, abnormal environments in study areas (such as air conditioning malfunctions causing excessively high temperatures), and sudden equipment failures (such as turnstile malfunctions causing crowd congestion). The library has completed IoT coverage, which detects real-time visitor density at the entrance, and uses IoT temperature and humidity sensors and smoke sensors installed on the ceiling and corridors of the reading area, as well as cameras installed at the main entrances and inside the reading area. The library's self-service borrowing and returning machines, turnstiles, and air conditioning system's current and voltage monitoring modules and their status (online / offline) are also used to report these features, providing a good implementation background for the embodiments of the present invention.

[0051] In the specific implementation process of the above embodiments, firstly, multi-source campus data is collected and spatiotemporally aligned, followed by data preprocessing and multi-source data feature extraction to obtain a set of campus scene data features. This process automatically correlates heterogeneous data from environmental sensors, cameras, equipment monitors, etc., under a unified spatiotemporal benchmark, automatically identifies and removes failed and abnormal data, significantly reducing noise and error interference. Adaptive interpolation is performed based on the trends before and after, effectively maintaining data continuity and trend authenticity, facilitating the subsequent establishment of risk assessment models and early warning rules. Secondly, historical campus scene data is acquired and core campus scene classification is performed, dynamic threshold key parameters are set, an objective function is established based on minimum error, and an improved dung beetle optimization algorithm is used for parameter optimization. Sub-scenes are subdivided by function, allowing different areas to adopt differentiated parameter strategies, making alarms more consistent with actual risk patterns, significantly reducing overall error. At the same time, the reduction factor (accelerating convergence) and boundary adjustment mechanism are integrated to achieve efficient parameter optimization, avoiding parameter errors compared to traditional algorithms. The method first optimizes the threshold to avoid getting stuck in local optima, making it adaptable in real time and reducing the cost of manual intervention. Second, it sets initial thresholds for core campus scenarios, calculates compensation factors for dynamic offset correction, obtains dynamic thresholds for campus scenarios, and labels risks, outputting a risk index. This method overcomes the shortcomings of traditional fixed thresholds in adapting to complex scenario changes through a dynamic threshold correction mechanism. Based on a lightweight risk index with 0 / 1 risk labeling, it intuitively locates high-risk areas while filtering out low-risk interference, avoiding response fatigue and resource waste caused by traditional methods. Finally, it establishes a campus risk prediction model based on spatiotemporal location coding to predict campus risks, outputs campus safety warning values, and generates campus safety management strategies. By using a Transformer model to fuse spatiotemporal coding for prediction, and an attention mechanism to accurately capture spatial correlations, it transforms risk identification from traditional post-event response to pre-event intervention, simultaneously covering related areas, achieving precise spatial collaborative prevention and control, effectively preventing risks from occurring, and significantly improving safety management efficiency.

[0052] Furthermore, to better illustrate the technical solutions of the embodiments of the present invention, such as... Figure 2 As shown, this paper combines big data analytics-based smart campus security management methods to provide a detailed explanation of a big data analytics-based smart campus security management system, including the following:

[0053] S1. Collect multi-source campus data and align it in time and space to generate an initial campus scene data set. Then, perform data preprocessing and multi-source data feature extraction to obtain a campus scene data feature set.

[0054] S1 includes the following steps:

[0055] S11. Collect multi-source campus data, including environmental data, behavioral data, and equipment data. Obtain the time points of the collected multi-source campus data to obtain the campus time series, and perform clock calibration to synchronize the time base. Then, establish a campus geographic information mapping table, divide the campus into grid units, generate grid unit codes based on campus geographic information, automatically associate the multi-source campus data within the same grid unit, aggregate them into campus scene data, and generate an initial campus scene data set.

[0056] S12. Set cleaning rules for the initial campus scene data set. When the initial campus scene data set contains continuous... When multiple campus scene data are identical, they are marked as invalid data. A physical range for the data is defined; when the number of campus scene data in the initial campus scene data set exceeds this physical range, it is marked as abnormal data. The invalid and abnormal data are removed, and combined with the missing data in the initial campus scene data set, continuous data to be filled is obtained. Considering both upward and downward trends, data filling is performed to obtain the processed campus scene data set. The specific steps are as follows:

[0057] S121. Select the two consecutive campus scene data before the continuous data to be filled and the two consecutive campus scene data after the continuous data to be filled, and calculate the difference between the two consecutive campus scene data. When the difference between the two consecutive campus scene data is positive, an upward trend is obtained. When the difference between the two consecutive campus scene data is negative, a downward trend is obtained.

[0058] S122. Count the number of consecutive data points to be filled. When the trends of consecutive data points to be filled are the same or the number of consecutive data points to be filled is less than 2, use linear interpolation to fill in the consecutive data points to be filled. When the trends of consecutive data points to be filled are not the same, determine the inflection point position. Where L represents the number of consecutive data points to be filled. This represents the absolute value of the difference between the two consecutive campus scene data points preceding the data to be filled. This represents the absolute value of the difference between two consecutive campus scene data points after the data to be filled in.

[0059] S123, Select the preceding continuous data to be filled Using a set of campus scene data as a preceding reference interval, the subsequent continuous data to be filled were selected. Using campus scene data as the later reference interval, the mean of the earlier reference interval was calculated. and the mean of the reference interval ;

[0060] Calibrate the relative position of continuous data to be filled ,in This indicates the location of the Lth consecutive data to be filled;

[0061] When the position of the c-th consecutive data to be filled is between Between, the c-th consecutive data to be filled When the position of the c-th consecutive data to be filled is between Between, the c-th consecutive data to be filled ; Calculate all consecutive data to be filled in sequence, and fill in the data in the initial campus scene data set to obtain the processed campus scene data set;

[0062] S13. Extract multi-source data features from the processed campus scene data set. Within the campus grid unit, statistically analyze environmental features such as temperature, humidity, and smoke concentration. Calculate behavioral features such as real-time crowd density and personnel trajectory based on cameras. Calculate equipment features such as equipment current and equipment offline ratio to form a campus scene data feature set.

[0063] In this embodiment, multi-source data from the campus is collected and spatiotemporally aligned, followed by data preprocessing and multi-source data feature extraction to obtain a set of campus scene data features. This process automatically correlates heterogeneous data from environmental sensors, cameras, and equipment monitors under a unified spatiotemporal reference, automatically identifies and removes failed and abnormal data, significantly reducing noise and error interference. Adaptive interpolation is performed based on the trends before and after, effectively maintaining data continuity and trend authenticity, facilitating the subsequent establishment of risk assessment models and early warning rules. Specifically, for example, in the main reading area of ​​the campus library and nearby corridors, all sensors, cameras, and equipment status monitors simultaneously start data collection at 8:00 AM. The main reading area of ​​the library is divided into multiple 5m x 5m grid units, and a unique grid unit code is generated (such as LIB-A1, LIB-A2, ...). Failed and abnormal data are marked, and missing data is filled in. A brief power outage (30 minutes) occurs in the library area from 2:00 PM to 2:30 PM. (Six consecutive 5-minute intervals of data points are missing). Analysis shows that the ambient temperatures at the two points before the power outage (13:50, 13:55) were 26.0℃ and 26.2℃, respectively, with a difference of +0.2℃ (an upward trend). The temperatures at the two points after the power was restored (14:35, 14:40) were 27.5℃ and 27.3℃, with a difference of -0.2℃ (a downward trend). The inflection point is calculated to be 3, meaning the third missing point (corresponding to approximately 14:15) is the trend inflection point; previous reference interval. (13:50, 13:55), then the reference interval (14:35, 14:40), for the missing 1 to 6 points, for example, the first consecutive data to be filled = 26.1 + (1 / 7) × (1.3) + 0.2 × cos(1 × π / 12) ≈ 26.1 + 0.186 + 0.2 × 0.9659 ≈ 26.48℃, the data is filled in sequentially; statistical features are collected in each grid cell, and combined to form a set of campus scene data features for the library area;

[0064] S2. Obtain historical campus scene data and classify core campus scenes, set dynamic threshold key parameters, establish an objective function based on minimum error, and use an improved dung beetle optimization algorithm to optimize parameters and output the optimal dynamic threshold key parameters.

[0065] S2 includes the following steps:

[0066] S21. Obtain historical campus scene data and extract historical data features, mark time factors and core campus scenes, the core campus scenes include classrooms, laboratories, canteens, gymnasiums, etc., statistically analyze the historical data features within the campus grid units, and assign them to the core campus scenes respectively to form a set of historical campus scene data features;

[0067] S22. Set key parameters for the dynamic threshold, including sensitivity coefficient, time decay factor, and environmental correction weight, and set an adjustable range for the key parameters. Use the key parameters to generate a dynamic threshold for the campus scenario and mark risks. Verify the risk markings, calculate the false negative rate and false positive rate, and establish an objective function based on minimizing the error. ;

[0068] An improved dung beetle optimization algorithm is obtained by integrating a boundary adjustment mechanism and a reduction factor. This algorithm optimizes the key parameters of the dynamic threshold and outputs the optimal dynamic threshold parameters, such as... Figure 3 The parameter optimization is performed using an improved dung beetle optimization algorithm, and the specific steps are as follows:

[0069] S221. Using the objective function as the fitness function, a search space is set according to the adjustable range. A dung beetle population exists in the search space, and each dung beetle in the population represents a dynamic threshold key parameter. The process of updating the dung beetle position is considered a parameter optimization process. The dung beetle population is initialized, and the population is classified into rolling dung beetles, breeding dung beetles, foraging dung beetles, and thieving dung beetles. The population size P and population dimension Q are set, the current iteration number is t, the maximum iteration number is T, and the position of the i-th dung beetle at the t-th iteration is... Depending on the individual dung beetle species, they enter the stages of rolling dung beetle, breeding dung beetle, foraging dung beetle, and stealing dung beetle;

[0070] S222. In the rolling dung beetle stage, set random parameters a and b, and introduce a reduction factor. The position of the i-th dung beetle in the (t-1)-th iteration is The difference between the position of the i-th dung beetle and the position of the worst-performing dung beetle is the light intensity coefficient. The position of the i-th dung beetle is obtained at the (t+1)-th iteration. When unable to move forward during the Dung Beetle stage, set the scratching angle. Given the interval [0, π], redetermine the direction of movement to obtain the position of the i-th dung beetle at the (t+1)-th iteration. ;

[0071] S223. During the dung beetle breeding stage, establish a boundary adjustment mechanism to find the optimal dung beetle individual position that satisfies the fitness function. Adjust the upper bound of the search space and lower bound of search space ;set up and Let Q be a random vector of size 1×Q. Now, the positions of the individual dung beetles are updated again, resulting in... ;

[0072] During the dung beetle foraging phase, update the optimal dung beetle individual position that satisfies the fitness function, readjust the upper and lower bounds of the search space, and update the dung beetle individual position again.

[0073] S224. During the dung beetle stealing stage, determine the optimal food source location. In a dung beetle population, individual dung beetles move towards the optimal food source. During the iteration process, the position of the i-th dung beetle at the (t+1)-th iteration is obtained. ,in This represents a random vector of size 1×Q;

[0074] At this point, the fitness function values ​​are compared, and the one with the smaller fitness function value is selected to enter the next iteration. The iteration continues until the current iteration reaches the maximum number of iterations, at which point the iteration stops, and the final dung beetle population is obtained. The dung beetle individual corresponding to the best fitness function value is then found, and the optimal dynamic threshold key parameter is obtained.

[0075] In this embodiment, historical campus scene data is acquired and categorized into core campus scenes. Dynamic threshold key parameters are set, an objective function is established based on minimum error, and an improved dung beetle optimization algorithm is used for parameter optimization. Sub-scenes are subdivided by function, allowing different areas to adopt differentiated parameter strategies, making alarms more consistent with actual risk patterns and significantly reducing overall error. Simultaneously, the reduction factor (accelerating convergence) and boundary adjustment mechanism are integrated to achieve efficient parameter optimization. Compared to traditional algorithms, this avoids parameter tuning getting stuck in local optima, making the threshold adaptable in real time and reducing manual intervention costs. Specifically, for example, time factors are labeled: each data point is labeled with its occurrence time information, such as time period type: weekday / weekend, class time / break / lunch break / before closing time, and specific time: hour, minute (used to calculate time decay). Core campus scenes are categorized as: self-study core area, personnel gathering and dispersing area, passageway area, etc. Historical data features from the past three months are acquired, forming a set of historical campus scene data features organized by sub-scenes. Sensitivity coefficients control the threshold's sensitivity to data changes. The initial range is [0.5, 2.0] (smaller values ​​indicate greater sensitivity). The time decay factor controls the rate at which the influence of historical data on the current threshold decays over time, with an initial range of [0.01, 0.1] (larger values ​​indicate faster decay). The environmental correction weight is the weight of environmental factors (such as season) on threshold adjustment, with an initial range of [0.1, 0.5]. The system uses tagged historical safety event records (such as recorded air conditioning overheating alarms and actual personnel congestion events) for simulation verification, statistically analyzing the risk underreporting rate (the proportion of the system that does not alarm when a real risk event occurs) and the risk false alarm rate (the proportion of the system that falsely alarms when there is no real risk). The dung beetle population is set to 50, the dimension to 3 (corresponding to three parameters), and the maximum number of iterations to 100. 50 sets of parameter combinations are randomly generated within the initial search space. During the iterative optimization process, the position of the dung beetle is updated according to its stage, the objective function is calculated using the new parameter combination, the fitness of the new and old systems is compared, the better system is retained, and the current global optimal solution is recorded. Optimization stops after 100 iterations.

[0076] S3. Based on the set of campus scene data features and the key parameters of the optimal dynamic threshold, set an initial threshold for the core campus scene, calculate the compensation factor for dynamic offset correction, obtain the dynamic threshold of the campus scene and mark the risk, and output the risk index.

[0077] S3 includes the following steps:

[0078] S31. The key parameters of the optimal dynamic threshold include the optimal sensitivity coefficient, the optimal time decay factor, and the optimal environmental correction weight. Based on the environmental features, behavioral features, and equipment features in the campus scene data feature set, for the core campus scene, the safety index benchmarks for different features are calculated respectively. The mean and standard deviation of different features in each core campus scene are obtained respectively. Combined with the optimal sensitivity coefficient, the mean of different features in each core campus scene is added to the standard deviation of different features in each core campus scene multiplied by the optimal sensitivity coefficient, as the initial upper limit of the threshold. The mean of different features in each core campus scene is calculated minus the standard deviation of different features in each core campus scene multiplied by the optimal sensitivity coefficient, as the initial lower limit of the threshold.

[0079] S32. Based on the campus time series corresponding to the campus scene data feature set, select the current time point and the initial time point in the campus time series, and calculate the time compensation amount by introducing the optimal time decay factor. ,in This represents the optimal time decay factor. Indicates the current time point, The initial time point is indicated; an environmental compensation mechanism is established, which collects weather data in real time, determines the degree of influence of the weather data on the initial threshold, and then combines the time compensation amount to obtain the compensation factor;

[0080] S33. Perform dynamic offset correction based on the compensation factor to obtain the dynamic threshold of the campus scene, perform risk marking in the core campus scene, and output the risk index. The specific steps are as follows:

[0081] S331. Adjust the initial threshold using the optimal environmental correction weight to achieve dynamic offset correction. When the influence of weather data on the initial threshold is positive, the final upper limit of the threshold is obtained. ,in This represents the upper limit of the initial threshold. This represents the optimal environmental correction weight, which yields the final lower limit of the threshold when the influence of weather data on the initial threshold is negative. ,in Indicates the lower limit of the initial threshold;

[0082] S332. The final upper limit and the final lower limit form a dynamic threshold for the campus scene. Then, risk marking is performed. When the campus scene data feature in the campus scene data feature set is within the range of the dynamic threshold for the campus scene, the corresponding campus scene data feature is marked as 0. Otherwise, the corresponding campus scene data feature is marked as 1, and the risk index is output.

[0083] In this embodiment, an initial threshold is set for the core campus scene, a compensation factor is calculated for dynamic offset correction, resulting in a dynamic threshold for the campus scene and risk labeling, outputting a risk index. This method overcomes the shortcomings of traditional fixed thresholds in adapting to complex scene changes through a dynamic threshold correction mechanism. Based on a lightweight risk index with 0 / 1 risk labeling, it intuitively locates high-risk areas while filtering out low-risk interference, avoiding response fatigue and resource waste caused by traditional methods. Specifically, for example, the average temperature during the afternoon hours on a summer weekday is 27.5℃, with a standard deviation of 0.8℃. Using an optimal sensitivity coefficient of 1.2, the upper limit of the initial threshold is 28.46℃, and the lower limit is 26.54℃. Since it is a weekday, the standard reference time point for weekdays (e.g., 08:00:00) is set. The current time is 14:30:00, the optimal time decay factor is 0.03, and the time compensation amount is 0.03 × 6.5 = 0.195 (meaning that the threshold can be moderately relaxed over time). The high external temperature significantly increases the cooling load inside the library, resulting in a positive impact of increased base temperature in the study area (i.e., the internal temperature will be higher under the same conditions). Using the optimal environmental correction weight of 0.4 and the time compensation amount of 0.195 for correction, the final upper limit of the threshold is obtained as 28.46 × (1 + 0.4 × 0.195) ≈ 30.68℃. Then, the final lower limit of the threshold is calculated to form a dynamic threshold for the campus scene, which effectively avoids frequent false alarms caused by high external temperatures on hot summer afternoons. A risk label of 0 or 1 is output for each key feature of each monitoring point (grid unit).

[0084] S4. Set labels according to the risk index, establish a campus risk prediction model based on spatiotemporal location coding to predict campus risks, output campus safety early warning values, and generate campus safety management strategies.

[0085] S4 includes the following steps:

[0086] S41. Obtain the risk index of the historical campus scene data feature set and the corresponding time series. Use the risk index as a label and mark it in the grid cell of each core campus scene. Perform spatial encoding according to the spatial location of the grid cell. Capture the temporal dependency according to the time series and generate temporal encoding. Merge the spatial encoding and temporal encoding to obtain the campus risk sample tensor.

[0087] S42. The campus risk prediction model adopts a transformer layered processing mechanism, including an encoder layer and a decoder layer. In the encoder layer, a multi-head attention mechanism is used to learn network dependencies and output a risk correlation matrix. In the decoder layer, a masked multi-head attention mechanism is used to output the risk probability of grid cells in each core campus scene in the future, and a campus risk prediction model is established.

[0088] S43. Train the campus risk prediction model using the campus risk sample tensor to obtain the final campus risk prediction model, predict campus risks, and output campus safety warning values. The specific steps are as follows:

[0089] S431. Divide the campus risk sample tensor into a sample training set and a sample test set. Input the sample training set into the campus risk prediction model for training until the model converges to obtain a trained campus risk prediction model. Then input the sample test set into the trained campus risk prediction model, output the prediction result, set an accuracy threshold, and stop training when the accuracy of the prediction result is greater than the accuracy threshold; otherwise, adjust the weights to obtain the final campus risk prediction model.

[0090] S432. Extract the spatial and temporal codes of the campus scene data feature set to obtain the campus risk tensor, and then input it into the final campus risk prediction model to output the campus safety warning value.

[0091] S44. Mark campus safety warning values ​​in the grid cells of each core campus scene, set warning thresholds, and trigger campus safety warnings when the campus safety warning value exceeds the warning threshold, locate the corresponding campus location, execute preset operations, and generate campus safety management strategies.

[0092] In this embodiment, a campus risk prediction model is established based on spatiotemporal location coding to predict campus risks, output campus safety warning values, and generate campus safety management strategies. The prediction is performed by fusing spatiotemporal coding with a transformer model, and the attention mechanism accurately captures spatial correlations, transforming risk identification from traditional post-event response to pre-event intervention. This synchronously covers related areas, achieving precise spatial collaborative prevention and control, effectively avoiding risks and significantly improving safety management efficiency. Specifically, for example, continuous monitoring of the library study area (LIB-A1), entrance area (LIB-B1), and corridor (LIB-C1) uses historical risk indices (0 or 1) as labels, associating them with corresponding grid cells. Spatial coding generates a unique location vector for each grid cell (e.g., LIB-C1 → [0.2, 0.8]), and temporal coding extracts time features (hour, day of the week, whether it's a break between classes) to generate a time-series vector (e.g., break time period → [1, 0, 1]). The spatiotemporal coding is then fused to form a three-dimensional risk sample tensor (spatial location × time series × risk label). The encoder layer learns inter-grid dependencies (e.g., entrance...) through a multi-head attention mechanism. The model outputs a risk correlation matrix (due to peak pedestrian traffic in the area often leading to corridor congestion); Decoder layer: Using masked multi-head attention, it predicts the risk probability of each grid in the next 30 minutes based on historical sequences; Divide the sample set (70% training set, 30% test set), train the model until convergence, predict the probability of LIB-B1 congestion in the next break as 78%, and if congestion actually occurs (marked as 1), the prediction accuracy reaches 92% (exceeding the preset 85% threshold), and the model is deployed; At this point, the current spatiotemporal code is input into the trained model, and the future safety warning value is output (e.g., LIB-B1 in 10 minutes). (The risk value is 0.88, and the LIB-A1 risk value is 0.05). Based on the characteristics of historical data from the past three months, a risk probability higher than 80% indicates a high risk, requiring immediate reporting. Therefore, a warning threshold of 0.8 is set. When the predicted value of LIB-B1 (0.88 > 0.8) is greater than 0.8, the system triggers a warning and generates a campus safety management strategy: pushes an alarm to the security personnel's APP: "It is estimated that the main entrance will be overcrowded in 10 minutes, and the risk of overcrowding is high. Please guide the flow of people immediately." The system automatically opens the backup gate channel at the entrance and displays a message on the building's screen: "The main entrance is congested. It is recommended to detour via the west passage."

[0093] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic point described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristic points described may be combined in any suitable manner in one or more embodiments or examples.

[0094] The preferred embodiments of the invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention.

Claims

1. A smart campus security management system based on big data analytics, characterized in that: include: The data processing and extraction module is used to collect multi-source data from the campus and align it in time and space, then perform data preprocessing and multi-source data feature extraction to obtain a set of campus scene data features; The key parameter optimization module is used to acquire historical campus scene data and classify core campus scenes, set dynamic threshold key parameters, use an improved dung beetle optimization algorithm to optimize parameters, and output the optimal dynamic threshold key parameters. The dynamic threshold generation module is used to calculate compensation factors and perform dynamic offset correction based on the set of campus scene data features and the key parameters of the optimal dynamic threshold, to obtain the dynamic threshold of the campus scene and mark the risk, and output the risk index. The campus risk prediction module is used to set labels based on risk indices, build a campus risk prediction model to predict campus risks, output campus safety early warning values, and generate campus safety management strategies.

2. The smart campus security management system based on big data analysis according to claim 1, characterized in that, The collection and spatiotemporal alignment of multi-source campus data includes: Collect multi-source campus data and campus time series, perform clock calibration, and synchronize the time base; then divide the campus into grid units, generate grid unit codes based on campus geographic information, aggregate campus scene data, and generate an initial campus scene data set.

3. The smart campus security management system based on big data analysis according to claim 2, characterized in that, The data preprocessing and multi-source data feature extraction include: Set cleaning rules for the initial campus scene dataset, mark and remove invalid and abnormal data; Calculate the upward and downward trends of continuous data to be filled in the initial campus scene dataset; When consecutive data to be filled have the same trend or the number of consecutive data to be filled is less than 2, linear interpolation is used to fill in the consecutive data to be filled. When the trends of consecutive data to be filled are different, find the turning point, divide the previous reference interval and the next reference interval, and fill in the data considering the upward and downward trends to obtain the processed campus scene data set. Multi-source data features are extracted from the processed campus scene data set to form a campus scene data feature set.

4. The smart campus security management system based on big data analysis according to claim 3, characterized in that, The process of acquiring historical campus scene data and classifying core campus scenes includes: Historical campus scene data is acquired and historical data features are extracted. Core campus scenes are marked, and historical data features within campus grid units are statistically analyzed and assigned to the core campus scenes to form a set of historical campus scene data features.

5. The smart campus security management system based on big data analysis according to claim 4, characterized in that, The parameter optimization using the improved dung beetle optimization algorithm includes: Set key parameters for dynamic thresholds, calculate the risk underreporting rate and risk false alarm rate, and establish an objective function based on the minimum error; The objective function is used as the fitness function, and a search space is set. A dung beetle population exists in the search space. Each dung beetle in the population represents a key parameter of the dynamic threshold. The process of updating the position of the dung beetle is regarded as the parameter optimization process. Initialize the dung beetle population, use the boundary adjustment mechanism to adjust the upper and lower bounds of the search space, and update the positions of individual dung beetles; Compare the fitness function values, select the one with the smaller fitness function value to proceed to the next iteration, and stop iterating when the current iteration reaches the maximum number of iterations to obtain the final dung beetle population. Find the dung beetle individual corresponding to the best fitness function value to obtain the optimal dynamic threshold key parameter.

6. The smart campus security management system based on big data analysis according to claim 5, characterized in that, The calculation of the compensation factor for dynamic offset correction includes: Based on the data feature set of campus scenarios and the key parameters of the optimal dynamic threshold, the upper limit and lower limit of the initial threshold are calculated for the core campus scenarios. Calculate the time compensation amount, establish an environmental compensation mechanism, obtain the compensation factor, perform dynamic offset correction, and obtain the final upper limit and the final lower limit of the threshold to form a dynamic threshold for the campus scene.

7. The smart campus security management system based on big data analysis according to claim 6, characterized in that, The output risk index includes: When the campus scene data features in the set of campus scene data features are within the dynamic threshold range of the campus scene, the corresponding campus scene data features are marked as 0; otherwise, the corresponding campus scene data features are marked as 1, and the risk index is output.

8. The smart campus security management system based on big data analysis according to claim 7, characterized in that, The establishment of a campus risk prediction model to predict campus risks includes: Obtain the risk index of the historical campus scene data feature set, use the risk index as a label, mark it in the grid cell of each core campus scene, and generate a campus risk sample tensor; The campus risk prediction model adopts a transformer layered processing mechanism, including an encoder layer and a decoder layer. In the encoder layer, a multi-head attention mechanism is used to learn network dependencies and output a risk correlation matrix. In the decoder layer, a masked multi-head attention mechanism is used to output the risk probability of grid cells in each core campus scene in the future, thus establishing the campus risk prediction model. The campus risk prediction model is trained using the campus risk sample tensor to obtain the final campus risk prediction model; the campus risk tensor of the campus scene data feature set is extracted and then input into the final campus risk prediction model to output the campus safety warning value.

9. The smart campus security management system based on big data analysis according to claim 8, characterized in that, The generated campus security management strategy includes: Campus safety warning values ​​are marked in grid cells of each core campus scene, and warning thresholds are set. When a campus safety warning value exceeds the warning threshold, a campus safety warning is triggered, the corresponding campus location is located, preset operations are executed, and a campus safety management strategy is generated.

10. A smart campus security management method based on big data analysis, characterized in that: Specifically, it includes: S1. Collect multi-source campus data and align it in time and space to generate an initial campus scene data set. Then, perform data preprocessing and multi-source data feature extraction to obtain a campus scene data feature set. S2. Obtain historical campus scene data and classify core campus scenes, set dynamic threshold key parameters, establish an objective function based on minimum error, and use an improved dung beetle optimization algorithm to optimize parameters and output the optimal dynamic threshold key parameters. S3. Based on the set of campus scene data features and the key parameters of the optimal dynamic threshold, set an initial threshold for the core campus scene, calculate the compensation factor for dynamic offset correction, obtain the dynamic threshold of the campus scene and mark the risk, and output the risk index. S4. Set labels according to the risk index, establish a campus risk prediction model based on spatiotemporal location coding to predict campus risks, output campus safety early warning values, and generate campus safety management strategies.

Citation Information

Cited By

  • Intelligent security access control system

    CN121415495A