A commuter traffic community pair identification method based on improved K-means clustering algorithm
Through the improved K-means clustering algorithm combined with urban road network and POI data to identify commuter traffic community pairs, the traffic congestion problem caused by urban commuting behavior is solved and more efficient traffic planning and management is achieved.
Patent Information
- Application Number
- CN202211069752.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-02
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2042-09-02
AI Technical Summary
The separation of urban residents' residences and work places leads to longer commuting times and longer commuting distances, reducing the operating efficiency of public transportation systems and increasing urban traffic congestion problems.
The improved K-means clustering algorithm is used to combine urban road network data and POI data to identify commuter traffic cell pairs, and the pair of commuter traffic cell pairs with strong stability is screened through the traffic transfer matrix and discrete coefficients.
By identifying commuter traffic communities, supporting the planning decisions of the transportation department, providing effective data support to alleviate urban traffic congestion and improve public transportation efficiency.
Smart Images

Figure CN115456063B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of transportation, and in particular to a commuter transportation community pair identification method based on an improved K-means clustering algorithm. Background Art
[0002] In the past decade, with the rapid development of my country's society, economy, science and technology, my country's urbanization process has made great strides and developed rapidly, which has led to the rapid expansion of urban areas and significant changes in urban spatial structure, and ultimately led to the separation of urban residents' residence and work, especially in large cities. This phenomenon is more obvious. The separation of residence and work has brought about the problem of longer commuting time and longer commuting distance in cities. To a certain extent, it has reduced the efficiency of the public transportation system and aggravated the problem of urban traffic congestion. Commuting is a travel behavior of urban residents with high periodicity and relative stability. It accounts for the vast majority of urban residents' travel and is an important research content of urban development planning and public transportation management.
[0003] In the urban transportation system, taxis play a very important role in the travel of urban residents. Taxi GPS trajectory data is collected by the collection equipment installed in the taxi during the driving process of the taxi, and contains spatiotemporal information about the travel activities of urban residents. In general, this spatiotemporal information mainly consists of the following two parts: taxi drivers and passengers. Taxi drivers are usually experienced drivers. Years of driving experience have made them very familiar with the city's road network and traffic operation conditions. When choosing a route, factors such as travel time, distance and road conditions are usually considered. The other part contains a large amount of spatiotemporal information on passenger travel, which reflects the citizens' transportation travel needs and travel activity patterns, and is an important data source for analyzing citizens' travel patterns. Taxi GPS data has a wide distribution range, a large amount of data and high real-time positioning. It is a high-quality data source for analyzing urban road environment and vehicle driving behavior. Therefore, the analysis and research of taxi GPS data is very important for the development of urban transportation systems, especially in cities with complex urban road networks. Summary of the invention
[0004] In view of this, one of the objectives of the present invention is to provide a commuter traffic community pair identification method based on an improved K-means clustering algorithm.
[0005] The objective of the present invention is achieved through the following technical solutions:
[0006] A commuter traffic community pair identification method based on an improved K-means clustering algorithm, the method comprising:
[0007] The commuting traffic community pair is defined as follows: if two traffic communities have stable traffic flows that meet the set requirements during the morning and evening rush hours on weekdays, it is considered that there is regional-level commuting travel behavior of taxis in these two traffic communities, and thus these two traffic communities can be considered as a commuting traffic community pair;
[0008] Divide commuter traffic zones: Comprehensively consider the urban road network and regional POI attribute factors, and divide traffic zones based on urban road network data and POI data;
[0009] Get the traffic transfer matrix;
[0010] Identify commuter traffic community pairs: select morning peak flow, evening peak flow, morning peak dispersion coefficient and evening peak dispersion coefficient as input features, and use the improved K-means clustering algorithm based on Minkowski distance to identify commuter traffic community pairs.
[0011] Furthermore, after identifying the commuting traffic community pairs, the coefficient of dispersion COD<0.3 is finally combined to further screen the commuting traffic community pairs.
[0012] Furthermore, when dividing commuter traffic communities, we obtain POI data sets and focus on the three fields of latitude, longitude and mark. The content of the mark field is POI information, which specifically includes two parts: POI categories and specific subcategories. We use classification to count the number of POIs within the community and use the K-means method to cluster them, and comprehensively analyze the POI attributes of the traffic community.
[0013] Furthermore, the POI attributes of the community are used to merge the regions, and finally an irregularly shaped region of appropriate size that conforms to the real urban spatial distribution is formed, namely, the traffic community.
[0014] Furthermore, the coefficient of dispersion (COD) of traffic flow is designed to measure the fluctuation of traffic flow, that is, the stability characteristic. Based on the flow transfer matrix between traffic cells, the coefficient of dispersion COD of traffic flow is calculated. The calculation formula is as follows:
[0015]
[0016]
[0017]
[0018] in, is the mean value of taxi traffic flow between traffic areas a and b in a specific time period within the observation period K; is the taxi traffic flow of traffic areas a and b on the kth day; S abis the standard deviation of traffic flow between communities a and b within observation period K.
[0019] Furthermore, the silhouette coefficient method and elbow rule are used to select the number of clusters k to ensure the reliability of the results.
[0020] Furthermore, in the process of obtaining the traffic transfer matrix, a frequency-based method is used to allocate OD. Specifically, if there is a point P distributed on the road, N cells are extended around the cell where point P is located to form a research window of (2N+1)×(2N+1) units. In this research window, if a certain traffic zone has the largest number of cells, point P is allocated to the traffic zone. Using this OD allocation method, a group of ODs are allocated to a pair of commuter traffic zones, and the transfer flow between each traffic zone is calculated to form a traffic transfer matrix.
[0021] A second object of the present invention is to provide a computer device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the method described above when executing the computer program.
[0022] A third object of the present invention is to provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method described above when executed by a processor.
[0023] The beneficial effects of the present invention are as follows: the present invention analyzes and mines massive taxi GPS data to identify taxi commuting traffic community pairs, which is conducive to supporting the planning and decision-making of the transportation department, and can also provide effective data support for third-party companies to design solutions, such as designing customized buses. This has very important practical significance for alleviating urban traffic congestion, improving public transportation efficiency, and creating smooth cities.
[0024] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description and the preceding claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings, in which:
[0026] Figure 1 It is the overall framework diagram of the present invention;
[0027] Figure 2 It is a schematic diagram of traffic zone division of the present invention;
[0028] Figure 3 It is a sample diagram of OD allocation of the present invention;
[0029] Figure 4 It is a selection diagram of the number of clusters k of the present invention;
[0030] Figure 5 It is a statistical distribution diagram of the morning and evening peak dispersion coefficient of the present invention;
[0031] Figure 6 Table 1 shown is the taxi trajectory data format of a certain city;
[0032] Figure 7 Table 2 shown is the POI data format of a certain city. DETAILED DESCRIPTION
[0033] The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the preferred embodiments are only for illustrating the present invention, rather than for limiting the protection scope of the present invention.
[0034] The present invention proposes a new commuter traffic cell identification method to identify the commuter travel mode at the taxi regional level, which is based on massive taxi GPS data, urban road network data and POI information.
[0035] The specific steps include:
[0036] The definition of commuting traffic zone pairs is as follows: If the commuting behavior of urban residents at the regional level can be regarded as the travel activities between the residents' residence and the workplace with characteristics such as time period, stability, and periodicity, then on this basis, combined with the characteristics of taxi travel, the following definition of commuting traffic zones is proposed: If two traffic analysis zones (TAZs) have stable traffic flows that meet certain requirements during the morning and evening rush hours on weekdays, then it is considered that these two traffic zones have taxi regional-level commuting travel behaviors, and then the two traffic zones can be considered as a commuting traffic zone pair;
[0037] Divide commuter traffic zones: Comprehensively consider the factors of urban road network and regional POI attributes, and combine urban road network data and POI data to divide traffic zones; Different studies have different viewpoints on the division of traffic zones. Traditional methods are mostly based on administrative division units (such as streets, communities, etc.), which have large areas and are not conducive to detailed research; There are also some methods that divide the study area into regular grids of the same size. Although such methods can be used for detailed research, they do not take into account the real spatial structure of the city and undermine the integrity of the spatial structure of the urban area. In view of this, the present invention believes that it is necessary to comprehensively consider factors such as urban road network and regional POI attributes when dividing traffic zones;
[0038] Obtaining the flow transfer matrix: When identifying commuter traffic cells, the commuter flow correlation index between traffic cells is mainly used as a metric. Therefore, it is crucial to obtain the flow transfer matrix between commuter traffic cells. The difficulty in obtaining the flow transfer matrix lies in the inaccurate starting point (O) and end point (D). Since the OD of taxi vehicles is distributed on the road network, the OD needs to be allocated to the adjacent commuter traffic cells. The method of the present invention mainly adopts a frequency-based method to allocate OD;
[0039] Identify commuter traffic community pairs: select morning peak flow (Flow-M), evening peak flow (Flow-E), morning peak dispersion coefficient (COD-M) and evening peak dispersion coefficient (COD-E) as input features. Based on the above four features, the present invention uses an improved K-means clustering algorithm based on Minkowski distance (d=4) to identify commuter traffic community pairs. In this way, traffic community pairs with large flow and strong stability during peak hours in the morning and evening will be classified into one category. Finally, the dispersion coefficient COD<0.3 is combined to further screen commuter traffic community pairs.
[0040] Based on the above method flow, a specific embodiment will be provided below for detailed description. To deepen the understanding of the new commuter traffic zone identification method proposed in the present invention to identify the commuter travel mode at the taxi regional level. This embodiment is based on a 40km*40km research area in a certain city, and specifically includes the following steps:
[0041] Step 1: Divide the 40km*40km study area into 2000*2000 grids, each with a size of 20m×20m, such as Figure 2 As shown in (a), the reason for selecting 20m is that the width of urban roads is generally about 20m;.
[0042] Step 2: Mark all road grids as 1 according to the urban road network information, so that other grids are surrounded by road grids into irregular areas, and then merge the grids in the area. Figure 2 As shown in (b), the red area is marked as cell 3;
[0043] Step 3: Delete unreasonable areas, for example, if the area is too small or the area is a special area such as a river, lake, mountain, forest, etc. (because the city is a mountainous city and there are many rivers in the urban area);
[0044] Step 4: Analyzing the POI attributes of traffic cells is conducive to improving the rationality and accuracy of cell merging, and can also provide support for identifying commuter traffic cells.
[0045] After obtaining the POI data of the main urban area of the city, some important fields of the POI data set of the main urban area are shown in Table 2. The present invention focuses on the three fields of latitude, longitude and mark, among which the content of the mark field is the POI information, which includes two parts: POI category and specific subcategory, such as the mark of the university is "education and training; colleges and universities". Due to the various categories of POI information, the POI information is classified and counted into 7 categories: consumption and entertainment, business and office, education, transportation facilities, medical care, scenic spots, and residences. By using the classification statistics of the number of POIs within the community and clustering them using the K-means method, the POI attributes of the transportation community are comprehensively analyzed. Visual effects can also be used for identification, which is easier to identify, such as red areas are identified as consumption and entertainment areas, brown areas are identified as residential areas, khaki areas are identified as education areas, pink areas are business and office areas, and dark blue areas are transportation facilities.
[0046] Step 5: Use the community POI attributes to merge regions, and finally form an irregularly shaped area of appropriate size that conforms to the actual urban spatial distribution, namely the traffic community.
[0047] Step 6: Figure 3 As shown in the figure, point P is distributed on the road (the label of the road unit is 1), and the cell where point P is located is centered and extends to three cells around, forming a 7×7 cell research window. In this research window, the number of cells in traffic area No. 2 is the largest, so we assign point P to traffic area No. 2. Using this OD allocation method, a group of ODs are assigned to a pair of commuter traffic areas, and the transfer flow between each traffic area is calculated to form a flow transfer matrix.
[0048] Step 7: Design the coefficient of dispersion (COD) of traffic flow to measure the fluctuation of traffic flow (i.e., stability characteristics). Based on the flow transfer matrix between traffic zones, the coefficient of dispersion (COD) of traffic flow is calculated. The calculation formula is as follows:
[0049]
[0050]
[0051]
[0052] in, is the mean value of taxi traffic flow between traffic areas a and b in a specific time period (morning peak or evening peak) within the observation period K (two weeks); is the taxi traffic flow of traffic areas a and b on the kth day; S ab is the standard deviation of traffic flow between communities a and b within observation period K.
[0053] Step 8: The number of clusters k is a constant and needs to be set in advance. The setting of the k value is very important to the final result. The commonly used methods for selecting k are the Silhouette Coefficient (SC) method and the elbow rule. The Silhouette Coefficient (SC) is a way to evaluate the clustering effect, which combines the two factors of cohesion and separation. The mean of all sample SC is called the silhouette coefficient of the clustering result. The value of the silhouette coefficient is between [-1,1]. The larger the value, the closer the samples of the same type are to each other, and the farther the samples of different types are from each other, the better the clustering effect. The calculation formula of the silhouette coefficient SC is as follows:
[0054]
[0055]
[0056]
[0057] Where: C i , C j Represents the sample data set contained in the i-th and j-th clusters, sample point x i ∈C i , a(i) represents the sample point x i The internal dissimilarity of , b(i) represents the sample point x i The external dissimilarity of , N represents the number of all sample points.
[0058] The elbow rule determines the optimal K value by comparing the trend of the sum of squared errors (SSE) of the clustering results. The closer the SSE is to 0, the better the clustering effect. The calculation formula of the sum of squared errors (SSE) is as follows:
[0059]
[0060] Where: u i Represents the cluster center of the i-th cluster.
[0061] In order to avoid cognitive bias caused by a single method, the present invention selects the silhouette coefficient (SC) method and the elbow rule to jointly determine k to ensure the reliability of the results. The experimental results are as follows Figure 5 shown.
[0062] Step 9: Select morning peak flow (Flow-M), evening peak flow (Flow-E), morning peak dispersion coefficient (COD-M) and evening peak dispersion coefficient (COD-E) as input features. The most commonly used K-means algorithm is clustering based on Minkowski distance. It believes that the closer the distance between two targets, the greater the similarity, and the easier it is to be clustered into the same class. The present invention uses an improved K-means algorithm for clustering. The pseudo code of the improved K-means algorithm is as follows.
[0063]
[0064]
[0065] Step 10: After clustering, traffic cell pairs with large traffic volume and strong stability during peak hours in the morning and evening will be classified into one category. Figure 7 We can know that the dispersion coefficient results are in [0.001, 1.0], among which the dispersion coefficient in the interval [0.1, 0.3] accounts for more than 70%, and the taxi traffic flow between each community is relatively stable when Gab < 0.3. Therefore, referring to the relevant statistical criteria, the present invention selects Gab = 0.3 as the boundary of the dispersion coefficient and selects the commuter traffic community pairs with a dispersion coefficient COD < 0.3.
[0066] In view of the problems of low efficiency and low recognition accuracy of the existing regional commuting identification methods based on taxi GPS data, the present invention proposes a commuting traffic zone identification method based on an improved K-means clustering algorithm. The method mainly includes the following steps: dividing traffic zones, generating a flow transfer matrix between traffic zones, and identifying commuting traffic zone pairs. Referring to the existing method of dividing traffic zones, the present invention adopts a bottom-up traffic zone division method based on fine-grained element units. When generating the flow transfer matrix, facing the OD allocation problem on the road, the present invention adopts a frequency-based method to allocate the OD on the road to the traffic zone. In the commuting traffic zone pair identification model, the present invention uses the flow during peak hours and its discrete coefficient as input features to directly identify commuting traffic zone pairs. Finally, the present invention verifies the method on a real data set of a certain city, and the results show that the method is effective.
[0067] It should be noted that any process or method description in the flowchart of the present invention or described in other ways herein may be understood to represent a module, fragment or portion of a code including one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations, in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.
[0068] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0069] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0070] A person skilled in the art may understand that all or part of the steps of the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0071] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0072] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A commuter traffic community pair identification method based on an improved K-means clustering algorithm, characterized by: The method comprises: The commuting traffic community pair is defined as follows: if two traffic communities have stable traffic flows that meet the set requirements during the morning and evening rush hours on weekdays, it is considered that there is regional-level commuting travel behavior of taxis in these two traffic communities, and thus these two traffic communities can be considered as a commuting traffic community pair; Divide commuter traffic zones: Comprehensively consider the urban road network and regional POI attribute factors, and divide traffic zones based on urban road network data and POI data; Obtaining the traffic transfer matrix; In the process of obtaining the traffic transfer matrix, a frequency-based method is used to allocate OD. Specifically, if there is a point P distributed on the road, N cells are extended around the cell where the point P is located to form a research window of (2N+1)×(2N+1) cells. In this research window, if a certain traffic zone has the largest number of cells, the point P is allocated to the traffic zone. Using this OD allocation method, a group of ODs are respectively allocated to a pair of commuter traffic zones, and the transfer flow between each traffic zone is calculated to form a traffic transfer matrix. Identify commuter traffic community pairs: select morning peak flow, evening peak flow, morning peak dispersion coefficient and evening peak dispersion coefficient as input features, and use the improved K-means clustering algorithm based on Minkowski distance to identify commuter traffic community pairs; The traffic flow dispersion coefficient COD is designed to measure the fluctuation of traffic flow, that is, the stability characteristic. Based on the flow transfer matrix between traffic cells, the traffic flow dispersion coefficient COD is calculated. The calculation formula is as follows: in, is the mean value of taxi traffic flow between traffic areas a and b in a specific time period within the observation period K; is the taxi traffic flow of traffic areas a and b on the kth day; S ab is the standard deviation of traffic flow between communities a and b within observation period K.
2. The commuter traffic community pair identification method based on the improved K-means clustering algorithm according to claim 1 is characterized by: After identifying the commuting traffic community pairs, the dispersion coefficient COD<0.3 is finally combined to further screen the commuting traffic community pairs.
3. The commuter traffic community pair identification method based on the improved K-means clustering algorithm according to claim 1 is characterized by: When dividing commuter traffic communities, we obtain POI data sets and focus on the three fields of latitude, longitude and mark. The content of the mark field is POI information, which specifically includes two parts: POI categories and specific subcategories. We use classification to count the number of POIs within the community and use the K-means method to cluster them, and comprehensively analyze the POI attributes of the traffic community.
4. The commuter traffic community pair identification method based on the improved K-means clustering algorithm according to claim 3 is characterized by: The area merging is performed using the POI attributes of the community, and finally an irregularly shaped area of appropriate size that conforms to the real urban spatial distribution is formed, namely the traffic community.
5. The method for identifying commuter traffic community pairs based on an improved K-means clustering algorithm according to claim 1, characterized in that: The silhouette coefficient method and elbow rule are used to select the number of clusters k to ensure the reliability of the results.
6. A computer device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.