Method and device for constructing mobile source driving conditions based on short-trip feature clustering
By using a method based on short-stroke feature clustering and using vehicle data to construct driving conditions, the lack of randomness and representativeness of the driving condition construction results in the existing technology is solved, and a more accurate reflection of driving characteristics and energy consumption is achieved. .
Patent Information
- Application Number
- CN202111153923.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-09-29
AI Technical Summary
Existing driving condition construction methods have shortcomings in reducing randomness and representativeness of construction results. Especially when dealing with vehicle driving conditions, it is difficult to accurately reflect real driving characteristics and energy consumption.
A method based on short-distance feature clustering is used to obtain vehicle OBD and GPS data for preprocessing and segmentation. PCA dimensionality reduction and K-means clustering are used to construct driving conditions by combining the maximum correlation coefficient method and the minimum parameter deviation method. , and finally output more accurate driving conditions through relative error and speed acceleration distribution evaluation.
It reduces the randomness of the construction of working conditions, improves the representativeness of the construction results, has smaller errors, is closer to the real driving conditions, and can more accurately reflect the driving characteristics and energy consumption of the vehicle.
Smart Images

Figure CN114021617B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of environmental detection, and in particular to a method and device for constructing a mobile source driving condition based on short-trip feature clustering. Background Art
[0002] In recent years, the number of passenger cars in my country has grown rapidly, making transportation more convenient and providing greater opportunities for industrial development, but it has also aggravated the energy crisis and automobile pollutant emissions. Automobile fuels are mostly gasoline and diesel, and fuel consumption has led to the gradual depletion of fossil energy. Automobile exhaust contains harmful gases and substances such as CO and PM, as well as CO2, which causes greenhouse effects. According to the "Technical Policy for Motor Vehicle Pollution Prevention and Control" revised by the Ministry of Environmental Protection, it is pointed out that the motor vehicle pollution prevention and control system should be built with further improvement of environmental quality as the core. The "Technical Policy" clearly states that the emission limits of pollutants such as carbon monoxide (CO), total hydrocarbons (THC), nitrogen oxides (NOx) and particulate matter (PM) for newly produced motor vehicles will be gradually tightened. Motor vehicle pollutant emissions are mainly affected by vehicle driving conditions. For example, if the vehicle idles for a long time in traffic jams and the acceleration and deceleration frequency is too high, it will cause higher exhaust emissions. Vehicle driving conditions are speed-time curves that describe the driving laws of a certain type of vehicle in a specific traffic area and time period. As the vehicle speed increases, the concentration of fine particulate matter emissions from light gasoline vehicles increases. The number and mass concentrations of vehicle particulate matter also increase significantly under acceleration. Therefore, studying driving conditions plays an important role in vehicle emissions and energy consumption.
[0003] At present, the methods for constructing driving conditions are mainly divided into two categories: Markov analysis method and short-stroke method. The Markov analysis method mainly utilizes the random characteristics of the speed change process. The state at time t+1 only depends on the characteristics of the state at time t (that is, there is no aftereffect). After multiple iterations and calculation of random probabilities, the intermediate kinematic segments are selected to construct the final driving condition. The short-stroke method divides all kinematic segments into several categories according to their similarities, and then selects representative segments from each category of the segment library based on certain selection principles to form the final operating condition curve. Compared with the Markov analysis method, the short-stroke method divides the kinematic segments into different types, the results are clearer, more meaningful for reference to actual conditions, and closer to actual road conditions. Summary of the invention
[0004] The present invention proposes a method and device for constructing a mobile source driving condition based on short-trip feature clustering, which can solve the above technical problems.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] A method for constructing a mobile source driving condition based on short-trip feature clustering comprises the following steps:
[0007] S1: Obtain speed data and GPS data from the vehicle OBD interface, pre-process the raw data, remove invalid data, and fill in missing values;
[0008] S2: segment the velocity data to obtain kinematic segments;
[0009] S3: Perform kinematic segment feature design, i.e. define two types of feature parameters: vehicle motion feature parameters and overall distribution parameters, which are used for cluster analysis basis and verification of constructed working conditions, respectively, and calculate the vehicle motion feature parameters of each kinematic segment and the overall distribution parameters of the total data;
[0010] S4: Use principal component analysis (PCA) to reduce the dimension of kinematic feature parameters of kinematic segments;
[0011] S5: Use K-means clustering to classify the input fragments to obtain multiple types of fragment libraries;
[0012] S6: Select input segments from various segment libraries according to the maximum correlation coefficient method and the minimum parameter deviation method to form driving conditions, compare the comprehensive indicators of the two types of conditions, and finally output the constructed conditions.
[0013] Furthermore, after S6 outputs the constructed operating condition, S7 is also included: evaluating the constructed driving condition using two methods: relative error and speed-acceleration joint distribution.
[0014] On the other hand, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the above method.
[0015] On the other hand, the present invention further discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.
[0016] It can be seen from the above technical solution that the method for constructing a mobile source driving condition based on short-trip feature clustering of the present invention has the following beneficial effects:
[0017] 1. Compared with the working condition construction of the Markov method, the mobile source driving condition construction based on short-trip feature clustering reduces the randomness of the construction results, making the constructed conditions cover the characteristics of various kinematic fragments and more representative.
[0018] 2. The present invention adopts the maximum correlation coefficient method and the minimum parameter deviation method to select fragments, measures the representativeness of a single fragment from the perspectives of spatial vector correlation and parameter numerical deviation, and compares and outputs the final working condition, so that the constructed working condition error is smaller and closer to the actual driving condition. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a flow chart of the method of the present invention;
[0020] Figure 2 and Figure 3 The clustering results of the embodiment of the present invention are t-SNE dimension reduction 2D graph and 3D graph;
[0021] Figure 4 is a working condition diagram of an embodiment of the present invention;
[0022] Figure 5 Acceleration frequency distribution diagram of an embodiment of the present invention; DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0024] like Figure 1 As shown, the method for constructing a mobile source driving condition based on short-trip feature clustering described in this embodiment includes:
[0025] S1: Obtain speed data and GPS data from the vehicle OBD interface, pre-process the original data, remove invalid data, and fill in missing values.
[0026] S2: segment the velocity data to obtain kinematic segments;
[0027] S3: Design kinematic segment features. Define two types of feature parameters: vehicle motion feature parameters and overall distribution parameters, which are used for cluster analysis basis and verification of constructed working conditions, respectively. Calculate the vehicle motion feature parameters of each kinematic segment and the overall distribution parameters of the total data.
[0028] S4: In order to reduce the amount of clustering calculations, principal component analysis (PCA) is used to reduce the dimension of kinematic feature parameters of kinematic segments.
[0029] S5: Use K-means clustering to classify the input fragments to obtain multiple types of fragment libraries;
[0030] S6: Select input segments from various segment libraries according to the maximum correlation coefficient method and the minimum parameter deviation method to form driving conditions, compare the comprehensive indicators of the two types of conditions, and finally output the constructed conditions.
[0031] S7: Evaluate the constructed driving cycle using two methods: relative error and joint distribution of velocity and acceleration.
[0032] The specific implementation steps are as follows:
[0033] S1: Obtain speed data and GPS data from the vehicle OBD interface, pre-process the original data, remove invalid data, and fill in missing values.
[0034] Specifically, it includes speed, acceleration abnormal value processing, burr processing, and long-term traffic jam / parking processing; setting the maximum parking time to 180s, cutting off excess time, and avoiding too much idling state.
[0035] S2: segment the velocity data to obtain kinematic segments;
[0036] The kinematic segment is defined as the interval from the start of the vehicle's current stop to the start of the next stop.
[0037] S3: Design kinematic segment features. Define two types of feature parameters: vehicle motion feature parameters and overall distribution parameters, which are used for cluster analysis basis and verification of constructed working conditions, respectively. Calculate the vehicle motion feature parameters of each kinematic segment and the overall distribution parameters of the total data.
[0038] Table 1 Vehicle motion characteristic parameters
[0039]
[0040]
[0041] Table 2 Overall distribution characteristic parameters of data
[0042]
[0043]
[0044] S4: In order to reduce the amount of clustering calculations, principal component analysis (PCA) is used to reduce the dimension of kinematic feature parameters of kinematic segments.
[0045] The specific steps are as follows:
[0046] m kinematic segments, n kinematic characteristic parameters, the corresponding indicator matrix is:
[0047]
[0048] The new comprehensive index is:
[0049]
[0050] In the new comprehensive index, F i 、F j Unrelated. The variance reaches the maximum and is required to decrease in sequence. The restriction conditions are met: a i12 +a i2 2 +...+a in 2 =1 is standardized before the principal component analysis. Standardize it to eliminate the unit effect:
[0051]
[0052]
[0053]
[0054] The standardized matrix can be obtained:
[0055] S=(X1,S2,...,X p )
[0056] Then calculate the correlation coefficient matrix as follows:
[0057]
[0058] r ij For x i With x j The correlation coefficient is calculated as follows:
[0059]
[0060]
[0061] Calculate the eigenvalues and eigenvectors of the correlation coefficient matrix:
[0062] |R-λE|=0
[0063] Then calculate the principal component scores:
[0064]
[0065] When the cumulative contribution rate of the principal component reaches 85% (α k >0.85), it can be considered that the principal component can represent most of the information
[0066] Then the principal component value can be calculated as: Z = (Xu1, Xu2, ..., Xu k )=(z1,z2,...,z k )
[0067] where z1, z2, z3, ... z k are the first k main components respectively.
[0068] S5: Use K-means clustering to classify the input fragments to obtain multiple types of fragment libraries. According to the Davidson-Boulding Index DBI, select the optimal number of clusters, including the following steps:
[0069] Set the k value and bring it into the clustering network respectively;
[0070]
[0071] Calculate the DBI value of the clustering results under each k value:
[0072] Where k represents the number of clusters; ||c i -c j ||2 represents the Euclidean distance between the centroid of cluster i and the centroid of cluster j; It represents the average distance from the feature vector in cluster i to its centroid, which represents the degree of dispersion of the data in cluster i. It represents the average distance from the feature vector in cluster j to its centroid, which represents the dispersion of data in cluster j; M i represents the number of data in cluster i; X is represents the sth data in cluster i, X js represents the sth data in cluster j, c i represents the centroid of cluster i, c j represents the centroid of cluster j; p is usually 2;
[0073] The k value when the DBI value first appears in the local minimum is selected as the optimal clustering number k0.
[0074] Initialize cluster centers and divide kinematic segments into different libraries.
[0075] S6: Calculate the proportion of each type of segment in the final working condition, select input segments from each type of segment library according to the maximum correlation coefficient method and the minimum parameter deviation method to form a driving condition, compare the comprehensive indicators of the two types of conditions, and finally output the constructed condition.
[0076] Specifically, the core idea of the minimum parameter deviation method is that the closer the characteristic parameters of the kinematic segment are to the overall parameters of the segment, the more representative it is. When selecting segments, the segments with smaller deviations are selected in ascending order of parameter deviation. The sum of the comprehensive parameters of each segment library is calculated.
[0077] The specific method is to standardize the mean of each parameter and then sum them up.
[0078]
[0079] sum k represents the sum of the comprehensive parameters of the k-th type of fragments, x k,jIndicates the jth parameter of the k-type fragment
[0080] z k,j (i) =(x k,j (i) -minx k,j (i) ) / (maxx k,j -minx k,j )
[0081]
[0082] z k (i) Represents the comprehensive score of the parameters of the i-th fragment of the k-type fragment after standardization
[0083] Calculate the absolute deviation and sort the selected segments in ascending order of absolute deviation.
[0084] det k (i) =|sum k -z k (i) |
[0085] The idea of the maximum correlation coefficient method is to introduce the Pearson Correlation Coefficient to measure the similarity between the fragment parameter vector and the library parameter vector. From a geometric perspective, the Pearson correlation coefficient is interpreted as the cosine value of the spatial angle between two n-dimensional vectors. The larger the absolute value of the correlation coefficient, the smaller the angle, and the higher the similarity between the two vectors.
[0086] The Pearson correlation coefficient of an n-dimensional vector can be written as:
[0087]
[0088] After the data is standardized, the correlation coefficient between the segment parameter vector and the library parameter vector is calculated, and the kinematic segments with the highest ranking are selected in descending order until the selected segment duration is 0.95T. k ~T k If the range is exceeded, the system stops. All kinds of working conditions are combined to form the final working condition. The time proportion of each type of fragment in the final working condition is T k The calculation of is as follows:
[0089]
[0090] T k is the duration of the kth type of working condition, T f is the duration of the final working condition, which is 1200s in this paper, p represents the number of kinematic segment categories, and n represents the number of segments contained in each segment library.
[0091] According to the time proportion of each type of fragment library in the overall fragment library, the total duration of the fragments selected from each type of fragment library is determined, and the input fragments are selected according to the priority of the feature vectors under each type of label to form a driving condition.
[0092] The algorithm flow of the embodiment of the present invention is as follows:
[0093] enter:
[0094] Given a set of velocity values X for a vehicle kinematic segment,
[0095] The training sample size n,
[0096] The number of clusters k.
[0097] Output:
[0098] After preprocessing, the velocity sequence is
[0099] Kinematics fragment,
[0100] Principal component load matrix and principal component scores of kinematic segments.
[0101] Furthermore, the optimal number of clusters is selected based on the Davidson-Boulding Index (DBI). The smaller the DBI value, the smaller the intra-class distance and the larger the inter-class distance, that is, the better the clustering effect. Specifically:
[0102] S1. Set the k value, for example, from 2 to 10, and bring it into the training codec and clustering network respectively.
[0103] S2. Calculate the DBT value of the clustering result under each k value. The calculation formula is as follows:
[0104]
[0105] Where k represents the number of clusters; W i Calculate the average distance from the time series within the class to the centroid of the cluster, which represents the degree of dispersion of the data in cluster i, as shown in the following formula; the denominator represents the Euclidean distance between the centroids of cluster i and cluster j
[0106]
[0107] Among them, M i represents the number of data in cluster i; X j represents the jth data in cluster i; C i Represents the centroid of cluster i; p is usually set to 2, and the Euclidean distance is calculated.
[0108] S3. Select the k value where the DBI value first appears in the local minimum, which is the optimal number of clusters.
[0109] Furthermore, the segments are selected to form driving conditions. Specifically:
[0110] S1. Sort and select each type of fragment according to the minimum parameter deviation method and the maximum correlation coefficient method;
[0111] S2. Determine the duration of the selected segments from each segment library according to the time proportion of each segment library to the overall segment library, and select the segments according to the priority sorted in S1 to form a driving condition.
[0112] The following are examples:
[0113] The method of the present invention was verified on the OBD data of light vehicles in Fuzhou City, and the advanced nature of the method of the present invention was demonstrated from the clustering effect. The constructed working condition model was further demonstrated, and an application case of the working condition model was demonstrated. The details are as follows:
[0114] S1. Clustering results (after t-SNE dimension reduction, as shown in Figure 2 and Figure 3 As shown), the inter-class coupling degree is low and the intra-class aggregation degree is high, the clustering effect is good, and the method of the present invention has a better effect.
[0115] S2. The operating condition model constructed is as follows, and the driving condition cycle is set to 1189s. Figure 4 As shown;
[0116] S3, the constructed working condition model and original data, the acceleration frequency distribution is as follows Figure 5 As shown;
[0117] S4. Verify the constructed working condition model. The acceleration speed frequency distribution is as follows:
[0118] Overall data velocity-acceleration joint distribution
[0119]
[0120] Speed-acceleration joint distribution of driving conditions
[0121]
[0122]
[0123] 3: From the final results, we know that the final constructed working condition can effectively represent the driving characteristics of light vehicles in Fuzhou. The speed of light vehicles in Fuzhou is mostly concentrated in the medium and low speed range (0-40km / h), and the uniform speed driving time is relatively long (30.4%), the acceleration and deceleration time is uniform, and the average acceleration and deceleration are small. The overall driving characteristics are gentle, and there are many congested sections.
[0124] In summary, the present invention adopts the maximum correlation coefficient method and the minimum parameter deviation method to select fragments, measures the representativeness of a single fragment from the perspectives of spatial vector correlation and parameter numerical deviation, and compares and outputs the final working condition, so that the constructed working condition error is smaller and closer to the actual driving condition.
[0125] On the other hand, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the above method.
[0126] On the other hand, the present invention further discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.
[0127] It is understandable that the system provided by the embodiment of the present invention corresponds to the method provided by the embodiment of the present invention, and the explanation, examples and beneficial effects of the relevant contents can refer to the corresponding parts in the above method.
[0128] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0129] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0130] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1A function specified in one or more boxes.
[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0132] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for constructing a mobile source driving condition based on short-trip feature clustering, characterized in that: The following steps are included: S1: Obtain speed data and GPS data from the vehicle OBD interface, pre-process the raw data, remove invalid data, and fill in missing values; S2: segment the velocity data to obtain kinematic segments; S3: Perform kinematic segment feature design, i.e. define two types of feature parameters: vehicle motion feature parameters and overall distribution parameters, which are used for cluster analysis basis and verification of constructed working conditions, respectively, and calculate the vehicle motion feature parameters of each kinematic segment and the overall distribution parameters of the total data; S4: Use principal component analysis (PCA) to reduce the dimension of kinematic feature parameters of kinematic segments; S5: Use K-means clustering to classify the input fragments to obtain multiple types of fragment libraries; S6: Select input segments from various segment libraries according to the maximum correlation coefficient method and the minimum parameter deviation method to form driving conditions, compare the comprehensive indicators of the two types of conditions, and finally output the constructed conditions; S5: Using K-means clustering to classify the input fragments to obtain multiple types of fragment libraries, specifically including: According to the Davidson-Botting Index DBI, the optimal number of clusters is selected, including the following steps: Set the k value and bring it into the clustering network respectively; Calculate the clustering results under each k value value: Where k represents the number of clusters; Representation clustering Centroids and Clusters Euclidean distance to centroid; Representation clustering The average distance from the inner feature vector to its centroid, representing the clustering The degree of dispersion of data in Representation clustering The average distance from the inner feature vector to its centroid, representing the clustering The degree of dispersion of data in ; , Representation clustering The number of data; Representation clustering The data, Representation clustering The data, Representation clustering The center of mass, Representation clustering The center of mass of; p is usually taken as 2; Select The k value when the value first appears in the local minimum is used as the optimal number of clusters ; Initialize cluster centers and divide kinematic segments into different libraries; The S6 specifically includes: The mean of each parameter is normalized and then summed. represents the sum of the comprehensive parameters of the k-th type of fragments, Indicates the jth parameter of the k-type fragment represents the comprehensive score of the i-th fragment parameter of the k-type fragment after standardization, calculates the absolute value deviation, and selects the fragments in ascending order of the absolute value deviation; The Pearson correlation coefficient of an n-dimensional vector is written as: After the data is standardized, the correlation coefficient between the segment parameter vector and the library parameter vector is calculated, and the kinematic segments with the highest ranking are selected in descending order until the selected segment duration is within If the range is reached, the system stops and all kinds of working conditions are combined to form the final working condition. The proportion of each type of fragment time in the final working condition The calculation of is as follows: is the duration of the kth working condition, is the duration of the final working condition, which is 1200s in the present invention, p represents the number of kinematic segment categories, and n represents the number of segments contained in each segment library; According to the time proportion of each type of fragment library in the overall fragment library, the total duration of the fragments selected from each type of fragment library is determined, and the input fragments are selected according to the priority of the feature vectors under each type of label to form a driving condition.
2. The method for constructing a mobile source driving condition based on short-trip feature clustering according to claim 1, characterized in that: After S6 outputs the constructed driving condition, S7 is also included: using two methods, relative error and joint distribution of speed and acceleration, to evaluate the constructed driving condition.
3. The method for constructing a mobile source driving condition based on short-trip feature clustering according to claim 1 or 2, characterized in that: The S1 specifically includes: Including speed, acceleration abnormal value processing, burr processing, long-term traffic jam / parking processing; It also includes setting the maximum parking time to 180s, cutting off excess time and avoiding excessive idling.
4. The method for constructing a mobile source driving condition based on short-trip feature clustering according to claim 3 is characterized in that: The kinematic segment of step S2 is defined as the interval from the start of the vehicle's current parking to the start of the next parking, and is divided accordingly.
5. The method for constructing a mobile source driving condition based on short-trip feature clustering according to claim 4 is characterized in that: The S4 uses principal component analysis PCA to reduce the dimension of kinematic feature parameters of the kinematic segments. The specific steps are as follows: m kinematic segments, n kinematic characteristic parameters, the corresponding indicator matrix is: The new comprehensive index is: In the new comprehensive indicator, Unrelated; the variance reaches the maximum and is required to decrease in sequence; the restrictions are met: Before the principal component analysis, standardization is performed to eliminate the unit effect: Get the standardized matrix: Then calculate the correlation coefficient matrix as follows: for and The correlation coefficient is calculated as follows: Calculate the eigenvalues and eigenvectors of the correlation coefficient matrix: Then calculate the principal component scores: When the cumulative contribution rate of the principal component reaches 85%, that is, >0.85, it is considered that the principal component represents most of the information, and the principal component value can be calculated as: in are the first k main components respectively.
6. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 5.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 5.
