Tractor transportation operation condition construction method based on improved particle swarm optimization and KMeans fusion
By improving the method of fusing particle swarm optimization and KMeans, and combining three-level screening and principal component analysis, the tractor transportation operation data is optimized, which solves the problem of inaccurate work condition division in traditional methods and achieves higher accuracy and robustness in work condition construction.
Patent Information
- Application Number
- CN202511770583.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-01-23
AI Technical Summary
Traditional methods for constructing vehicle driving conditions cannot accurately reflect the complex transportation operation scenarios of agricultural tractors, resulting in insufficient accuracy and robustness in condition classification. Existing KMeans clustering algorithms are sensitive to initial cluster centers and are prone to getting trapped in local optima.
An improved particle swarm optimization and KMeans fusion method is adopted to process tractor transportation operation data through a three-level screening mechanism. The initial center is optimized by combining principal component analysis and dynamic inertia weight particle swarm optimization algorithm, and standardized working condition curves are synthesized by using the feature similarity principle.
This improved the quality of tractor transportation operation condition construction, enhanced clustering accuracy and robustness, ensured the accuracy of operation condition classification, data coverage and representativeness, reduced data complexity, and improved the efficiency of subsequent analysis.
Smart Images

Figure CN121389075A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural machinery operating condition analysis technology, and in particular to a method for constructing tractor transportation operating conditions based on improved particle swarm optimization and KMeans fusion. Background Technology
[0002] Vehicle operating conditions are core parameters describing vehicle operating patterns, providing crucial information for fuel efficiency testing, pollutant emission detection, and powertrain design. Traditional general-purpose standard operating conditions such as NEDC, UDDS, and WLTC cannot accurately reflect the actual driving characteristics of specific regions and vehicle types, leading to significant discrepancies between research results based on these conditions and real-world conditions.
[0003] Currently, research on vehicle operating conditions mainly focuses on passenger cars, commercial vehicles, and some tracked vehicles, with limited research specifically on agricultural tractor transportation operating conditions. With the rapid development of agricultural mechanization and intelligentization, tractor transportation operation scenarios are complex and diverse, involving various types such as field transportation, rural road transportation, and short-distance urban-rural transportation. Road conditions include paved roads, gravel roads, and dirt roads, and these scenarios are characterized by dynamic load changes and frequent start-stop operations. Accurately characterizing the multi-dimensional data features of tractors under complex operating scenarios and constructing realistic and effective transportation operating conditions has become a key issue in improving tractor operating efficiency and reducing energy consumption.
[0004] Traditional KMeans clustering algorithm is widely used in work condition construction, but it is sensitive to initial cluster centers and prone to getting trapped in local optima, resulting in insufficient accuracy and robustness in work condition partitioning. Therefore, there is an urgent need for an optimized clustering algorithm and work condition construction method to improve the quality of tractor transportation operation work condition construction. Summary of the Invention
[0005] The purpose of this invention is to provide a method for constructing tractor transportation operation conditions based on improved particle swarm optimization and KMeans fusion, which aims to solve or improve at least one of the above-mentioned technical problems.
[0006] To achieve the above objectives, the present invention provides the following solution: A method for constructing tractor transportation operation conditions based on the fusion of improved particle swarm optimization and KMeans includes: A method for constructing tractor transportation operation conditions based on the fusion of improved particle swarm optimization and KMeans is characterized by the following steps: Collect tractor transportation operation data; The collected tractor transportation operation data is filled with missing values, removed outliers and filtered. Kinematic segments are divided according to preset rules and effective kinematic segments are obtained through a three-level screening mechanism. Select multidimensional feature parameters that characterize the motion characteristics of the tractor, calculate the feature parameter values of the effective kinematic segment, and construct a feature matrix; Principal component analysis is used to reduce the dimensionality of the feature matrix, and principal components with a cumulative contribution rate exceeding a preset threshold are selected to form the dimensionality-reduced feature space. The particle swarm optimization algorithm is improved by introducing dynamic inertia weights and Gaussian mutation strategy. The initial centers of KMeans clustering are optimized by IPSO. Cluster analysis is performed on the dimensionality-reduced feature space to obtain kinematic segments of different categories. Based on the principle of feature similarity, the sum of the average relative errors of all feature dimensions is used as the objective function. The duration is allocated according to the proportion of each type of kinematic segment, and representative segments are selected to synthesize standardized tractor transportation operation condition curves.
[0007] Furthermore, the three-level screening mechanism specifically includes: Completeness screening is used to remove kinematic segments with an interval of more than 180 seconds between adjacent valid data points or a data missing rate of more than 10%. Duration filtering: Remove kinematic segments with a duration of less than 30 seconds or more than 600 seconds; Motion state screening: Based on the GB / T 38146.2-2019 standard, acceleration, deceleration, constant speed and idling conditions are distinguished, and segments that do not meet the definition are eliminated.
[0008] Furthermore, the multidimensional feature parameters include motion state description parameters and statistical distribution characterization parameters, specifically: kinematic segment time length, acceleration time, deceleration time, constant speed time, idling time, average speed including idling, average driving speed excluding idling, maximum speed, speed standard deviation, average acceleration, average deceleration, acceleration standard deviation, deceleration standard deviation, acceleration time ratio, deceleration time ratio, constant speed time ratio, idling time ratio, 0-10km / h percentage, 10-20km / h percentage, and 20-30km / h percentage.
[0009] Furthermore, principal component analysis is used to reduce the dimensionality of the feature matrix, and principal components with a cumulative contribution rate exceeding a preset threshold are selected to form the dimensionality-reduced feature space. Specifically: The feature matrix is Z-score standardized so that the mean of each feature parameter is 0 and the standard deviation is 1, thus obtaining the standardized matrix. Calculate the covariance matrix of the standardized matrix, and solve for the eigenvalues and corresponding eigenvectors of the covariance matrix; Sort the eigenvalues and their corresponding eigenvectors in descending order of eigenvalue, and calculate the variance contribution rate and cumulative contribution rate of each eigenvalue; A preset threshold of 95% is set, and the top n principal components with a cumulative contribution rate of over 95% are selected to form the feature space after dimensionality reduction.
[0010] Furthermore, dynamic inertia weights and Gaussian mutation strategies are introduced to improve the particle swarm optimization algorithm. IPSO is used to optimize the initial centers of KMeans clustering, and cluster analysis is performed on the dimensionality-reduced feature space to obtain the kinematic segments of different categories as follows: The optimal number of clusters was determined by combining the Calinski-Harabasz index with the Silhouette coefficient method. Initialize the IPSO algorithm parameters, set the population size to 30, the maximum number of iterations to 200, the initial inertia weight to a maximum value of 0.9 and a minimum value of 0.4, and the learning factor to be mutually independent random numbers in the interval [0,1]. The inertia weights are dynamically updated in three stages to meet the needs of different stages of clustering optimization. The fitness function is the sum of the Euclidean distances from all samples within a cluster to the centroid of that cluster. Based on the above parameter settings, weight update strategy and fitness function, the particle position and velocity are updated iteratively through IPSO until the maximum number of iterations is reached or the change in the centroid is less than a preset threshold, thus obtaining the optimal initial cluster center. The optimal initial center is then substituted into the KMeans algorithm to complete the clustering of the dimensionality-reduced feature space, resulting in two classes of kinematic segments.
[0011] Furthermore, the three-stage dynamic update of inertia weights, combining clustering optimization with different stage requirements, specifically involves: Exploration period: Before the fitness variance drops to 50% of its initial value, the inertia weights are updated using a cosine annealing strategy, with the following formula: in, The inertia weight at the end of Phase I. The initial maximum inertia weight value is set to 0.9. The minimum weight value set in stage I is 0.4. This represents the current iteration number. end represents the number of iterations in period I; Transition period: Once the fitness variance decreases to 50% of its initial value, an adaptive perturbation magnitude is added to the base weights, using the following formula: in, To adapt to the disturbance amplitude, The current global optimal fitness The average fitness of the initial population; Convergence Period: If the global optimum is not updated after 10 consecutive iterations, a Gaussian mutation operation is introduced to perturb the positions of 10% of the non-elite particles, as shown in the formula: in, To control the intensity of the disturbance, To define the search scope; Simultaneously, based on the change in fitness variance, a random scaling factor is introduced, and the inertia weight is adjusted. : in, This represents the current iteration number. The maximum number of iterations, r This is the random scaling factor.
[0012] Furthermore, the fitness function is specifically as follows: in, K The number of clusters, Let k be the sample set of the k-th cluster. Let be the centroid of the k-th cluster; For the sample.
[0013] Furthermore, the process of synthesizing a standardized tractor transport operation curve based on the principle of feature similarity, using the sum of the average relative errors of all feature dimensions as the objective function, allocating time according to the proportion of each type of kinematic segment, and selecting representative segments is as follows: First, calculate the proportion of the total duration of each type of kinematic segment to the total duration of all valid kinematic segments; Set the total duration of the compositing process, and allocate the compositing time to each type of segment according to this ratio; Next, for each type of segment, calculate the relative error between each segment and the mean of the feature parameters of all segments in that type, and select the segment with the smallest sum of the relative errors of all features in each type as the representative segment; Finally, the selected representative segments are spliced together in chronological order to synthesize a standard chemical condition curve that conforms to the total duration.
[0014] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects: The multi-mode data acquisition method proposed in this invention covers different transportation scenarios and road conditions for tractors. The acquired data is comprehensive and representative, laying a reliable data foundation for the construction of working conditions. By eliminating invalid kinematic segments through a three-level screening mechanism and combining it with principal component analysis for dimensionality reduction, data complexity is reduced while retaining key information, thereby improving the efficiency of subsequent cluster analysis. The improved IPSO-Kmeans algorithm effectively solves the problems of the traditional KMeans algorithm being sensitive to initial centers and easily getting trapped in local optima. The clustering accuracy is improved by 5.938% compared with the traditional PSO, ensuring the accuracy and robustness of the working condition division. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 is a flowchart of the tractor transportation operation mode construction process; Figure 2 shows the data collection area and route map; Figure 3 is a schematic diagram of the test equipment; Figure 4 shows the effect of filtering the sampled data; Figure 5 is a schematic diagram of the kinematics of a tractor; Figure 6 is a heatmap of the Pearson correlation coefficient matrix; Figure 7 shows the contribution rate of principal component variance and cumulative contribution rate. Figure 8 shows the CH score index. Figure 9 shows the average profile coefficient. Figure 10 shows the optimization iteration process; Figure 11 is a flowchart of the working condition synthesis process; Figure 12 shows the constructed tractor transportation operation condition curve; Figure 13 shows the joint probability distribution of velocity and acceleration. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] like Figure 1 As shown, this invention provides a method for constructing tractor transportation operation conditions based on the fusion of improved particle swarm optimization and KMeans, including: 1. Tractor Transportation Operating Condition Data Acquisition and Segmentation 1.1 Data Acquisition Methods Taking into account the test cycle, cost, test conditions, and data representativeness, and considering the characteristics of tractor transportation conditions (such as agricultural material transportation and agricultural product transshipment), and taking into account the characteristics of agricultural machinery, the following data collection methods are proposed: (1) The route cycle test method is adopted on the main transportation route. That is, according to the tractor transportation operation requirements, the unpaved road surface (asphalt / concrete road), gravel road surface, dirt road and other unpaved road surface are covered according to the planned transportation route. The load counterweight is 0%, 50% and 100% of the rated load of the trailer, respectively. The data is collected by the "multi-person random rotation driving method". (2) On some typical transportation routes (such as gravel roads and asphalt roads from villages to fields), the “tractor-agricultural vehicle mixed tracking method” is adopted to track tractors or light agricultural vehicles (tricycles, mini trucks) and establish a corresponding comparison database; (3) During certain time periods and on certain narrow road sections (operation sections) (3.5m), the “autonomous driving method” is adopted, in which the driver drives the tractor normally according to his own wishes and travel habits to collect data.
[0019] 1.2 Selection of test area Typical tractor transport operation conditions are shown in Table 1. To ensure the constructed conditions represent the typical characteristics of tractor operation in the hilly areas of southern China, the experimental data needed to cover as many road combinations and scenario types as possible. Therefore, the Jiangsu Modern Agricultural Machinery Technology Demonstration Park and its surrounding area in Baima Town, Lishui District, Nanjing City, were ultimately selected as the data collection area. Figure 2 As shown, the data collection area includes a combination of roads such as asphalt / concrete straight acceleration sections (≥1km), S-curves, gravel roads, slopes (5%-15%), dirt roads, forest trails, as well as real-world scenarios such as narrow road encounters, village crossings, and livestock disturbances.
[0020] Table 1 Typical Tractor Transportation Operation Conditions
[0021] 1.3 Test Equipment Based on the actual operating conditions in the local test area, and taking into account factors such as the weight of the trailer, road conditions, and gradient, speed and stability requirements were ensured. The Aolong DX1204 tractor manufactured by Wode Company was selected. Furthermore, considering that the materials being loaded and unloaded were mainly grain and fertilizer, the accompanying trailer was the Woli Machinery 12101 dual-axle self-dumping trailer, using a tow pin connection and equipped with a hydraulic lifting device. Specific parameters are shown in Table 2.
[0022] Table 2 Tractor Transport Unit Parameters
[0023] To adapt to complex terrains such as slopes and gullies, and considering the significant bumps experienced by the tractor during testing, especially on unpaved roads and narrow forest trails, where obstacles and signal instability may occur, the data acquisition equipment needed sufficient stability and shock resistance, while also being easy to install on the vehicle. Taking all these factors into account, the WTGARRS1 inertial navigation sensor manufactured by Witt Systems was used for vehicle speed sampling. This sensor utilizes a GPS + BeiDou high-precision navigation system, with a sampling accuracy of <0.1 m / s, a positioning accuracy of <2.5 m, and an output rate of 0.2–200 Hz. Besides processing and recording time and vehicle speed signal data in real time, it also measures auxiliary parameters such as acceleration, angular velocity, angle, magnetic field, air pressure, altitude, and latitude and longitude in real time, providing relevant data for screening and subsequent analysis. To ensure the collected data better represents the actual driving data of the tractor and facilitates later data processing, the sampling frequency was set to 1 Hz via the host computer software. The sampling equipment system is as follows: Figure 3 As shown.
[0024] 1.4 Raw Data Processing and Kinematic Segmentation 1.4.1 Preprocessing of Sampling Data After about a month of collecting operating condition data, more than 100 sets, totaling more than 500,000 data points, were obtained. Some of the data was processed to eliminate some errors. The specific processing logic is as follows.
[0025] (1) Handling missing values: linear interpolation is performed on data points with fewer than 5 missing values between them. (2) To handle excessively long idling time, if the idling time exceeds 180 s, it is considered that the tractor is stopped for a long time or data is missed during this period, and only 180 s of idling time is retained; (3) Due to the fact that the maximum driving speed of the tractor does not exceed 30 km / h during this transportation data collection, data points with a speed greater than 30 km / h and an acceleration greater than 2 m / s² are processed. 2 The deceleration is less than -3.5 m / s². 2 burrs; (4) Moving average filtering is used to process the abnormal speed changes caused by road surface disturbances. The filtering results are as follows: Figure 4 As shown, the filtered vehicle speed can follow the original vehicle speed better, avoiding many high-frequency fluctuations, and can better reflect the true speed of the tractor.
[0026] 1.4.2 Kinematic segment division The process from a vehicle stopping to the next starting is defined as an idling segment, while a kinematic segment refers to the driving segment from the start of one idle speed to the start of the next idle speed. For example... Figure 5As shown, a typical kinematic segment includes four motion states: acceleration, deceleration, constant speed, and idle speed.
[0027] In constructing tractor driving conditions, the speed-time curve is typically composed of several segments with specific kinematic characteristics. Due to differences in traffic environment, road conditions, and time dimension, these kinematic segments exhibit significant heterogeneity. This invention employs a clustering algorithm to classify segments with similar dynamic characteristics, constructing a typical kinematic segment library, and forming representative driving conditions based on an optimal selection mechanism. It is worth noting that the kinematic segments obtained from the initial segmentation contain short-term abnormal data and invalid segments, which may lead to deviations in feature parameter calculation. Therefore, a three-level tractor kinematic segment data selection mechanism is established: (1) Integrity screening: When the interval between adjacent valid data points exceeds 180 s or the data missing rate exceeds 10%, it is judged as an incomplete segment and removed; (2) Duration filtering: Remove abnormal segments with a duration of less than 30 seconds or more than 600 seconds; (3) Motion state screening: According to the definition of GB / T 38146.2-2019 standard, strictly distinguish: acceleration condition (a≥0.15 m / 2 ), deceleration condition (a≤ -0.15 m / s) 2 Under uniform speed conditions (|a|<0.15 m / s) 2 And v≥0.5 km / h), idling condition (|a|<0.15 m / s) 2 (And v < 0.5 km / h) segments that do not meet the above definition are filtered a second time.
[0028] After three levels of screening, invalid segments in the original dataset were effectively removed, resulting in 349 valid kinematic segments of tractors.
[0029] 1.5 Selection and Calculation of Kinematic Segment Characteristic Parameters 1.5.1 Selection of Feature Parameters The construction of tractor operating conditions is essentially a feature-driven pattern recognition process. This involves selecting typical candidate segments from a categorized kinematic segment library based on optimization criteria, and then recombining them temporally to form representative operating condition curves. To achieve mathematical representation of kinematic segments and analysis of their operational states, a multi-dimensional feature parameter system needs to be established. Simultaneously, analysis of measured data shows that during tractor field transport operations, the start-stop frequency reaches 5-8 times / min, the standard deviation of the operating speed exceeds 2.5 m / s, the speed fluctuation amplitude reaches 40% of the nominal value, and the peak acceleration change rate during obstacle avoidance exceeds 0.8 m / s². 3Therefore, considering the characteristics of tractor field transportation (low-frequency high-amplitude speed fluctuations, high-frequency start-stop alternation), the 20 characteristic parameters selected in this study are shown in Table 3, which are divided into two main categories: (1) Motion state description parameters: including average speed (including / excluding idle speed), average acceleration, maximum speed, speed standard deviation, maximum acceleration, maximum deceleration, etc., mainly used to characterize the dynamic running characteristics of the segment; (2) Statistical distribution characteristic parameters: covering the proportion of idling time, the proportion of each speed range, acceleration distribution, etc., focusing on reflecting the distribution law of segment characteristic parameters, and serving as the core criterion for verifying the effectiveness of tractor transportation conditions.
[0030] Table 3 Tractor kinematic segment parameters
[0031] 1.5.2 Calculation of Characteristic Parameters Based on the selection results in Section 1.5.1, the 20 characteristic parameters selected in this invention are defined as follows: (1) Length of kinematic segments Accelerate time deceleration time Uniform time Idle time =Total number of kinematic segments (1) =In this kinematic segment Total number (2) =In this kinematic segment Total number (3) =In this kinematic segment ,and Total number of km / h (4) =In this kinematic segment ,and Total number of km / h (5) (2) Average speed (including idle speed) Average driving speed (excluding idling speed) Maximum speed speed standard deviation (6) (7) (8) (9) in, This represents the distance traveled by the kinematic segment. Let represent the velocity at the i-th second, in km / h, and n represent the number of data points in this kinematic segment.
[0032] (3) Average acceleration average deceleration Acceleration standard deviation standard deviation of deceleration (10) (11) (12) (13) In the formula, , These are the acceleration and deceleration at second i of the segment, respectively, in m / s². 2 The specific calculation formula is shown in equation (14).
[0033] (14) (4) Acceleration time ratio Deceleration time ratio The uniform speed time ratio Idle time compared to (15) (16) (17) (18) (5) Percentage of speeds between 0-10 km / h 10-20 km / h percentage 20-30 km / h percentage (19) (20) (twenty one) In the formula, , , These represent the total number of segments in the segment whose velocities belong to [0, 10), [10, 20), and [20, 30].
[0034] Based on the above formula, we can calculate the characteristic parameter value matrix Z of the 349×20 dimension tractor transportation working condition kinematic segment, as shown in Table 4.
[0035] Table 4 Kinematic segment feature parameter matrix Z
[0036] 2. Construction of working conditions based on principal component analysis and IPSO-Kmeans like Figure 6 As shown, based on the heatmap analysis of the Pearson correlation coefficient matrix, the interaction relationships among 20 characteristic parameters can be obtained. The diagonal elements of this matrix represent the autocorrelation of the parameters (coefficient r=1.0), and the off-diagonal elements quantify the linear correlation strength between parameter pairs. Significant coupling exists between time-domain parameters: the average velocity ( ) and maximum driving speed ( The correlation between the two parameters is strong (r=0.9083); the statistical distribution parameters exhibit modular characteristics: the proportion of idling time ( ) and speed standard deviation ( ) form a negatively correlated cluster (r=-0.4451); dynamic characteristic parameters have independent information dimensions: deceleration standard deviation ( The correlation coefficient between this parameter and most other characteristic parameters is below 0.35. Therefore, principal component analysis is needed to merge the highly redundant characteristic parameters while retaining the independent parameters.
[0037] 2.1 Principal Component Analysis 2.1.1 Composition Analysis The sample studied in this invention contains 349 kinematic segments, and 20 feature parameters are used to evaluate the sample data, thus yielding a 349×20 dimensional matrix A: (twenty two) 2.1.2 Standardization of kinematic segment data Because the dimensions of the feature parameters of the original sample data are different, the sample data needs to be standardized. According to formula (23), the present invention uses Z-Score standardization so that the mean of each feature parameter is 0 and the standard deviation is 1, and the standardized sample data matrix B is shown in Table 5.
[0038] (twenty three) Table 5. Standardized kinematic segment feature parameter matrix B
[0039] 2.1.3 Eigenvalues and eigenvectors of the covariance matrix of matrix B Let C be the covariance matrix of matrix B. According to the covariance formula (24), the covariance matrix C is as shown in equation (25).
[0040] (twenty four) (25) For the characteristic equation Solve, and according to eigenvalues By sorting the values by size, we can obtain the corresponding feature vectors. The result is shown in equation (26).
[0041] (26) If the eigenvectors are arranged column-wise, the loading matrix D of the orthogonal principal components can be obtained.
[0042] (27) 2.1.4 Calculate the variance contribution rate and cumulative contribution rate of principal components. Principal component analysis of the characteristic parameter matrix Z of the tractor transportation working condition sample can be performed to calculate the variance contribution rate and cumulative contribution rate of the 20 principal components of the standardized matrix Z, as follows: Figure 7 As shown.
[0043] from Figure 7 As can be seen, the first seven principal components can explain 95.385% of the information in the original variables. To balance information retention and model complexity, they are selected as the effective feature subset. The corresponding loading matrices are shown in Table 7.
[0044] Table 7. Principal component loading matrix with a contribution rate greater than 95%
[0045] As shown in Table 7, PCA1 mainly reflects average speed and the percentage of speeds between 0-10 km / h; PCA2 mainly reflects running time and idling time; the third principal component mainly reflects constant speed time and the percentage of constant speed time; the fourth principal component mainly reflects average acceleration and the standard deviation of acceleration; the fifth principal component mainly reflects average deceleration and the standard deviation of speed bumps; the sixth principal component mainly reflects the percentage of speeds between 10-20 km / h and 20-30 km / h; and the seventh principal component mainly reflects the percentage of speeds between 10-20 km / h. Therefore, the principal component score matrix of the original sample data is shown in Table 8.
[0046] Table 8. Principal Component Score Matrix of Original Samples
[0047] 2.2 Kinematic Segment Clustering Based on IPSO-Kmeans 2.2.1 K-means clustering principle In this invention, K-means clustering is used to study the test data of tractor transportation conditions. The principal component scores obtained from principal component analysis are used as research variables to classify all kinematic segments. Then, the driving characteristics of tractor transportation operations in each kinematic segment library are analyzed. The optimal candidate segment in each segment library is selected, and then representative working condition curves are obtained.
[0048] This paper uses the Calinski-Harabasz (CH) index to evaluate the clustering results and combines it with the Silhouette coefficient method to determine the optimal number of clusters.
[0049] The CH index is a reference for evaluating the clustering effect of a dataset, and it is derived from the ratio of separation to compactness. Therefore, the larger the CH index value, the higher the inter-cluster separation and the better the intra-cluster compactness of the clustering results, i.e., the better clustering results. Its calculation method is as shown in equation (28): (28) In the formula, k represents the number of clusters; N represents the total number of samples; For inter-class variance; Within-class variance; It is the number of samples in the k-th cluster. It is the centroid (mean of samples within each of the k clusters); It is the global centroid (the mean of the entire dataset); It is the i-th sample point.
[0050] like Figure 8 As shown, the CH score of the sample reaches its maximum value of 216.195 when k is 2, and then decreases as the number of clusters k increases.
[0051] The Silhouette coefficient method aims to evaluate clustering performance by quantifying the density and separation of samples within a cluster. Its theoretical formula is as follows: (29) In the formula, It is the average distance from sample i to other samples in the same cluster (reflecting the cluster density). It is the average distance from sample i to all samples in the nearest other cluster (reflecting the inter-cluster separation). This represents the average silhouette coefficient value when the number of clusters is k. Therefore, from formula (29), we can see that... The value range of is [-1, 1]. The closer the result is to 1, the more reasonable the sample clustering is, with close clustering within clusters and clear separation between clusters.
[0052] Therefore, the average silhouette coefficient value of the sample can be calculated as follows: Figure 9 As shown, the average silhouette coefficient is highest when the number of clusters is 2, with a maximum value of 0.493. In summary, this paper classifies the tractor kinematic segments into two categories.
[0053] 2.2.3 Kinematic Segment Cluster Center Optimization Based on IPSO-Kmeans To improve the accuracy of selecting typical kinematic segments of tractors and reduce the error of synthesized working condition feature parameters, this invention constructs a target model using Euclidean distance as the fitness function. It improves the global search capability of the PSO algorithm by introducing dynamic inertia weights and nonlinear learning factors, and then iteratively optimizes the initial cluster centers of the K-means algorithm. This method effectively improves the stability of clustering results and the representativeness of working condition features, providing a reliable data foundation for the accurate selection of typical kinematic segments and the synthesis of working conditions.
[0054] This invention divides the entire iteration cycle into three sub-cycles: Exploration Phase I, Transition Phase II, and Convergence Phase III, based on the fitness variance of all particles in the population and the number of iterations without continuous updates to the global optimum. Within each sub-cycle, the inertia weight fluctuates within an optimal range. The specific strategy is as follows: In the exploration period I, which is the number of iterations before the fitness variance drops to 50% of the initial value, a cosine annealing strategy is adopted to make the inertia weight decrease slowly in the early stage to maintain exploration, and then decrease faster in the later stage to focus on development. The specific change strategy is as shown in equation (30): (30) in, The inertia weight at the end of Phase I. The initial maximum inertia weight value is set to 0.9. The minimum weight value set in stage I is 0.4. This represents the current iteration number. The iteration number is period I.
[0055] (2) In transition period II, after the fitness variance decreases to 50% of the initial value, an adaptive perturbation amplitude is added to the basic weights to enhance the ability to escape local optima. The particle swarm optimization algorithm update iteration calculation formula is as follows: (31) in To adapt to the perturbation amplitude, a larger perturbation is needed in the early stage to explore the unknown region, and a smaller perturbation is needed in the later stage to achieve stable convergence. The current global optimal fitness This represents the average fitness of the initial population.
[0056] (3) If the global optimum is not updated after 10 consecutive iterations, the algorithm enters convergence phase III. To avoid the algorithm getting stuck in local optima, a Gaussian mutation operation is introduced to maintain population diversity by randomly perturbing the positions of particles. The mutation is performed with a certain probability. (Typically set to 10%) Randomly select non-elite particles that need to be mutated, and apply Gaussian-distributed random perturbations to certain dimensions of the selected particles. That is: (32) In the formula, To control the intensity of the disturbance, This defines the search scope.
[0057] Simultaneously, based on the change in fitness variance, a random scaling factor r∈[0.95,1.1] is introduced, and the inertia weight is adjusted. : (33) Using the sum of the Euclidean distances from the data within each cluster to the cluster centroid as the objective function, the fitness function for particle swarm optimization is constructed as shown in equation (34): (34) Where K is the number of clusters, Let k be the sample set of the k-th cluster. The centroid of the k-th cluster; For the sample to the center of mass Euclidean distance.
[0058] The population size is set to 30, and the maximum number of iterations is 200. The optimization iteration process is as follows: Figure 10 As shown in Table 8, the improved PSO algorithm with cosine annealing and Gaussian mutation converged after 38 iterations, significantly outperforming the basic PSO algorithm in convergence speed. Furthermore, the improved PSO algorithm also found a better solution in terms of convergence accuracy compared to the basic PSO algorithm, improving accuracy by 5.938%. The optimized results are shown in Table 8.
[0059] Table 8. Cluster Center Optimization Results
[0060] The optimized feature values of various segment samples are shown in Table 9, with units as above. As can be seen from the table, the number of segments in the two categories are 178 and 171 respectively, with a relatively balanced sampling distribution, reflecting the importance of both scenarios in actual transportation. However, there are significant differences in the feature parameters between the categories. Category 1 is characterized by a relatively high average driving speed (14.563 km / h), a relatively high proportion of constant speed (43%), short-term acceleration capability (20-30 km / h, 21%), and a moderate idling speed (34%), which aligns with the traffic conditions of county or township roads and is suitable for short-distance urban and rural transportation scenarios. In this category, tractors can maintain stable driving on road sections with few traffic signals, but intermittent stops are still necessary due to intersections and pedestrian interference, resulting in a 0-10 km / h proportion of 55.8%. The overall characteristics are biased towards medium- and low-speed mixed transportation scenarios.
[0061] Category 2 is characterized by low-speed dominance (94.1% of speeds are between 0-10 km / h), occasional medium and high-speed demands (5.6% for medium speeds and 0.3% for high speeds), a high idling rate (61.3%), and similar acceleration and deceleration behaviors (6.1% for acceleration and 6.5% for deceleration). This fully reflects the frequent start-stop and loading / unloading demands on field roads, as well as the stability control requirements when towing heavy equipment. It accurately matches both field transportation and rural road transportation scenarios. While the average driving speed of Category 2 (5.429 km / h) is slightly higher than actual field conditions (typically <5 km / h), the low-speed and idling rates still effectively characterize the typical features of the operating scenarios.
[0062] Table 9. Feature values of various fragment samples after optimization
[0063] 3. Working condition synthesis and inspection 3.1 Working condition synthesis based on feature similarity To address the challenges of multi-mode switching (field-road-slope), dynamic load changes (empty-half-full-load), and complex terrain (slope, road conditions) in tractor transportation operations, this paper proposes a work condition synthesis method based on feature similarity. The process is as follows: Figure 11 As shown. Considering the tractor's operating efficiency and mechanical reliability, while also taking into account the driver's health and environmental requirements, the total operating time of the working condition constructed in this invention is 2400 seconds.
[0064] The duration allocation for each category is derived from formula (35), and the objective function is the sum of the average relative errors of all feature dimensions, as shown in formula (36).
[0065] (35) In the formula, This represents the time occupied by the i-th type of kinematic segment in the final composite curve; The total duration of all kinematic segments of type i, This indicates the total duration of all kinematic images.
[0066] (36) In the formula, This represents the sum of the average relative errors across all feature dimensions. The average value of the synthetic operating condition across k characteristics. This represents the overall average of the original data across k features. The sum of the durations of N1, which represents the number of kinematic segments of the first type in the synthetic driving condition. The sum of the durations of N2, representing the number of kinematic segments of the second type in the synthesized condition, satisfies the constraint that the total duration is 2400 ± 20 s. The final synthesized operating condition curve has a total duration of 2388 seconds, with Type I kinematic segments accounting for 61.09% and Type II kinematic segments accounting for 38.91%. Figure 12 As shown, the tractor's speed underwent several significant changes during transport operations. These speed fluctuations realistically reflect the tractor's adjustments during transport, including switching between different operational stages, varying road conditions (such as flat roads, slopes, and curves), different load conditions (such as empty, half-loaded, and overloaded), and different driving strategies. When the tractor is transporting within fields, the speed curve exhibits frequent starts and stops and low-speed fluctuations (5-10 km / h). When the tractor is transporting on rural roads, the speed fluctuates periodically within the low-to-medium speed range (10-20 km / h), corresponding to deceleration and acceleration operations when avoiding obstacles or pedestrians, with occasional brief periods of stable medium speed. When the tractor is engaged in short-distance transport between urban and rural areas, the overall speed is higher, but there are also steep drops caused by sudden deceleration at intersections or pedestrian interference.
[0067] 3.2 Verification of Operating Condition Effectiveness (1) The characteristic parameters of the constructed tractor transportation operation condition were verified. As shown in Table 10, the construction results of the tractor transportation operation condition show that the characteristic parameters perform well, and each characteristic parameter is as follows: , , The relative error distribution is reasonable, and the errors of the 20 characteristic parameters of the constructed working condition and the overall sample data are small. The relative errors of all parameters remain below 10%, and the overall average error is 6.30%. This proves that the constructed tractor transportation working condition can accurately reflect the actual transportation situation in terms of characteristic parameters and has high practical value.
[0068] Table 10. Optimized Clustering Results
[0069] (2) Perform data structure similarity verification on the constructed tractor transportation operation conditions. For example... Figure 13 As shown, the joint probabilities of speed and acceleration in the tractor transportation operation conditions constructed in this paper are similar to those in the original overall sample data in terms of their main distribution areas, and the overall distribution trends are quite consistent. Specifically, in the constructed operation conditions, the speed is mainly concentrated between 0 and 20 km / h, while the acceleration distribution range is relatively small, mainly concentrated between -0.5 and 0.5 m / s. 2 The original overall sample data also shows a similar trend, with roughly the same velocity distribution range and a slightly wider acceleration distribution range, but both mainly concentrated within the same interval. In terms of color distribution, both show higher density in areas of lower velocity and near-zero acceleration, indicating that tractors are more commonly used in these areas, consistent with the characteristics of actual tractor transportation operations. Overall, the constructed working condition reflects the velocity and acceleration distribution characteristics of the original sample data well.
[0070] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0071] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for constructing tractor transportation operation conditions based on the fusion of improved particle swarm optimization and KMeans, characterized in that, Includes the following steps: Collect tractor transportation operation data; The collected tractor transportation operation data is filled with missing values, removed outliers and filtered. Kinematic segments are divided according to preset rules and effective kinematic segments are obtained through a three-level screening mechanism. Select multidimensional feature parameters that characterize the motion characteristics of the tractor, calculate the feature parameter values of the effective kinematic segment, and construct a feature matrix; Principal component analysis is used to reduce the dimensionality of the feature matrix, and principal components with a cumulative contribution rate exceeding a preset threshold are selected to form the dimensionality-reduced feature space. The particle swarm optimization algorithm is improved by introducing dynamic inertia weights and Gaussian mutation strategy. The initial centers of KMeans clustering are optimized by IPSO. Cluster analysis is performed on the dimensionality-reduced feature space to obtain kinematic segments of different categories. Based on the principle of feature similarity, the sum of the average relative errors of all feature dimensions is used as the objective function. The duration is allocated according to the proportion of each type of kinematic segment, and representative segments are selected to synthesize standardized tractor transportation operation condition curves.
2. The method for constructing tractor transportation operation conditions based on improved particle swarm optimization and KMeans fusion as described in claim 1, characterized in that, The three-level screening mechanism specifically includes: Completeness screening: Kinematic segments with an interval of more than 180 seconds between adjacent valid data points or a data missing rate of more than 10% are removed; Duration filtering: Remove kinematic segments with a duration of less than 30 seconds or more than 600 seconds; Motion state screening: Based on the GB / T 38146.2-2019 standard, acceleration, deceleration, constant speed and idling conditions are distinguished, and segments that do not meet the definition are eliminated.
3. The method for constructing tractor transportation operation conditions based on improved particle swarm optimization and KMeans fusion as described in claim 1, characterized in that, The multidimensional feature parameters include motion state description parameters and statistical distribution characterization parameters, specifically: kinematic segment duration, acceleration time, deceleration time, constant speed time, idling time, average speed including idling, average driving speed excluding idling, maximum speed, speed standard deviation, average acceleration, average deceleration, acceleration standard deviation, deceleration standard deviation, acceleration time ratio, deceleration time ratio, constant speed time ratio, idling time ratio, 0-10km / h percentage, 10-20km / h percentage, and 20-30km / h percentage.
4. The method for constructing tractor transportation operation conditions based on improved particle swarm optimization and KMeans fusion as described in claim 1, characterized in that, Principal component analysis is used to reduce the dimensionality of the feature matrix, and principal components with a cumulative contribution rate exceeding a preset threshold are selected to form the dimensionality-reduced feature space. Specifically: The feature matrix is Z-score standardized so that the mean of each feature parameter is 0 and the standard deviation is 1, thus obtaining the standardized matrix. Calculate the covariance matrix of the standardized matrix, and solve for the eigenvalues and corresponding eigenvectors of the covariance matrix; Sort the eigenvalues and their corresponding eigenvectors in descending order of eigenvalue, and calculate the variance contribution rate and cumulative contribution rate of each eigenvalue; A preset threshold of 95% is set, and the top n principal components with a cumulative contribution rate of over 95% are selected to form the feature space after dimensionality reduction.
5. The method for constructing tractor transportation operation conditions based on improved particle swarm optimization and KMeans fusion as described in claim 1, characterized in that, The particle swarm optimization algorithm is improved by introducing dynamic inertia weights and Gaussian mutation strategy. IPSO is used to optimize the initial centers of KMeans clustering. Cluster analysis is then performed on the dimensionality-reduced feature space to obtain the kinematic segments of different categories as follows: The optimal number of clusters was determined by combining the Calinski-Harabasz index with the Silhouette coefficient method. Initialize the IPSO algorithm parameters, set the population size to 30, the maximum number of iterations to 200, the initial inertia weight to a maximum value of 0.9 and a minimum value of 0.4, and the learning factor to be mutually independent random numbers in the interval [0,1]. The inertia weights are dynamically updated in three stages to meet the needs of different stages of clustering optimization. The fitness function is the sum of the Euclidean distances from all samples within a cluster to the centroid of that cluster. Based on the above parameter settings, weight update strategy and fitness function, the particle position and velocity are updated iteratively through IPSO until the maximum number of iterations is reached or the change in the centroid is less than a preset threshold, thus obtaining the optimal initial cluster center. The optimal initial center is then substituted into the KMeans algorithm to complete the clustering of the dimensionality-reduced feature space, resulting in two classes of kinematic segments.
6. The method for constructing tractor transportation operation conditions based on improved particle swarm optimization and KMeans fusion as described in claim 5, characterized in that, The specific steps for dynamically updating the inertia weights in three stages, combining clustering optimization to meet different stage requirements, are as follows: Exploration period: Before the fitness variance drops to 50% of its initial value, the inertia weights are updated using a cosine annealing strategy, with the following formula: in, The inertia weight at the end of Phase I. This is the initial maximum inertia weight value. This is the minimum weight value set in stage I. This represents the current iteration number. end represents the number of iterations in period I; Transition period: Once the fitness variance decreases to 50% of its initial value, an adaptive perturbation magnitude is added to the base weights, using the following formula: in, To adapt to the disturbance amplitude, The current global optimal fitness The average fitness of the initial population; Convergence Period: If the global optimum is not updated after 10 consecutive iterations, a Gaussian mutation operation is introduced to perturb the positions of 10% of the non-elite particles, as shown in the formula: in, To control the intensity of the disturbance, To define the search scope; Simultaneously, based on the change in fitness variance, a random scaling factor is introduced, and the inertia weight is adjusted. ; in, This represents the current iteration number. The maximum number of iterations, r This is the random scaling factor.
7. The method for constructing tractor transportation operation conditions based on improved particle swarm optimization and KMeans fusion as described in claim 5, characterized in that, The fitness function is specifically: in, K The number of clusters, Let k be the sample set of the k-th cluster. Let be the centroid of the k-th cluster; For the sample.
8. The method for constructing tractor transportation operation conditions based on improved particle swarm optimization and KMeans fusion as described in claim 1, characterized in that, The process of synthesizing standardized tractor transport operation condition curves based on feature similarity principles, using the sum of the average relative errors of all feature dimensions as the objective function, allocating time according to the proportion of each type of kinematic segment, and selecting representative segments is as follows: First, calculate the proportion of the total duration of each type of kinematic segment to the total duration of all valid kinematic segments; Set the total duration of the compositing process, and allocate the compositing time to each type of segment according to this ratio; Next, for each type of segment, calculate the relative error between each segment and the mean of the feature parameters of all segments in that type, and select the segment with the smallest sum of the relative errors of all features in each type as the representative segment; Finally, the selected representative segments are spliced together in chronological order to synthesize a standard chemical condition curve that conforms to the total duration.
Citation Information
Cited By
On-line prediction method for power of electric tractor represented by working condition separation degree
CN122153421A
An on-line power prediction method for electric tractor based on working condition separation degree
CN122153421B