Vehicle track thermodynamic diagram display method, device and equipment and readable storage medium

The vehicle trajectory data is clustered through the K-mean clustering algorithm and the number of target points to appear, which solves the problem of poor heat map display when a large number of trajectory data is processed, and the data integrity and global overview effect is achieved.

CN119513436APending Publication Date: 2025-02-25DONGFENG COMML VEHICLE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411683807.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

When processing large amounts of trajectory data, the prior art is difficult to achieve smooth display of heat maps on the basis of retaining data integrity, and cannot overview the global situation, resulting in abnormal system lag and errors.

Method used

The target array is clustered by the K-mean clustering algorithm and the number of occurrences of target points, and K initial clusters are obtained, and the weighted average calculation is performed to obtain the coordinates of the new cluster center. The iterative processing is performed until the preset conditions are met, K target cluster centers are output, and the rendering output is performed based on the coordinates and occurrences of the cluster center.

Benefits of technology

It realizes smooth display and global overview of heat maps on the basis of retaining data integrity, improving the performance and user experience of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513436A_ABST
    Figure CN119513436A_ABST
Patent Text Reader

Abstract

A vehicle trajectory thermodynamic diagram display method, apparatus and device, and a readable storage medium, and relates to the field of webpage front-end display, the method comprises: obtaining a target array corresponding to a target trajectory, the target array comprising three-dimensional arrays corresponding to target points on the target trajectory, the three-dimensional arrays comprising coordinates and occurrence times of the target points; performing clustering processing on the target array based on a K-means clustering algorithm and the occurrence frequency of the target points to obtain K initial clusters; for each initial cluster, performing weighted average calculation according to the coordinates and the occurrence frequency of each target point in the initial cluster to obtain a new cluster center coordinate; carrying out clustering iteration processing on the target array again through all cluster center coordinates, and outputting K target cluster centers until an iteration termination condition is met; and performing rendering output according to the coordinates of the center of the target cluster and the occurrence frequency so as to realize track thermodynamic diagram display. According to the method, on the basis of keeping data integrity, smooth display of the thermodynamic diagram can be effectively realized, and the overall situation can be overlooked.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of web page front-end display, and specifically to a vehicle trajectory heat map display method, device, equipment and readable storage medium. Background Art

[0002] Heatmap is a graphical presentation method that displays data through color changes. It can intuitively reflect the distribution and density of data and has been widely used in the field of vehicle data display and analysis to intuitively display the driving conditions of vehicles in different areas, thereby providing a basis for path planning and management. At present, heatmaps are often generated through a large amount of trajectory point map information, which requires the front end to process a large amount of trajectory point map information; and for a large amount of trajectory point map information, especially trajectory data above 10,000, if the front end does not perform optimization processing when generating the heatmap, it will cause abnormal freezing and errors in the entire system.

[0003] In the related art, when optimizing the heat map, the optimization of a large amount of trajectory data is generally achieved by randomly thinning samples or intercepting point data for on-demand display. However, random thinning processing will result in the data being not detailed enough and some important information is easily lost. On-demand display will result in the inability to have an overall view, which will fail to meet system requirements. Summary of the invention

[0004] The present application provides a vehicle trajectory heat map display method, device, equipment and readable storage medium, which can effectively realize the smooth display of the heat map and provide an overall overview while retaining data integrity.

[0005] In a first aspect, an embodiment of the present application provides a method for displaying a vehicle trajectory heat map, comprising the following steps:

[0006] Acquire a target array corresponding to the target trajectory, wherein the target array includes a three-dimensional array corresponding to each target point on the target trajectory, and the three-dimensional array includes the coordinates and the number of occurrences of the target points;

[0007] Clustering the target array based on the K-means clustering algorithm and the number of occurrences of the target point to obtain K initial clusters, where K is a positive integer;

[0008] For each initial cluster, a weighted average calculation is performed according to the coordinates and the number of occurrences of each target point in the initial cluster to obtain the coordinates of the center of the new cluster;

[0009] Re-clustering the target array through all new cluster center coordinates until a preset iteration termination condition is reached to output K target cluster centers;

[0010] Rendering output is performed according to the coordinates and occurrence counts of the target cluster center to display the trajectory heat map.

[0011] In combination with the first aspect, in one implementation, clustering the target array based on the K-means clustering algorithm and the number of occurrences of the target point to obtain K cluster centers includes:

[0012] Randomly select K target points from the target array as initial cluster centers;

[0013] For each target point in the target array, a first distance from the target point to the center of each initial cluster is calculated based on the coordinates of the target point;

[0014] Calculate the target distance from the target point to each initial cluster center based on the first distance and the number of occurrences of the target point;

[0015] According to the target distance, the target point is assigned to the cluster where the initial cluster center closest to it is located, and K initial clusters are formed after all target points are assigned.

[0016] In combination with the first aspect, in one implementation, randomly selecting K target points from the target array as initial cluster centers includes:

[0017] Generate a target random number based on a preset random number function;

[0018] Determine a target index value by using the target random number and the size of the target array;

[0019] Filtering out a target point corresponding to a target index value from the target array as an initial cluster center;

[0020] The target index value is added to a preset index record table, and the step of generating a target random number based on a preset random number function is re-executed until the number of target index values ​​in the index record table is K, wherein all target index values ​​in the index record table are different.

[0021] In combination with the first aspect, in one implementation, the step of calculating the target distance from the target point to each initial cluster center based on the first distance and the number of occurrences of the target point includes:

[0022] The quotient between the first distance and the number of occurrences of the target point is used as the target distance from the target point to the center of the initial cluster.

[0023] In combination with the first aspect, in one implementation, performing weighted average calculation based on the coordinates and the number of occurrences of each target point in the initial cluster to obtain the coordinates of the center of the new cluster includes:

[0024] The number of occurrences of each target point in the initial cluster is summed to obtain the target weight;

[0025] The center coordinates of the new cluster are calculated based on the target weight and the center coordinates of the initial cluster.

[0026] In combination with the first aspect, in one implementation, the rendering output according to the coordinates and the number of occurrences of the target cluster center includes:

[0027] According to the preset stratification principle, the K target cluster centers are stratified to obtain multiple levels of data;

[0028] The hierarchical data are read sequentially based on a preset interval duration, and the rendering output is performed in batches according to the coordinates and the number of occurrences of the target cluster centers in the read hierarchical data.

[0029] In combination with the first aspect, in one implementation, before the step of clustering the target array based on the K-means clustering algorithm and the number of occurrences of the target points, the method further includes:

[0030] Determine whether the size of the target array is greater than a preset target threshold;

[0031] If yes, then executing the step of clustering the target array based on the K-means clustering algorithm and the number of occurrences of the target points;

[0032] If not, the target array is rendered and output to realize the trajectory heat map display.

[0033] In a second aspect, an embodiment of the present application provides a vehicle trajectory heat map display device, the vehicle trajectory heat map display device comprising:

[0034] A data acquisition module, which is used to acquire a target array corresponding to the target trajectory, wherein the target array includes a three-dimensional array corresponding to each target point on the target trajectory, and the three-dimensional array includes the coordinates and the number of occurrences of the target point;

[0035] A clustering processing module, which is used to perform clustering processing on the target array based on the K-means clustering algorithm and the number of occurrences of the target point to obtain K initial clusters, where K is a positive integer; for each initial cluster, weighted average calculation is performed according to the coordinates and the number of occurrences of each target point in the initial cluster to obtain the coordinates of the new cluster center; the target array is re-clustered iteratively processed through all the new cluster center coordinates until a preset iteration termination condition is reached to output K target cluster centers;

[0036] The rendering and display module is used to render and output according to the coordinates and occurrence times of the target cluster center to realize the trajectory heat map display.

[0037] In conjunction with the second aspect, in one implementation, the cluster processing module is specifically used to:

[0038] Randomly select K target points from the target array as initial cluster centers;

[0039] For each target point in the target array, a first distance from the target point to the center of each initial cluster is calculated based on the coordinates of the target point;

[0040] Calculate the target distance from the target point to each initial cluster center based on the first distance and the number of occurrences of the target point;

[0041] According to the target distance, the target point is assigned to the cluster where the initial cluster center closest to it is located, and K initial clusters are formed after all target points are assigned.

[0042] In conjunction with the second aspect, in one implementation, the cluster processing module is further configured to:

[0043] Generate a target random number based on a preset random number function;

[0044] Determine a target index value by using the target random number and the size of the target array;

[0045] Filtering out a target point corresponding to a target index value from the target array as an initial cluster center;

[0046] The target index value is added to a preset index record table, and the step of generating a target random number based on a preset random number function is re-executed until the number of target index values ​​in the index record table is K, wherein all target index values ​​in the index record table are different.

[0047] In conjunction with the second aspect, in one implementation, the cluster processing module is further configured to:

[0048] The quotient between the first distance and the number of occurrences of the target point is used as the target distance from the target point to the center of the initial cluster.

[0049] In conjunction with the second aspect, in one implementation, the cluster processing module is further configured to:

[0050] The number of occurrences of each target point in the initial cluster is summed to obtain the target weight;

[0051] The center coordinates of the new cluster are calculated based on the target weight and the center coordinates of the initial cluster.

[0052] In conjunction with the second aspect, in one implementation, the rendering and display module is specifically used to:

[0053] According to the preset stratification principle, the K target cluster centers are stratified to obtain multiple levels of data;

[0054] The hierarchical data are read sequentially based on a preset interval duration, and the rendering output is performed in batches according to the coordinates and the number of occurrences of the target cluster centers in the read hierarchical data.

[0055] In conjunction with the second aspect, in one implementation, the cluster processing module is further used to:

[0056] Determine whether the size of the target array is greater than a preset target threshold;

[0057] If yes, then executing the step of clustering the target array based on the K-means clustering algorithm and the number of occurrences of the target points;

[0058] If not, the target array is rendered and outputted through a rendering and display module to realize trajectory heat map display.

[0059] In a third aspect, an embodiment of the present application provides a vehicle trajectory heat map display device, which includes a processor, a memory, and a vehicle trajectory heat map display program stored in the memory and executable by the processor, wherein when the vehicle trajectory heat map display program is executed by the processor, the steps of the vehicle trajectory heat map display method as described above are implemented.

[0060] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a vehicle trajectory heat map display program is stored, wherein when the vehicle trajectory heat map display program is executed by a processor, the steps of the vehicle trajectory heat map display method as described above are implemented.

[0061] The beneficial effects brought by the technical solution provided in the embodiments of the present application include:

[0062] The target array including the coordinates and occurrences of each target point on the target trajectory is clustered by the K-means clustering algorithm and the number of occurrences of the target point to obtain K initial clusters; then the weighted average calculation is performed according to the coordinates and occurrences of each target point in the initial cluster to obtain the coordinates of the center of each cluster; then the target array is re-clustered and iteratively processed through all cluster center coordinates until the iteration termination condition is reached to output K target cluster centers; finally, the output is rendered according to the coordinates and occurrences of the target cluster center to realize the trajectory heat map display. It can be seen that the present application can improve the integrity of the data by taking the number of occurrences of the target point on the target trajectory as a weight parameter and processing the trajectory data based on the K-means clustering algorithm, ensuring that the presented heat map can have an overview of the overall situation, and then outputting the cluster center that best represents the overall characteristics; and only the cluster center that best represents the overall characteristics is displayed as a heat map, thereby improving the fluency of the display. Therefore, the present application can effectively realize the smooth display of the heat map and the overview of the overall situation on the basis of retaining the integrity of the data. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 A schematic diagram of a process flow of an embodiment of a vehicle trajectory heat map display method of the present application;

[0064] Figure 2 For this application Figure 1 Detailed flow chart of step S20;

[0065] Figure 3 For this application Figure 2 Detailed flow chart of step S210;

[0066] Figure 4 For this application Figure 1 Detailed flow chart of step S30;

[0067] Figure 5 This is a schematic diagram of the hardware structure of the vehicle trajectory heat map display device involved in the embodiment of the present application. DETAILED DESCRIPTION

[0068] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0069] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0070] In a first aspect, an embodiment of the present application provides a method for displaying a vehicle trajectory heat map.

[0071] In one embodiment, referring to Figure 1 , Figure 1 This is a flow chart of an embodiment of the vehicle trajectory heat map display method of the present application. Figure 1 As shown, the vehicle trajectory heat map display method includes:

[0072] Step S10: obtaining a target array corresponding to the target trajectory, wherein the target array includes a three-dimensional array corresponding to each target point on the target trajectory, and the three-dimensional array includes the coordinates and the number of occurrences of the target points.

[0073] Exemplarily, in this embodiment, the target trajectory refers to a pre-planned driving path that needs to be displayed on a heat map; the target point refers to a series of data points (i.e., target points) on the target trajectory, and each target point has corresponding coordinates and the total number of times it appears on different driving paths; after obtaining the longitude and latitude and number of occurrences of the target point returned by the background through the interface, the coordinates of the target point (i.e., latitude lat and longitude lon) and the number of occurrences count can be regularized into a three-dimensional array [lat, lon, count], and then all target points on the target trajectory are stored in a one-dimensional array in the form of a three-dimensional array to form a target array.

[0074] Furthermore, in one embodiment, before the step of clustering the target array based on the K-means clustering algorithm and the number of occurrences of the target points, the method further includes:

[0075] Determine whether the size of the target array is greater than a preset target threshold;

[0076] If yes, then executing the step of clustering the target array based on the K-means clustering algorithm and the number of occurrences of the target points;

[0077] If not, the target array is rendered and output to realize the trajectory heat map display.

[0078] For example, it should be noted that the target threshold is used to characterize the display capability of the front-end page. Its specific value setting can be determined according to actual needs and is not limited here. For example, the target threshold is set to 5000. In this embodiment, after obtaining the target array, it is preferred to first determine whether the size of the target array is greater than the target threshold. If it is less than, it means that the number of target points in the target array is within the normal tolerance range of the front-end page display, and it is determined that no aggregation is required. Therefore, the heat map rendering output display is directly based on the target array and the map is called; if it is greater than, it means that the number of target points in the target array exceeds the normal tolerance range of the front-end page display, that is, it is subject to performance limitations, and it is determined that aggregation is required to achieve optimization of the trajectory heat map, thereby improving the smoothness of the display.

[0079] Step S20: clustering the target array based on the K-means clustering algorithm and the number of occurrences of the target points to obtain K initial clusters, where K is a positive integer.

[0080] Exemplarily, in this embodiment, the target array containing trajectory data is clustered by the K-means clustering algorithm (i.e., the KMeans clustering algorithm) to obtain K initial clusters, and then the heat map optimization is realized; wherein, the KMeans clustering algorithm is an unsupervised learning algorithm, which is used to divide the data set into K clusters, and the goal is to minimize the sum of the distances from the sample points to the centers of the clusters to which they belong, so as to ensure that the obtained cluster points can best represent the characteristics of the overall sample; at the same time, a weight dimension is added to the KMeans clustering algorithm, that is, the number of occurrences count of the target point is used as a weight parameter to participate in the clustering processing of the KMeans clustering algorithm, so as to retain the integrity of the data before clustering, thereby solving the problem of heat map display jamming in the scenario where there are a large number of data points in the vehicle trajectory; specifically, after the KMeans clustering algorithm calculates the distance between the target point and the cluster center, the number of occurrences count of the target point is used to assign a weight to the calculated distance, and then the contribution of each target point is weighted in the clustering process to achieve weight quantification, thereby generating a cluster center that best represents the overall characteristics. It should be noted that K is a positive integer and its specific value can be determined according to actual needs and is not limited here.

[0081] Further, see Figure 2 As shown, the target array is clustered based on the K-means clustering algorithm and the number of occurrences of the target point to obtain K cluster centers, including:

[0082] Step S201: randomly selecting K target points from the target array as initial cluster centers;

[0083] Step S202: for each target point in the target array, a first distance from the target point to the center of each initial cluster is calculated based on the coordinates of the target point;

[0084] Step S203: Calculate the target distance from the target point to each initial cluster center based on the first distance and the number of occurrences of the target point;

[0085] Step S204: assigning the target point to the cluster where the initial cluster center is closest to it according to the target distance, and forming K initial clusters after all the target points are assigned.

[0086] For example, in this embodiment, when clustering is performed according to the KMeans clustering algorithm, K target points are first randomly selected from the target array as the initial cluster centers certers; then the Euclidean distance (i.e., the first distance) from each target point to each initial cluster center certers is calculated. For example, the coordinates of an initial cluster center certers are (lat1, lon1), which corresponds to (x1, y1) in the two-dimensional coordinate system, and the coordinates of one of the target points are (lat2, lon2), which corresponds to (x2, y2) in the two-dimensional coordinate system, then the first distance d from the target point to the initial cluster center certers is: Then, the first distance d is weighted and quantized by the number of occurrences count of the target point, that is, the first distance d and the number of occurrences count are anti-correlated, so as to obtain the target distance d′ from the target point to the center of the initial cluster; finally, the target point is allocated according to the size of the target distance from the target point to the center of each initial cluster, so as to allocate the target point to the cluster where the initial cluster center closest to it is located, that is, the target distance d′ from the target point to the centers of all initial clusters is compared to obtain the minimum target distance minD, at which point the target point can be classified into the cluster where the initial cluster center corresponding to minD is located; according to the above calculation logic, all target points can be classified into their respective clusters, thus forming K initial clusters.

[0087] Further, see Figure 3 As shown, the step of randomly selecting K target points from the target array as initial cluster centers includes:

[0088] Step S2011: Generate a target random number based on a preset random number function;

[0089] Step S2012: determining a target index value according to the target random number and the size of the target array;

[0090] Step S2013: Filtering out a target point corresponding to a target index value from the target array as an initial cluster center;

[0091] Step S2014: Add the target index value to a preset index record table, and re-execute the step of generating a target random number based on a preset random number function until the number of target index values ​​in the index record table is K, wherein all target index values ​​in the index record table are different.

[0092] Exemplarily, in this embodiment, when initializing the cluster center, in order to avoid repeatedly selecting the same target point, an index record table Set can be used to record the index that has been selected, that is, the target point corresponding to the index recorded in the Set will no longer be selected as the cluster center. Specifically, it is preferred to use a preset random number function (such as Math.random function) to randomly obtain a floating point number between 0 and 1 (that is, a target random number), and then multiply the random number by the target array size size to obtain an initial index value; then use a floor function (such as Math.floor function) to floor the initial index value to obtain a random target index value; then, according to the target index value, take out the target point corresponding to it from the target array as the initial cluster center, and store the target index value in Set to determine that it is unique and non-repeated, that is, all target index values ​​in the index record table are different; it can be understood that the random selection of K initial cluster centers can be completed based on the above principle, and the number of target index values ​​in the index record table is K.

[0093] Further, in one embodiment, the step of calculating the target distance from the target point to each initial cluster center based on the first distance and the number of occurrences of the target point includes:

[0094] The quotient between the first distance and the number of occurrences of the target point is used as the target distance from the target point to the center of the initial cluster.

[0095] Exemplarily, in this embodiment, the number of occurrences count of the target point is used as a weight parameter. Since the number of occurrences count must be an integer greater than or equal to 1, the method d′=d / count can be used to make the Euclidean distance d from the target point to the initial cluster center and the number of occurrences count become anti-correlated; it can be seen that the larger the weight count, the smaller the calculated target distance d′, and the closer the target point is to the initial cluster center, thereby realizing the quantization of the weight.

[0096] Step S30: For each initial cluster, weighted average calculation is performed according to the coordinates and the number of occurrences of each target point in the initial cluster to obtain the coordinates of the center of a new cluster.

[0097] Exemplarily, after K initial clusters are obtained, the cluster center will be updated using the weighted mean method. Specifically, for each initial cluster, the weights (i.e., count values) and coordinate values ​​of all target points belonging to the cluster are multiplied and accumulated to obtain a weighted value, and finally the weighted value is used to update the centroid to obtain the coordinates of the new cluster center.

[0098] Further, see Figure 4 As shown, the weighted average calculation is performed according to the coordinates and the number of occurrences of each target point in the initial cluster to obtain the coordinates of the center of the new cluster, including:

[0099] Step S301: summing the number of occurrences of each target point in the initial cluster to obtain the target weight;

[0100] Step S302: Calculate the center coordinates of a new cluster based on the target weight and the center coordinates of the initial cluster.

[0101] Exemplarily, it should be understood that the calculation method and principle of each cluster center coordinate are the same, so for the sake of brevity of description, the following embodiment only takes one cluster center coordinate as an example to illustrate the calculation method and principle.

[0102] Specifically, first calculate the sum of the weights of all target points in the cluster (i.e., target weight), that is, simply add up the number of occurrences of all target points in the cluster. It can be understood that target points with larger weights (i.e., count values) have a greater impact on the cluster center, so their contribution is greater; then calculate the weighted average coordinates, that is, the weighted average coordinates can be calculated based on the coordinates of each target point in the cluster and its weight, and the weighted average coordinates are the coordinates of the new cluster center. Assume that an initial cluster C i There are n i target points, and the coordinates of each target point are (x j ,y j ) and the weight is w j , then the initial cluster C i The coordinates of the new cluster center (x i ,y i )for:

[0103]

[0104] In the formula, C i represents the i-th initial cluster, x j and j Cluster C i The horizontal and vertical coordinates of the jth target point in w j is the weight (i.e., count value) of the jth target point; it can be understood that, taking the x coordinate as an example, the denominator is the sum of the weights, and the numerator is the sum of the products of all x coordinates and their weights.

[0105] Step S40: re-clustering the target array using all new cluster center coordinates until a preset iteration termination condition is reached to output K target cluster centers.

[0106] Exemplarily, it should be noted that the iteration termination condition can be that the number of iterations reaches the maximum number of iterations (for example, the maximum number of iterations is set to 1000), or that the function is in a convergence state (the convergence condition is to check whether the current cluster center is the same as the previous cluster center), or other conditions that can terminate the iteration, which are not limited here. In this embodiment, the new cluster center coordinates are used for iterative updating, that is, the new cluster center is used as the new centers and the target distance is continued to be calculated and the new cluster is divided according to the above clustering method and principle; this is repeated until the maximum number of iterations is reached or the function converges, that is, when the cluster center is no longer changing or the maximum number of iterations is reached, the iteration is stopped to obtain the K final cluster centers (i.e., the target cluster centers) that best represent the overall characteristics, and the coordinates and count values ​​corresponding to the target cluster centers are the final optimized coordinates and optimized count values.

[0107] Step S50: Rendering and outputting according to the coordinates and the number of occurrences of the target cluster center to realize trajectory heat map display.

[0108] Exemplarily, in this embodiment, a basic map (such as Amap, Baidu Map, etc.) is called and the heat map is rendered and output according to the coordinates and number of occurrences of the centers of the K target clusters that best represent the overall characteristics, so as to achieve a smooth display of the trajectory heat map; it can be understood that the number of occurrences is proportional to the color depth in the heat map, that is, the greater the number of occurrences, the darker the color, and vice versa. The smaller the number of occurrences, the lighter the color. It should be noted that the method and principle of how to render and display a heat map by calling a basic map is common knowledge in the art, and for the sake of brevity of description, it will not be repeated here.

[0109] It can be seen that this embodiment uses the number of occurrences of target points on the target trajectory as a weight parameter and processes the trajectory data based on the K-means clustering algorithm, which can improve the integrity of the data, ensure that the presented heat map can have an overview of the overall situation, and then output the cluster center that best represents the overall characteristics; and only display the heat map for the cluster center that best represents the overall characteristics, thereby improving the smoothness of the display. Therefore, the present application can effectively achieve the smooth display of the heat map and the overall overview on the basis of retaining the integrity of the data.

[0110] Further, in one embodiment, the rendering output according to the coordinates and the number of occurrences of the target cluster center includes:

[0111] According to the preset stratification principle, the K target cluster centers are stratified to obtain multiple levels of data;

[0112] The hierarchical data are read sequentially based on a preset interval duration, and the rendering output is performed in batches according to the coordinates and the number of occurrences of the target cluster centers in the read hierarchical data.

[0113] Exemplarily, in this embodiment, in order to ease the loading pressure of the front-end page, the final target cluster centers can be displayed in layers and batches; it should be noted that the specific settings of the layering principle and the interval time can be determined according to actual needs, and are not limited here, as long as the purpose of layered and batched display is achieved. Specifically, the layering can directly use the segmentation function (such as the split function) and put every N (such as N is 1000) target cluster centers into a layer according to the one-dimensional array index, so that the data can be easily layered to obtain multiple levels of data; then the page is rendered in batches, that is, all data sets after layering are traversed, and the setTimeOut function (this function is used to execute a function or a specified section of code after a specified delay time, that is, to process delayed execution tasks) is used every M (such as M is 500) milliseconds to call a heat map rendering, so as to render and output the read target cluster centers according to the coordinates and number of occurrences of the target cluster centers, so that the heat map can be displayed on the map in batches to ensure the smoothness of the page.

[0114] It should be noted that each time a heat map is rendered, the transparency of the layer must be set, otherwise the new heat map layer will cover the previously rendered layer; based on this, the present embodiment may preferably use a linear decreasing method to set the layer transparency, for example, the first layer transparency is 0.8, and then decreases by 0.01 until it is reduced to 0.6, then the transparency will no longer decrease, and no matter how many layers there are, 0.6 can be uniformly used.

[0115] In summary, this embodiment extracts and optimizes a large number of vehicle trajectory points through a data aggregation algorithm, which can reduce the amount of data while retaining the original characteristics of the data to the greatest extent, and can then be smoothly applied to the map heat map to display the trajectory data more intuitively, clearly and effectively. Therefore, this embodiment can easily process hundreds of thousands or even hundreds of thousands of heat map trajectory points, which can retain the data weight characteristics while taking into account the front-end display performance, greatly improving the user experience.

[0116] In a second aspect, an embodiment of the present application also provides a vehicle trajectory heat map display device.

[0117] In one embodiment, the vehicle trajectory heat map display device includes:

[0118] A data acquisition module, which is used to acquire a target array corresponding to the target trajectory, wherein the target array includes a three-dimensional array corresponding to each target point on the target trajectory, and the three-dimensional array includes the coordinates and the number of occurrences of the target point;

[0119] A clustering processing module, which is used to perform clustering processing on the target array based on the K-means clustering algorithm and the number of occurrences of the target point to obtain K initial clusters, where K is a positive integer; for each initial cluster, weighted average calculation is performed according to the coordinates and the number of occurrences of each target point in the initial cluster to obtain the coordinates of the new cluster center; the target array is re-clustered iteratively processed through all the new cluster center coordinates until a preset iteration termination condition is reached to output K target cluster centers;

[0120] The rendering and display module is used to render and output according to the coordinates and occurrence times of the target cluster center to realize the trajectory heat map display.

[0121] Furthermore, in one embodiment, the cluster processing module is specifically used for:

[0122] Randomly select K target points from the target array as initial cluster centers;

[0123] For each target point in the target array, a first distance from the target point to the center of each initial cluster is calculated based on the coordinates of the target point;

[0124] Calculate the target distance from the target point to each initial cluster center based on the first distance and the number of occurrences of the target point;

[0125] According to the target distance, the target point is assigned to the cluster where the initial cluster center closest to it is located, and K initial clusters are formed after all target points are assigned.

[0126] Furthermore, in one embodiment, the cluster processing module is further configured to:

[0127] Generate a target random number based on a preset random number function;

[0128] Determine a target index value by using the target random number and the size of the target array;

[0129] Filtering out a target point corresponding to a target index value from the target array as an initial cluster center;

[0130] The target index value is added to a preset index record table, and the step of generating a target random number based on a preset random number function is re-executed until the number of target index values ​​in the index record table is K, wherein all target index values ​​in the index record table are different.

[0131] Furthermore, in one embodiment, the cluster processing module is further configured to:

[0132] The quotient between the first distance and the number of occurrences of the target point is used as the target distance from the target point to the center of the initial cluster.

[0133] Furthermore, in one embodiment, the cluster processing module is further configured to:

[0134] The number of occurrences of each target point in the initial cluster is summed to obtain the target weight;

[0135] The center coordinates of the new cluster are calculated based on the target weight and the center coordinates of the initial cluster.

[0136] Furthermore, in one embodiment, the rendering and display module is specifically used for:

[0137] According to the preset stratification principle, the K target cluster centers are stratified to obtain multiple levels of data;

[0138] The hierarchical data are read sequentially based on a preset interval duration, and the rendering output is performed in batches according to the coordinates and the number of occurrences of the target cluster centers in the read hierarchical data.

[0139] Furthermore, in one embodiment, the cluster processing module is also used for:

[0140] Determine whether the size of the target array is greater than a preset target threshold;

[0141] If yes, then executing the step of clustering the target array based on the K-means clustering algorithm and the number of occurrences of the target points;

[0142] If not, the target array is rendered and outputted through a rendering and display module to realize trajectory heat map display.

[0143] Among them, the functional implementation of each module in the above-mentioned vehicle trajectory heat map display device corresponds to the various steps in the above-mentioned vehicle trajectory heat map display method embodiment, and its functions and implementation processes are no longer repeated here one by one.

[0144] In a third aspect, an embodiment of the present application provides a vehicle trajectory heat map display device, which may be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.

[0145] Reference Figure 5 , Figure 5Schematic diagram of the hardware structure of the vehicle trajectory heat map display device involved in the embodiment of the present application. In the embodiment of the present application, the vehicle trajectory heat map display device may include a processor, a memory, a communication interface and a communication bus.

[0146] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.

[0147] The communication interface includes an input / output (I / O) interface, a physical interface, and a logical interface, etc., which are used to interconnect the devices inside the vehicle trajectory heat map display device, and an interface for interconnecting the vehicle trajectory heat map display device with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, an optical fiber interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.

[0148] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0149] The processor may be a general-purpose processor, and the general-purpose processor may call the vehicle trajectory heat map display program stored in the memory and execute the vehicle trajectory heat map display method provided in the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). Among them, the method executed when the vehicle trajectory heat map display program is called can refer to the various embodiments of the vehicle trajectory heat map display method of the present application, which will not be repeated here.

[0150] Those skilled in the art will understand that Figure 5 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0151] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium.

[0152] A vehicle trajectory heat map display program is stored on the readable storage medium of the present application, wherein when the vehicle trajectory heat map display program is executed by the processor, the steps of the vehicle trajectory heat map display method as described above are implemented.

[0153] Among them, the method implemented when the vehicle trajectory heat map display program is executed can refer to the various embodiments of the vehicle trajectory heat map display method of the present application, and will not be repeated here.

[0154] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.

[0155] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.

[0156] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.

[0157] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.

[0158] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.

[0159] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.

[0160] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A vehicle trajectory heat map display method, characterized in that: The following steps are involved: Acquire a target array corresponding to the target trajectory, wherein the target array includes a three-dimensional array corresponding to each target point on the target trajectory, and the three-dimensional array includes the coordinates and the number of occurrences of the target points; Clustering the target array based on the K-means clustering algorithm and the number of occurrences of the target point to obtain K initial clusters, where K is a positive integer; For each initial cluster, a weighted average calculation is performed according to the coordinates and the number of occurrences of each target point in the initial cluster to obtain the coordinates of the center of the new cluster; Re-clustering the target array through all new cluster center coordinates until a preset iteration termination condition is reached to output K target cluster centers; Rendering output is performed according to the coordinates and occurrence counts of the target cluster center to display the trajectory heat map.

2. The vehicle trajectory heat map display method according to claim 1, characterized in that: The clustering process of the target array based on the K-means clustering algorithm and the number of occurrences of the target point to obtain K cluster centers includes: Randomly select K target points from the target array as initial cluster centers; For each target point in the target array, a first distance from the target point to the center of each initial cluster is calculated based on the coordinates of the target point; Calculate the target distance from the target point to each initial cluster center based on the first distance and the number of occurrences of the target point; According to the target distance, the target point is assigned to the cluster where the initial cluster center closest to it is located, and K initial clusters are formed after all target points are assigned.

3. The vehicle trajectory heat map display method according to claim 2, characterized in that: The step of randomly selecting K target points from the target array as initial cluster centers includes: Generate a target random number based on a preset random number function; Determine a target index value by using the target random number and the size of the target array; Filtering out a target point corresponding to a target index value from the target array as an initial cluster center; The target index value is added to a preset index record table, and the step of generating a target random number based on a preset random number function is re-executed until the number of target index values ​​in the index record table is K, wherein all target index values ​​in the index record table are different.

4. The vehicle trajectory heat map display method according to claim 2, characterized in that: The step of calculating the target distance from the target point to each initial cluster center based on the first distance and the number of occurrences of the target point includes: The quotient between the first distance and the number of occurrences of the target point is used as the target distance from the target point to the center of the initial cluster.

5. The vehicle trajectory heat map display method according to claim 1, characterized in that: The weighted average calculation is performed according to the coordinates and the number of occurrences of each target point in the initial cluster to obtain the coordinates of the center of the new cluster, including: The number of occurrences of each target point in the initial cluster is summed to obtain the target weight; The center coordinates of the new cluster are calculated based on the target weight and the center coordinates of the initial cluster.

6. The vehicle trajectory heat map display method according to claim 1, characterized in that: The rendering output according to the coordinates and the number of occurrences of the target cluster center includes: According to the preset stratification principle, the K target cluster centers are stratified to obtain multiple levels of data; The hierarchical data are read sequentially based on a preset interval duration, and the rendering output is performed in batches according to the coordinates and the number of occurrences of the target cluster centers in the read hierarchical data.

7. The vehicle trajectory heat map display method according to claim 1, characterized in that: Before the step of clustering the target array based on the K-means clustering algorithm and the number of occurrences of the target points, the method further includes: Determine whether the size of the target array is greater than a preset target threshold; If yes, then executing the step of clustering the target array based on the K-means clustering algorithm and the number of occurrences of the target points; If not, the target array is rendered and output to realize the trajectory heat map display.

8. A vehicle trajectory heat map display device, characterized in that: The vehicle trajectory heat map display device comprises: A data acquisition module, which is used to acquire a target array corresponding to the target trajectory, wherein the target array includes a three-dimensional array corresponding to each target point on the target trajectory, and the three-dimensional array includes the coordinates and the number of occurrences of the target point; A clustering processing module, which is used to perform clustering processing on the target array based on the K-means clustering algorithm and the number of occurrences of the target point to obtain K initial clusters, where K is a positive integer; for each initial cluster, weighted average calculation is performed according to the coordinates and the number of occurrences of each target point in the initial cluster to obtain the coordinates of the new cluster center; the target array is re-clustered iteratively processed through all the new cluster center coordinates until a preset iteration termination condition is reached to output K target cluster centers; The rendering and display module is used to render and output according to the coordinates and occurrence times of the target cluster center to realize the trajectory heat map display.

9. A vehicle trajectory heat map display device, characterized in that: The vehicle trajectory heat map display device includes a processor, a memory, and a vehicle trajectory heat map display program stored in the memory and executable by the processor, wherein when the vehicle trajectory heat map display program is executed by the processor, the steps of the vehicle trajectory heat map display method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a vehicle trajectory heat map display program, wherein when the vehicle trajectory heat map display program is executed by a processor, the steps of the vehicle trajectory heat map display method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Method and device for generating PID (Proportion Integration Differentiation) of secondary piping of semiconductor

    CN119918809A