Target trajectory and behavior analysis method and device based on clustering algorithm, and medium
Through the target trajectory and behavior analysis method based on the clustering algorithm, the historical trajectory information is clustered using time and space weight factors, which solves the problem of low accuracy in predicting abnormal behavior of target personnel in the existing technology, and efficient prediction of abnormal behavior of target objects is achieved, and the safety warning ability of public places is improved.
Patent Information
- Application Number
- CN202510408661.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-07-18
AI Technical Summary
The existing methods have low accuracy in predicting abnormal behaviors of target personnel, especially in the safety threats of public places after increasing personnel mobility, it is difficult to effectively predict the frequent active areas and behaviors of target personnel.
The target trajectory and behavior analysis method based on the clustering algorithm are used to obtain the historical trajectory information of the target object, feature extraction and weight factor determination are performed, and the feature matrix is clustered using time and space weight factors to obtain clustering results, and then abnormal behavior is predicted.
By increasing the weight of the space-time dimension, the accuracy of clustering results can be improved, the abnormal behavior of the target object can be predicted dynamically and accurately, and the safety warning efficiency of public places is improved.
Smart Images

Figure CN120336648A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of big data, and specifically provides a method, device and medium for analyzing target trajectories and behaviors based on a clustering algorithm. Background Art
[0002] Currently, theft and robbery cases pose a serious threat to the safety of public places such as rail transit, airports, railway stations, shopping malls, scenic spots, parks, etc. The traditional investigation methods for such cases (including theft, robbery, car theft, etc.) mainly rely on manual surveillance and monitoring, which not only consume a large amount of police resources, but also have limited actual prevention and control effects.
[0003] The existing need is to predict and warn against theft and robbery behaviors of target personnel through strengthening informatization construction. However, the analysis and prediction of theft and robbery behaviors of personnel rely on a multi-faceted data foundation. Among them, information on the current frequent activity areas of target personnel (such as: residential location, work location) is an important factor affecting the accuracy of this prediction. However, the continuous increase in the mobility of the general public in society currently makes it difficult to accurately grasp the current frequent activity areas of target personnel and the prediction accuracy of their behaviors is extremely low. Summary of the Invention
[0004] In order to overcome the above defects, the present application is proposed to provide a solution to or at least partially solve the technical problem that the accuracy of predicting abnormal behaviors of target personnel in existing methods is relatively low. The present application provides a method, device and medium for analyzing target trajectories and behaviors based on a clustering algorithm.
[0005] In a first aspect, the present application provides a method for analyzing target trajectories and behaviors based on a clustering algorithm, the method comprising:
[0006] Obtaining historical trajectory information of a target object;
[0007] Performing feature extraction on the historical trajectory information of the target object to obtain a feature matrix;
[0008] Determining a weight factor corresponding to the historical trajectory information;
[0009] Clustering the feature matrix based on the weight factor to obtain a clustering result;
[0010] Predicting abnormal behaviors of the target object based on the clustering result.
[0011] In an embodiment of the present application, the weight factor includes a time weight factor and a space weight factor; the determining the weight factor corresponding to the historical trajectory information includes: determining the time weight factor of the historical trajectory information according to the timestamp of the historical trajectory information, and determining the space weight factor of the historical trajectory information based on the device type for collecting the historical trajectory information.
[0012] In an embodiment of the present application, determining the time weight factor of the historical trajectory information according to the time stamp of the historical trajectory information includes: the closer the time stamp of the historical trajectory information is to the current time, the greater the time weight factor of the historical trajectory information; the farther the time stamp of the historical trajectory information is from the current time, the smaller the time weight factor of the historical trajectory information.
[0013] In an embodiment of the present application, determining the space weight factor of the historical trajectory information based on the device type for collecting the historical trajectory information includes:
[0014] Obtaining the basic weight of the historical trajectory information based on the device type;
[0015] Dividing the target area into multiple grids according to a preset size;
[0016] Counting the total number of devices in each grid;
[0017] Determining the density score of each grid based on the total number of devices;
[0018] Obtaining the density score corresponding to the device for collecting the historical trajectory information;
[0019] Obtaining the space weight factor of the historical trajectory information based on the product between the basic weight of the historical trajectory information and the density score corresponding to the device for collecting the historical trajectory information.
[0020] In an embodiment of the present application, the sum of the time weight factor and the space weight factor is 1.
[0021] In an embodiment of the present application, the historical trajectory information includes multiple trajectory points, and the weight factor corresponding to the historical trajectory information includes the weight factor corresponding to each trajectory point;
[0022] Clustering the feature matrix based on the weight factor includes:
[0023] Selecting a preset number of trajectory points from the historical trajectory information as clustering centers, and the set where each clustering center is located is a cluster;
[0024] Calculating the weighted distance from each trajectory point to each clustering center based on the weight factor and the feature matrix;
[0025] Allocating each trajectory point to the cluster with the smallest distance from each trajectory point based on the weighted distance;
[0026] Updating the clustering center of each cluster;
[0027] Determine whether the cluster center of each of the clusters has changed;
[0028] If not, output the clustering result.
[0029] In an embodiment of the present application, the feature matrix includes the timestamps, longitudes, and latitudes of the trajectory points; the weight factors include a time weight factor and a space weight factor;
[0030] Calculating the weighted distance from each trajectory point to each of the cluster centers based on the weight factors and the feature matrix includes:
[0031] Normalize the timestamps, longitudes, and latitudes of each trajectory point;
[0032] Based on the normalized timestamps, longitudes, and latitudes of each trajectory point, determine the time difference, longitude difference, and latitude difference between each trajectory point and the cluster center respectively;
[0033] Obtain the weighted distance based on the sum of the product of the time difference and the time weight factor, the product of the longitude difference and the space weight factor, and the product of the latitude difference and the space weight factor.
[0034] In an embodiment of the present application, the clustering result includes the cluster number where each trajectory point is located and the cluster center of each cluster;
[0035] Predicting the abnormal behavior of the target object based on the clustering result includes:
[0036] Obtain the activity area of the target object based on the clustering result;
[0037] Determine whether the target object has abnormal behavior based on the activity area.
[0038] In a second aspect, there is provided an electronic device, including:
[0039] At least one processor;
[0040] And a memory communicatively connected to the at least one processor;
[0041] Wherein, the memory stores a computer program, and when the computer program is executed by the at least one processor, the foregoing method for analyzing the target trajectory and behavior based on the clustering algorithm is implemented.
[0042] In a third aspect, there is provided a computer-readable storage medium, which stores multiple program codes, and the program codes are adapted to be loaded and run by a processor to execute the foregoing method for analyzing the target trajectory and behavior based on the clustering algorithm according to any one of the foregoing items.
[0043] One or more of the above technical solutions of the present application have at least one or more of the following Advantageous effects:
[0044] The method for analyzing target trajectory and behavior based on clustering algorithm in the present application includes: obtaining historical trajectory information of a target object; extracting features from the historical trajectory information of the target object to obtain a feature matrix; determining a weight factor corresponding to the historical trajectory information; clustering the feature matrix based on the weight factor to obtain a clustering result; and predicting abnormal behavior of the target object based on the clustering result. By adding weights to historical data from the spatio-temporal dimension, the defects of historical data are effectively compensated, and the accuracy of the clustering result is improved, so that abnormal user behavior can be accurately predicted. Description of the Drawings
[0045] Referring to the accompanying drawings, the disclosure of the present application will become more understandable. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the protection scope of the present application. In addition, similar numbers in the figures are used to represent similar components, where:
[0046] Figure 1 is a schematic diagram of the main process of the method for analyzing target trajectory and behavior based on clustering algorithm in an embodiment of the present application;
[0047] Figure 2 is a schematic diagram of the complete process of the method for analyzing target trajectory and behavior based on clustering algorithm in an embodiment of the present application;
[0048] Figure 3 is a schematic diagram of the main structure of the device for analyzing target trajectory and behavior based on clustering algorithm in an embodiment of the present application;
[0049] Figure 4 is a schematic diagram of the structure of an electronic device in an embodiment of the present application. Detailed Embodiments
[0050] Some embodiments of the present application will be described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principle of the present application and are not intended to limit the protection scope of the present application.
[0051] In the description of the present application, "module" and "processor" may include hardware, software, or a combination of both. A module may include a hardware circuit, various appropriate sensors, communication ports, memory, and may also include a software part, such as program code, or may be a combination of software and hardware. A processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other appropriate processor. The processor has data and / or signal processing functions. The processor may be implemented in software, in hardware, or in a combination of both. A non-transitory computer-readable storage medium includes any appropriate medium capable of storing program code, such as magnetic disks, hard disks, optical discs, flash memories, read-only memories, random access memories, and so on. The term "A and / or B" represents all possible combinations of A and B, such as only A, only B, or A and B. The term "at least one of A or B" or "at least one of A and B" has a meaning similar to "A and / or B" and may include only A, only B, or A and B. The singular terms "a" and "the" may also include the plural form.
[0052] With the continuous increase in the mobility of personnel in the current social context, it has become extremely difficult to accurately grasp the current frequent activity areas of target personnel and predict their behaviors using traditional methods. Therefore, the present application proposes a method, device, and medium for target trajectory and behavior analysis based on a clustering algorithm.
[0053] Refer to the attached Figure 1 , Figure 1 which is a schematic diagram of the main steps of a method for target trajectory and behavior analysis based on a clustering algorithm according to an embodiment of the present application.
[0054] As Figure 1 shown, the method for target trajectory and behavior analysis based on a clustering algorithm in the embodiments of the present application mainly includes the following steps S10 - step S50.
[0055] Step S10: Obtain the historical trajectory information of the target object.
[0056] The historical trajectory information can be obtained from databases, data tables, system interfaces, etc. The historical trajectory information includes multiple previous trajectory points of the target object, and each trajectory point may include a timestamp, longitude, latitude, portrait picture, etc.
[0057] Step S20: Extract features from the historical trajectory information of the target object to obtain a feature matrix.
[0058] Specifically, feature extraction mainly extracts useful feature information from the historical trajectory information, such as the timestamp, longitude, and latitude of each trajectory point.
[0059] Step S30: Determine the weight factor corresponding to the historical trajectory information.
[0060] The weight factor is a parameter used to quantify the influence degree of the spatio-temporal dimension on the clustering result. Specifically, the weight factor includes a time weight factor and a space weight factor, where the time weight factor is used to quantify the influence degree of the time dimension on the clustering result; the space weight factor is used to quantify the influence degree of the space dimension on the clustering result.
[0061] Step S40: Cluster the feature matrix based on the weight factor to obtain a clustering result.
[0062] Specifically, the KMeans clustering algorithm or other clustering algorithms can be used to cluster the feature matrix to obtain a clustering result.
[0063] Step S50: Predict the abnormal behavior of the target object based on the clustering result.
[0064] Abnormal behavior is an activity that significantly deviates from the historical behavior pattern or the group's normal behavior.
[0065] Based on the above steps S10 - S50, first obtain the historical trajectory information of the target object; extract features from the historical trajectory information of the target object to obtain a feature matrix; determine the weight factor corresponding to the historical trajectory information; cluster the feature matrix based on the weight factor to obtain a clustering result; predict the abnormal behavior of the target object based on the clustering result. By adding weights to historical data from the spatio-temporal dimension, the defects of historical data are effectively compensated, and the accuracy of the clustering result is improved, so that the abnormal behavior of the user can be accurately predicted.
[0066] The following further describes steps S30 to S50 above.
[0067] Specifically, step S30 can be implemented through the following steps S301 to S302.
[0068] Step S301: Determine the time weight factor of the historical trajectory information according to the time stamp of the historical trajectory information.
[0069] In a specific embodiment of the present application, determining the time weight factor of the historical trajectory information according to the time stamp of the historical trajectory information includes: the closer the time stamp of the historical trajectory information is to the current time, the greater the time weight factor of the historical trajectory information; the farther the time stamp of the historical trajectory information is from the current time, the smaller the time weight factor of the historical trajectory information. The sum of the time weight factor and the space weight factor is 1.
[0070] Specifically, a time weight factor can be added to the historical trajectory information. Specifically, the historical trajectory information includes multiple trajectory points of the target object. Therefore, determining the time weight factor of the historical trajectory information is to add a time weight factor to each trajectory point. When adding a time weight factor to each trajectory point, the closer the timestamp of the historical trajectory point is to the current time, the greater the time weight factor of the historical trajectory point; the farther the timestamp of the historical trajectory point is from the current time, the smaller the time weight factor of the historical trajectory point. In this way, by adding a time weight factor to each trajectory point, the importance of the trajectory points closer to the current time can be enhanced, and the importance of the trajectory points farther from the current time can be weakened, thus compensating for the defects of the trajectory points in the time dimension and facilitating the improvement of the clustering accuracy.
[0071] Step S302: Determine the spatial weight factor of the historical trajectory information according to the device type for collecting the historical trajectory information.
[0072] The device types for collecting the historical trajectory information include actively triggered devices and passively triggered devices. Among them, actively triggered devices are those where personnel need to actively stay or interact to generate trajectory points, and passively triggered devices are those that automatically collect trajectory points when the target object passes by. Exemplarily, actively triggered devices can be Internet cafes, access control systems, etc., and passively triggered devices can be cameras, WIFI probes, etc.
[0073] Specifically, step S302 can be implemented through the following steps S3021 to S3026.
[0074] Step S3021: Obtain the basic weight of the historical trajectory information based on the device type.
[0075] Specifically, different basic weights can be set for the trajectory points according to the device type for collecting the trajectory points. Exemplarily, the basic weight corresponding to an actively triggered device can be 2.0, and the basic weight corresponding to a passively triggered device can be 1.0. The basic weights corresponding to actively triggered devices and passively triggered devices can be adaptively modified according to the actual application scenario, and no specific limitation is made in this regard.
[0076] Step S3022: Divide the target area into multiple grids according to a preset size.
[0077] The target area is the area corresponding to all the trajectory points of the collected target object.
[0078] The preset size can be a size set in advance, and no specific limitation is made in this regard.
[0079] Specifically, the target area can be divided into multiple grids according to the preset size, and the position of each trajectory point is the position of the device for collecting the trajectory point.
[0080] Step S3023: Count the total number of devices in each grid.
[0081] Specifically, count the total number of devices N in each grid. i,j .
[0082] Step S3024: Determine the density score of each grid based on the total number of devices.
[0083] Specifically, the density score of each grid can be calculated in the following way:
[0084] Step S3025: Obtain the density score corresponding to the device that collects the historical trajectory information.
[0085] Specifically, the density score of each grid can be used as the density score corresponding to each device, that is, collect the density score corresponding to each trajectory point.
[0086] Step S3026: Obtain the spatial weight factor of the historical trajectory information based on the product between the basic weight of the historical trajectory information and the density score corresponding to the device that collects the historical trajectory information.
[0087] Specifically, the product of the basic weight of each trajectory point and the density score is used as the spatial weight factor of each trajectory point.
[0088] By adding the spatial weight factor to each trajectory point, the importance of the trajectory points at different positions can be enhanced, thus making up for the defect of the trajectory points in the spatial dimension and being beneficial to improving the accuracy of clustering.
[0089] The above is a further description of step S30. Next, step S40 will be further described.
[0090] Specifically, the historical trajectory information includes multiple trajectory points, and the weight factor corresponding to the historical trajectory information includes the weight factor corresponding to each trajectory point. Further, step S40 can be implemented through the following steps S401 to S406.
[0091] Step S401: Select a preset number of trajectory points from the historical trajectory information as the clustering centers, and the set where each clustering center is located is a cluster.
[0092] Specifically, the random sampling method can be used to extract a preset number of trajectory points from all the historical trajectory points as the clustering centers, where each clustering center is a cluster, and subsequently, the trajectory points with a weighted distance less than the preset value from the clustering center will be added to the cluster where the clustering center is located.
[0093] Step S402: Calculate the weighted distance from each trajectory point to each cluster center based on the weight factors and the feature matrix. The feature matrix includes the timestamp, longitude, and latitude of the trajectory points; the weight factors include the time weight factor and the space weight factor.
[0094] Specifically, step S402 is implemented through the following steps S4021 to S4023.
[0095] Step S4021: Normalize the timestamp, longitude, and latitude of each trajectory point.
[0096] Specifically, map the timestamp, longitude, and latitude of each trajectory point to [0, 1].
[0097] Step S4022: Determine the time difference, longitude difference, and latitude difference between each trajectory point and the cluster center respectively based on the normalized timestamp, longitude, and latitude of each trajectory point.
[0098] Specifically, according to the normalized timestamp, longitude, and latitude of each trajectory point, calculate the time difference, longitude difference, and latitude difference from each trajectory point to the cluster center. In one embodiment, the time difference, longitude difference, and latitude difference can be the absolute value of the time difference, the absolute value of the longitude difference, and the absolute value of the latitude difference.
[0099] Step S4023: Obtain the weighted distance based on the sum of the product of the time difference and the time weight factor, the product of the longitude difference and the space weight factor, and the product of the latitude difference and the space weight factor.
[0100] Specifically, the calculation formula for the weighted distance can be shown as follows: D(x i ,c j )=α·|t i -t j |+β·|lon i -lon j |+β·|lat i -lat j |
[0101] Where, D(x i ,c j ) is the weighted distance between each trajectory point x i and the cluster center c j , α is the time weight factor, β is the space weight factor, t i , lon i , lat i are the normalized timestamp, longitude, and latitude of each trajectory point x i , t j , lon j , lat jis the clustering center c j The normalized timestamp, longitude, and latitude.
[0102] Step S403: Based on the weighted distance, assign each trajectory point to the cluster where the clustering center with the minimum distance to the trajectory point is located.
[0103] Specifically, by calculating the weighted distance between the trajectory point and each clustering center, the trajectory point can be assigned to the cluster where the clustering center with the minimum weighted distance to the trajectory point is located.
[0104] Step S404: Update the clustering center of each cluster.
[0105] Specifically, through all the trajectory points within the current cluster, recalculate the clustering center of the cluster. Specifically, take the time average, longitude average, and latitude average of all the trajectory points in the current cluster as the clustering center of the current cluster.
[0106] Step S405: Determine whether the clustering center of each cluster has changed. If so, re - execute Steps S401 to S405 until the clustering center of each cluster does not change, then go to Step S406; if not, execute Step S406.
[0107] Specifically, by comparing whether the updated clustering center is the same as the clustering center before clustering, determine whether the clustering center of each cluster has changed. When the clustering center changes, repeat the above - mentioned Steps S401 to S405 until the clustering center no longer changes to obtain the clustering result, which includes the cluster number where each trajectory point is located and the clustering center of each cluster.
[0108] Step S406: Output the clustering result.
[0109] When the clustering center no longer changes, output the clustering result.
[0110] The above is a further description of Step S40. Next, continue to further describe Step S50.
[0111] Step S50 can be implemented through the following Steps S501 to S502.
[0112] Step S501: Obtain the activity area of the target object based on the clustering result.
[0113] Specifically, since the clustering result is the cluster number where each trajectory point is located and the clustering center of each cluster, the frequently - visited activity area of the target object can be obtained by analyzing the clustering result. For example, by statistically analyzing and sorting the trajectory points in all clusters, the top three activity areas that the target object frequently visits can be obtained, including but not limited to the place of residence, workplace, and daily entertainment locations.
[0114] Step S502: Determine whether the target object has abnormal behavior based on the activity area.
[0115] Specifically, determine whether the target object has abnormal behavior by analyzing the frequent activity area of the target object. Exemplarily, taking a suspected theft person as an example of the target object, it can be determined whether there is a risk of theft by analyzing the clustering result.
[0116] By adding weights to historical data from the time and space dimensions, the defects of historical data can be effectively compensated, the accuracy of the clustering result can be improved, and thus the current frequent activity area of the target person can be dynamically and accurately calculated. When conducting trajectory surveillance on the target person, it provides an important reference for analyzing the motivation of the target person's current trajectory behavior.
[0117] Based on the frequent activity area and real-time trajectory data of the target object, combined with business rules, it is possible to predict the possible theft and robbery behaviors of the target person and obtain a prediction result. Compared with traditional means such as stakeouts and video inspections, it is a leapfrog upgrade of the detection means for theft and robbery cases in terms of both efficiency and usability.
[0118] In addition, the prediction information can be displayed in a card format through the system interface, and the staff can search and view each record.
[0119] Figure 2 It is a complete flow schematic diagram of the target trajectory and behavior analysis method based on the clustering algorithm in an embodiment of the present application.
[0120] Specifically as Figure 2 shown, the target trajectory and behavior analysis method based on the clustering algorithm can be implemented through the following steps S100 to step S600.
[0121] Step S100: Obtain the historical trajectory information of the target person.
[0122] Step S200: Perform data preprocessing on the historical trajectory information of the target person, such as removing abnormal data and supplementing missing data.
[0123] Step S300: Extract information such as the timestamp, longitude, and latitude of each trajectory point from the historical trajectory information.
[0124] Step S400: Cluster the trajectory information of the target person to obtain a clustering result.
[0125] Step S500: Obtain the frequent activity area of the target person according to the clustering result.
[0126] Step S600: Determine whether the target person has abnormal behavior according to the frequent activity area of the target person, and display the clustering result.
[0127] It should be noted that although the above embodiments describe the various steps in a specific order, those skilled in the art can understand that in order to achieve the effects of the present application, the different steps do not necessarily have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders, and these variations are within the protection scope of the present application.
[0128] Furthermore, the present application also provides a target trajectory and behavior analysis device based on a clustering algorithm.
[0129] Refer to the attached Figure 3 , Figure 3 which is the main structural block diagram of the target trajectory and behavior analysis device based on a clustering algorithm according to an embodiment of the present application.
[0130] As Figure 3 shown, the target trajectory and behavior analysis device based on a clustering algorithm in the embodiments of the present application mainly includes an acquisition module 11, an extraction module 12, a determination module 13, a clustering module 14, and a prediction module 15. In some embodiments, one or more of the acquisition module 11, the extraction module 12, the determination module 13, the clustering module 14, and the prediction module 15 can be combined together into one module.
[0131] In some embodiments, the acquisition module 11 can be configured to acquire the historical trajectory information of the target object.
[0132] The extraction module 12 can be configured to perform feature extraction on the historical trajectory information of the target object to obtain a feature matrix.
[0133] The determination module 13 can be configured to determine the weight factor corresponding to the historical trajectory information.
[0134] The clustering module 14 can be configured to perform clustering on the feature matrix based on the weight factor to obtain a clustering result.
[0135] The prediction module 15 can be configured to predict the abnormal behavior of the target object based on the clustering result.
[0136] In one implementation manner, the description of the specific implementation functions can be referred to the steps S10 to S50.
[0137] The above target trajectory and behavior analysis device based on a clustering algorithm is used to execute Figure 1The embodiments of the target trajectory and behavior analysis method based on the clustering algorithm shown have similar technical principles, technical problems to be solved, and technical effects. Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working process and related descriptions of the target trajectory and behavior analysis device based on the clustering algorithm can refer to the content described in the embodiments of the target trajectory and behavior analysis method based on the clustering algorithm, which will not be elaborated here.
[0138] Furthermore, it should be understood that since the setting of each module is only to illustrate the functional units of the device of the present application, the physical devices corresponding to these modules can be the processor itself, or a part of the software in the processor, a part of the hardware, or a part of the combination of software and hardware. Therefore, the number of each module in the figure is only illustrative.
[0139] Those skilled in the art can understand that the various modules in the device can be adaptively split or combined. Such splitting or combining of specific modules will not cause the technical solution to deviate from the principle of the present application. Therefore, the technical solutions after splitting or combining will all fall within the protection scope of the present application.
[0140] Those skilled in the art can understand that all or part of the processes in the method of the above-mentioned embodiment of the present application can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable storage medium can include: any entity or device, medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory, random access memory, electrical carrier signal, telecommunication signal, and software distribution medium that can carry the computer program code.
[0141] Furthermore, the present application also provides an electronic device, which may include at least one processor; and a memory communicatively connected to at least one processor; wherein, a computer program is stored in the memory, and when the computer program is executed by at least one processor, the target trajectory and behavior analysis method based on the clustering algorithm described in any of the above embodiments is implemented. See Figure 4 shown Figure 4 exemplarily shows the structure of the electronic device, which includes a processor 100 and a memory 200.
[0142] Furthermore, the present application also provides a computer-readable storage medium. In an embodiment of the computer-readable storage medium according to the present application, the computer-readable storage medium may be configured to store a program for executing the above-method embodiment of the method for analyzing target trajectories and behaviors based on a clustering algorithm. The program may be loaded and run by a processor to implement the above method for analyzing target trajectories and behaviors based on a clustering algorithm. For the sake of convenience, only the parts related to the embodiments of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present application. The computer-readable storage medium may be a memory device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiments of the present application is a non-transitory computer-readable storage medium.
[0143] In each embodiment of the present application, the relevant user personal information that may be involved is strictly in accordance with the requirements of laws and regulations, following the principles of legality, legitimacy, and necessity, and for a reasonable purpose based on the business scenario, to process the personal information actively provided by the user during the use of the product / service or generated due to the use of the product / service, as well as the personal information obtained with the user's authorization.
[0144] The user personal information processed by the present application may vary depending on the specific product / service scenario. It is subject to the specific scenario of the user using the product / service and may involve the user's account information, device information, driving information, vehicle information, or other relevant information. The applicant will treat the user's personal information and its processing with a high degree of diligence.
[0145] The present application attaches great importance to the security of user personal information and has taken security protection measures that meet industry standards and are reasonable and feasible to protect the user's information and prevent personal information from being accessed, publicly disclosed, used, modified, damaged, or lost without authorization.
[0146] So far, the technical solutions of the present application have been described in conjunction with the specific embodiments shown in the drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments. Without departing from the principle of the present application, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the protection scope of the present application.
Claims
1. A method for target trajectory and behavior analysis based on a clustering algorithm, characterized in that, The method includes: Obtaining historical trajectory information of a target object; Performing feature extraction on the historical trajectory information of the target object to obtain a feature matrix; Determining a weight factor corresponding to the historical trajectory information; Clustering the feature matrix based on the weight factor to obtain a clustering result; Predicting abnormal behavior of the target object based on the clustering result.
2. The method for analyzing target trajectory and behavior based on clustering algorithm according to claim 1, characterized in that, The weight factor includes a time weight factor and a space weight factor; The determining the weight factor corresponding to the historical trajectory information includes: determining the time weight factor of the historical trajectory information according to the timestamp of the historical trajectory information, and determining the space weight factor of the historical trajectory information according to the device type for collecting the historical trajectory information.
3. The method for analyzing target trajectory and behavior based on clustering algorithm according to claim 2, characterized in that The determining the time weight factor of the historical trajectory information according to the timestamp of the historical trajectory information includes: the closer the timestamp of the historical trajectory information is to the current time, the greater the time weight factor of the historical trajectory information, and the farther the timestamp of the historical trajectory information is from the current time, the smaller the time weight factor of the historical trajectory information.
4. The method for analyzing target trajectory and behavior based on clustering algorithm according to claim 2, wherein The determining the space weight factor of the historical trajectory information according to the device type for collecting the historical trajectory information includes: Obtaining a basic weight of the historical trajectory information based on the device type; Dividing a target area into multiple grids according to a preset size; Counting the total number of devices in each grid; Determining a density score for each grid based on the total number of devices; Obtaining the density score corresponding to the device for collecting the historical trajectory information; Obtaining the space weight factor of the historical trajectory information based on the product between the basic weight of the historical trajectory information and the density score corresponding to the device for collecting the historical trajectory information.
5. The method for target trajectory and behavior analysis based on clustering algorithm according to claim 2, characterized in that The sum of the time weight factor and the space weight factor is 1.
6. The method for analyzing the target trajectory and behavior based on the clustering algorithm according to claim 1, characterized in that The historical trajectory information includes multiple trajectory points, and the weight factor corresponding to the historical trajectory information includes the weight factor corresponding to each trajectory point; The clustering the feature matrix based on the weight factor includes: Selecting a preset number of trajectory points from the historical trajectory information as clustering centers, and each set where a clustering center is located is a cluster; Calculating the weighted distance from each trajectory point to each clustering center based on the weight factor and the feature matrix; Assigning each trajectory point to the cluster where the clustering center with the smallest distance from the each trajectory point is located based on the weighted distance; Updating the clustering center of each cluster; Judging whether the clustering center of each cluster has changed; If not, outputting the clustering result.
7. The method for analyzing target trajectory and behavior based on clustering algorithm according to claim 6, characterized in that, The feature matrix includes the timestamp, longitude, and latitude of the trajectory point; the weight factor includes a time weight factor and a space weight factor; The calculating the weighted distance from each trajectory point to each clustering center based on the weight factor and the feature matrix includes: Normalizing the timestamp, longitude, and latitude of each trajectory point; Determining the time difference, longitude difference, and latitude difference between each trajectory point and the clustering center respectively based on the normalized timestamp, longitude, and latitude of each trajectory point; The weighted distance is obtained based on the sum of the product of the time difference and the time weighting factor, the product of the longitude difference and the spatial weighting factor, and the product of the latitude difference and the spatial weighting factor.
8. The method for analyzing target trajectory and behavior based on clustering algorithm according to claim 1, characterized in that The clustering result includes the cluster number where each trajectory point is located and the clustering center of each cluster; Predicting the abnormal behavior of the target object based on the clustering result includes: Obtaining the activity area of the target object based on the clustering result; Determining whether the target object has abnormal behavior based on the activity area.
9. An electronic device, characterized in that, Including: At least one processor; And a memory communicatively connected to the at least one processor; Wherein, a computer program is stored in the memory, and when the computer program is executed by the at least one processor, the method for analyzing the target trajectory and behavior based on the clustering algorithm according to any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium storing multiple program codes, characterized in that, The program code is adapted to be loaded and run by a processor to execute the method for analyzing the target trajectory and behavior based on the clustering algorithm according to any one of claims 1 to 8.
Citation Information
Cited By
Method, device and equipment for determining position of key person
CN122173580A