Stop point division method, device, computer equipment and storage medium
Through density clustering and adjacency matrix segmentation combined with attribute entropy and similarity ratio between clusters, the problem of outliers sensitive in spatial clustering is solved, and the accurate division of stops and effective reduction of regional boundaries is achieved.
Patent Information
- Application Number
- CN202210321912.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-30
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-03-30
AI Technical Summary
The prior art fails to effectively combine spatial characteristics and entity attributes in spatial clustering, resulting in sensitive outliers and difficult to accurately divide stops. Especially under spatial constraints, there is a cumulative problem with the calculation similarity of attribute distances.
The density clustering algorithm is used to cluster truck trajectory points, establish an adjacency matrix, and select the segmentation method through the attribute entropy and the similarity ratio between clusters to ensure that the segmented cluster has the highest similarity within the class and the lowest similarity between classes, and the stop point division is used to use the principle of maximum equal probability entropy.
The accurate division of stops under spatial constraints is achieved, the sensitivity to outliers is reduced, the real area boundaries can be better restored, and the accuracy and consistency of clustering are improved.
Smart Images

Figure CN115048412B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of stop point division, and in particular to a stop point division method, device, computer equipment and storage medium. Background Art
[0002] For spatial clustering research, existing methods mainly divide the space separately without considering the attributes of spatial entities, such as the common density clustering and Delaunay triangulation. Some methods also integrate spatial attributes with entity data for unified clustering, but spatial features and attribute features have different dimensions and expressions, making it difficult to adjust the weights. Attribute clustering under spatial constraints usually uses attribute distance to calculate similarity, which is sensitive to outliers and has the problem of binary similarity propagation accumulation (for example, AB, BC, CD, DE have high similarity, but BD, CD have low similarity). Summary of the Invention
[0003] The present application provides a method, apparatus, computer device and storage medium for dividing a stop point.
[0004] A first aspect provides a method for dividing a stop point, the method comprising:
[0005] Determining a track point of the truck when it is at a stop point based on the running track point of the truck;
[0006] Clustering the trajectory points based on a density clustering algorithm to obtain multiple clusters;
[0007] Building an adjacency matrix between clusters based on proximity search;
[0008] The adjacency matrix is segmented according to the partitioning rule, and a plurality of new clusters formed after the segmentation are selected to meet a preset condition of the segmentation method as the stop point division rule, wherein the preset condition is that the plurality of new clusters formed after the segmentation have the highest intra-class similarity and the lowest inter-class similarity.
[0009] In some embodiments, determining the trajectory point of the truck at the stop point based on the running trajectory point of the truck includes:
[0010] Match the trajectory data with the road network data, calculate the road grade and distance from the road corresponding to the vehicle-mounted point, and remove trajectory points that stay on highways, national roads, provincial roads, and county roads.
[0011] Keep trajectory points with a velocity of 0
[0012] In some embodiments, clustering the trajectory points based on a density clustering algorithm to obtain a plurality of clusters includes:
[0013] The density-based clustering algorithm DBSCAN is used to cluster the trajectory points to obtain multiple clusters.
[0014] In some embodiments, establishing an adjacency matrix between clusters based on proximity search includes:
[0015] Establish an STRTree spatial index for each trajectory point in the cluster, preset the distance threshold β, and establish the adjacency matrix D between clusters through proximity search, where The adjacency matrix D is partitioned based on connectivity to obtain clusters.
[0016] In some embodiments, the segmentation method of selecting the multiple new clusters formed after segmentation to meet the preset conditions is a division rule of the stop points, including:
[0017] Determine the attribute entropy of the new cluster after segmentation;
[0018] Determine the inter-cluster similarity of the new clusters after segmentation;
[0019] Calculating the ratio of the attribute entropy to the similarity between clusters;
[0020] The division rule corresponding to the division method with the largest ratio is selected as the division rule that meets the preset conditions.
[0021] In some embodiments, the attribute entropy of the new cluster after segmentation is calculated using the following formula:
[0022] H(A)=H(A1)+H(A2)+…+H(A m )
[0023] Where, H(A r )=-∑ k P k log P k , where P k is the probability of having value k on the r-dimensional attribute;
[0024] Determine the inter-cluster similarity of the new clusters after segmentation and calculate it using the following formula
[0025] H i,j (A)=H i,j (A1)+H i,j (A2)+…+H i,j (A m ).
[0026] A second aspect provides a stop point division device, comprising:
[0027] A track point screening unit, configured to determine a track point when the truck is at a stop point based on the running track point of the truck;
[0028] A clustering unit, configured to cluster the trajectory points based on a density clustering algorithm to obtain a plurality of clusters;
[0029] an adjacency calculation unit, for establishing an adjacency matrix between clusters based on proximity search;
[0030] The result output unit is used to divide the adjacency matrix according to the division rule of the stop point, and select the multiple new clusters formed after the division that meet the preset conditions. The preset conditions are that the multiple new clusters formed after the division have the highest intra-class similarity and the lowest inter-class similarity.
[0031] A third aspect provides a computer device including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the above-mentioned stop point division method.
[0032] A fourth aspect provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, causes the one or more processors to perform the steps of the above-mentioned stop point division method.
[0033] A fifth aspect provides a computer program product, comprising a computer program, which implements the above method when executed by a processor.
[0034] The above-mentioned stop point division method, device, computer equipment, and storage medium determine the trajectory points of a truck when it is at a stop point based on its operating trajectory points; cluster the trajectory points based on a density clustering algorithm to obtain multiple clusters; establish an adjacency matrix between clusters based on proximity search; segment the adjacency matrix according to the segmentation method, and select the segmentation method that satisfies the preset conditions for the multiple new clusters formed after segmentation as the stop point division rule, wherein the preset conditions are that the multiple new clusters formed after segmentation have the highest intra-class similarity and the lowest inter-class similarity. Therefore, based on the principle of equal probability maximum entropy, information entropy is introduced to cluster adjacent spatial features. This method has good results when the attribute space is unevenly distributed, is insensitive to outliers (traditional distance similarity metrics are sensitive to outliers), and can effectively restore the true regional boundaries. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A diagram illustrating an implementation environment of a stop point division method provided in one embodiment;
[0036] Figure 2 is a block diagram of the internal structure of a computer device in one embodiment;
[0037] Figure 3 is a flow chart of a method for dividing a stop point in one embodiment;
[0038] Figure 4 4 is a structural block diagram of a stop point division device in one embodiment. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0040] It will be understood that the terms "first," "second," etc. used herein may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element.
[0041] An implementation environment of the stop point division method provided in one embodiment may include a computer device 110 and a terminal.
[0042] Computer device 110 is a data provider and has an interface, such as an API (Application Programming Interface). A terminal is a request inputter and has an interface configuration interface. When a stop is allocated, a user can input a request through the terminal to cause computer device 110 to perform the next stop allocation.
[0043] It should be noted that the terminal 120 and the computer device 110 may be, but are not limited to, a smartphone, a tablet computer, a laptop computer, a desktop computer, etc. The computer device 110 and the terminal 110 may be connected via Bluetooth, USB (Universal Serial Bus), or other communication connection methods, and the present invention does not impose any limitation thereto.
[0044] Figure 1 FIG. 1 is a schematic diagram of the internal structure of a computer device in one embodiment. Figure 1As shown, the computer device may include a processor, a storage medium, a memory and a network API interface connected via a system bus. Among them, the storage medium of the computer device stores an operating system, a database and computer-readable instructions, and the database may store a control information sequence. When the computer-readable instructions are executed by the processor, the processor may implement a method for determining sentence similarity based on a knowledge graph. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor may execute a method for determining sentence similarity based on a knowledge graph. The network API interface of the computer device is used to connect and communicate with a terminal. Those skilled in the art will understand that Figure 2 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0045] like Figure 2 As shown, in one embodiment, a stop point division method is proposed, which can be applied to the above-mentioned computer device 120, such as Figure 2 As shown, the following steps may be specifically included:
[0046] Step 201: Determine the track point of the truck when it is at the stop point based on the running track point of the truck;
[0047] In this step, useless trajectory points (roadside and running trajectory points) are removed. The essence is to cluster the stop points, and the roadside indicates traffic congestion to reduce the amount of calculation.
[0048] In some embodiments, the above step 201 may include:
[0049] Step 211: Match the trajectory data with the road network data, calculate the road grade and distance from the road corresponding to the vehicle-mounted point, and remove trajectory points that stay on highways, national roads, provincial roads, and county roads;
[0050] Step 2012: retain the trajectory points with a velocity of 0.
[0051] Step 202: clustering the trajectory points based on a density clustering algorithm to obtain multiple clusters;
[0052] In this step, the density-based clustering algorithm DBSCAN is used to cluster the trajectory points to obtain multiple clusters.
[0053] In some embodiments, the processed trajectory points are clustered using DBScan with a given threshold mpts, σ (or a threshold can be evaluated using optics clustering methods), mpts, the number of core area points, the number of clusters; σ the radius of the core area. The clustering results form a plurality of clusters S;
[0054] Step 203: Establish an adjacency matrix between clusters based on proximity search;
[0055] Establish an STRTree spatial index for each point in the cluster, give a distance threshold β, and establish the adjacency matrix D between clusters through proximity search, where Perform connectivity segmentation on the adjacency matrix D to obtain clusters C, C i ={S m , S n , S k …}.
[0056] Step 204 : partition the adjacency matrix according to , and select multiple new clusters formed after the partitioning that meet a preset condition as the partitioning rule of the stop point, wherein the preset condition is that the multiple new clusters formed after the partitioning have the highest intra-class similarity and the lowest inter-class similarity.
[0057] It is understandable that, assuming that each stop has m-dimensional attributes (vehicle id, vehicle model, vehicle length, stop duration, stop time period, etc.) A = (a1, a2, ... a m ), cluster S i There are n stops S i =(p i1 , p i2 ,…p in ), then S i The attribute entropy H(A r )= -∑ k P k log P k , where P k is the probability that the value of the r-dimensional attribute is k
[0058] Define cluster S i The attribute entropy is H(A)=H(A1)+H(A2)+…+H(A m ). According to the principle of equal probability maximum entropy, the smaller the attribute entropy in the same clustering result of the same attribute, the more stable and similar the attribute value is. The cluster S is defined as i With S j Similarity H on attribute r i,j (A r )=1 / -∑ k P k log P k , where Pk is the probability that the value is k on the r-dimensional attribute, that is, the set S i With S j Attribute entropy on attribute r after merging
[0059] Define cluster S i With S j The similarity H i,j (A)=H i,j (A1)+H i,j (A2)+…+H i,j (A m ), the problem is to calculate the probability of any two clusters S for each cluster set C (spatial constraint). i With S j When there is an optimal segmentation L, which makes the intra-class similarity the highest and the inter-class similarity the lowest, the cluster set C can be further clustered into L regions.
[0060] like Figure 4 As shown, in one embodiment, a stop point division device is provided. The stop point division device can be integrated into the above-mentioned computer device 110 and can specifically include:
[0061] A track point screening unit 411 is used to determine the track point of the truck when it is at the stop point based on the running track point of the truck;
[0062] A clustering unit 412 is used to cluster the trajectory points based on a density clustering algorithm to obtain a plurality of clusters;
[0063] an adjacency calculation unit 413 for establishing an adjacency matrix between clusters based on proximity search;
[0064] The result output unit 414 is used to partition the adjacency matrix according to the partitioning rule, and select multiple new clusters formed after the partitioning that meet the preset condition of the partitioning method as the stop point partitioning rule, wherein the preset condition is that the multiple new clusters formed after the partitioning have the highest intra-class similarity and the lowest inter-class similarity.
[0065] Clustering effect. The black dot is the center point obtained by density clustering, and the border is the final clustering result. It can be seen that the effect of using feature clustering under spatial constraints is better and conforms to the actual area boundary.
[0066] In one embodiment, a computer device is proposed. The computer device may include a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: determining the trajectory points of a truck when it is at a stop point based on the running trajectory points of the truck; clustering the trajectory points based on a density clustering algorithm to obtain multiple clusters; establishing an adjacency matrix between clusters based on proximity search; segmenting the adjacency matrix according to a segmentation rule, and selecting a segmentation method that satisfies a preset condition for multiple new clusters formed after segmentation as a division rule for stop points, wherein the preset condition is that the multiple new clusters formed after segmentation have the highest intra-class similarity and the lowest inter-class similarity.
[0067] In one embodiment, a storage medium storing computer-readable instructions is proposed. When the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the following steps: determining the trajectory points of the truck when it is at a stop point based on the running trajectory points of the truck; clustering the trajectory points based on a density clustering algorithm to obtain multiple clusters; establishing an adjacency matrix between clusters based on a proximity search; segmenting the adjacency matrix according to the segmentation, and selecting the segmentation method of the multiple new clusters formed after the segmentation that meet a preset condition as the division rule of the stop point, wherein the preset condition is that the multiple new clusters formed after the segmentation have the highest intra-class similarity and the lowest inter-class similarity.
[0068] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When executed, the program can include the processes in the above-described method embodiments. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0069] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0070] The above embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make numerous modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A method for dividing a stop point, characterized in that: The method comprises: Determining a track point of the truck when it is at a stop point based on the running track point of the truck; Clustering the trajectory points based on a density clustering algorithm to obtain multiple clusters; Building an adjacency matrix between clusters based on proximity search; The adjacency matrix is segmented according to a preset condition, and a segmentation method that satisfies the preset condition is selected as a division rule of a stop point, wherein the preset condition is that the multiple new clusters formed after the segmentation have the highest intra-class similarity and the lowest inter-class similarity; The multiple new clusters formed after the segmentation are selected to meet the preset conditions. The segmentation method is a division rule of the stop point, including: Determine the attribute entropy of the new cluster after segmentation; Determine the inter-cluster similarity of the new clusters after segmentation; Calculating the ratio of the attribute entropy to the similarity between clusters; The division rule corresponding to the division method with the largest ratio is selected as the division rule that meets the preset conditions; The attribute entropy of the new cluster after segmentation is calculated using the following formula: H(A)= In the formula, ,in, is the probability of having value k on the r-dimensional attribute; Determine the inter-cluster similarity of the new clusters after segmentation and calculate it using the following formula: , Among them, m means that each stop has m-dimensional attributes, A is the cluster, H is the attribute entropy, k is the value of the attribute, and r is a dimension in the m-dimensional attribute.
2. The method for dividing stop points according to claim 1, wherein: The step of determining the trajectory point of the truck when the truck is at the stop point based on the running trajectory point of the truck includes: Match the trajectory data with the road network data, calculate the road grade and distance from the road corresponding to the vehicle-mounted point, and remove trajectory points that stay on highways, national highways, provincial highways, and county roads; Keep trajectory points with a velocity of 0.
3. The method for dividing stop points according to claim 1, wherein: The density-based clustering algorithm is used to cluster the trajectory points to obtain multiple clusters, including: The density-based clustering algorithm DBSCAN is used to cluster the trajectory points to obtain multiple clusters.
4. The method for dividing stop points according to claim 1, wherein: The step of establishing an adjacency matrix between clusters based on proximity search includes: Create an STRTree spatial index for each trajectory point in the cluster and preset the distance threshold , establish the adjacency matrix D between clusters through proximity search, where , perform connectivity partitioning on the adjacency matrix D to obtain clustering clusters.
5. A stop point division device, characterized in that: include: A track point screening unit, configured to determine a track point when the truck is at a stop point based on the running track point of the truck; A clustering unit, configured to cluster the trajectory points based on a density clustering algorithm to obtain a plurality of clusters; an adjacency calculation unit, for establishing an adjacency matrix between clusters based on proximity search; A result output unit is used to segment the adjacency matrix according to a preset condition, and select a plurality of new clusters formed after segmentation that meet the preset condition as a division rule of the stop point, wherein the preset condition is that the plurality of new clusters formed after segmentation have the highest intra-class similarity and the lowest inter-class similarity; The multiple new clusters formed after the segmentation are selected to meet the preset conditions. The segmentation method is a division rule of the stop point, including: Determine the attribute entropy of the new cluster after segmentation; Determine the inter-cluster similarity of the new clusters after segmentation; Calculating the ratio of the attribute entropy to the similarity between clusters; The division rule corresponding to the division method with the largest ratio is selected as the division rule that meets the preset conditions; The attribute entropy of the new cluster after segmentation is calculated using the following formula: H(A)= In the formula, ,in, is the probability of having value k on the r-dimensional attribute; Determine the inter-cluster similarity of the new clusters after segmentation and calculate it using the following formula: , Among them, m means that each stop has m-dimensional attributes, A is the cluster, H is the attribute entropy, k is the value of the attribute, and r is a dimension in the m-dimensional attribute.
6. A computer device comprising a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor performs the steps of the stop point division method according to any one of claims 1 to 4.
7. A storage medium storing computer-readable instructions, wherein when the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the steps of the stop point division method according to any one of claims 1 to 4.
8. A computer program product, characterized in that A computer program is included which, when executed by a processor, implements the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Automobile proving ground testing route planning method based on ant colony algorithm
CN108801261A
Data processing method and device, computer readable storage medium and computer equipment
CN113792206A