Transaction detection method, device, equipment and storage medium

By acquiring pedestrian flow data of the target grid and preset baseline data, the first anomaly information is determined and combined with pedestrian flow data of the adjacent area of ​​the anomaly. By using methods such as Nightingale rose graphics and anomaly coefficients, the problem of low accuracy caused by dirty data and offset data in pedestrian flow detection is solved, and higher detection accuracy is achieved.

CN116975650BActive Publication Date: 2026-04-24CHINA MOBILE GROUP JIANGSU +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILE GROUP JIANGSU
Filing Date
2023-07-18
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing technologies have poor resistance to interference from dirty and offset data in people flow detection, resulting in low detection accuracy.

Method used

By acquiring pedestrian traffic data and preset baseline data for the target grid, the first anomaly information is determined, and the anomaly neighboring area is determined based on the first anomaly information. The second anomaly information is determined by combining the pedestrian traffic data of the anomaly neighboring area, and finally the actual anomaly information of the target grid is determined. The Nightingale rose diagram and anomaly coefficient are used to improve the detection accuracy.

Benefits of technology

It improves the accuracy of detecting abnormal pedestrian flow and enhances the ability to resist interference from dirty data and data offset.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116975650B_ABST
    Figure CN116975650B_ABST
Patent Text Reader

Abstract

The application discloses an abnormality detection method, device and equipment and a storage medium, and comprises the following steps: obtaining people flow data of a target grid and preset reference data; determining first abnormality information of the target grid according to the people flow data and the preset reference data; in the case that the target grid is determined to be an abnormal grid according to the first abnormality information, determining an abnormal adjacent area corresponding to the target grid; determining second abnormality information according to the people flow data of the abnormal adjacent area; and determining actual abnormality information of the target grid according to the first abnormality information and the second abnormality information. The actual abnormality information of the target grid is determined through the first abnormality information of the target grid and the second abnormality information of the abnormal adjacent area, the technical problem of poor anti-interference capability of dirty data and data offset in the prior art is solved, and the accuracy of people flow abnormality detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to an anomaly detection method, apparatus, device, and storage medium. Background Technology

[0002] Currently, when conducting pedestrian flow detection, a baseline value for pedestrian flow in a certain area is generally determined. Then, the pedestrian flow situation in the area is compared with the baseline value to conclude whether a clustering has occurred in the area. However, the above method has poor resistance to interference from dirty and offset data, resulting in low detection accuracy. Summary of the Invention

[0003] The main objective of this invention is to provide an anomaly detection method, apparatus, device, and storage medium, aiming to solve the technical problem of low accuracy in existing pedestrian flow detection technology.

[0004] To achieve the above objectives, the present invention provides an anomaly detection method, the method comprising the following steps:

[0005] Acquire pedestrian traffic data and preset baseline data for the target grid;

[0006] The first anomaly information of the target grid is determined based on the pedestrian flow data and the preset benchmark data;

[0007] If the target grid is determined to be an abnormal grid based on the first abnormality information, an abnormality neighboring region corresponding to the target grid is determined;

[0008] The second abnormality information is determined based on the pedestrian flow data in the vicinity of the abnormality.

[0009] The actual anomaly information of the target grid is determined based on the first anomaly information and the second anomaly information.

[0010] Optionally, the preset benchmark data includes preset pedestrian flow benchmark values ​​and preset area benchmark values;

[0011] The step of determining the first anomaly information of the target grid based on the pedestrian flow data and the preset benchmark data includes:

[0012] The pedestrian flow data is compared with a preset pedestrian flow benchmark value, and the pedestrian flow deviation information is determined based on the comparison results;

[0013] Generate a grid pedestrian flow curve corresponding to the target grid based on the preset data slice time and the pedestrian flow data, and determine the area under the curve value of the grid pedestrian flow curve;

[0014] The area under the curve is compared with the preset area benchmark value, and the area deviation information is determined based on the comparison result.

[0015] The first anomaly information of the target grid is determined based on the pedestrian flow deviation information, the area deviation information, and the preset weight.

[0016] Optionally, before acquiring the pedestrian flow data and preset baseline data for the target grid, the method further includes:

[0017] The historical pedestrian flow data of the target grid is sliced ​​according to a preset time interval to obtain multiple historical pedestrian flow data corresponding to each data slice time.

[0018] The number of data bins for the historical pedestrian flow data is determined based on the number of time slices in the data slice and the preset detection period.

[0019] The data interval is determined based on the historical pedestrian flow data and the number of data bins, and the data endpoints of each data bin are determined based on the data intervals.

[0020] A pedestrian flow line graph is constructed based on the data endpoints of each data bin, and the preset pedestrian flow baseline value of the target grid is determined based on the convergence of the pedestrian flow line graph.

[0021] Optionally, the step of determining the data interval based on the historical pedestrian flow data and the number of data bins, and determining the data endpoints of each data bin based on the data interval, includes:

[0022] The maximum and minimum historical pedestrian flow rates are determined based on the historical pedestrian flow data.

[0023] The data interval is determined based on the maximum historical traffic volume, the minimum historical traffic volume, and the number of data bins;

[0024] The data endpoints of each data bin are determined based on the minimum historical pedestrian flow and the data interval.

[0025] Optionally, before acquiring the pedestrian flow data and preset baseline data for the target grid, the method further includes:

[0026] The historical pedestrian flow data of the target grid is sliced ​​according to a preset time interval to obtain multiple historical pedestrian flow data corresponding to each slice time.

[0027] A pedestrian flow curve is constructed based on the preset detection period and the historical pedestrian flow corresponding to each data slice time.

[0028] The preset area benchmark value is determined based on the area under the curve of the pedestrian flow curve.

[0029] Optionally, when the target grid is determined to be an anomaly grid based on the first anomaly information, determining the anomaly neighboring region corresponding to the target grid includes:

[0030] If the target grid is determined to be an abnormal grid based on the first abnormality information, the abnormality type of the target grid is determined based on the first abnormality information;

[0031] When the anomaly type is a high-frequency anomaly type, determine multiple adjacent grids of the target grid;

[0032] A Nightingale rose graphic is constructed based on the anomaly scores of the multiple adjacent grids, and the overlap area between the Nightingale rose graphic and the multiple grids is determined.

[0033] The abnormal neighboring region corresponding to the target grid is determined based on the overlapping area.

[0034] Optionally, after determining the first anomaly information of the target grid based on the pedestrian flow data and the preset reference data, the method further includes:

[0035] If the target grid is determined to be an abnormal grid based on the first abnormality information, the pedestrian traffic data of the adjacent grids of the target grid are obtained;

[0036] The anomaly coefficient is determined based on the nearby pedestrian traffic data;

[0037] The number of people moving in the target grid is determined based on the anomaly coefficient and the pedestrian flow data.

[0038] Furthermore, to achieve the above objectives, the present invention also proposes an anomaly detection device, the device comprising:

[0039] The acquisition module is used to acquire pedestrian traffic data and preset baseline data for the target grid.

[0040] The determination module is used to determine the first anomaly information of the target grid based on the pedestrian flow data and the preset benchmark data;

[0041] The determining module is further configured to determine the anomalous neighboring region corresponding to the target grid when the target grid is determined to be an anomalous grid based on the first anomalous information;

[0042] The determining module is further configured to determine second anomaly information based on the pedestrian flow data in the adjacent area of ​​the anomaly.

[0043] The determining module is further configured to determine the actual anomaly information of the target grid based on the first anomaly information and the second anomaly information.

[0044] Furthermore, to achieve the above objectives, the present invention also proposes an anomaly detection device, the device comprising: a memory, a processor, and an anomaly detection program stored in the memory and executable on the processor, the anomaly detection program being configured to implement the steps of the anomaly detection method as described above.

[0045] In addition, to achieve the above objectives, the present invention also proposes a storage medium storing an anomaly detection program, which, when executed by a processor, implements the steps of the anomaly detection method as described above.

[0046] This invention acquires pedestrian flow data and preset reference data for a target grid; determines first anomaly information of the target grid based on the pedestrian flow data and the preset reference data; if the target grid is determined to be an anomaly grid based on the first anomaly information, determines an anomaly neighboring region corresponding to the target grid; determines second anomaly information based on the pedestrian flow data of the anomaly neighboring region; and determines the actual anomaly information of the target grid based on the first anomaly information and the second anomaly information. This invention, by determining the second anomaly information based on the pedestrian flow data of the corresponding anomaly neighboring region when the target grid is determined to be an anomaly grid based on the first anomaly information, and by determining the actual anomaly information of the target grid based on the first anomaly information and the second anomaly information of the anomaly neighboring region, solves the technical problem of poor anti-interference ability against dirty data and data offset in the prior art, and improves the accuracy of pedestrian flow anomaly detection. Attached Figure Description

[0047] Figure 1 This is a schematic diagram of the structure of the hardware operating environment anomaly detection device involved in the embodiments of the present invention;

[0048] Figure 2 This is a flowchart illustrating the first embodiment of the anomaly detection method of the present invention;

[0049] Figure 3 This is a flowchart illustrating the second embodiment of the anomaly detection method of the present invention;

[0050] Figure 4 This is a flowchart illustrating the third embodiment of the anomaly detection method of the present invention;

[0051] Figure 5 This is a schematic diagram illustrating the determination of the anomaly proximity region based on the Nightingale rose diagram in one embodiment of the anomaly detection method of the present invention;

[0052] Figure 6 This is a schematic diagram illustrating the determination of the anomaly proximity region corresponding to a moderate anomaly type in one embodiment of the anomaly detection method of the present invention;

[0053] Figure 7 This is a schematic diagram of the anomaly proximity area corresponding to a general anomaly type in one embodiment of the anomaly detection method of the present invention;

[0054] Figure 8 This is a structural block diagram of the first embodiment of the anomaly detection device of the present invention.

[0055] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0056] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0057] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of the hardware operating environment anomaly detection device involved in the embodiment of the present invention.

[0058] like Figure 1 As shown, the anomaly detection device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.

[0059] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the anomaly detection device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0060] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and an anomaly detection program.

[0061] exist Figure 1 In the anomaly detection device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 can be set in the anomaly detection device. The anomaly detection device calls the anomaly detection program stored in the memory 1005 through the processor 1001 and executes the anomaly detection method provided in the embodiment of the present invention.

[0062] This invention provides an anomaly detection method, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the anomaly detection method of the present invention.

[0063] In this embodiment, the anomaly detection method includes the following steps:

[0064] Step S10: Obtain the pedestrian flow data and preset baseline data of the target grid.

[0065] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or anomaly detection device capable of performing the above functions. The following uses an anomaly detection device as an example to illustrate this embodiment and the subsequent embodiments.

[0066] Understandably, a target grid can be a grid that requires pedestrian flow detection to determine if there are any abnormal pedestrian flow patterns. If the pedestrian flow within a grid exceeds the corresponding baseline value, it can be determined that there is an anomaly in pedestrian flow within that grid. A grid (Grid-GR) can be a grid of squares with fixed intervals (e.g., 100m*100m) drawn on top of an existing public map, and this grid is used as the data granularity to display some basic information (such as pedestrian flow). A raster map (Raster Map-RM) can be a raster layer created on top of an existing public map, with each raster as a unit, and then merged with the existing map to form a raster map. Pedestrian flow data can be real-time monitoring data of pedestrian flow within the area corresponding to the grid. Preset baseline data can be baseline data pre-set based on historical pedestrian flow data within the area corresponding to the grid.

[0067] Step S20: Determine the first anomaly information of the target grid based on the pedestrian flow data and the preset benchmark data.

[0068] It is understandable that the first anomaly information can be the offset information of the pedestrian flow data within the target grid relative to the corresponding preset baseline data. The first anomaly information includes, but is not limited to: anomaly size, anomaly ratio, and anomaly score.

[0069] As one approach, pedestrian flow data is compared with preset baseline data, and information such as the magnitude, proportion, and score of the anomaly in the target grid are determined based on the comparison results.

[0070] Step S30: If the target grid is determined to be an abnormal grid based on the first abnormality information, determine the abnormality neighboring region corresponding to the target grid.

[0071] It is understandable that an abnormal grid can be a grid with abnormal pedestrian flow data; the abnormal neighboring area can be an area composed of grids adjacent to the target grid.

[0072] Step S40: Determine the second abnormality information based on the pedestrian flow data of the adjacent area of ​​the abnormality.

[0073] It is understandable that the pedestrian traffic data in the vicinity of the anomaly can be the pedestrian traffic data of all grids in the vicinity of the anomaly; the second anomaly information includes, but is not limited to, anomaly size, anomaly ratio, and anomaly score, etc. Anomaly size can be the amount of deviation of pedestrian traffic data from preset benchmark data, anomaly ratio can be the proportion of deviation of pedestrian traffic data from preset benchmark data, and anomaly score can be a score based on the anomaly situation.

[0074] Step S50: Determine the actual anomaly information of the target grid based on the first anomaly information and the second anomaly information.

[0075] It is understandable that the actual anomaly information can be the anomaly information of the final output target raster, and the actual anomaly information includes, but is not limited to: anomaly size, anomaly ratio, and anomaly score.

[0076] In practice, the pedestrian flow data of the area corresponding to the target grid and the preset benchmark data of the target grid are obtained. The pedestrian flow data is compared with the preset benchmark data. Based on the comparison results, the anomaly size, anomaly ratio and anomaly score of the target grid are determined. Based on the anomaly score, it is determined whether the target grid is an anomaly grid. If so, the anomaly neighboring area composed of grids close to the target grid is determined. Based on the pedestrian flow data of the anomaly neighboring area, the anomaly size, anomaly ratio and anomaly score of the anomaly neighboring area are determined. Based on the anomaly score of the target grid and the anomaly score of the anomaly neighboring area, the actual anomaly score of the target grid is determined.

[0077] Furthermore, to improve the accuracy of pedestrian flow anomaly detection, the preset benchmark data includes a preset pedestrian flow benchmark value and a preset area benchmark value. Step S20 includes: comparing the pedestrian flow data with the preset pedestrian flow benchmark value and determining pedestrian flow deviation information based on the comparison result; generating a grid pedestrian flow curve corresponding to the target grid based on the preset data slice time and the pedestrian flow data, and determining the area under the curve value of the grid pedestrian flow curve; comparing the area under the curve value with the preset area benchmark value and determining area deviation information based on the comparison result; and determining the first anomaly information of the target grid based on the pedestrian flow deviation information, the area deviation information, and a preset weight.

[0078] It is understandable that the preset traffic flow benchmark value can be a benchmark value determined based on the historical traffic flow data of the target grid for judging traffic flow anomalies; the preset area benchmark value can be a benchmark value determined based on the area under the traffic flow curve constructed based on the historical traffic flow data of the target grid for judging traffic flow anomalies; traffic flow deviation information can be the deviation information between traffic flow data and the preset traffic flow benchmark value, including but not limited to: the number of times traffic flow data exceeds the preset traffic flow benchmark value, the magnitude of the traffic flow data exceeding the preset traffic flow benchmark value, and the proportion of traffic flow data exceeding the preset traffic flow benchmark value; the preset data slice time can be the predetermined time for slicing traffic flow data; the grid traffic flow curve can be a curve constructed based on the traffic flow corresponding to the preset data slice time; the area under the curve can be the area of ​​the graph between the grid traffic flow curve and the coordinate axis; the area deviation information can be the deviation information between the area under the curve value and the preset area benchmark value, including but not limited to: the magnitude of the area under the curve value exceeding the preset area benchmark value and the proportion of the area under the curve value exceeding the preset area benchmark value; the preset weight can be the pre-set weight of each judgment dimension.

[0079] It should be understood that pedestrian flow data may vary at different times. Therefore, different preset pedestrian flow benchmark values ​​and preset area benchmark values ​​can be set for different detection periods. Each judgment dimension has a preset weight corresponding to a weight threshold. If the preset weight is greater than the weight threshold, the corresponding judgment dimension will be given a corresponding reward.

[0080] In practical implementation, for example, it is necessary to detect pedestrian flow anomalies in the area corresponding to the target grid during time periods A and B. This involves acquiring pedestrian flow data, a preset pedestrian flow baseline value, and a preset area baseline value for time periods A and B. The pedestrian flow data is compared with the preset pedestrian flow baseline value at a set time. Based on the comparison results, the number of times (C) the pedestrian flow data exceeds the preset pedestrian flow baseline value during time periods A and B (also known as the number of times the grid is alerted), the magnitude of the pedestrian flow data exceeding the preset pedestrian flow baseline value (D), and the proportion of the pedestrian flow data exceeding the preset pedestrian flow baseline value (E) are determined. The pedestrian flow data at the corresponding time in the preset data slice time within time periods A and B is obtained. A grid pedestrian flow curve for time periods A and B is constructed based on the acquired pedestrian flow data, and the area under the curve of the grid pedestrian flow curve within time periods A and B is calculated. This area under the curve value is then compared with the preset area baseline value. The baseline values ​​are compared, and the proportion F of the area under the curve exceeding the preset area baseline value is determined based on the comparison results. Assuming that the weight values ​​corresponding to C, D, E and F are 35%, 15%, 25% and 25% respectively, the score of this dimension is determined according to the ratio of C to the preset number of times. For example, if the ratio is greater than or equal to 100%, the score of this dimension is 35 points. The scores of other dimensions can be calculated in a similar way. The final anomaly score of the target grid is calculated based on the scores calculated for each dimension. Assuming that the calculated anomaly score is 90, and the weights of C, D and E are set to 40%, 20% and 30% respectively, then the corresponding bonus points are given to these three dimensions. For example, if the bonus score is 5, the final calculated anomaly score of the target grid is 105 points. The above weights and scores can be adjusted according to the specific scenario, and this embodiment does not limit them here.

[0081] This embodiment acquires pedestrian flow data and preset reference data for a target grid; determines first anomaly information for the target grid based on the pedestrian flow data and the preset reference data; if the target grid is determined to be an anomaly grid based on the first anomaly information, determines the anomaly neighboring region corresponding to the target grid; determines second anomaly information based on the pedestrian flow data of the anomaly neighboring region; and determines the actual anomaly information of the target grid based on the first anomaly information and the second anomaly information. This embodiment, by determining the second anomaly information based on the pedestrian flow data of the anomaly neighboring region corresponding to the target grid when the target grid is determined to be an anomaly grid based on the first anomaly information, and then determining the actual anomaly information of the target grid based on the first and second anomaly information, solves the technical problem of poor anti-interference capability against dirty data and data offset in the prior art, and improves the accuracy of pedestrian flow anomaly detection.

[0082] refer to Figure 3 , Figure 3 This is a flowchart illustrating the second embodiment of the anomaly detection method of the present invention.

[0083] Based on the first embodiment described above, in this embodiment, before step S10, the method further includes:

[0084] Step S01: Slice the historical pedestrian traffic data of the target grid according to the preset time interval to obtain multiple historical pedestrian traffic data corresponding to each data slice time.

[0085] It is understandable that the preset time interval can be a pre-set time interval for data slicing; the historical traffic data can be the traffic data of the target grid area monitored within the preset historical time period; the data slicing time can be the time when data slicing is performed, and each data slicing time corresponds to a historical traffic data.

[0086] Step S02: Determine the number of data bins for the historical pedestrian flow data based on the number of time slices of the data slices and the preset detection period.

[0087] It is understandable that the preset detection period can be a pre-set period for detecting abnormal pedestrian flow in the target grid; the number of time slices can be the number of time slices within the preset detection period; for example, if the preset detection period is 9:00-12:00 and the preset time interval is 15 minutes, then the number of time slices within this period is 12; the number of data bins can be the number of data bins for historical pedestrian flow data.

[0088] Step S03: Determine the data interval based on the historical pedestrian flow data and the number of data bins, and determine the data endpoint of each data bin based on the data interval.

[0089] It is understandable that the data interval can be the interval of pedestrian flow between data bins; the data endpoint can be the starting point and ending point of pedestrian flow data for each data bin.

[0090] Step S04: Construct a pedestrian flow line graph based on the data endpoints of each data bin, and determine the preset pedestrian flow baseline value of the target grid based on the convergence of the pedestrian flow line graph.

[0091] Understandably, a pedestrian flow line chart can be a line chart constructed based on data endpoints that can represent pedestrian flow.

[0092] As one implementation method, the instantaneous pedestrian flow count value of the grid in each data bin is determined based on the data endpoints of each data bin, that is, the instantaneous pedestrian flow count value of the grid between every two data endpoints. A pedestrian flow line chart is constructed based on each pedestrian flow count value. The pedestrian flow count value can be the number of times the same instantaneous pedestrian flow occurs.

[0093] In practice, the historical pedestrian traffic data of the target grid is sliced ​​according to a preset time interval to obtain multiple historical pedestrian traffic data corresponding to each data slice moment. The number of data bins for the historical pedestrian traffic data is determined according to the duration of the preset detection period and the number of time slices. The data interval is determined according to the historical pedestrian traffic data and the number of data bins. The data endpoints of each data bin are determined according to the data interval. The count value of the same instantaneous pedestrian traffic between every two data endpoints is counted. A pedestrian traffic line chart is constructed based on the count value. The slope of each line segment is calculated. The last convergence value in each line segment is taken. The data endpoint before the convergence value is taken as the preset pedestrian traffic baseline value of the target grid in the preset detection period.

[0094] Furthermore, in order to improve the accuracy of the preset traffic flow benchmark value and thus improve the accuracy of traffic flow anomaly detection, step S03 includes: determining the maximum and minimum historical traffic flow based on the historical traffic flow data; determining the data interval based on the maximum historical traffic flow, the minimum historical traffic flow, and the number of data bins; and determining the data endpoints of each data bin based on the minimum historical traffic flow and the data interval.

[0095] It is understandable that the maximum historical traffic volume can be the maximum traffic volume in the historical traffic volume data within the preset detection period; the minimum historical traffic volume can be the minimum traffic volume in the historical traffic volume data within the preset detection period; the data interval is obtained by subtracting the minimum historical traffic volume from the maximum historical traffic volume and dividing by the number of data bins; the data endpoint of each data bin is obtained by adding the minimum historical traffic volume to the product of the data interval and the breakpoint number.

[0096] In one example, the first step is data slicing: Historical pedestrian traffic data within the target grid is sliced ​​and recorded at preset time intervals (assuming a preset time interval of 15 minutes) on a single grid unit, and stored in a database table. The table includes the date (year / month / day), the data slicing time (accurate to the second), and the instantaneous pedestrian traffic (people). The second step is to preprocess the sliced ​​data to obtain a preset pedestrian traffic baseline value for the target grid. This preset baseline value is used to determine whether the target grid has experienced any anomalies. The instantaneous pedestrian flow of the target grid is compared with the preset pedestrian flow baseline value calculated offline to determine whether the grid has changed; Step 1: Divide the historical pedestrian flow data in the data table according to the preset detection period, for example, divide a day into 5 preset detection periods: morning (9:00-12:00), noon (12:00-14:00), afternoon (14:00-18:00), evening (18:00-22:00), and night (22:00-9:00); Step 2: Using the target single grid as Step 1: Select data from 2 days before and 15 days before the date to be predicted, and aggregate these data into a dataset as a training set for later use. Use real-time data as the prediction set. Step 2: Calculate the maximum and minimum historical pedestrian traffic of the target grid. Step 3: Using the maximum and minimum historical pedestrian traffic as the data range, divide the instantaneous pedestrian traffic of the target grid into bins, and calculate the interval between bins. The number of data bins is determined by the difference between the maximum and minimum historical pedestrian traffic and the number of time slices in the preset detection period. To ensure the reliability of the algorithm under extreme conditions, each data bin should have at least two time slice values. Assuming the preset detection period is 9:00-12:00, the minimum value of the bin is 3 (number of hours in the minimum time period) * 4 (number of time slices per hour) / 2, which is 6. Secondly, the number of bins should be positively correlated with the number of training days. Therefore, if the number of data bins is f and the number of hours in the training period is t, then f = 6 + (15-2) / t.Assuming the maximum historical pedestrian flow of the target grid is Pmax, the minimum historical pedestrian flow is Pmin, the number of data bins is f, and the data interval is I, the data interval can be calculated as: I = (Pmax - Pmin) / f; Step 5: Calculate the data endpoints Dn of each data bin in the target grid dataset based on the maximum historical pedestrian flow Pmax, the minimum historical pedestrian flow Pmin, and the endpoint number n. The data endpoints can be calculated as: Dn = Pmin + I * (n-1); Step 6: Observe the distribution of pedestrian flow counts through a pedestrian flow line graph: Calculate the instantaneous pedestrian flow count of the grid in each data bin of the target grid dataset, that is, the instantaneous pedestrian flow count between every two data endpoints Dn, denoted as Cn. For example, if the instantaneous pedestrian flow m occurs n times, the count value is n; Plot a line graph of Cn with Pmin as the starting point, I as the interval, and Pmax as the maximum value. Step 7: Calculate the slope of each segment of the line and take the last converged value. Take the data endpoint before the converged value as the preset traffic flow benchmark value. If the line does not converge, take the maximum historical traffic flow Pmax as the preset traffic flow benchmark value.

[0097] Furthermore, in order to improve the accuracy of the preset area benchmark value and thus improve the accuracy of pedestrian flow anomaly detection, before step S10, the method further includes: performing data slicing on the historical pedestrian flow data of the target grid according to a preset time interval to obtain multiple historical pedestrian flows corresponding to each slice time; constructing a pedestrian flow curve based on the preset detection period and the multiple historical pedestrian flows corresponding to each data slice time; and determining the preset area benchmark value based on the area under the curve of the pedestrian flow curve.

[0098] In specific implementation, for example: obtaining the historical traffic flow corresponding to each data slice time within a preset detection period (for example, the preset detection period is 14:00-18:00, which is 4 hours. Assuming the preset time interval is 15 minutes, there are a total of 4*4 data slices, and the historical traffic flow corresponding to the 16 data slice times is obtained). The image between any two data slice times can be approximated as a trapezoid. Since the height of each trapezoid is the difference between the times of two adjacent data slices, that is, the height of each trapezoid is equal, k can be used as the height of the trapezoid. The area under the curve is approximated by calculating the area of ​​the trapezoid. The preset area reference value can be obtained by summing the areas of each trapezoid. In order to improve the accuracy of the preset area reference value, multiple areas under the curve can be calculated. The maximum and minimum values ​​of the multiple areas under the curve are removed, and the average value of the remaining areas under the curve is calculated. This average value is used as the preset area reference value of the target grid.

[0099] This embodiment segments the historical pedestrian flow data of the target grid according to a preset time interval, obtaining multiple historical pedestrian flow data corresponding to each data slice time. The number of data bins for the historical pedestrian flow data is determined based on the number of time slices in each data slice and a preset detection period. A data interval is determined based on the historical pedestrian flow data and the number of data bins, and the data endpoints of each data bin are determined based on the data intervals. A pedestrian flow line graph is constructed based on the data endpoints of each data bin, and a preset pedestrian flow baseline value for the target grid is determined based on the convergence of the pedestrian flow line graph. This embodiment segments the historical pedestrian flow data of the target grid, constructs a pedestrian flow line graph based on the data endpoints of each data bin, and determines the preset pedestrian flow baseline value for the target grid based on the convergence of the pedestrian flow line graph. This improves the accuracy of the baseline value and enhances both the anti-interference capability and accuracy of pedestrian flow anomaly detection.

[0100] refer to Figure 4 , Figure 4 This is a flowchart illustrating the third embodiment of the anomaly detection method of the present invention.

[0101] Based on the above embodiments, in this embodiment, step S30 includes:

[0102] Step S301: If the target grid is determined to be an abnormal grid based on the first abnormal information, the abnormal type of the target grid is determined based on the first abnormal information.

[0103] It is understandable that the types of anomalies include, but are not limited to: high-frequency anomalies, medium-frequency anomalies, general anomalies, and no anomalies.

[0104] In practice, the anomaly score of the target grid is determined based on the first anomaly information, and the anomaly type of the target grid is determined based on the score range to which the anomaly score belongs.

[0105] Step S302: If the anomaly type is a high-frequency anomaly type, determine multiple adjacent grids of the target grid.

[0106] It is understandable that the high-frequency anomaly type can be an anomaly type whose anomaly score is greater than the preset high-frequency threshold; the adjacent grid can be a grid adjacent to the target grid.

[0107] Step S303: Construct a Nightingale rose graphic based on the anomaly scores of the multiple adjacent grids, and determine the overlap area between the Nightingale rose graphic and the multiple grids.

[0108] In practice, an initial sector is constructed for each adjacent grid. The central angle and radius of each initial sector are adjusted according to the anomaly score of each adjacent grid to obtain the Nightingale rose pattern corresponding to the target grid.

[0109] Step S304: Determine the abnormal neighboring region corresponding to the target grid based on the overlapping area.

[0110] In specific implementation, when the target grid is determined to be an abnormal grid based on the first abnormality information, the abnormality type of the target grid is determined based on the abnormality score in the first abnormality information. If the abnormality score is greater than a preset high-frequency threshold, the abnormality type of the target grid is determined to be a high-frequency abnormality type. Multiple adjacent grids of the target grid are determined, and an initial sector corresponding to each adjacent grid is constructed. The central angle and radius of each initial sector are adjusted according to the abnormality score of each adjacent grid to obtain the Nightingale rose pattern of the target grid. The overlapping area between the Nightingale rose pattern and the grid is obtained. When the overlapping area is greater than a preset ratio of the area of ​​the grid, the grid is determined to be an abnormal grid. All abnormal grids form an abnormal adjacent region.

[0111] In one example: if the target grid is determined to be an anomalous grid based on the first anomaly information, the anomaly type of the target grid is determined based on its anomaly score. Assuming the target grid's anomaly score is 105 points, the score range and corresponding anomaly types are as follows: scores greater than or equal to 100 points represent high-frequency anomalies, [60, 100) represent medium-frequency anomalies, [20, 60) represent general anomalies, and [0, 20) represent no anomalies. Therefore, the target grid's anomaly type is determined to be a high-frequency anomaly type. (Refer to...) Figure 5 , Figure 5 This document presents a schematic diagram for determining the adjacent area of ​​anomalies based on the Nightingale Rose diagram. It identifies eight grids adjacent to the target grid. Based on the pedestrian traffic data of each adjacent grid, it calculates the anomaly score for each of the eight adjacent grids and outputs the anomaly scores of all adjacent grids of the anomaly grid, along with their corresponding relationships. Using each adjacent grid as a unit, it fits eight approximate initial sectors onto the grid map, calculating the base value of the central angle for each grid (here, 360° / 8 = 45°), and the base value of the sector radius for each grid. To ensure the sector covers all eight adjacent grids, this radius is set to half the diagonal length of a 3x3 grid square. The central angle and radius of adjacent grid cells are adjusted based on the anomaly scores of each adjacent grid cell. Specifically, the central angle is calculated as follows: Let the average score of the 8 adjacent grid cells be 'a', the score of each grid cell be 'Mn', the base value of the central angle is 45°, and the actual value of the central angle is 'S', then: S = Mn / a * 45; The sector radius is calculated as follows: Let the average anomaly score of the 8 adjacent grid cells be 'b', the anomaly score of each grid cell be 'Yn', and the base value of the sector radius is... If the actual radius of the sector is T, then: T = Yn / b* After adjusting the central angle and radius of the initial sector, output the Nightingale Rose graphic corresponding to the target grid. If the graphic covers more than half of the grid area, the grid is designated as an anomaly grid. All anomaly grids form an anomaly proximity region. Based on the pedestrian traffic data and baseline data of the anomaly proximity region, determine the proximity anomaly score. The calculation method is similar to the above. The final anomaly score of the target grid is determined based on the proximity anomaly score and the target grid's anomaly score. For example, if the proximity anomaly score is 103, the final anomaly score is 104, thus identifying the target grid as a high-frequency anomaly grid. If the target grid's anomaly score is 70, the anomaly type is medium anomaly. (Refer to...) Figure 6 , Figure 6 To determine the anomaly proximity area corresponding to a moderate anomaly type, eight adjacent grids of the target grid are identified. Anomaly scores are calculated for these eight grids based on pedestrian traffic data. If an anomaly grid is identified based on its score, it is included in the identification process. The total anomaly score is calculated based on the pedestrian traffic data of this grid and the target grid, thus ultimately determining the anomaly score of the target grid. This method can remove pedestrian traffic offsets caused by inaccurate location data, thus eliminating interference with the prediction results. It also filters out grids with insignificant anomalies. Assuming the target grid's anomaly score is 55, the anomaly type is classified as a general anomaly. The pedestrian traffic data of the eight surrounding grids are summed to form a large grid, which represents the anomaly proximity area of ​​the general anomaly type target grid. The anomaly score of this large grid is calculated, and the anomaly status of the target grid is reassessed based on this score to reduce interference from dirty and offset data. (Refer to...) Figure 7 , Figure 7 A schematic diagram for determining the adjacent area of ​​a general type of anomaly.

[0112] Furthermore, in order to fit the actual number of people moving in the abnormal area where the target grid is located, after step S20, the method further includes: if the target grid is determined to be an abnormal grid based on the first abnormal information, obtaining the neighboring pedestrian flow data of the grid adjacent to the target grid; determining the abnormal coefficient based on the neighboring pedestrian flow data; and determining the number of people moving in the target grid based on the abnormal coefficient and the pedestrian flow data.

[0113] It is understandable that the neighboring pedestrian traffic data can be the pedestrian traffic data of the grid adjacent to the target grid.

[0114] In specific implementation, for example: obtain the pedestrian flow data of the grid adjacent to the target grid, calculate the anomaly coefficient based on the pedestrian flow data of the adjacent grid, multiply it by the actual number of people in the target grid, and thus fit the actual number of people in the anomaly area where the target grid is located. Let the instantaneous pedestrian flow of the target grid be P, the fitted actual number of people in anomaly be Ps, the maximum pedestrian flow in the neighboring pedestrian flow data be Qmax, the minimum pedestrian flow be Qmin, and the average pedestrian flow calculated based on the neighboring pedestrian flow data be Qavg. Then we have: Ps=Sqrt((Qmax-Qmin) / Qavg)*P.

[0115] In this embodiment, when the target grid is determined to be an anomalous grid based on the first anomaly information, the anomaly type of the target grid is determined based on the first anomaly information. If the anomaly type is a high-frequency anomaly type, multiple adjacent grids of the target grid are determined. A Nightingale rose pattern is constructed based on the anomaly scores of the multiple adjacent grids, and the overlap area between the Nightingale rose pattern and the multiple grids is determined. The anomaly proximity region corresponding to the target grid is determined based on the overlap area. This embodiment, when the anomaly type of the target grid is a high-frequency anomaly type, constructs a Nightingale rose pattern corresponding to the target grid and determines the anomaly proximity region corresponding to the target grid based on the overlap area between the Nightingale rose pattern and the grid. This allows the grids surrounding the target grid to form an anomaly proximity region for judging pedestrian flow anomalies, thereby improving anti-interference capability and detection accuracy.

[0116] Furthermore, this embodiment of the invention also proposes a storage medium storing an anomaly detection program, which, when executed by a processor, implements the steps of the anomaly detection method described above.

[0117] Reference Figure 8 , Figure 8 This is a structural block diagram of the first embodiment of the anomaly detection device of the present invention.

[0118] like Figure 8 As shown, the anomaly detection device proposed in this embodiment of the invention includes:

[0119] The acquisition module 10 is used to acquire the pedestrian flow data and preset baseline data of the target grid;

[0120] The determining module 20 is used to determine the first anomaly information of the target grid based on the pedestrian flow data and the preset benchmark data;

[0121] The determining module 20 is further configured to determine the abnormal neighboring region corresponding to the target grid when the target grid is determined to be an abnormal grid based on the first abnormal information;

[0122] The determining module 20 is further configured to determine second abnormality information based on the pedestrian flow data of the adjacent area of ​​the abnormality;

[0123] The determining module 20 is further configured to determine the actual anomaly information of the target grid based on the first anomaly information and the second anomaly information.

[0124] This embodiment acquires pedestrian flow data and preset reference data for a target grid; determines first anomaly information for the target grid based on the pedestrian flow data and the preset reference data; if the target grid is determined to be an anomaly grid based on the first anomaly information, determines the anomaly neighboring region corresponding to the target grid; determines second anomaly information based on the pedestrian flow data of the anomaly neighboring region; and determines the actual anomaly information of the target grid based on the first anomaly information and the second anomaly information. This embodiment, by determining the second anomaly information based on the pedestrian flow data of the anomaly neighboring region corresponding to the target grid when the target grid is determined to be an anomaly grid based on the first anomaly information, and then determining the actual anomaly information of the target grid based on the first and second anomaly information, solves the technical problem of poor anti-interference capability against dirty data and data offset in the prior art, and improves the accuracy of pedestrian flow anomaly detection.

[0125] Based on the first embodiment of the anomaly detection device of the present invention described above, a second embodiment of the anomaly detection device of the present invention is proposed.

[0126] In this embodiment, the determining module 20 is further configured to compare the pedestrian flow data with a preset pedestrian flow benchmark value, and determine pedestrian flow deviation information based on the comparison result; generate a grid pedestrian flow curve corresponding to the target grid based on a preset data slice time and the pedestrian flow data, and determine the area under the curve value of the grid pedestrian flow curve; compare the area under the curve value with the preset area benchmark value, and determine area deviation information based on the comparison result; determine the first anomaly information of the target grid based on the pedestrian flow deviation information, the area deviation information, and a preset weight, wherein the preset benchmark data includes a preset pedestrian flow benchmark value and a preset area benchmark value.

[0127] The acquisition module 10 is further configured to slice the historical pedestrian traffic data of the target grid according to a preset time interval to obtain multiple historical pedestrian traffic data corresponding to each data slice time; determine the number of data bins of the historical pedestrian traffic data according to the number of time slices of the data slices and the preset detection period; determine the data interval according to the historical pedestrian traffic data and the number of data bins, and determine the data endpoint of each data bin according to the data interval; construct a pedestrian traffic line graph according to the data endpoint of each data bin, and determine the preset pedestrian traffic baseline value of the target grid according to the convergence of the pedestrian traffic line graph.

[0128] The acquisition module 10 is further configured to determine the maximum and minimum historical pedestrian flow based on the historical pedestrian flow data; determine the data interval based on the maximum historical pedestrian flow, the minimum historical pedestrian flow, and the number of data bins; and determine the data endpoint of each data bin based on the minimum historical pedestrian flow and the data interval.

[0129] The acquisition module 10 is further configured to slice the historical pedestrian flow data of the target grid according to a preset time interval to obtain multiple historical pedestrian flows corresponding to each slice time; construct a pedestrian flow curve based on the preset detection time period and the multiple historical pedestrian flows corresponding to each data slice time; and determine a preset area benchmark value based on the area under the curve of the pedestrian flow curve.

[0130] The determining module 20 is further configured to, when the target grid is determined to be an anomalous grid based on the first anomaly information, determine the anomaly type of the target grid based on the first anomaly information; when the anomaly type is a high-frequency anomaly type, determine multiple adjacent grids of the target grid; construct a Nightingale rose graphic based on the anomaly scores of the multiple adjacent grids, and determine the overlap area between the Nightingale rose graphic and the multiple grids; and determine the anomaly neighboring region corresponding to the target grid based on the overlap area.

[0131] The determining module 20 is further configured to, when the target grid is determined to be an abnormal grid based on the first abnormality information, acquire the neighboring pedestrian flow data of the adjacent grids of the target grid; determine the abnormality coefficient based on the neighboring pedestrian flow data; and determine the number of abnormal persons in the target grid based on the abnormality coefficient and the pedestrian flow data.

[0132] Other embodiments or specific implementations of the anomaly detection device of the present invention can be referred to the above-described method embodiments, and will not be repeated here.

[0133] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0134] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0135] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0136] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. An anomaly detection method, characterized in that, The method includes: Acquire pedestrian flow data and preset baseline data for the target grid. The target grid is the grid that needs to be detected to determine whether there is abnormal pedestrian flow. The grid is a square grid drawn at fixed intervals based on an existing public map. The first anomaly information of the target grid is determined based on the pedestrian flow data and the preset reference data. The first anomaly information is the offset information of the pedestrian flow data in the target grid relative to the corresponding preset reference data. If the target grid is determined to be an abnormal grid based on the first abnormality information, an abnormality neighboring region corresponding to the target grid is determined; The second abnormality information is determined based on the pedestrian flow data in the vicinity of the abnormality. The actual anomaly information of the target grid is determined based on the first anomaly information and the second anomaly information; The preset benchmark data includes preset pedestrian flow benchmark values ​​and preset area benchmark values; The step of determining the first anomaly information of the target grid based on the pedestrian flow data and the preset benchmark data includes: The pedestrian flow data is compared with a preset pedestrian flow benchmark value, and the pedestrian flow deviation information is determined based on the comparison results; Generate a grid pedestrian flow curve corresponding to the target grid based on the preset data slice time and the pedestrian flow data, and determine the area under the curve value of the grid pedestrian flow curve; The area under the curve is compared with the preset area benchmark value, and the area deviation information is determined based on the comparison result. The first anomaly information of the target grid is determined based on the pedestrian flow deviation information, the area deviation information, and the preset weight.

2. The method as described in claim 1, characterized in that, Before acquiring the pedestrian flow data and preset baseline data of the target grid, the process also includes: The historical pedestrian flow data of the target grid is sliced ​​according to a preset time interval to obtain multiple historical pedestrian flow data corresponding to each data slice time. The number of data bins for the historical pedestrian flow data is determined based on the number of time slices in the data slice and the preset detection period. The data interval is determined based on the historical pedestrian flow data and the number of data bins, and the data endpoints of each data bin are determined based on the data intervals. A pedestrian flow line graph is constructed based on the data endpoints of each data bin, and the preset pedestrian flow baseline value of the target grid is determined based on the convergence of the pedestrian flow line graph.

3. The method as described in claim 2, characterized in that, The step of determining the data interval based on the historical pedestrian flow data and the number of data bins, and determining the data endpoints of each data bin based on the data interval, includes: The maximum and minimum historical pedestrian flow rates are determined based on the historical pedestrian flow data. The data interval is determined based on the maximum historical traffic volume, the minimum historical traffic volume, and the number of data bins; The data endpoints of each data bin are determined based on the minimum historical pedestrian flow and the data interval.

4. The method according to any one of claims 1-3, characterized in that, Before acquiring the pedestrian flow data and preset baseline data of the target grid, the process also includes: The historical pedestrian flow data of the target grid is sliced ​​according to a preset time interval to obtain multiple historical pedestrian flow data corresponding to each slice time. A pedestrian flow curve is constructed based on the preset detection period and the historical pedestrian flow corresponding to each data slice time. The preset area benchmark value is determined based on the area under the curve of the pedestrian flow curve.

5. The method according to any one of claims 1-3, characterized in that, When the target grid is determined to be an abnormal grid based on the first abnormality information, determining the abnormality neighboring region corresponding to the target grid includes: If the target grid is determined to be an abnormal grid based on the first abnormality information, the abnormality type of the target grid is determined based on the first abnormality information; When the anomaly type is a high-frequency anomaly type, determine multiple adjacent grids of the target grid; A Nightingale rose graphic is constructed based on the anomaly scores of the multiple adjacent grids, and the overlap area between the Nightingale rose graphic and the multiple grids is determined. The abnormal neighboring region corresponding to the target grid is determined based on the overlapping area.

6. The method according to any one of claims 1-3, characterized in that, After determining the first anomaly information of the target grid based on the pedestrian flow data and the preset benchmark data, the method further includes: If the target grid is determined to be an abnormal grid based on the first abnormality information, the pedestrian traffic data of the adjacent grids of the target grid are obtained; The anomaly coefficient is determined based on the nearby pedestrian traffic data; The number of people moving in the target grid is determined based on the anomaly coefficient and the pedestrian flow data.

7. An anomaly detection device, characterized in that, The device includes: The acquisition module is used to acquire pedestrian flow data and preset baseline data of the target grid. The target grid is the grid that needs to be detected to determine whether there is abnormal pedestrian flow. The grid is a square grid drawn at fixed intervals on the basis of an existing public map. The determination module is used to determine the first anomaly information of the target grid based on the pedestrian flow data and the preset reference data. The first anomaly information is the offset information of the pedestrian flow data in the target grid relative to the corresponding preset reference data. The determining module is further configured to determine the anomalous neighboring region corresponding to the target grid when the target grid is determined to be an anomalous grid based on the first anomalous information; The determining module is further configured to determine second anomaly information based on the pedestrian flow data in the adjacent area of ​​the anomaly. The determining module is further configured to determine the actual anomaly information of the target grid based on the first anomaly information and the second anomaly information; The preset benchmark data includes preset pedestrian flow benchmark values ​​and preset area benchmark values; The determining module is further configured to compare the pedestrian flow data with a preset pedestrian flow benchmark value, and determine pedestrian flow deviation information based on the comparison result; generate a grid pedestrian flow curve corresponding to the target grid based on a preset data slice time and the pedestrian flow data, and determine the area under the curve value of the grid pedestrian flow curve; compare the area under the curve value with the preset area benchmark value, and determine area deviation information based on the comparison result; and determine the first anomaly information of the target grid based on the pedestrian flow deviation information, the area deviation information, and a preset weight.

8. An anomaly detection device, characterized in that, The device includes: a memory, a processor, and an anomaly detection program stored in the memory and executable on the processor, the anomaly detection program being configured to implement the steps of the anomaly detection method as described in any one of claims 1 to 6.

9. A storage medium, characterized in that, The storage medium stores an anomaly detection program, which, when executed by a processor, implements the steps of the anomaly detection method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Target object tracking method and device, storage medium and computer equipment

    CN110930434A