A driving condition construction method based on a generative adversarial network

By constructing driving conditions using generative adversarial networks, the problems of high computational complexity and strong data dependency of existing methods are solved, achieving efficient and accurate generation of driving conditions, which is suitable for autonomous driving test scenarios.

CN121597984BActive Publication Date: 2026-07-24HEFEI UNIV OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HEFEI UNIV OF TECH
Filing Date
2025-11-26
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing methods for constructing driving conditions, such as clustering and Markov methods and wavelet analysis methods, suffer from high computational complexity, strong data dependence, high sensitivity to outliers and noise, and sensitivity to parameter selection. As a result, the constructed driving conditions are not accurate enough and cannot effectively reflect the complex road traffic conditions in China.

Method used

A generative adversarial network (GAN) is used to construct driving conditions. GPS data is collected and preprocessed, and K-means clustering is used to estimate kernel density. The generator and discriminator are designed as multilayer perceptrons. The speed curves of different clustered driving conditions are generated by training and then integrated into a complete driving condition curve by linear interpolation.

Benefits of technology

Generative adversarial networks can efficiently generate driving conditions that closely resemble real-world driving scenarios, reducing reliance on labeled data, improving sample generation efficiency and accuracy, overcoming the shortcomings of traditional methods, and providing more accurate driving condition simulations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121597984B_ABST
    Figure CN121597984B_ABST
Patent Text Reader

Abstract

The application relates to the field of vehicle driving condition construction, and particularly discloses a driving condition construction method based on a generative adversarial network, which comprises the following steps: collecting vehicle driving data on expressways and urban roads and preprocessing; clustering by means of the elbow rule and K-means algorithm; extracting features from each clustering data subset and analyzing speed probability distribution by means of kernel density estimation to determine corresponding distribution models and parameters; constructing a generative adversarial network; training the generative adversarial network; and processing curve transition problems by means of a linear interpolation method and integrating into complete driving condition curves. The application improves sample generation efficiency, simultaneously gets rid of excessive dependence on labeled data, and generates condition data which is more in line with actual driving scenes, effectively overcoming the defects of a Markov model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle driving condition construction, specifically a driving condition construction method based on generative adversarial networks. Background Technology

[0002] Driving conditions are fundamental to evaluating vehicle emissions, fuel consumption, and vehicle design and development. They reflect the kinematic characteristics of vehicles on the road and simulate real traffic conditions. However, my country's road traffic conditions are becoming increasingly complex. The three key characteristic parameters of the currently used European driving conditions—idle speed ratio, average speed, and high-speed driving ratio—are all far higher than those in actual Chinese conditions, failing to reflect current vehicle driving characteristics. Furthermore, there are significant differences between foreign and domestic driving conditions, leading to substantial discrepancies between test results and actual data when directly adopted. Testing autonomous vehicles requires complete driving conditions to ensure comprehensiveness and effectiveness. Therefore, a driving condition generation method is urgently needed for autonomous driving testing to enrich the testing scenarios.

[0003] Currently, the most common methods for constructing driving conditions are those combining clustering and Markov methods, and wavelet analysis and clustering. For preprocessed vehicle driving data, clustering and Markov methods typically use Principal Component Analysis (PCA) and K-Means clustering to classify kinematic segments. Markov chains are used to divide the driving condition into each class, calculating the segment transition probabilities for each class and constructing a state transition matrix. Within each cluster, the most representative segments are selected based on transition probabilities and driving characteristic parameters. These segments and their transition probabilities are used to synthesize a complete driving condition. Then, the driving conditions obtained from each cluster are synthesized to obtain the constructed driving condition. For wavelet analysis, the preprocessed driving data is first extended using a wavelet analysis toolbox to eliminate or reduce boundary effects. Then, wavelet decomposition is performed on the extended data, followed by noise reduction of the coefficients obtained from the wavelet decomposition, and signal compression is also achieved. Clustering algorithms are used to cluster the data, and finally, representative driving conditions are synthesized based on the clustering results and feature parameters.

[0004] Among the methods for constructing driving conditions, the clustering and Markov methods and the wavelet analysis-based methods mentioned above all have certain shortcomings.

[0005] Methods based on clustering and Markov models have significant computational complexity, requiring substantial data processing and calculations, particularly in cluster analysis and state transition probability calculations. They are highly dependent on the quality and completeness of the original data; biased or inaccurate input data can negatively impact the accuracy of clustering results and the final driving conditions. Regarding model limitations, Markov methods assume no aftereffects in state transitions, meaning future states depend only on the current state, while driving behavior can be influenced by various factors, including historical driving patterns. They are also sensitive to outliers and noise; incomplete handling of outliers and noise can lead to biases in kinematic segmentation, affecting the accuracy of the final driving conditions.

[0006] Methods based on wavelet analysis and clustering have several drawbacks. In terms of computational complexity and efficiency, wavelet analysis may require significant computation when processing large datasets, especially during multi-scale wavelet decomposition and denoising. It is also highly dependent on data quality; if the original data is noisy or inaccurate, wavelet analysis may fail to extract accurate features, affecting the final driving condition construction. Furthermore, wavelet analysis can be sensitive to parameter selection, such as the choice of wavelet basis and the number of decomposition levels, which can significantly impact the results. Summary of the Invention

[0007] The purpose of this invention is to provide a method for constructing driving conditions based on generative adversarial networks, so as to solve the problems mentioned in the background art.

[0008] To achieve the above objectives, the present invention provides the following technical solution:

[0009] A method for constructing driving conditions based on generative adversarial networks, the method comprising:

[0010] S1. Collect and preprocess vehicle driving data on highways and urban roads via GPS, including outlier and missing value handling, kinematic segmentation, feature extraction and standardization.

[0011] S2. Using the elbow rule and K-means algorithm, the clusters are divided into 4 classes, and the clustering quality is evaluated.

[0012] S3. Extract features from each clustered data subset and analyze the velocity probability distribution using kernel density estimation to determine the corresponding distribution model and parameters;

[0013] S4. Construct a generative adversarial network. Design the input, intermediate hidden layer and output layer structures for the generator and discriminator respectively, and select a multilayer perceptron.

[0014] S5. Generative Adversarial Network Training: During training, parameters are initialized first, and then data sampling, generation, extraction, discrimination, and iterative training are performed on the generator and discriminator according to specific loss functions and weight update formulas. Finally, speed curves are generated for different clustering conditions.

[0015] S6. Linear interpolation is used to handle curve transition issues and integrate them into a complete driving condition curve.

[0016] As a further technical solution of the present invention, step S1 includes:

[0017] S11, Data Source:

[0018] GPS was used to collect real-world vehicle driving data for highways and urban roads, including vehicle speed, location, and time information.

[0019] S12. Data Cleaning and Processing:

[0020] S12.1 Outlier Handling: For highways, data points whose speeds do not meet the preset highway speed threshold are deleted; for urban roads, data points whose speeds do not meet the preset urban road speed threshold are deleted.

[0021] S12.2 Missing value handling: For missing values ​​accounting for less than 5%, linear interpolation is used to supplement them; for missing values ​​accounting for more than 5%, the velocity curve sample is directly deleted.

[0022] S12.3 Kinematic segment division: Divide the travel data into multiple kinematic segments according to a preset time interval;

[0023] S13. Feature Extraction and Standardization:

[0024] S13.1 Feature Extraction:

[0025] Feature extraction is performed on each kinematic segment after segmentation;

[0026] S13.2 Standardization: Standard deviation standardization is used to standardize the features extracted from the kinematic segments that have been divided above.

[0027] As a further technical solution of the present invention, step S2 includes:

[0028] S21. Determine the number of clusters:

[0029] S21.1 The number of clusters is determined by the Elbow Method, an empirical rule. The number of clusters is determined by the Elbow Method for all preprocessed kinematic segments. Finally, the number of clusters is determined to be 4 based on the actual input kinematic segment characteristics.

[0030] S21.2 The idea behind the elbow rule is to calculate the sum of squared clustering errors under different values ​​( Select the corresponding "elbow" The value is used as the number of clusters; The calculation formula is:

[0031] Formula 1: ;

[0032] in It is the sum of squared clustering errors. It is the number of clusters. It is the first One cluster, It is clustering Data points in It is the first The center of each cluster;

[0033] S21.3, According to different The selection of values ​​yields... and Relationship curve;

[0034] S22, Clustering process:

[0035] S22.1 The core step of the K-means algorithm is to minimize the objective function, which is the sum of squared distances from each data point to the center of its cluster. Taking all the kinematic segments after data preprocessing as input, and based on the four determined clusters, the operations of steps S22.2 and S22.3 are repeated until the convergence condition is met. Through this iterative process, the K-means algorithm gradually optimizes the clustering, allowing data points to be more reasonably divided into different clusters, thus achieving the purpose of clustering.

[0036] S22.2, Objective Function:

[0037] Formula 2: ;

[0038] in It sums the squares of the distances between each data point in all clusters and the center of that cluster. The number of clusters, It is clustering The data points inside, It is clustering The center point inside;

[0039] Formula 3: ;

[0040] in It is clustering The data points inside, It is clustering The center point inside, It is the dimension of the data points. Data points The Values ​​of each dimension Data points The Values ​​in each dimension;

[0041] S22.3 During the clustering process, the algorithm continuously updates the cluster centers. And the cluster to which the data points belong;

[0042] Cluster Center The update formula is:

[0043] Formula 4: ;

[0044] in It is clustering The number of data points in the data. It is clustering The data points inside, It is clustering The center point inside;

[0045] S23. Evaluation and Adjustment of Clustering Results:

[0046] For the four clusters generated by the clustering process, and the kinematic segments in each cluster, the silhouette coefficient is used to evaluate and adjust the clustering results. If the silhouette coefficient is greater than the preset threshold, the clustering results are output and the clustering is completed.

[0047] S23.1, Profile Coefficient:

[0048] Formula 5: ;

[0049] Formula 6: ;

[0050] in Representing data points The relative tightness between its own cluster and its nearest neighbor cluster. It is the average distance from a data point to other data points in its cluster. It is the average distance from a data point to all data points in the nearest neighbor cluster. It is the silhouette coefficient of the entire clustering result. It is the total number of data points, and the range of values ​​for the silhouette coefficient is... The larger the profile coefficient, the better.

[0051] As a further technical solution of the present invention, step S3 includes:

[0052] S31, Feature Extraction;

[0053] S32. Probability Distribution Analysis:

[0054] S321. For the data subsets of the four clusters—highway congestion, highway smooth traffic, urban road congestion, and urban road slow traffic—perform probability distribution analysis respectively.

[0055] S322. Use the kernel density estimation method to estimate the probability density function PDF of velocity. By observing the shape of PDF, we can make a preliminary judgment on the appropriate probability distribution model. The basic idea is to place a kernel function at each data point, and then add all kernel functions together and normalize them to obtain the estimated probability density function.

[0056] For a given dataset The formula for kernel density estimation is:

[0057] Formula 7: ;

[0058] Formula 8: ;

[0059] in It is the estimated probability density function in The value at that location, It is the number of data points. It's bandwidth. It's a kernel function. for ;

[0060] When highways are congested, the KDE (Knowledge-Defined Deduction) method is used to estimate the probability density function of speed. Combined with statistical tests, the goodness of fit of the KDE-estimated probability distribution model is examined. The model shows a good fit to the normal probability distribution model, whose probability density function is:

[0061] Formula 9: ;

[0062] in It is the average speed. It is the speed standard deviation; the parameters are estimated using the maximum likelihood estimation method. and ;

[0063] When the highway is in smooth traffic, the KDE (Knowledge-Definition Error) is used to estimate the probability density function of speed. Combined with statistical tests, the goodness of fit of the KDE-estimated probability distribution model is examined. The model shows a good fit to the normal probability distribution model, whose probability density function is:

[0064] Formula 10: ;

[0065] in It is the average speed. The standard deviation of the velocity is used, and finally, the parameters are estimated using the maximum likelihood estimation method. and ;

[0066] In urban traffic congestion, speeds are low and fluctuate frequently, with numerous stops and starts. The KDE (Knowledge-Definition Error) is used to estimate the probability density function of speed. Combined with statistical tests to examine the goodness of fit of the KDE-estimated probability distribution model, it shows a good fit to the log-normal probability distribution model. The log-normal probability density function is as follows:

[0067] Formula 11: ;

[0068] in It is the mean of the logarithmic velocity. The standard deviation of the logarithmic velocity is used, and finally, the parameters are estimated using the maximum likelihood estimation method. and ;

[0069] When traffic is slow in urban areas, the KDE (Knowledge, Determination, and Equation) is used to estimate the probability density function of speed. Combined with statistical tests, the goodness of fit of the KDE-estimated probability distribution model is examined. The model shows a good fit to the Weibull distribution probability distribution model, whose probability density function is:

[0070] Formula 12: ;

[0071] in It is a parameter. Reflecting the fluctuation characteristics of speed, Reflecting the average speed level, the parameters are finally estimated using the maximum likelihood estimation method. and .

[0072] As a further technical solution of the present invention, step S4 includes:

[0073] S41. Generator Design:

[0074] S41.1, Input Layer:

[0075] (1) Cluster label encoding: Based on the above clustering categories of four, 2-bit binary encoding is used, which requires 2 nodes;

[0076] (2) Input of distribution parameters:

[0077] For highway congestion (normal distribution), the mean of the normal distribution needs to be input. and variance It occupies 2 nodes;

[0078] For a smooth highway (normal distribution), the mean of the normal distribution needs to be entered. and variance It occupies 2 nodes;

[0079] For urban road congestion (log-normal distribution), after taking the logarithm of the data, you need to input the mean of the normal distribution corresponding to the log-normal distribution. and variance It occupies 2 nodes;

[0080] For slow-moving traffic on urban roads (Weibull distribution), the shape parameters of the Weibull distribution need to be input. and scale parameters It occupies 2 nodes;

[0081] Therefore, the input layer is set with 10 nodes to comprehensively cover clustering and distribution information, providing accurate input for the generator;

[0082] S41.2, Intermediate Hidden Layer:

[0083] First hidden layer: This layer is set to 32 nodes, using... Activation function Assuming the input vector is The weight matrix is The bias vector is Output , It can effectively extract features, avoid gradient vanishing, and its 32 nodes can fully process input information and initially abstract and transform features;

[0084] The second hidden layer further refines the features output by the first hidden layer, therefore it has 16 nodes. Activation function Let the output of the first hidden layer be... The second layer weight matrix is The bias vector is Output ; The function maps the output to a graph, which is beneficial for generating complex velocity curves and further refining features.

[0085] S41.3, Output Layer:

[0086] The goal is to generate a 60-second velocity curve, with one data point per second, therefore 60 nodes are needed. Each node outputs one velocity value, forming a complete velocity curve. Let the output of the second hidden layer be... The output layer weight matrix is The bias vector is The output value is ;

[0087] S41.4 Generator Network Selection:

[0088] Considering that the generator's input is discrete code and has multiple parameters, a typical fully connected neural network of multilayer perceptron (MLP) is used to perform fully connected feature extraction and transformation on different types of input;

[0089] S42. Discriminator Design:

[0090] S42.1, Input Layer:

[0091] The input is either velocity curve data generated by the generator or real velocity curve data. The generator samples the velocity curve at a frequency of one data point per second, with a sampling duration of 60 seconds, and the kinematic segments are divided according to 60-second time intervals. The number of input layer nodes is set to 60.

[0092] S42.2, Hidden Layer in the Middle:

[0093] First hidden layer: Set 64 nodes, and use... Activation function, let the input vector be... The weight matrix is The bias vector is Output , It quickly extracts effective features, fully processes the input with 64 nodes, and initially extracts features for discriminative analysis based on the speed curve. It can quickly extract effective features, with 64 nodes fully processing the input, and initially extract features based on the speed curve.

[0094] The second hidden layer: Set up 32 nodes, and use the same... Activation function, let the output of the first hidden layer be... The second layer weight matrix is The bias vector is Output Further refine the features and compress the data dimensions to prepare for output discrimination;

[0095] S42.3, Output Layer:

[0096] through function The output is a probability value between 0 and 1, representing the likelihood that the input velocity curve represents real data. The output layer has one node. Let the output of the second hidden layer be... The output layer weight matrix is The bias vector is Output ;

[0097] S42.4 Discriminator Network Selection:

[0098] A typical fully connected layer neural network of a multilayer perceptron (MLP) is used as the discriminator neural network.

[0099] As a further technical solution of the present invention, step S5 includes:

[0100] S51. Initialization:

[0101] S51.1 Weight Initialization: Initialize the generator and discriminator weights randomly using a normal distribution, and set the mean of the normal distribution used by all layers of the generator and discriminator to be the mean. Standard deviation ;

[0102] S51.2, Bias Initialization: Initialize all bias vectors to 0 (zero vectors);

[0103] S51.3, Hyperparameter Settings: Learning Rate Set to 0.0005, the number of iterations (i.e., the number of rounds of model training) to 50,000, and the batch size (i.e., the number of data samples input into the model for each training session) to 32.

[0104] S52, Generator Training:

[0105] S52.1 Data Sampling and Generation:

[0106] First, parameters are randomly sampled from the parameter spaces of uniform, normal, log-normal, and Weibull distributions according to their respective distribution rules. Simultaneously, cluster labels are randomly selected (00 - highway congestion, 01 - highway smooth traffic, 10 - city road congestion, 11 - city road slow traffic). The sampled parameters and cluster labels are then combined into an input vector. Input to generator In the process, a batch of velocity curve data is generated. ;

[0107] S52.2, Loss Function Formula:

[0108] Formula 13: ;

[0109] in It is a discriminator. It is a generator. Generator input, It is data generated by the generator. The discriminator determines the probability that the data generated by the generator is true; the generator hopes... The value is very large, and the probability that the discriminator will judge it as true is high. At this point, it should be smaller. The loss function of the generator is the discriminator's loss function, which aims to optimize the loss function to the minimum possible.

[0110] S52.3 Weight Update Formula:

[0111] Formula 14: ;

[0112] in It's the learning rate. Starting with weight The gradient is used to calculate the loss function via backpropagation. Regarding generator weights The gradient is used to update the weights of each layer of the generator, further optimizing the loss function. ;

[0113] S53, Discriminator Training:

[0114] S53.1 Data Extraction and Judgment:

[0115] A batch of velocity curve data was randomly selected from the real dataset. Simultaneously, a batch of velocity curve data is extracted from the data generated by the generator. , to use real data and generating data Input to the discriminator respectively In the process, the discriminator obtains the discrimination results for them. and ;

[0116] S53.2 Loss Function Formula:

[0117] Formula 15: ;

[0118] in It is a discriminator. It is a generator. It involves randomly selecting a batch of velocity curves from a real dataset. These are a batch of curves extracted from the data generated by the generator. Discriminator discrimination The probability of it being true. For discriminator to distinguish The probability of it being true. The loss function of the discriminator It is an indicator variable when the input data is real data. When the input data is generator data When inputting real data ( Minimize It will promote Approaching 1, meaning correctly identifying the real data; when inputting generated data Minimize It will promote Approaching 0 means correctly identifying the generated data; the goal of the discriminator is to optimize the loss function to the minimum possible.

[0119] S53.3, Weight Update Formula:

[0120] Formula 16: ;

[0121] in It's the learning rate. Starting with weight The gradient is used to calculate the loss function via backpropagation. Regarding discriminator weights The gradient is used to update the weights of each layer of the discriminator, further optimizing the loss function. ;

[0122] S54, Iterative Training:

[0123] The generator is trained by first fixing the discriminator weights and then updating the discriminator parameters while fixing the generator weights. This process is repeated until the preset number of model training iterations is reached. After the generative adversarial network is trained, corresponding speed curves are generated according to the four clustering conditions: highway congestion, highway smooth traffic, urban road congestion, and urban road slow traffic.

[0124] As a further technical solution of the present invention, step S6 includes:

[0125] Using linear interpolation, considering the smoothness of the transition, as well as the computational load and complexity, the time interval between adjacent time nodes is set according to the total duration of a single speed curve, and the number of time nodes (excluding the two endpoints of a single curve) is calculated. The speed value of the intermediate transition is calculated based on the speed values ​​at the endpoints of the preceding and following curves, and each time node and the endpoints of the two adjacent curves are smoothly connected. Since the road route studied consists of highways and urban roads, speed curves are generated using generative adversarial networks according to different road segments and clustering conditions. Then, the linear interpolation method is used to connect the curves to obtain the complete operating condition curve.

[0126] Terminology Explanation:

[0127] Generative Adversarial Networks (GANs) are a type of deep learning model that consists of two key neural network components: a generator and a discriminator. These two components compete with each other during training. The generator attempts to generate increasingly realistic data to deceive the discriminator, while the discriminator tries to distinguish between the data generated by the generator and real data. The ultimate goal of training is to reach a balance.

[0128] Driving Cycle: A driving cycle is a curve showing how dynamic parameters such as speed, acceleration, and deceleration of a vehicle change over time under specific conditions. It is a method used in automotive engineering to simulate actual road driving conditions and reflects the general driving behavior of vehicles in specific regions or on specific types of roads.

[0129] Compared with the prior art, the beneficial effects of the present invention are:

[0130] Markov models, when constructing driving conditions, rely on a large amount of labeled data and tedious statistical analysis for parameter estimation, exhibiting poor tolerance to noise and outliers, and struggling with high-dimensional space problems. The generative adversarial network of this invention can generate complete samples at once, eliminating the need for step-by-step derivation, greatly improving sample generation efficiency. Simultaneously, it eliminates excessive reliance on labeled data, and the generated driving condition data more closely reflects actual driving scenarios, effectively overcoming the shortcomings of Markov models. Attached Figure Description

[0131] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention.

[0132] Figure 1 The overall flowchart of the method for constructing driving conditions for generating adversarial networks is shown.

[0133] Figure 2 The overall flowchart for clustering work condition types using the K-means clustering algorithm.

[0134] Figure 3 Flowchart for determining the number of clusters k for the elbow rule of thumb.

[0135] Figure 4 This is a structural design diagram for the generator and discriminator.

[0136] Figure 5 The flowchart for training the adversarial network generator and discriminator is provided. Detailed Implementation

[0137] To make the technical problems to be solved, the technical solutions, and the beneficial effects of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention.

[0138] Please see Figure 1 This invention provides a method for constructing driving conditions based on generative adversarial networks, the method comprising:

[0139] S1. Collect and preprocess vehicle driving data on highways and urban roads via GPS, including outlier and missing value handling, kinematic segmentation, feature extraction and standardization.

[0140] S2. Using the elbow rule and K-means algorithm, the clusters are divided into 4 classes, and the clustering quality is evaluated.

[0141] S3. Extract features from each clustered data subset and analyze the velocity probability distribution using kernel density estimation to determine the corresponding distribution model and parameters;

[0142] S4. Construct a generative adversarial network. Design the input, intermediate hidden layer and output layer structures of the generator and discriminator respectively, and select a multilayer perceptron.

[0143] S5. Generative Adversarial Network Training: During training, parameters are initialized first, and then data sampling, generation, extraction, discrimination, and iterative training are performed on the generator and discriminator according to specific loss functions and weight update formulas. Finally, speed curves are generated for different clustering conditions.

[0144] S6. Linear interpolation is used to handle curve transition issues and integrate them into a complete driving condition curve.

[0145] In this embodiment, step S1 includes:

[0146] S11, Data Source:

[0147] GPS was used to collect real-world vehicle driving data for highways and urban roads, including vehicle speed, location, and time information.

[0148] S12. Data Cleaning and Processing:

[0149] S12.1 Outlier Handling: For highways, data points whose speeds do not meet the preset highway speed threshold (exceeding 130km / h or falling below 30km / h) are deleted; for urban roads, data points whose speeds do not meet the preset urban road speed threshold (exceeding 100km / h or falling below -5km / h) are deleted.

[0150] S12.2 Missing value handling: For missing values ​​accounting for less than 5%, linear interpolation is used to supplement them; for missing values ​​accounting for more than 5%, the velocity curve sample is directly deleted.

[0151] S12.3, Kinematic segment division: Divide the travel data into multiple kinematic segments according to a preset time interval (every 60 seconds for the vehicle);

[0152] S13. Feature Extraction and Standardization:

[0153] S13.1 Feature Extraction:

[0154] Feature extraction was performed on each kinematic segment after segmentation, and the extracted feature parameters are shown in Table 1 below;

[0155] Table 1

[0156] Characteristic parameters abbreviation name Units (in physical unit form) average speed velocity variance Frequency of velocity change Mean slope of the velocity curve Variance of the rising slope of the velocity curve Mean slope of the velocity curve Variance of the slope of the velocity curve Frequency of change in the slope of the velocity curve (ascending segment) Frequency of change in the slope of the velocity curve (decreasing segment) Frequency of change of the overall slope of the velocity curve

[0157] S13.2 Standardization: Standard deviation standardization is used to standardize the features extracted from the kinematic segments that have been divided above.

[0158] Please see Figure 2 and Figure 3 Step S2 in this embodiment includes:

[0159] S21. Determine the number of clusters:

[0160] S21.1 In the K-means algorithm, there is no absolute formula for determining the number of clusters. This invention uses the Elbow Method, an empirical rule, to determine the number of clusters. The Elbow Method is applied to all preprocessed kinematic segments to determine the number of clusters. Theoretically, a maximum of 6 clusters can be generated (highway congestion, highway smooth traffic, highway slow traffic, urban road congestion, urban road smooth traffic, urban road slow traffic). Finally, based on the actual input kinematic segment features, the number of clusters is determined to be 4, including highway congestion, highway smooth traffic, urban road congestion, and urban road slow traffic.

[0161] S21.2 The idea behind the elbow rule is to calculate the sum of squared clustering errors under different values ​​( Select the corresponding "elbow" The value is used as the number of clusters; The calculation formula is:

[0162] Formula 1: ;

[0163] in It is the sum of squared clustering errors. It is the number of clusters. It is the first One cluster, It is clustering Data points in It is the first The center of each cluster;

[0164] S21.3, According to different The selection of values ​​yields... and The relationship curve when we start increasing the number of clusters The value of will gradually decrease; this is because as the number of clusters increases, the data points within each cluster become more tightly packed around the cluster center, so the sum of the squared distances from the data points to the cluster center decreases. As continues to increase, It will continue to decline. However, after a certain point, The rate of decrease will become significantly smaller. This point is analogous to the "elbow" of the curve; from this point onward, increasing the number of clusters will have a noticeable effect on reducing... The contribution became less significant;

[0165] S22, Clustering process:

[0166] S22.1 The core step of the K-means algorithm is to minimize the objective function, which is the sum of squared distances from each data point to its cluster center. Taking all the kinematic segments after data preprocessing as input, and based on the four determined clusters, the operations of "assigning data points to the clustering stage and calculating the objective function" (step S22.2) and "updating the cluster centers" (step S22.3) are repeated until the convergence condition is met (the cluster centers no longer change significantly). Through this iterative process, the K-means algorithm gradually optimizes the clustering, allowing data points to be more reasonably divided into different clusters, thus achieving the purpose of clustering.

[0167] S22.2, Objective Function:

[0168] Formula 2: ;

[0169] in The number of clusters, It is clustering The data points inside, It is clustering The center point inside;

[0170] Formula 3: ;

[0171] in It is clustering The data points inside, It is clustering The center point inside, It is the dimension of the data points. Data points The Values ​​of each dimension Data points The Values ​​in each dimension;

[0172] S22.3 During the clustering process, the algorithm continuously updates the cluster centers. And the cluster to which the data points belong;

[0173] Cluster Center The update formula is:

[0174] Formula 4: ;

[0175] in It is clustering The number of data points in the data. It is clustering The data points inside, It is clustering The center point inside;

[0176] S23. Evaluation and Adjustment of Clustering Results:

[0177] For the four clusters generated by the clustering process, and the kinematic segments in each cluster, the silhouette coefficient is used to evaluate and adjust the clustering results. If the silhouette coefficient is greater than a preset threshold (i.e., the silhouette coefficient is greater than 0.6 in this embodiment of the invention), the clustering results are output and the clustering is completed.

[0178] S23.1, Profile coefficient:

[0179] Formula 5: ;

[0180] Formula 6: ;

[0181] in Representing data points The relative tightness between its own cluster and its nearest neighbor cluster. It is the average distance from a data point to other data points in its cluster. It is the average distance from a data point to all data points in its nearest neighbor cluster (the cluster that is closest to it besides its own). It is the silhouette coefficient of the entire clustering result. It is the total number of data points, and the range of values ​​for the silhouette coefficient is... A higher silhouette coefficient is better because it represents better clustering quality, meaning the clusters are more compact.

[0182] Step S3 in this embodiment includes:

[0183] S31. Feature extraction, the results are shown in Table 2;

[0184] Table 2

[0185] Characteristic parameters abbreviation name Units (in physical unit form) average speed velocity variance Kudo None (dimensionless) Skewness None (dimensionless) Swiftness (mean) Jerkiness (variance) Rate of change of acceleration (mean) Rate of change of acceleration (variance) Frequency of velocity change Mean slope of the velocity curve Variance of the rising slope of the velocity curve Mean slope of the velocity curve Variance of the slope of the velocity curve Frequency of change in the slope of the velocity curve (ascending segment) Frequency of change in the slope of the velocity curve (decreasing segment) Frequency of change of the overall slope of the velocity curve

[0186] S32. Probability Distribution Analysis:

[0187] S321. For the data subsets of the four clusters—highway congestion, highway smooth traffic, urban road congestion, and urban road slow traffic—perform probability distribution analysis respectively.

[0188] S322. Use the kernel density estimation (KDE) method to estimate the probability density function PDF of velocity. By observing the shape of the PDF, we can make a preliminary judgment on the appropriate probability distribution model. The basic idea is to place a kernel function (usually a symmetric probability density function, such as a Gaussian kernel function) at each data point, and then add all kernel functions together and normalize them to obtain the estimated probability density function.

[0189] For a given dataset The formula for kernel density estimation is:

[0190] Formula 7: ;

[0191] Formula 8: ;

[0192] in It is the estimated probability density function in The value at that location, It is the number of data points. It is bandwidth (which controls the width of the kernel function). It is a kernel function for ;

[0193] During highway congestion, vehicle speeds are relatively low and do not fluctuate significantly, remaining close to a stable and moderate speed value. The KDE (Knowledge-Definition Error) is used to estimate the probability density function of the speed. Combined with statistical tests to examine the goodness of fit of the KDE-estimated probability distribution model, it shows a good fit to the normal probability distribution model. The normal probability density function is:

[0194] Formula 9: ;

[0195] in It is the average speed. It is the speed standard deviation; finally, the parameters are estimated using the maximum likelihood estimation method. and ;

[0196] When traffic is smooth on highways, vehicle speeds are high and fluctuations are relatively small, potentially approaching a stable speed value. The KDE (Knowledge-Defined Deduction) method is used to estimate the probability density function of the speed. Combined with statistical tests to examine the goodness of fit of the KDE-estimated probability distribution model, it shows a good fit to the normal probability distribution model. The normal probability density function is:

[0197] Formula 10: ;

[0198] in It is the average speed. The standard deviation of the velocity is used, and finally, the parameters are estimated using the maximum likelihood estimation method. and ;

[0199] In urban traffic congestion, speeds are low and fluctuate frequently, with numerous stops and starts. The KDE (Knowledge-Definition Error) is used to estimate the probability density function of speed. Combined with statistical tests to examine the goodness of fit of the KDE-estimated probability distribution model, it shows a good fit to the log-normal probability distribution model. The log-normal probability density function is as follows:

[0200] Formula 11: ;

[0201] in It is the mean of the logarithmic velocity. The standard deviation of the logarithmic velocity is used, and finally, the parameters are estimated using the maximum likelihood estimation method. and ;

[0202] When driving slowly on urban roads, with moderate speeds and some fluctuations, the KDE (Knowledge, Determination, and Equation) is used to estimate the probability density function of the speed. Combined with statistical tests to examine the goodness of fit of the KDE-estimated probability distribution model, it shows a good fit to the Weibull distribution probability distribution model. The Weibull distribution probability density function is:

[0203] Formula 12: ;

[0204] in It is a parameter. Reflecting the fluctuation characteristics of speed, Reflecting the average speed level, the parameters are finally estimated using the maximum likelihood estimation method. and .

[0205] Please see Figure 4 Step S4 in this embodiment includes:

[0206] S41. Generator Design:

[0207] S41.1, Input Layer:

[0208] (1) Cluster label encoding: Based on the above clustering categories, there are four categories. Use 2-bit binary encoding (00-highway congestion, 01-highway smooth, 10-city road congestion, 11-city road slow traffic). This part requires 2 nodes;

[0209] (2) Input of distribution parameters:

[0210] For highway congestion (normal distribution), the mean of the normal distribution needs to be input. and variance It occupies 2 nodes;

[0211] For a smooth highway (normal distribution), the mean of the normal distribution needs to be entered. and variance It occupies 2 nodes;

[0212] For urban road congestion (log-normal distribution), after taking the logarithm of the data, you need to input the mean of the normal distribution corresponding to the log-normal distribution. and variance It occupies 2 nodes;

[0213] For slow-moving traffic on urban roads (Weibull distribution), the shape parameters of the Weibull distribution need to be input. and scale parameters It occupies 2 nodes;

[0214] Therefore, the input layer is set with 10 nodes to comprehensively cover clustering and distribution information, providing accurate input for the generator;

[0215] S41.2, Intermediate Hidden Layer:

[0216] First hidden layer: To prevent the generator from fully learning the complex relationship between input features and output velocity curves, and to avoid overly complex models, a moderate number of nodes is chosen. This layer is set to 32 nodes. Activation function Assuming the input vector is The weight matrix is The bias vector is Output , It can effectively extract features, avoid gradient vanishing, and its 32 nodes can fully process input information and initially abstract and transform features;

[0217] The second hidden layer further refines the features output by the first hidden layer, therefore it has 16 nodes. Activation function Let the output of the first hidden layer be... The second layer weight matrix is The bias vector is Output ; The function maps the output to a graph, which is beneficial for generating complex velocity curves and further refining features.

[0218] S41.3, Output Layer:

[0219] The goal is to generate a 60-second velocity curve, with one data point per second, therefore 60 nodes are needed. Each node outputs one velocity value, forming a complete velocity curve. Let the output of the second hidden layer be... The output layer weight matrix is The bias vector is The output value is ;

[0220] S41.4 Generator Network Selection:

[0221] Considering that the generator's input is discrete code and has multiple parameters, a typical fully connected neural network of multilayer perceptron (MLP) is used to perform fully connected feature extraction and transformation on different types of input;

[0222] S42. Discriminator Design:

[0223] S42.1, Input Layer:

[0224] The input is either velocity curve data generated by the generator or real velocity curve data. The generator samples the velocity curve at a frequency of one data point per second, with a sampling duration of 60 seconds, and the kinematic segments are divided according to 60-second time intervals. The number of input layer nodes is set to 60.

[0225] S42.2, Hidden Layer in the Middle:

[0226] First hidden layer: Set 64 nodes, and use... Activation function, let the input vector be... The weight matrix is The bias vector is Output , It quickly extracts effective features, with 64 nodes fully processing the input, and initially extracts features for discriminative analysis based on the speed curve. It can quickly extract effective features, with 64 nodes fully processing the input, and initially extract features based on the speed curve.

[0227] The second hidden layer: Set up 32 nodes, and use the same... Activation function, let the output of the first hidden layer be... The second layer weight matrix is The bias vector is Output Further refine the features and compress the data dimensions to prepare for output discrimination;

[0228] S42.3, Output Layer:

[0229] through function The output is a probability value between 0 and 1, representing the likelihood that the input velocity curve represents real data. The output layer has one node. Let the output of the second hidden layer be... The output layer weight matrix is The bias vector is Output ;

[0230] S42.4 Discriminator Network Selection:

[0231] Considering that Multilayer Perceptrons (MLPs) can also handle velocity curve data well, extracting features stepwise through fully connected layers and making judgments may be easier to implement and understand due to its simplicity and directness. Therefore, a typical fully connected layer neural network of a Multilayer Perceptron (MLP) is used as the discriminator neural network.

[0232] Please see Figure 5 Step S5 in this embodiment includes:

[0233] S51. Initialization:

[0234] S51.1 Weight Initialization: Initialize the generator and discriminator weights randomly using a normal distribution, and set the mean of the normal distribution used by all layers of the generator and discriminator to be the mean. Standard deviation ;

[0235] S51.2, Bias Initialization: Initialize all bias vectors to 0 (zero vectors);

[0236] S51.3, Hyperparameter Settings: Learning Rate Set to 0.0005, the number of iterations (i.e., the number of rounds of model training) to 50,000, and the batch size (i.e., the number of data samples input into the model for each training session) to 32.

[0237] S52, Generator Training:

[0238] S52.1 Data Sampling and Generation:

[0239] First, parameters are randomly sampled from the parameter spaces of uniform, normal, log-normal, and Weibull distributions according to their respective distribution rules. Simultaneously, cluster labels are randomly selected (00 - highway congestion, 01 - highway smooth traffic, 10 - city road congestion, 11 - city road slow traffic). The sampled parameters and cluster labels are then combined into an input vector. Input to generator In the process, a batch of velocity curve data is generated. ;

[0240] S52.2, Loss Function Formula:

[0241] Formula 13: ;

[0242] in It is a discriminator. It is a generator. Generator input, It is data generated by the generator. The discriminator determines the probability that the data generated by the generator is true; the generator hopes... The value is very large, and the probability that the discriminator will judge it as true is high. At this point, it should be smaller. The loss function of the generator is the discriminator's loss function, which aims to optimize the loss function to the minimum possible.

[0243] S52.3 Weight Update Formula:

[0244] Formula 14: ;

[0245] in It's the learning rate. Starting with weight The gradient is used to calculate the loss function via backpropagation. Regarding generator weights The gradient is used to update the weights of each layer of the generator, further optimizing the loss function. ;

[0246] S53, Discriminator Training:

[0247] S53.1 Data Extraction and Judgment:

[0248] A batch of velocity curve data was randomly selected from the real dataset. Simultaneously, a batch of velocity curve data is extracted from the data generated by the generator. , to use real data and generating data Input to the discriminator respectively In the process, the discriminator obtains the discrimination results for them. and ;

[0249] S53.2 Loss Function Formula:

[0250] Formula 15: ;

[0251] in It is a discriminator. It is a generator. It involves randomly selecting a batch of velocity curves from a real dataset. These are a batch of curves extracted from the data generated by the generator. Discriminator discrimination The probability of it being true. For discriminator to distinguish The probability of it being true. Let the loss function be that of the discriminator. It is an indicator variable when the input data is real data. When the input data is generator data When inputting real data ( Minimize It will promote Approaching 1, meaning correctly identifying the real data; when inputting generated data Minimize It will promote Approaching 0 means correctly identifying the generated data; the objective of the discriminator is to optimize the loss function to the minimum possible.

[0252] S53.3, Weight Update Formula:

[0253] Formula 16: ;

[0254] in It's the learning rate. Starting with weight The gradient is used to calculate the loss function via backpropagation. Regarding discriminator weights The gradient is used to update the weights of each layer of the discriminator, further optimizing the loss function. ;

[0255] S54, Iterative Training:

[0256] The generator is trained by first fixing the discriminator weights and then updating the discriminator parameters while fixing the generator weights. This process is repeated until the preset number of model training iterations is reached. After the generative adversarial network is trained, corresponding speed curves are generated according to the four clustering conditions: highway congestion, highway smooth traffic, urban road congestion, and urban road slow traffic.

[0257] Step S6 in this embodiment includes:

[0258] Reasons for transition:

[0259] Because the generator generates speed curve data based on different clusters (highway congestion, highway smooth traffic, urban road congestion, urban road slow traffic) and corresponding distribution parameters, the spliced ​​speed curves may be discontinuous or unreasonable when switching between different clustering scenarios. Therefore, it is necessary to perform transition processing to integrate the discrete speed curves generated by the generator, which may have connection problems, into a complete curve that conforms to actual driving conditions.

[0260] Curve transition method:

[0261] Using linear interpolation, at the junction of two adjacent speed curves with a duration of 60 seconds, considering the smoothness of the transition, as well as the computational load and complexity, the time interval between adjacent time nodes is set to 10 seconds based on the total duration of the speed curves being 60 seconds. The number of time nodes is calculated to be 5 (excluding the two endpoints of a single curve). The speed value of the intermediate transition is calculated based on the speed values ​​at the endpoints of the preceding and following curves. These 5 time nodes are then smoothly connected to the endpoints of the two adjacent curves. Since the road routes studied in the data collection consist of highways and urban roads, speed curves are generated using generative adversarial networks based on different road segments and clustering conditions. The linear interpolation method is then used to connect the curves to obtain the complete operating condition curve.

[0262] It should be noted that, in this document, the term "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0263] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method for constructing driving conditions based on generative adversarial networks, characterized in that, The method includes: S1. Collect and preprocess vehicle driving data on highways and urban roads via GPS, including outlier and missing value handling, kinematic segmentation, feature extraction and standardization. S2. Using the elbow rule and K-means algorithm, the data are clustered into 4 categories: highway congestion, highway smooth traffic, urban road congestion, and urban road slow traffic. The clustering quality is then evaluated. S3. Extract features from each cluster data subset and analyze the speed probability distribution using kernel density estimation to determine the probability distribution model corresponding to each cluster. Among them, highway congestion and smooth highway traffic correspond to normal distribution, urban road congestion corresponds to logarithmic normal distribution, and urban road slow traffic corresponds to Weibull distribution. The parameters of the probability distribution model are estimated using the maximum likelihood estimation method. S4. Construct a generative adversarial network. The generator and discriminator are designed with input, intermediate hidden layer and output layer structures respectively and a multilayer perceptron is selected. The generator uses the cluster label encoding of each cluster and the distribution parameters determined in S3 as conditional inputs and the velocity curve as output. S5. Generative Adversarial Network Training: During training, parameters are initialized first, and then the generator and discriminator are trained by data sampling, extraction and discrimination and iterative training according to the loss function and weight update formula respectively. Finally, the generator directly generates the corresponding speed curve for different clustering conditions. S6. Linear interpolation is used to handle curve transition issues and integrate them into a complete driving condition curve.

2. The method for constructing driving conditions based on generative adversarial networks according to claim 1, characterized in that, Step S1 includes: S11, Data Source: GPS was used to collect real-world vehicle driving data for highways and urban roads, including vehicle speed, location, and time information. S12. Data Cleaning and Processing: S12.1 Outlier Handling: For highways, data points whose speeds do not meet the preset highway speed threshold are deleted; for urban roads, data points whose speeds do not meet the preset urban road speed threshold are deleted. S12.2 Missing value handling: For missing values ​​accounting for less than 5%, linear interpolation is used to supplement them; for missing values ​​accounting for more than 5%, the velocity curve sample is directly deleted. S12.3 Kinematic segment division: Divide the travel data into multiple kinematic segments according to a preset time interval; S13. Feature Extraction and Standardization: S13.1 Feature Extraction: Feature extraction is performed on each kinematic segment after segmentation; S13.2 Standardization: Standard deviation standardization is used to standardize the features extracted from the kinematic segments that have been divided above.

3. The method for constructing driving conditions based on generative adversarial networks according to claim 1, characterized in that, Step S2 includes: S21. Determine the number of clusters: S21.1 The elbow rule, an empirical rule, is used to determine the number of clusters. The elbow rule is used to determine the number of clusters for all kinematic segments after preprocessing. Finally, based on the characteristics of the actual input kinematic segments, the number of clusters is determined to be 4, including highway congestion, highway smooth traffic, urban road congestion, and urban road slow traffic. S21.2 The idea behind the elbow rule is to calculate the sum of squared clustering errors under different values. Select the area corresponding to "elbow". The value is used as the number of clusters; The calculation formula is: Official 1: ; in It is the sum of squared clustering errors. It is the number of clusters. It is the first One cluster, It is clustering Data points in It is the first The center of each cluster; S21.3, According to different The selection of values ​​yields... and Relationship curve; S22, Clustering process: S22.1 The core step of the K-means algorithm is to minimize the objective function, which is the sum of squared distances from each data point to the center of its cluster. Taking all the kinematic segments after data preprocessing as input, and based on the four determined clusters, the operations of steps S22.2 and S22.3 are repeated until the convergence condition is met. Through this iterative process, the K-means algorithm gradually optimizes the clustering, allowing data points to be more reasonably divided into different clusters, thus achieving the purpose of clustering. S22.2, Objective Function: Official 2: ; in It sums the squares of the distances between each data point in all clusters and the center of that cluster. The number of clusters, It is clustering The data points inside, It is clustering The center point inside; Official 3: ; in It is clustering The data points inside, It is clustering The center point inside, It is the dimension of the data points. Data points The Values ​​of each dimension Data points The Values ​​in each dimension; S22.3 During the clustering process, the algorithm continuously updates the cluster centers. And the cluster to which the data points belong; Cluster Center The update formula is: Official 4: ; in It is clustering The number of data points in the data. It is clustering The data points inside, It is clustering The center point inside; S23. Evaluation and Adjustment of Clustering Results: For the four clusters generated by the clustering process, and the kinematic segments in each cluster, the silhouette coefficient is used to evaluate and adjust the clustering results. If the silhouette coefficient is greater than the preset threshold, the clustering results are output and the clustering is completed. S23.1, Profile coefficient: Official 5: ; Official 6: ; in, Representing data points The relative tightness between its own cluster and its nearest neighbor cluster. It is the average distance from a data point to other data points in its cluster. It is the average distance from a data point to all data points in the nearest neighbor cluster. It is the silhouette coefficient of the entire clustering result. It is the total number of data points, and the range of values ​​for the silhouette coefficient is... The larger the profile coefficient, the better.

4. The method for constructing driving conditions based on generative adversarial networks according to claim 1, characterized in that, Step S3 includes: S31, Feature Extraction; S32. Probability Distribution Analysis: S321. For the data subsets of the four clusters—highway congestion, highway smooth traffic, urban road congestion, and urban road slow traffic—perform probability distribution analysis respectively. S322. Use the kernel density estimation method to estimate the probability density function PDF of velocity. By observing the shape of PDF, we can make a preliminary judgment on the appropriate probability distribution model. The basic idea is to place a kernel function at each data point, and then add all kernel functions together and normalize them to obtain the estimated probability density function. For a given dataset The formula for kernel density estimation is: Official 7: ; Official 8: ; in It is the estimated probability density function in The value at that location, It is the number of data points. It's bandwidth. It is a kernel function, where for ; When highways are congested, the KDE (Knowledge-Defined Deduction) method is used to estimate the probability density function of speed. Combined with statistical tests, the goodness of fit of the KDE-estimated probability distribution model is examined. The model shows a good fit to the normal probability distribution model, whose probability density function is: Official 9: ; in It is the average speed. It is the speed standard deviation; When the highway is in smooth traffic, the KDE (Knowledge-Definition Error) is used to estimate the probability density function of speed. Combined with statistical tests, the goodness of fit of the KDE-estimated probability distribution model is examined. The model shows a good fit to the normal probability distribution model, whose probability density function is: Official 10: ; in It is the average speed. The standard deviation of the velocity is used, and finally, the parameters are estimated using the maximum likelihood estimation method. and ; In urban traffic congestion, speeds are low and fluctuate frequently, with numerous stops and starts. The KDE (Knowledge-Definition Error) is used to estimate the probability density function of speed. Combined with statistical tests to examine the goodness of fit of the KDE-estimated probability distribution model, it shows a good fit to the log-normal probability distribution model. The log-normal probability density function is as follows: Official 11: ; in It is the mean of the logarithmic velocity. The standard deviation of the logarithmic velocity is used, and finally, the parameters are estimated using the maximum likelihood estimation method. and ; When traffic is slow in urban areas, the KDE (Knowledge, Determination, and Equation) is used to estimate the probability density function of speed. Combined with statistical tests, the goodness of fit of the KDE-estimated probability distribution model is examined. The model shows a good fit to the Weibull distribution probability distribution model, whose probability density function is: Official 12: ; in, Reflecting the fluctuation characteristics of speed, Reflecting the average speed level, the parameters are finally estimated using the maximum likelihood estimation method. and .

5. The method for constructing driving conditions based on generative adversarial networks according to claim 1, characterized in that, Step S4 includes: S41. Generator Design: S41.1, Input Layer: (1) Cluster label encoding: Based on the four cluster categories, 2-bit binary encoding is used, which requires 2 nodes; (2) Input of distribution parameters: For highway congestion, the mean of a normal distribution needs to be input. and variance It occupies 2 nodes; For smooth traffic flow on highways, the mean of a normal distribution needs to be input. and variance It occupies 2 nodes; For urban road congestion, after taking the logarithm of the data, the mean of the normal distribution corresponding to the log-normal distribution needs to be input. and variance It occupies 2 nodes; For slow-moving traffic on urban roads, the shape parameters of the Weibull distribution need to be input. and scale parameters It occupies 2 nodes; Therefore, the input layer is set with 10 nodes to comprehensively cover clustering and distribution information, providing accurate input for the generator; S41.2, Hidden Layer in the Middle: First hidden layer: This layer is set to 32 nodes, using... Activation function Assuming the input vector is The weight matrix is The bias vector is Output , It can effectively extract features, avoid gradient vanishing, and its 32 nodes can fully process input information and initially abstract and transform features; The second hidden layer further refines the features output by the first hidden layer, therefore it has 16 nodes. Activation function Let the output of the first hidden layer be... The second layer weight matrix is The bias vector is Output ; The function maps the output to a graph, which is beneficial for generating complex velocity curves and further refining features. S41.3, Output Layer: The goal is to generate a 60-second velocity curve, with one data point per second, therefore requiring 60 nodes. Each node outputs one value to form the complete velocity curve. Let the output of the second hidden layer be... The output layer weight matrix is The bias vector is The output value is ; S41.4 Generator Network Selection: Considering that the generator input is discrete code and has multiple parameters, a typical fully connected layer neural network of multilayer perceptron is adopted to perform fully connected feature extraction and transformation on different types of input; S42. Discriminator Design: S42.1, Input Layer: The input is either velocity curve data generated by the generator or real velocity curve data. The generator samples the velocity curve at a frequency of one data point per second, with a sampling duration of 60 seconds, and the kinematic segments are divided according to 60-second time intervals. The number of input layer nodes is set to 60. S42.2, Hidden Layer in the Middle: First hidden layer: Set 64 nodes, and use... Activation function, let the input vector be... The weight matrix is The bias vector is Output , It quickly extracts effective features, fully processes the input with 64 nodes, and initially extracts features for discriminative analysis based on the speed curve. It can quickly extract effective features, with 64 nodes fully processing the input, and initially extract features based on the speed curve. The second hidden layer: Set up 32 nodes, and use the same... Activation function, let the output of the first hidden layer be... The second layer weight matrix is The bias vector is Output Further refine the features and compress the data dimensions to prepare for output discrimination; S42.3, Output Layer: through function The output is a probability value between 0 and 1, representing the likelihood that the input velocity curve represents the true data. The output layer has one node. Let the output of the second hidden layer be... The output layer weight matrix is The bias vector is Output ; S42.4 Discriminator Network Selection: A typical fully connected layer neural network of a multilayer perceptron is used as the discriminator neural network.

6. The method for constructing driving conditions based on generative adversarial networks according to claim 1, characterized in that, Step S5 includes: S51. Initialization: S51.1 Weight Initialization: Initialize the generator and discriminator weights randomly using a normal distribution, and set the mean of the normal distribution used by all layers of the generator and discriminator to be the mean. Standard deviation ; S51.2, Bias Initialization: Initialize all bias vectors to 0; S51.3, Hyperparameter Settings: Learning Rate Set to 0.0005, the number of iterations (i.e., the number of rounds of model training) to 50,000, and the batch size (i.e., the number of data samples input into the model for each training session) to 32. S52, Generator Training: S52.1 Data Sampling and Generation: First, parameters are randomly sampled from the parameter spaces of uniform, normal, log-normal, and Weibull distributions according to their respective distribution rules. Simultaneously, cluster labels are randomly selected. The sampled parameters and cluster labels are then combined into an input vector. Input to generator In the process, a batch of velocity curve data is generated. ; S52.2, Loss Function Formula: Official 13: ; in It is a discriminator. It is a generator. Generator input, It is data generated by the generator. The discriminator determines the probability that the data generated by the generator is true; the generator hopes... The value is very large, and the probability that the discriminator will judge it as true is high. At this point, it should be smaller. The loss function of the generator is the discriminator's loss function, which aims to optimize the loss function to the minimum possible. S52.3 Weight Update Formula: Official 14: ; in It's the learning rate. It's about weights The gradient is used to calculate the loss function via backpropagation. Regarding generator weights The gradient is used to update the weights of each layer of the generator, further optimizing the loss function. ; S53, Discriminator Training: S53.1 Data Extraction and Judgment: A batch of velocity curve data was randomly selected from the real dataset. Simultaneously, a batch of velocity curve data is extracted from the data generated by the generator. , to use real data and generating data Input to the discriminator respectively In the process, the discriminator obtains the discrimination results for them. and ; S53.2 Loss Function Formula: Official 15: ; in It is a discriminator. It is a generator. It involves randomly selecting a batch of velocity curves from a real dataset. These are a batch of curves extracted from the data generated by the generator. For discriminator to distinguish The probability of it being true. For discriminator to distinguish The probability of it being true. Let the loss function of the discriminator be , It is an indicator variable when the input data is real data. When the input data is generator data When inputting real data ( Minimize It will promote Approaching 1, meaning correctly identifying the real data; when inputting generated data Minimize It will promote Approaching 0 indicates that the generated data was correctly identified; S53.3, Weight Update Formula: Official 16: ; in It's the learning rate. Starting with weight The gradient is used to calculate the loss function via backpropagation. Regarding discriminator weights The gradient is used to update the weights of each layer of the discriminator, further optimizing the loss function. ; S54, Iterative Training: The generator is trained by first fixing the discriminator weights and then updating the discriminator parameters while fixing the generator weights. This process is repeated until the preset number of model training iterations is reached. After the generative adversarial network is trained, corresponding speed curves are generated according to the four clustering conditions: highway congestion, highway smooth traffic, urban road congestion, and urban road slow traffic.

7. The method for constructing driving conditions based on generative adversarial networks according to claim 1, characterized in that, Step S6 includes: Using linear interpolation, at the junction of two adjacent velocity curves, considering the smoothness of the transition, as well as the computational load and complexity, the time interval between adjacent time nodes is set according to the total duration of a single velocity curve, and the number of time nodes is calculated, excluding the two endpoints of a single curve. The velocity value of the intermediate transition is calculated based on the velocity values ​​at the endpoints of the preceding and following curves, and each time node and the endpoints of the two adjacent curves are smoothly connected. Since the road route studied is composed of highways and urban roads, according to different road segments and clustering conditions, a generative adversarial network is used to generate velocity curves, and then the linear interpolation method is combined to connect the curves to obtain the complete operating condition curve.