Smart campus management method, system and storage medium based on Internet of Things
The method improves the accuracy of abnormal behavior detection in smart campus management by calculating realness coefficients and confidence scores for door access data, addressing the inefficiencies in existing systems by quantifying anomaly likelihood and enhancing risk recognition.
Patent Information
- Application Number
- CN202411172873.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-08-26
AI Technical Summary
Current methods for identifying abnormal entry and exit behaviors in schools using IoT-based smart campus management systems suffer from low accuracy due to noise interference and varying student types, leading to inefficient risk recognition and management.
A method that calculates a realness coefficient and abnormal confidence score for door access data by analyzing sequences of entry and exit events, considering time intervals and density, to accurately assess and quantify the likelihood of anomalies, thereby improving the identification of abnormal behavior.
This approach enhances the accuracy of identifying abnormal entry and exit behaviors, thereby improving the overall effectiveness of smart campus management by quantifying the reliability of door access data and reducing false positives.
Smart Images

Figure CN119049165B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things data services, and in particular to a smart campus management method, system and storage medium based on the Internet of Things. Background Art
[0002] Smart campus management based on IoT technology can improve the efficiency of campus management and create a safer, more convenient and efficient campus environment and learning experience for schools. Among them, smart access control and security monitoring use IoT technology to achieve intelligent management of entrances and exits and comprehensive monitoring of the security environment. By authenticating the identity of authorized teachers and students and recording and analyzing their entry and exit data, it can not only help schools quickly identify and respond to potential security risks, but also improve management efficiency and resource utilization.
[0003] Since campus entry and exit data usually have a certain regular concentration, such as going to and from school at a fixed point and entering and exiting the school gate, but some students may have abnormal entry and exit behaviors, such as arriving early or returning late, which poses certain safety risks to both school safety and student safety; therefore, the existing technology can usually perform outlier analysis on the entry and exit data of all teachers and students on campus based on the Local Outlier Factor (LOF) algorithm, so as to determine the people with abnormal entry and exit behaviors; however, in the process of outlier analysis, there are factors such as noise interference or the different nature of some teachers and students on campus, such as deviations in entry and exit data, inconsistent entry and exit concentration patterns of day students and boarding students, etc., which will lead to low accuracy in identifying people with abnormal entry and exit behaviors, thereby reducing the management effect of the smart campus. Summary of the invention
[0004] In order to solve the technical problem that the existing technology has low accuracy in identifying people with abnormal entry and exit behaviors, resulting in low smart campus management effect, the purpose of the present invention is to provide a smart campus management method, system and storage medium based on the Internet of Things. The technical solutions adopted are as follows:
[0005] The present invention provides a smart campus management method based on the Internet of Things, the method comprising:
[0006] Obtaining a sequence of access control management data for each person, wherein the sequence of access control management data includes all access control data for each day, and the types of access control data include entry and exit;
[0007] In each of the access control management data sequences, the authenticity coefficient of each of the access control data is obtained according to the intersection of the types of each of the access control data and the adjacent access control data, combined with the difference between the corresponding time of the same type of access control data in other days, and the deviation of all the access control data in all the access control management data sequences;
[0008] Between the day where each access control data is located and other days, according to the similarity of changes in the corresponding moments of all the access control data in one day, combined with the authenticity coefficient of each access control data, the abnormal confidence of each access control data is obtained; according to the abnormal confidence, the local abnormal score of the corresponding access control data is corrected to obtain the corrected abnormal score of each access control data; according to the difference between the access control management data sequence of each person and other people and the corrected abnormal score of all the access control data in the corresponding access control management data sequence, the degree of access control abnormality of each person is obtained;
[0009] Smart campus management is carried out based on the degree of access control abnormality of each person.
[0010] Furthermore, the method for obtaining the authenticity coefficient includes:
[0011] In each of the access control management data sequences, if each of the access control data is of the same type as the adjacent access control data, the corresponding access control data and the adjacent access control data of the same type are both used as target access control data;
[0012] Between adjacent target access control data, the preference of each target access control data relative to another target access control data is obtained based on the minimum time interval between each target access control data and the corresponding time of the same type of access control data in other days, combined with the local reachable density of each target access control data;
[0013] Between adjacent target access control data, the authenticity coefficient of each target access control data is obtained according to the preference of each target access control data relative to another target access control data; and the authenticity coefficients of all non-target access control data in the access control management data sequence are set to a preset normal number.
[0014] Furthermore, the method for obtaining the preference includes:
[0015] Take the time corresponding to each target access control data as the target time, take the time corresponding to the same type of access control data in other days that is closest to the target time as a reference time; take the time interval between the target time and each reference time as a minimum time interval;
[0016] According to all the minimum time intervals corresponding to each of the target access control data, a relative habit coefficient of each of the target access control data is obtained, wherein the minimum time interval is negatively correlated with the relative habit coefficient;
[0017] Between adjacent target access control data, the preference of each target access control data relative to another target access control data is obtained based on the difference in the relative habit coefficient and the difference in the local reachable density; the difference in the relative habit coefficient and the difference in the local reachable density are both positively correlated with the preference.
[0018] Furthermore, the method for obtaining the abnormality confidence level includes:
[0019] Construct an access control change sequence according to the corresponding time of all access control data of each person every day; obtain the corresponding change similarity according to the sequence difference between the access control change sequences of each person;
[0020] Taking any of the access control data in the access control management data sequence of each person as the data to be analyzed, and screening out a reference access control change sequence corresponding to the access control change sequence on the day of the data to be analyzed from all the access control change sequences of each person according to the change similarity;
[0021] According to the change similarity between the access control change sequence corresponding to the day of the data to be analyzed and all the reference access control change sequences, and the authenticity coefficient of the data to be analyzed, the abnormality confidence of the data to be analyzed is obtained; the change similarity is negatively correlated with the abnormality confidence, and the authenticity coefficient is positively correlated with the abnormality confidence.
[0022] Furthermore, the method for obtaining the change similarity includes:
[0023] Construct two-dimensional sample points based on the corresponding time of all the access control data of each person every day, and each dimension of the two-dimensional sample points represents the corresponding time; construct a corresponding access control change sequence based on the two-dimensional sample points as sequence elements; map the sequence elements in the access control change sequence to a two-dimensional coordinate system to obtain a corresponding change curve;
[0024] According to the integral difference between the change curves corresponding to different access control change sequences, the change similarity between different access control change sequences of each person is obtained, and the integral difference is negatively correlated with the change similarity.
[0025] Furthermore, the method for obtaining the reference access control change sequence includes:
[0026] Taking the change similarity as the distance measurement, all clusters are obtained based on the preset K value and K-means algorithm, and all the access control change sequences in the cluster corresponding to the access control change sequence on the day of the data to be analyzed are used as reference access control change sequences.
[0027] Furthermore, the method for obtaining the modified anomaly score includes:
[0028] The anomaly confidence is a normalized value; the local outlier factor of each access control data is used as the corresponding local anomaly score; the local anomaly score corresponding to the access control data is weighted using the anomaly confidence, and the weighted result is used as the corrected anomaly score corresponding to the access control data.
[0029] Furthermore, the method for obtaining the degree of access control abnormality includes:
[0030] The nature of each person's attendance at school is different, including at least day students and boarding students; the degree of abnormality of the number of access control visits for each person is obtained based on the total number of access control data in the access control management data sequence of each person relative to the total number of access control data in the access control management data sequence of other people with the same nature of attendance at school; the difference in number is positively correlated with the degree of abnormality of the number of access control visits;
[0031] The average score of the corrected abnormality scores of all the access control data in the access control management data sequence of each person is obtained, and the product of the average score and the abnormality degree of the access control times is taken as the access control abnormality degree.
[0032] The present invention also proposes a smart campus management system based on the Internet of Things, the system comprising:
[0033] A collection module is used to obtain a sequence of access control management data for each person, wherein the sequence of access control management data includes all access control data for each day, and the types of access control data include entry and exit;
[0034] The analysis module is used to obtain the authenticity coefficient of each access control data in each access control data sequence according to the crossover between each access control data and the adjacent access control data, combined with the difference between the corresponding time of the same access control data in other days, and the deviation of all the access control data in all the access control data sequences; between the day where each access control data is located and other days, according to the similarity of the change of the corresponding time of all the access control data in one day, combined with the authenticity coefficient of each access control data, obtain the abnormal confidence of each access control data; correct the local abnormal score of the corresponding access control data according to the abnormal confidence to obtain the corrected abnormal score of each access control data; obtain the degree of access control abnormality of each person according to the difference between the access control data sequence of each person and other people and the corrected abnormal score of all the access control data in the access control data sequence;
[0035] The management module is used to manage the smart campus according to the degree of access control abnormality of each person.
[0036] The present invention also proposes a computer-readable storage medium on which a computer-readable program is stored. When the computer-readable program is called, it executes the smart campus management method based on the Internet of Things.
[0037] The present invention has the following beneficial effects:
[0038] The present invention obtains a door access management data sequence for each person, including all door access data of each day, and the types of door access data include entry and exit; in each door access management data sequence, according to the type intersection of each door access data and adjacent door access data, combined with the difference between the corresponding time of similar door access data in other days, and the deviation of all door access data in all door access management data sequences, the authenticity coefficient of each door access data is obtained; the authenticity coefficient combines the personal historical door access rules and the relative deviation of the door access data, quantitatively evaluates the confidence of each door access data, and prepares for the subsequent evaluation of the abnormal possibility of the door access data; between the day where each door access data is located and other days, according to the change similarity of the corresponding time of all door access data in one day, combined with the authenticity coefficient of each door access data, the abnormal confidence of each door access data is obtained; according to the abnormal confidence, the local abnormal score of the corresponding door access data is corrected to obtain the corrected abnormal score of each door access data; according to the difference between the door access management data sequence of each person and other people and the corrected abnormal score of all door access data in the corresponding door access management data sequence, the door access abnormality degree of each person is obtained; according to the door access abnormality degree of each person, smart campus management is performed. The present invention accurately analyzes and obtains the abnormal score of each access control data based on the entry and exit intersection characteristics in the access control tree of on-campus personnel and the regular centralized nature of personnel access control, thereby improving the accuracy of identifying abnormal entry and exit personnel on campus, and further improving the management effect of the smart campus. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 A flowchart of a smart campus management method based on the Internet of Things provided by an embodiment of the present invention;
[0041] Figure 2 A flow chart of a method for obtaining a authenticity coefficient provided by an embodiment of the present invention;
[0042] Figure 3 A flowchart of a method for obtaining anomaly confidence provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a smart campus management method, system and storage medium based on the Internet of Things proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0044] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0045] The following is a detailed description of a specific solution of a smart campus management method, system and storage medium based on the Internet of Things provided by the present invention in conjunction with the accompanying drawings.
[0046] See also Figure 1 , which shows a flow chart of a smart campus management method based on the Internet of Things provided by an embodiment of the present invention, specifically comprising:
[0047] Step S1, obtaining each person's access control management data sequence, the access control management data sequence includes all access control data of each day, and the types of access control data include entry and exit.
[0048] Taking into account that the people on campus include students, teachers and logistics staff, and monitoring gates are usually set up at each entrance and exit of the campus, students and faculty use campus cards or facial recognition to enter and exit the campus. The school will regularly track and analyze the access control data recorded by the monitoring gate system, and supervise abnormal people entering and leaving the campus to ensure campus safety.
[0049] Therefore, in one embodiment of the present invention, first, at the time of supervision, the access control management data sequence of each person in school within a preset historical period is obtained, where the duration of the preset historical period is set to 30 days, and the access control management data sequence includes all access control data for each day within these 30 days.
[0050] It should be noted that the access control data is a multi-dimensional data, which includes at least dimensional indicators such as personnel identity information, access control type such as entry or exit, and the corresponding time of entry or exit; implementers can also add other dimensional indicators to construct access control data according to actual needs, and can also set the duration of the preset historical period by themselves, which is not limited here.
[0051] Step S2, in each access control management data sequence, the authenticity coefficient of each access control data is obtained according to the intersection of each access control data with the adjacent access control data, combined with the difference between the corresponding time of the same type of access control data in other days, and the deviation relative to all access control data in all access control management data sequences.
[0052] Taking into account that when the monitoring gate collects and transmits access control data, it may be interfered by various external factors, resulting in inaccurate access control data in the access control management data sequence, such as deviations or false data items, which will affect the accuracy of supervision; considering that a person can only leave after entering, and can only enter again after leaving, the corresponding types of adjacent access control data in the access control management data sequence should be cross-changed. When there are continuous departures or continuous entries, it means that there is an abnormality; at the same time, each person's access control data should have a certain centralized regularity, that is, the access control data is related to school time and personal behavior habits. For example, some people usually leave school quickly after school, while some students leave school late due to personal habits such as organizing homework, but each person's access control data should have a certain regularity relative to themselves.
[0053] Therefore, the embodiment of the present invention first obtains the authenticity coefficient of each access control data in each access control management data sequence based on the type intersection of the access control data and the adjacent access control data, combined with the difference between the corresponding time of the same type of access control data in other days, and the deviation from all access control data in all access control management data sequences. The authenticity coefficient of the access control data, combined with the individual's historical access control rules and the deviation from the access control data of other school personnel, quantitatively evaluates the confidence of each access control data, and prepares for the subsequent evaluation of the possibility of abnormality of each person's access control data.
[0054] It should be noted that the possibility of statistical errors in the types of access control data is extremely low, and the possibility of continuous statistical errors in the access control data of the same person is also low, that is, the possibility that the types of access control data are consistent with the two adjacent access control data is low. Therefore, the statistical anomaly of untrue data items of access control data targeted by the embodiment of the present invention is only that two consecutive access control data are one true and the other false, and the subsequent analysis and correction are also targeted at the analysis and correction between two adjacent access control data that are one true and one false.
[0055] Preferably, in one embodiment of the present invention, the method for obtaining the authenticity coefficient includes:
[0056] See also Figure 2 , which shows a flow chart of a method for obtaining a authenticity coefficient provided by an embodiment of the present invention, specifically comprising:
[0057] Step S201: In each access control management data sequence, if each access control data is of the same type as adjacent access control data, the corresponding access control data and the adjacent access control data of the same type are used as target access control data.
[0058] An embodiment of the present invention first screens out all target access control data based on the consistency of each access control data with the adjacent access control data. The target access control data is the focus of subsequent analysis and correction, and its corresponding local anomaly score is less credible than the local anomaly score of non-target access control data.
[0059] To facilitate understanding of the process of determining the target access control data, as an example, first construct a type label sequence of the access control data in the access control management data sequence, wherein the type label is used as a sequence element and is constructed by sorting the sequence according to the acquisition sequence of the access control data; for example, the label of the incoming data is A, the label of the outgoing data is B, and the type label sequence is {A, B, B, A, B, A, B...}, wherein the type labels of the second sequence element and the third sequence element are the same, then the access control data corresponding to the second and third sequence elements are both used as the target access control data.
[0060] Step S202, between adjacent target access control data, according to the minimum time interval between each target access control data and the corresponding time of similar access control data in other days, combined with the local reachability density of each target access control data, obtain the preference of each target access control data relative to another target access control data.
[0061] Since two adjacent target access control data should be one true and one false, an embodiment of the present invention obtains the preference of each target access control data relative to another target access control data between adjacent target access control data; the preference preliminarily reflects the authenticity of each access control data between the two access control data, and the greater the preference of the access control data, the greater its authenticity.
[0062] Considering that each person's access control data usually has certain behavioral regularities, such as arriving or leaving school on time, the possibility of their entry or departure times being close every day within the preset historical period is also relatively high. The minimum time interval between each target access control data and the corresponding time of similar access control data on other days indirectly reflects the concentrated regularity of each person's access control; considering that each person's arrival or departure time is affected by the school hours, but the arrival and departure times of most people should also be close; and the local reachable density of access control data reflects its degree of deviation from other access control data. The more abnormal a person's arrival time is, the lower the authenticity of the corresponding access control data.
[0063] In a preferred embodiment of the present invention, the acquisition method considering the preference includes:
[0064] The time corresponding to each target access control data is taken as the target time, and the time corresponding to the similar access control data closest to the target time in other days is taken as a reference time; the time interval between the target time and each reference time is taken as a minimum time interval;
[0065] According to all the minimum time intervals corresponding to each target access control data, the relative habit coefficient of each target access control data is obtained, and the minimum time interval is negatively correlated with the relative habit coefficient;
[0066] Between adjacent target access control data, the preference of each target access control data relative to another target access control data is obtained according to the difference in relative habit coefficient and the difference in local reachable density; the difference in relative habit coefficient and the difference in local reachable density are both positively correlated with the preference.
[0067] As an example, the calculation formula for preference is: Among them, Z a-b is the preference of the ath target access control data over the bth target access control data between adjacent target access control data in each access control management data sequence; i is the serial number of the day in the preset historical period; I is the total number of days in the preset historical period; is the minimum time interval between the target time corresponding to the a-th target access control data and the corresponding reference time within the i-th day; lrd is the minimum time interval between the target time corresponding to the bth target access control data and the corresponding reference time within the ith day; k (a) is the local reachability density of the a-th target access control data; lrd k (b) is the local reachable density of the b-th target access control data; exp() is an exponential function with the natural constant e as the base; is the relative habit coefficient of the ath target access control data; is the relative habit coefficient of the bth target access control data; sigmoid[] is the S-type function.
[0068] It should be noted that The i in also includes the serial number of the day where the a-th target access control data is located. When i is the serial number of the day where the a-th target access control data is located, Take 0; Similarly, no further explanation is given; the local reachable density is obtained using the LOF algorithm and a preset k-distance neighborhood, where k in the preset k-distance neighborhood is set to 5, and the implementer can also set it according to actual needs; the local reachable density is a well-known technology and will not be described here.
[0069] In the calculation formula of the preference, Quantify the difference in the relative habit coefficients of the two target access control data. Since the relative habit coefficient is greater than 0 and less than or equal to 1, if the numerator is greater than the denominator, the fractional ratio makes the a-th target access control data more preferred than the b-th target access control data, and vice versa. k (a)-lrd k (b) After being mapped to the S-type function and normalized, it is The weight of , when the difference is positive and the larger it is, the smaller the possibility of abnormal deviation of the a-th target access control data relative to the b-th target access control data, the larger the weight, and finally the greater the preference of the a-th target access control data over the b-th target access control data.
[0070] In other examples, implementers may also use mode, mean, or median instead of Other negative correlation mapping methods can also be used, such as adding an anti-zero positive parameter and performing a reciprocal operation; the difference form can also be used to measure the relative habit coefficient difference of the target access control data, such as I won’t go into details here.
[0071] Step S203, between adjacent target access control data, according to the preference of each target access control data relative to another target access control data, obtain the authenticity coefficient of each target access control data; set the authenticity coefficient of all non-target access control data in the access control management data sequence to a preset normal number.
[0072] As an example, the authenticity coefficients of all non-target access control data in the access control management data sequence are directly set to a preset normal number, where the preset normal number is 1; the corresponding authenticity coefficient is obtained using the calculation formula of the authenticity coefficient of the target access control data. Since two adjacent target access control data are one true and one false, the sum of their authenticity coefficients is set to 1, and the authenticity coefficient of the target access control data with greater preference is also greater; then the calculation formula of the authenticity coefficient of the target access control data is:
[0073] Among them, H a is the authenticity coefficient of the ath target access control data; Z a-b is the preference of the ath target access control data over the bth target access control data between adjacent target access control data in each access control management data sequence; Z b-a is the preference of the bth target access control data over the ath target access control data between adjacent target access control data in each access control management data sequence.
[0074] At this point, the authenticity coefficient of each access control data in each access control management data sequence of each person is obtained.
[0075] Step S3, between the day where each access control data is located and other days, according to the change similarity of all access control data at corresponding moments in one day, combined with the authenticity coefficient of each access control data, obtain the abnormal confidence of each access control data; correct the local abnormality score of the corresponding access control data according to the abnormal confidence, and obtain the corrected abnormality score of each access control data; according to the difference between the access control management data sequence of each person and other people and the corrected abnormality score of all access control data in the corresponding access control management data sequence, obtain the access control abnormality degree of each person.
[0076] Considering that different people may have different plans for school, for example, a small number of special people such as art students or gifted students may have training plans, which may cause the change pattern of their daily access control data entering and leaving the campus to deviate from the majority of normal school personnel. As a result, these special people may be mistakenly supervised as abnormal people entering and leaving the campus;
[0077] Considering that the training and rehearsal plans of special personnel usually have a certain concentration regularity, because they usually attend training in a specific time period every day, which may cause these special personnel to arrive or leave school early, or arrive or leave school late, etc.; but for each special person, the access control data should have a certain regularity, and all the access control data of each special person should have a certain change similarity at the corresponding time of each day;
[0078] Therefore, the embodiment of the present invention obtains the abnormal confidence of each access control data based on the similarity of changes in the corresponding moments of all access control data in one day and the authenticity coefficient of each access control data between the day where each access control data is located and other days. The abnormal confidence further comprehensively considers the particularity of some on-campus personnel and quantitatively evaluates the authenticity of each access control data. The abnormal confidence is the confidence of the local abnormal score of each access control data. The larger the value, the higher the accuracy of abnormal supervision.
[0079] Preferably, in one embodiment of the present invention, the method for obtaining anomaly confidence includes:
[0080] See also Figure 3 , which shows a flow chart of a method for obtaining anomaly confidence provided by an embodiment of the present invention, specifically comprising:
[0081] Step S301, constructing a door access change sequence according to the corresponding time of all door access data of each person every day; and obtaining the corresponding change similarity according to the sequence difference between different door access change sequences of each person.
[0082] In a preferred embodiment of the present invention, in order to analyze the change similarity of all access control data of each person every day at corresponding moments, an embodiment of the present invention first constructs an access control change sequence, and then analyzes the sequence difference to measure the change similarity; the method for obtaining the change similarity includes:
[0083] Two-dimensional sample points are constructed based on the corresponding moments of all access control data of each person every day. Each dimension of the two-dimensional sample points represents the corresponding moment. The two-dimensional sample points are used as sequence elements to construct the corresponding access control change sequence. The sequence elements in the access control change sequence are mapped to the two-dimensional coordinate system to obtain the corresponding change curve. According to the integral difference between the corresponding change curves of different access control change sequences, the change similarity between different access control change sequences of each person is obtained, and the integral difference is negatively correlated with the change similarity.
[0084] As an example, suppose that the corresponding times of all the access control data of a person every day are 8:05, 12:05, 13:25, and 18:05 respectively. Directly constructing a one-dimensional sequence is easily limited by the inconsistency of the total number of access control data every day. Therefore, it is considered to construct a two-dimensional sample point to obtain the change curve, so as to measure the difference between the curve integrals and evaluate the change similarity; the horizontal and vertical coordinates of the corresponding two-dimensional sample points are (8:05, 8:05), (12:05, 12:05), (13:25, 13:25), (18:05, 18:05), and the corresponding access control change sequence is {(8: 05, 8:05), (12:05, 12:05), (13:25, 13:25), (18:05, 18:05)}, map each sequence element to a two-dimensional coordinate system, connect all sequence elements to obtain a change curve corresponding to each access control change sequence; further, the absolute value of the difference between the integrals of the change curves corresponding to different access control change sequences is negatively correlated with the x in the exponential function exp(-x) with the natural constant e as the base, and the change similarity between the corresponding different access control change sequences is obtained; integration is a well-known technical means and will not be repeated here.
[0085] As another example, considering that dynamic time warping (DTW) can be used to compare sequences of different lengths, the implementer can directly construct a one-dimensional sequence based on the corresponding time of all access control data of a person every day, such as {8:05, 12:05, 13:25, 18:05}, and further calculate the DTW distance to measure the sequence difference. The larger the DTW distance, the smaller the change similarity between different access control change sequences of different people. Further, the DTW distance needs to be used as the x in the exponential function exp(-x) with the natural constant e as the base to perform negative correlation mapping adjustment logic to obtain the change similarity. Other negative correlation mapping methods can also be used. The acquisition of DTW distance is a well-known technology and will not be repeated here.
[0086] Step S302, taking any access control data in each person's access control management data sequence as the data to be analyzed, and selecting a reference access control change sequence corresponding to the day of the data to be analyzed from all access control change sequences of each person according to change similarity.
[0087] Taking into account that under normal circumstances, Saturdays and Sundays are usually for rest, not all different access control change sequences of each person in a preset historical period have a high change similarity. Different access control change sequences corresponding to working days should have a high change similarity, and the same is true for non-working days. However, the change similarity between different access control change sequences corresponding to working days and non-working days may be relatively low. Therefore, an embodiment of the present invention uses any access control data in the access control management data sequence of each person as the data to be analyzed, and screens out a reference access control change sequence that is the same as the access control change sequence to which the data to be analyzed belongs, so as to improve the accuracy of subsequent abnormal analysis.
[0088] In a preferred embodiment of the present invention, considering that clustering can cluster similar data into the same cluster, a clustering algorithm can be used to obtain a reference access control change sequence similar to the access control change sequence to which the data to be analyzed belongs; a method for obtaining the reference access control change sequence includes:
[0089] Using change similarity as the distance measurement, all clusters are obtained based on the preset K value and K-means algorithm, and all access control change sequences in the cluster corresponding to the access control change sequence on the day of the data to be analyzed belong to are used as reference access control change sequences. The greater the possibility that the reference access control change sequence and the access control change sequence corresponding to the day of the data to be analyzed are in the same cluster, the more accurate the subsequent analysis will be.
[0090] Considering that there are two types of days, namely working days and non-working days, the preset K value is 2. The K-means algorithm is a well-known technology and will not be described in detail here.
[0091] Step S303, according to the change similarity between the access control change sequence corresponding to the day of the data to be analyzed and all reference access control change sequences, and the authenticity coefficient of the data to be analyzed, obtain the abnormal confidence of the data to be analyzed; the change similarity is negatively correlated with the abnormal confidence, and the authenticity coefficient is positively correlated with the abnormal confidence.
[0092] As an example, the calculation formula for anomaly confidence is: Where O is the serial number of the data to be analyzed; P O is the abnormal confidence of the Oth data to be analyzed; exp[] is an exponential function with the natural constant e as the base; i is the sequence number of the reference access control change sequence of the Oth data to be analyzed; k is the total number of the reference access control change sequence of the Oth data to be analyzed; S ( is the change correlation between the access control change sequence corresponding to the day of the Oth data to be analyzed and the i-th reference access control change sequence; H2 is the authenticity coefficient of the Oth data to be analyzed.
[0093] In the calculation formula of abnormal confidence, The smaller it is, the more it reflects that the corresponding access control change sequence of each person's data to be analyzed on the day is larger than the regular deviation of other reference access control change sequences in the preset historical period. The negative correlation mapping is multiplied and combined with the authenticity coefficient. On the basis of authenticity, combined with the relative regular deviation analysis of the access control change sequence, the greater the relative regular deviation, the greater the possibility of abnormality of the data to be analyzed, and the greater the corresponding abnormality confidence.
[0094] In other examples, implementers may also use other negative correlation mapping methods such as After adding the anti-zero positive parameter, perform the inverse operation, etc., or use addition or weighted summation to combine it with the authenticity coefficient; the implementer can also use the absolute value of the difference between the corresponding integral of the access control change sequence and the corresponding change curve in the process of obtaining the change similarity in step S301 to directly replace I won’t go into details here.
[0095] By changing the data to be analyzed, the abnormal confidence of each access control data in each person's access control management data sequence can be obtained, and the local abnormal score of the corresponding access control data can be further corrected according to the abnormal confidence to obtain the corrected abnormal score.
[0096] Preferably, in one embodiment of the present invention, considering that the value range of the anomaly confidence obtained in the above steps S301-S303 is 0 to 1, the anomaly confidence can be directly used as the confidence weight of the anomaly score; and considering that the local outlier factor reflects the possibility of anomaly of data in the local distance neighborhood, the local outlier factor is used as the corresponding local anomaly score; therefore, the method for obtaining the modified anomaly score includes:
[0097] The local outlier factor of each access control data is used as the corresponding local anomaly score; the local anomaly score of the corresponding access control data is weighted using the anomaly confidence, and the weighted result is used as the corrected anomaly score of the corresponding access control data. The corresponding calculation formula is: Among them, Q is the serial number of the access control data; is the corrected anomaly score of the Qth access control data; P Q is the abnormal confidence of the Qth access control data; LOF k (Q) is the local outlier factor of the Qth access control data, that is, the local anomaly score.
[0098] It should be noted that the local outlier factor is obtained based on the LOF algorithm, where k in the preset k-distance neighborhood is set to 5, which needs to be consistent with the preset k-distance neighborhood in the process of obtaining the local reachable density in step S2. The implementer can also set it according to actual needs. This is a well-known technology and will not be repeated here.
[0099] Taking into account that the nature of students on campus may be different, such as some students who go to school frequently and go in and out, while some students who live on campus have relatively few entries and exits in a preset historical period, the total number of access control times corresponding to the group with the same nature of students on campus should have a smaller deviation. If there is a large deviation between the total number of access control times corresponding to a certain person and the group with the same nature of students on campus, it is more likely that the person is an abnormal person entering and leaving the campus. Therefore, the embodiment of the present invention obtains the degree of access control abnormality for each person based on the difference between the access control management data sequence of each person and other people and the corrected abnormality score of all access control data in the corresponding access control management data sequence.
[0100] Preferably, in one embodiment of the present invention, the method for obtaining the degree of abnormality of access control includes:
[0101] The nature of each person's attendance at school is different, including at least day students and boarding students. The degree of abnormality of each person's access control times is obtained based on the total number of access control data in the access control management data sequence of each person and the difference in quantity between the total number of access control data in the access control management data sequence of other people with the same nature of attendance at school. The difference in quantity is positively correlated with the degree of abnormality of access control times.
[0102] The mean score of the corrected abnormality scores of all access control data in each person's access control management data sequence is obtained, and the product of the mean score and the degree of abnormality of the access control times is taken as the degree of access control abnormality.
[0103] The calculation formula for the access control abnormality degree is: Among them, Y P ″ is the access control abnormality level of the Pth person; Q is the serial number of the access control data; X P is the total number of access control data in the access control management data sequence of the Pth person; is the corrected abnormal score of the Qth access control data in the access control management data sequence of the Pth person; j is the number of the person with the same school nature as the Pth person among the people on campus; n is the total number of people with the same school nature as the Pth person among the people on campus; X G is the total number of access control data in the access control management data sequence of the jth person; || is the absolute value symbol; is the abnormality of the number of access control times of the Pth person; norm[] is the standard normalization function.
[0104] In the calculation formula of the access control abnormality level, the higher the mean score of the corrected abnormality score, the greater the abnormality level of the access control times, which means that the possibility that the person enters and leaves the campus abnormally is greater, so they are multiplied and combined; in other examples, the implementer can also use the maximum corrected abnormality score of the access control data in the access control management data sequence of the Pth person instead of the mean; the standard normalization function used is linear normalization. Since the possibility that the access control abnormality level of all people is the same is extremely low, the situation where the maximum value is equal to the minimum value can be ignored when using linear normalization. If this extreme situation exists, the normalized value is set to 1; the implementer can also use other normalization functions, which are not repeated here.
[0105] Step S4, perform smart campus management based on the degree of access control abnormality for each person.
[0106] In one embodiment of the present invention, people whose access control abnormality level is greater than or equal to a preset threshold are marked as abnormal ingress and egress of the campus, and their access control data is exported, analyzed and investigated to help relevant security managers quickly identify and respond to potential security risks; the preset threshold is set to 0.6, and the implementer can adjust the preset threshold by himself, without limitation here.
[0107] An embodiment of the present invention also provides a smart campus management system based on the Internet of Things, which includes: an access control acquisition module, an access control analysis module, and a smart management module.
[0108] The access control acquisition module is used to obtain each person's access control management data sequence, which includes all access control data of each day. The types of access control data include entry and exit;
[0109] The access control analysis module is used to obtain the authenticity coefficient of each access control data in each access control management data sequence according to the cross-type situation of each access control data and the adjacent access control data, combined with the difference between the corresponding time of the same type of access control data in other days, and the deviation of all access control data in all access control management data sequences; between the day where each access control data is located and other days, according to the change similarity of the corresponding time of all access control data in one day, combined with the authenticity coefficient of each access control data, obtain the abnormal confidence of each access control data; correct the local abnormal score of the corresponding access control data according to the abnormal confidence, and obtain the corrected abnormal score of each access control data; according to the difference between the access control management data sequence of each person and others and the corrected abnormal score of all access control data in the corresponding access control management data sequence, obtain the degree of access control abnormality of each person;
[0110] The smart management module is used to manage the smart campus based on the degree of access control abnormality of each person.
[0111] An embodiment of the present invention further provides a computer-readable storage medium having a computer-readable program stored thereon. When the computer-readable program is called, a smart campus management method based on the Internet of Things is executed as described in steps S1-S4.
[0112] In summary, the present invention first obtains each person's access control management data sequence, including all access control data of each day; in each access control management data sequence, analyzes the type intersection of access control data, historical access control rules and access control concentration, obtains the authenticity coefficient of each access control data, and further combines the similarity of changes in the access control data at corresponding moments within each day to obtain the abnormal confidence of each access control data, and then corrects the local abnormal score of each access control data, and further combines the differences between the access control management data sequences of different people to obtain the degree of access control abnormality of each person; and performs smart campus management according to the degree of access control abnormality. The present invention accurately analyzes and obtains the abnormal score of each access control data based on the entry and exit intersection characteristics in the access control tree of the on-campus personnel and the regular concentration nature of the personnel access control, thereby improving the accuracy of identifying abnormal people entering and leaving the campus, and thus improving the management effect of the smart campus.
[0113] It should be noted that the sequence of the above embodiments of the present invention is for description only and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0114] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A smart campus management method based on the Internet of Things, characterized in that: The method comprises: Obtaining a sequence of access control management data for each person, wherein the sequence of access control management data includes all access control data for each day, and the types of access control data include entry and exit; In each of the access control management data sequences, the authenticity coefficient of each of the access control data is obtained according to the intersection of the types of each of the access control data and the adjacent access control data, combined with the difference between the corresponding time of the same type of access control data in other days, and the deviation of all the access control data in all the access control management data sequences; Between the day where each access control data is located and other days, according to the similarity of changes in the corresponding moments of all the access control data in one day, combined with the authenticity coefficient of each access control data, the abnormal confidence of each access control data is obtained; according to the abnormal confidence, the local abnormal score of the corresponding access control data is corrected to obtain the corrected abnormal score of each access control data; according to the difference between the access control management data sequence of each person and other people and the corrected abnormal score of all the access control data in the corresponding access control management data sequence, the degree of access control abnormality of each person is obtained; Smart campus management is carried out according to the abnormal degree of access control for each person; The method for obtaining the authenticity coefficient includes: In each of the access control management data sequences, if each of the access control data is of the same type as the adjacent access control data, the corresponding access control data and the adjacent access control data of the same type are both used as target access control data; Between adjacent target access control data, the preference of each target access control data relative to another target access control data is obtained based on the minimum time interval between each target access control data and the corresponding time of the same type of access control data in other days, combined with the local reachable density of each target access control data; Between adjacent target access control data, according to the preference of each target access control data relative to another target access control data, the authenticity coefficient of each target access control data is obtained; the authenticity coefficient of all non-target access control data in the access control management data sequence is set to a preset normal number; The method for obtaining the abnormal confidence level includes: Construct an access control change sequence according to the corresponding time of all access control data of each person every day; obtain the corresponding change similarity according to the sequence difference between the access control change sequences of each person; Taking any of the access control data in the access control management data sequence of each person as the data to be analyzed, and screening out a reference access control change sequence corresponding to the access control change sequence on the day of the data to be analyzed from all the access control change sequences of each person according to the change similarity; According to the change similarity between the access control change sequence corresponding to the day of the data to be analyzed and all the reference access control change sequences, and the authenticity coefficient of the data to be analyzed, the abnormality confidence of the data to be analyzed is obtained; the change similarity is negatively correlated with the abnormality confidence, and the authenticity coefficient is positively correlated with the abnormality confidence; The method for obtaining the modified abnormality score includes: The abnormality confidence is a normalized value; the local outlier factor of each access control data is used as the corresponding local abnormality score; the local abnormality score corresponding to the access control data is weighted by using the abnormality confidence, and the weighted result is used as the corrected abnormality score corresponding to the access control data; The method for obtaining the access control abnormality degree includes: The nature of each person's attendance at school is different, including at least day students and boarding students; the degree of abnormality of the number of access control visits for each person is obtained based on the total number of access control data in the access control management data sequence of each person relative to the total number of access control data in the access control management data sequence of other people with the same nature of attendance at school; the difference in number is positively correlated with the degree of abnormality of the number of access control visits; The average score of the corrected abnormality scores of all the access control data in the access control management data sequence of each person is obtained, and the product of the average score and the abnormality degree of the access control times is taken as the access control abnormality degree.
2. According to the method for managing a smart campus based on the Internet of Things according to claim 1, it is characterized in that: The method for obtaining the preference includes: Take the time corresponding to each target access control data as the target time, take the time corresponding to the same type of access control data in other days that is closest to the target time as a reference time; take the time interval between the target time and each reference time as a minimum time interval; According to all the minimum time intervals corresponding to each of the target access control data, a relative habit coefficient of each of the target access control data is obtained, wherein the minimum time interval is negatively correlated with the relative habit coefficient; Between adjacent target access control data, the preference of each target access control data relative to another target access control data is obtained based on the difference in the relative habit coefficient and the difference in the local reachable density; the difference in the relative habit coefficient and the difference in the local reachable density are both positively correlated with the preference.
3. According to the method for managing a smart campus based on the Internet of Things in claim 1, it is characterized in that: The method for obtaining the change similarity includes: Construct two-dimensional sample points based on the corresponding time of all the access control data of each person every day, and each dimension of the two-dimensional sample points represents the corresponding time; construct a corresponding access control change sequence based on the two-dimensional sample points as sequence elements; map the sequence elements in the access control change sequence to a two-dimensional coordinate system to obtain a corresponding change curve; According to the integral difference between the change curves corresponding to different access control change sequences, the change similarity between different access control change sequences of each person is obtained, and the integral difference is negatively correlated with the change similarity.
4. According to the method for managing a smart campus based on the Internet of Things in claim 1, it is characterized in that: The method for obtaining the reference access control change sequence includes: Taking the change similarity as the distance measurement, all clusters are obtained based on the preset K value and K-means algorithm, and all the access control change sequences in the cluster corresponding to the access control change sequence on the day of the data to be analyzed are used as reference access control change sequences.
5. A smart campus management system based on the Internet of Things, characterized in that: The system comprises: A collection module is used to obtain a sequence of access control management data for each person, wherein the sequence of access control management data includes all access control data for each day, and the types of access control data include entry and exit; The analysis module is used to obtain the authenticity coefficient of each access control data in each access control data sequence according to the crossover between each access control data and the adjacent access control data, combined with the difference between the corresponding time of the same access control data in other days, and the deviation of all the access control data in all the access control data sequences; between the day where each access control data is located and other days, according to the similarity of the change of the corresponding time of all the access control data in one day, combined with the authenticity coefficient of each access control data, obtain the abnormal confidence of each access control data; correct the local abnormal score of the corresponding access control data according to the abnormal confidence to obtain the corrected abnormal score of each access control data; obtain the degree of access control abnormality of each person according to the difference between the access control data sequence of each person and other people and the corrected abnormal score of all the access control data in the access control data sequence; A management module, used to manage the smart campus according to the abnormal degree of access control for each person; The method for obtaining the authenticity coefficient includes: In each of the access control management data sequences, if each of the access control data is of the same type as the adjacent access control data, the corresponding access control data and the adjacent access control data of the same type are both used as target access control data; Between adjacent target access control data, the preference of each target access control data relative to another target access control data is obtained based on the minimum time interval between each target access control data and the corresponding time of the same type of access control data in other days, combined with the local reachable density of each target access control data; Between adjacent target access control data, obtaining the authenticity coefficient of each target access control data according to the preference of each target access control data relative to another target access control data; setting the authenticity coefficient of all non-target access control data in the access control management data sequence to a preset normal number; The method for obtaining the abnormal confidence level includes: Construct an access control change sequence according to the corresponding time of all access control data of each person every day; obtain the corresponding change similarity according to the sequence difference between the access control change sequences of each person; Taking any of the access control data in the access control management data sequence of each person as the data to be analyzed, and screening out a reference access control change sequence corresponding to the access control change sequence on the day of the data to be analyzed from all the access control change sequences of each person according to the change similarity; According to the change similarity between the access control change sequence corresponding to the day of the data to be analyzed and all the reference access control change sequences, and the authenticity coefficient of the data to be analyzed, the abnormality confidence of the data to be analyzed is obtained; the change similarity is negatively correlated with the abnormality confidence, and the authenticity coefficient is positively correlated with the abnormality confidence; The method for obtaining the modified abnormality score includes: The abnormality confidence is a normalized value; the local outlier factor of each access control data is used as the corresponding local abnormality score; the local abnormality score corresponding to the access control data is weighted by using the abnormality confidence, and the weighted result is used as the corrected abnormality score corresponding to the access control data; The method for obtaining the access control abnormality degree includes: The nature of each person's attendance at school is different, including at least day students and boarding students; the degree of abnormality of the number of access control visits for each person is obtained based on the total number of access control data in the access control management data sequence of each person relative to the total number of access control data in the access control management data sequence of other people with the same nature of attendance at school; the difference in number is positively correlated with the degree of abnormality of the number of access control visits; The average score of the corrected abnormality scores of all the access control data in the access control management data sequence of each person is obtained, and the product of the average score and the abnormality degree of the access control times is taken as the access control abnormality degree.
6. A computer-readable storage medium having a computer-readable program stored thereon, characterized in that: When the computer-readable program is called, it executes a smart campus management method based on the Internet of Things as described in any one of claims 1-4.