Simulation method and device
By acquiring and processing the driver's vehicle data, using the classification model and hidden Markov model to generate behavior and driving style sequences, and performing autonomous driving simulation based on real traffic flow data, solving the problem of low accuracy of simulation results in the existing technology , improves the accuracy and reliability of simulation results.
Patent Information
- Application Number
- CN202310932525.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-26
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2043-07-26
AI Technical Summary
Among the existing autonomous driving simulation methods, the simulation results are not accurate and it is difficult to fully conform to the driver's actual driving process.
By obtaining the data to be classified on the vehicle speed, acceleration, steering wheel angle and position information collected by the same driver when using the vehicle, using the pre-trained classification model and hidden Markov model, the behavior sequence and driving style sequence are generated, and Automatic driving simulation based on real traffic flow data.
The accuracy of simulation results is improved, the autonomous driving simulation process is more in line with the actual driving process, and the reliability of simulation results is enhanced.
Smart Images

Figure CN117172096B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of simulation technology, and more specifically, to a simulation method and device. Background Art
[0002] At present, autonomous driving technology has received extensive attention and application in the fields of automobiles, logistics, public transportation, etc. In the research and development of autonomous driving systems, simulation methods can be used to test and optimize the relevant algorithms of autonomous driving. In related methods, simulation can be performed through some typical traffic scenarios. However, in related methods, there is still the problem of low accuracy of simulation results. Summary of the invention
[0003] In view of the above problems, the present application proposes a simulation method and device to improve the above problems.
[0004] In a first aspect, the present application provides a simulation method, the method comprising: obtaining a plurality of data to be classified, each of the data to be classified comprising the speed, acceleration, steering wheel angle and position information of the vehicle, and each of the data to be classified is collected when the vehicle is used by the same driver; based on the plurality of data to be classified and a pre-trained classification model, obtaining a behavior sequence corresponding to the plurality of data to be classified, the behavior sequence being a sequence composed based on a time sequence and including classification results corresponding to each of the plurality of data to be classified, the classification results being smooth straight driving or sudden acceleration or sudden deceleration or sudden left turn or sudden right turn or sudden braking; based on the behavior sequence and a pre-trained hidden Markov model, obtaining a driving style sequence corresponding to the behavior sequence, the driving style sequence including a driving style corresponding to each of the classification results, the driving style being cautious, mild or aggressive; obtaining real traffic flow data corresponding to the driving style sequence; and performing an automatic driving simulation based on the real traffic flow data and the driving style sequence.
[0005] In a second aspect, the present application provides a simulation device, which includes: a data acquisition unit for acquiring data to be classified, which is used to acquire multiple data to be classified, each of which includes the speed, acceleration, steering wheel angle and position information of the vehicle, and each of which is collected when the vehicle is used by the same driver; a behavior sequence acquisition unit, which is used to obtain a behavior sequence corresponding to the multiple data to be classified based on the multiple data to be classified and a pre-trained classification model, and the behavior sequence is a sequence composed of classification results corresponding to the multiple data to be classified based on time sequence, and the classification results are straight and smooth driving or sudden acceleration or sudden deceleration or sudden left turn or sudden right turn or sudden braking; a driving style acquisition unit, which is used to obtain a driving style sequence corresponding to the behavior sequence based on the behavior sequence and a pre-trained hidden Markov model, and the driving style sequence includes the driving style corresponding to each of the classification results, and the driving style is cautious, mild or aggressive; a simulation unit, which is used to acquire real traffic flow data corresponding to the driving style sequence; based on the real traffic flow data and the driving style sequence, automatic driving simulation is performed.
[0006] In a third aspect, the present application provides a simulation device, comprising one or more processors and a memory; one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the above-mentioned method.
[0007] In a fourth aspect, the present application provides a computer-readable storage medium, in which program code is stored, wherein the above method is executed when the program code is run.
[0008] The present application provides a simulation method, device and storage medium. After obtaining multiple data to be classified including vehicle speed, acceleration, steering wheel angle and position information collected by the same driver when using a vehicle, based on the multiple data to be classified and a pre-trained classification model, a behavior sequence corresponding to the multiple data to be classified based on time sequence and including classification results corresponding to each of the multiple data to be classified is obtained, wherein the classification results are straight and smooth driving or sudden acceleration or sudden deceleration or sudden left turn or sudden right turn or sudden braking; based on the behavior sequence and a pre-trained hidden Markov model, a driving style sequence corresponding to the behavior sequence including a driving style corresponding to each of the classification results is obtained, wherein the driving style is cautious, mild or aggressive; real traffic flow data corresponding to the driving style sequence is obtained; and automatic driving simulation is performed based on the real traffic flow data and the driving style sequence. Through the above method, after obtaining multiple data to be classified, the multiple data to be classified can be input into a pre-trained classification model to obtain a behavior sequence, and then the behavior sequence can be input into a pre-trained hidden Markov model to obtain a driving style sequence, and the real traffic flow data corresponding to the driving style sequence can be obtained. Based on the real traffic flow data and the driving style sequence, automatic driving simulation is performed, so that the automatic driving simulation process is more consistent with the actual driving process of the driver, thereby improving the accuracy of the simulation results. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0010] Figure 1 A flowchart of a simulation method proposed in an embodiment of the present application;
[0011] Figure 2 A flowchart of a simulation method proposed in another embodiment of the present application;
[0012] Figure 3 A flowchart of a simulation method proposed in another embodiment of the present application;
[0013] Figure 4 A schematic diagram showing a basic process proposed in this application;
[0014] Figure 5 A structural block diagram of a simulation device proposed in an embodiment of the present application is shown;
[0015] Figure 6The figure shows a structural block diagram of a simulation device proposed in the present application. DETAILED DESCRIPTION
[0016] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0017] In an embodiment of the present application, the inventor proposes a simulation method and device, after obtaining multiple data to be classified including vehicle speed, acceleration, steering wheel angle and position information collected by the same driver when using the vehicle, based on the multiple data to be classified and a pre-trained classification model, obtain a behavior sequence corresponding to the multiple data to be classified based on a time sequence and including classification results corresponding to each of the multiple data to be classified, wherein the classification results are straight and smooth driving or sudden acceleration or sudden deceleration or sudden left turn or sudden right turn or sudden braking; based on the behavior sequence and a pre-trained hidden Markov model, obtain a driving style sequence corresponding to the behavior sequence including a driving style corresponding to each of the classification results, wherein the driving style is cautious, mild or aggressive; obtain real traffic flow data corresponding to the driving style sequence; and perform automatic driving simulation based on the real traffic flow data and the driving style sequence. Through the above method, after obtaining multiple data to be classified, the multiple data to be classified can be input into a pre-trained classification model to obtain a behavior sequence, and then the behavior sequence can be input into a pre-trained hidden Markov model to obtain a driving style sequence, and the real traffic flow data corresponding to the driving style sequence can be obtained. Based on the real traffic flow data and the driving style sequence, automatic driving simulation is performed, so that the automatic driving simulation process is more consistent with the actual driving process of the driver, thereby improving the accuracy of the simulation results.
[0018] See also Figure 1 , an embodiment of the present application provides a simulation method, the method comprising:
[0019] S110: Acquire multiple pieces of data to be classified, each piece of the data to be classified includes speed, acceleration, steering wheel angle and position information of the vehicle, and each piece of the data to be classified is collected when the vehicle is used by the same driver.
[0020] The vehicle's location information may include the longitude and latitude of the vehicle.
[0021] As one approach, source data may be acquired, and multiple pieces of target source data may be extracted from the source data, and then the speed, acceleration, steering wheel angle, and position information of the vehicle may be extracted from each piece of target source data to obtain multiple pieces of data to be classified.
[0022] Among them, source data may refer to data collected in real time during the driving process of the vehicle, which may include vehicle motion information and real traffic flow data. The vehicle motion information may include the vehicle's speed, acceleration, steering wheel angle and position information, etc. The real traffic flow data may include the number of lanes, motion information of surrounding vehicles, motion information of surrounding pedestrians, traffic signs on the road, etc.
[0023] Optionally, the vehicle is provided with information collection equipment (such as cameras, lidars, sensors, etc.) and information transmission equipment. The information collection equipment can collect source data, and the information transmission equipment can transmit the collected source data to a simulation device, which is, for example, a server.
[0024] The server may be a cloud server, which may be equipped with a simulation engine, which may be used for autonomous driving simulation. The cloud server may also perform data mining, and perform model training, autonomous driving simulation, etc. based on the mined data. Surrounding vehicles and pedestrians may be understood as vehicles and pedestrians within the range detectable by the vehicle's information collection device.
[0025] The target source data can be understood as source data segments with driver behavior research value. Driver behavior research value can be understood as target source data that can reflect the behaviors that frequently occur when the driver is driving the vehicle. For example, the source data can be data collected in real time from 10:00 to 12:00, and the target source data can be data collected in real time from 10:10:05 to 10:10:55.
[0026] In an embodiment of the present application, the target source data may be the data to be classified stored in the data header and the real traffic flow data stored after the data to be classified. Therefore, the data to be classified may be obtained by obtaining the data of the specified storage size or the specified number of character strings in the target source data.
[0027] Optionally, the target source data may be obtained through a data mining algorithm.
[0028] Optionally, the server may store the source data in an object storage system (Object Storage Service, OSS), and store the mapping relationship between the target source data and the data to be classified in ES (Elasticsearch).
[0029] The mapping relationship between the target source data and the data to be classified can be used to determine the source of each piece of data to be classified. The mapping relationship can be the storage address of the target source data corresponding to the data to be classified in the OSS.
[0030] In the embodiment of the present application, there are multiple ways to detect whether the vehicle is used by the same driver.
[0031] As a detection method, the vehicle can determine whether the vehicle is used by the same driver based on the opening and closing status of the vehicle door. Optionally, the vehicle is used by the same driver during the time interval between two adjacent door openings and closings.
[0032] As another detection method, the vehicle can determine whether the vehicle is used by the same driver based on the seat posture of the main driver's seat. Optionally, if the seat posture of the main driver's seat does not change in two consecutive travel records, it can indicate that the vehicle is used by the same driver.
[0033] As another detection method, the vehicle can determine whether the vehicle is used by the same driver based on the driver's biometric recognition results, such as the driver's voice, fingerprint, etc.
[0034] In an embodiment of the present application, by collecting multiple pieces of data to be classified when the same driver uses the vehicle, the rationality and consistency between the multiple pieces of data to be classified can be improved, thereby improving the accuracy of the behavior sequence and the driving style sequence, and making the simulation results more realistic.
[0035] S120: Based on the multiple data to be classified and the pre-trained classification model, obtain behavior sequences corresponding to the multiple data to be classified, wherein the behavior sequence is a sequence composed of classification results corresponding to the multiple data to be classified based on time order, and the classification results are smooth driving in a straight line or sudden acceleration or sudden deceleration or sudden left turn or sudden right turn or sudden braking.
[0036] Among them, the classification model can be an SVM (Support Vector Machine) model, a convolutional neural network model (such as VGG16, ResNET, etc.), etc.
[0037] As a method, multiple pieces of data to be classified may be input into a pre-trained classification model in order of collection time, to obtain behavior sequences corresponding to the multiple pieces of data to be classified.
[0038] Exemplarily, the order of multiple data to be classified in order of collection time from earliest to latest can be: A, B, C, the classification result corresponding to A can be sudden acceleration, the classification result corresponding to B can be straight and steady driving, and the classification result corresponding to C can be sudden right turn, then the behavior sequence can be: {sudden acceleration, straight and steady driving, sudden right turn}.
[0039] S130: Based on the behavior sequence and a pre-trained hidden Markov model, a driving style sequence corresponding to the behavior sequence is obtained, wherein the driving style sequence includes a driving style corresponding to each of the classification results, and the driving style is cautious, mild, or aggressive.
[0040] Among them, the Hidden Markov Model (HMM) can be a generative model. The Hidden Markov Model can be used to describe the dependency relationship between two related sequences, which can be called state sequence and observation sequence. The state sequence can refer to an unobservable, hidden sequence, and the observation sequence can refer to an observable sequence. The value of the state sequence at time t is only related to the value of the state sequence at time t-1.
[0041] The hidden Markov model can be determined by the initial probability vector (π), the state transition probability matrix (A) and the observation probability matrix (B). Among them, the state transition probability matrix can refer to the probability of transition between states, such as: at time t in state q i Under the condition of j The probability of the observation probability matrix can refer to the probability of obtaining each observation value according to the current state, such as: at time t in state q i Generate observation v under the condition k The probability of the initial state. The initial state probability vector can refer to the probability of each state appearing at the initial moment.
[0042] In the embodiment of the present application, the behavior sequence may be an observation sequence, and the driving style sequence may be a state sequence.
[0043] As a method, the behavior sequence can be input into a pre-trained hidden Markov model, and the driving style sequence corresponding to the behavior sequence can be obtained based on the Viterbi algorithm.
[0044] S140: Acquire real traffic flow data corresponding to the driving style sequence.
[0045] As a method, the storage addresses of the target source data corresponding to the multiple pieces of data to be classified can be obtained from ES based on the multiple pieces of data to be classified corresponding to the driving style sequence, and then the target source data can be found based on the storage addresses, and then the real traffic flow data can be extracted from the target source data.
[0046] S150: Performing an autonomous driving simulation based on the real traffic flow data and the driving style sequence.
[0047] As a method, a driving scene corresponding to each of the multiple driving styles can be constructed based on the real traffic flow data corresponding to each of the multiple driving styles in the driving style sequence; in the driving scene, the automatic driving simulation is performed based on the driving style corresponding to the driving scene.
[0048] A simulation method provided in this embodiment obtains multiple data to be classified including vehicle speed, acceleration, steering wheel angle and position information collected by the same driver when using the vehicle, and then obtains, based on the multiple data to be classified and a pre-trained classification model, a behavior sequence corresponding to the multiple data to be classified and composed of classification results corresponding to each of the multiple data to be classified based on a time sequence, wherein the classification results are straight and smooth driving or sudden acceleration or sudden deceleration or sudden left turn or sudden right turn or sudden braking; based on the behavior sequence and a pre-trained hidden Markov model, obtains a driving style sequence corresponding to the behavior sequence including a driving style corresponding to each of the classification results, wherein the driving style is cautious or mild or aggressive; obtains real traffic flow data corresponding to the driving style sequence; and performs automatic driving simulation based on the real traffic flow data and the driving style sequence. Through the above method, after obtaining multiple data to be classified, the multiple data to be classified can be input into a pre-trained classification model to obtain a behavior sequence, and then the behavior sequence can be input into a pre-trained hidden Markov model to obtain a driving style sequence, and the real traffic flow data corresponding to the driving style sequence can be obtained. Based on the real traffic flow data and the driving style sequence, automatic driving simulation is performed, so that the automatic driving simulation process is more consistent with the actual driving process of the driver, thereby improving the accuracy of the simulation results.
[0049] See also Figure 2 , an embodiment of the present application provides a simulation method, the method comprising:
[0050] S210: Acquire a first training data set, where the first training data set includes a plurality of training data and behavior types corresponding to the plurality of training data, each training data including speed, acceleration, steering wheel angle, and position information of a vehicle.
[0051] As a method, multiple pieces of training data may be obtained; based on a preset first definition rule and the multiple pieces of training data, the behavior types corresponding to the multiple pieces of training data are obtained.
[0052] The preset first definition rules may include the following four rules:
[0053] (1) If the maximum speed change value of the training data is less than or equal to the first preset value and the maximum direction change value is less than or equal to the second preset value, it is determined that the behavior type corresponding to the training data is straight-line steady driving.
[0054] The maximum speed change value may refer to the difference between the maximum speed value and the minimum speed value in the time period corresponding to the training data. The maximum direction change value may refer to the difference between the maximum steering wheel angle and the minimum steering wheel angle in the time period corresponding to the training data.
[0055] Optionally, based on the fact that the maximum speed change rate and the maximum direction change rate of the training data are both less than or equal to corresponding thresholds, it can be determined that the behavior type corresponding to the training data is straight and steady driving.
[0056] The maximum speed change rate may refer to a ratio of a maximum speed change value to a maximum speed value, and the maximum direction change value may refer to a ratio of a maximum direction change value to a maximum steering wheel angle.
[0057] Optionally, the first preset value, the second preset value, the maximum speed change rate, and the maximum direction change rate can be determined based on the experience of simulation testers.
[0058] (2) If the maximum speed change value of the training data is greater than the first preset value, the maximum direction change value is greater than the second preset value, and the steering wheel angle is clockwise, it is determined that the behavior type corresponding to the training data is a sharp right turn.
[0059] (3) If the maximum speed change value of the training data is greater than the first preset value, the maximum direction change value is greater than the second preset value, and the steering wheel angle is counterclockwise, it is determined that the behavior type corresponding to the training data is a sharp left turn.
[0060] (4) If the acceleration of the training data is greater than or equal to the third preset value, and the speed changes from small to large, it is determined that the behavior type corresponding to the training data is rapid acceleration.
[0061] The acceleration being greater than or equal to the third preset value may be understood as the acceleration being greater than or equal to the third preset value during the time period corresponding to the training data.
[0062] The acceleration being greater than or equal to the third preset value can also be understood as, within the time period corresponding to the training data, the proportion of the duration during which the acceleration is greater than or equal to the third preset value in the time period exceeds the first preset proportion.
[0063] Optionally, the third preset value and the first preset ratio can be determined based on the experience of simulation testers.
[0064] (5) If the acceleration of the training data is greater than or equal to the third preset value, and the speed changes from large to small, it is determined that the behavior type corresponding to the training data is a sudden deceleration.
[0065] (6) If the acceleration of the training data is greater than or equal to the fourth preset value, and the speed changes from a non-zero value to 0, it is determined that the behavior type corresponding to the training data is emergency braking.
[0066] The acceleration being greater than or equal to the fourth preset value may be understood as the acceleration being greater than or equal to the fourth preset value throughout the time period corresponding to the training data.
[0067] The acceleration being greater than or equal to the fourth preset value can also be understood as, within the time period corresponding to the training data, the proportion of the duration during which the acceleration is greater than or equal to the fourth preset value in the time period exceeds the second preset proportion.
[0068] Optionally, the fourth preset value and the second preset ratio can be determined based on the experience of simulation testers.
[0069] Optionally, the third threshold may be less than or equal to the fourth threshold, and the first ratio may be less than or equal to the second ratio.
[0070] Optionally, the training data may be acquired based on the method for acquiring the data to be classified in step S110.
[0071] S220: Training the classification model to be trained based on the first training data set to obtain the classification model.
[0072] As a method, when the model to be classified is an SVM model, the training process can be: projecting multiple training data in the first training data set into a high-dimensional space according to a preset kernel function (such as a polynomial kernel function, etc.), setting conditional constraints on the objective function of the SVM to be trained based on the behavior types corresponding to the multiple training data, solving the objective function through a predetermined optimization algorithm (such as a sequential minimum optimization algorithm, etc.), and finding the optimal hyperplane that can separate training data of different behavior types.
[0073] As a method, when the model to be classified is a convolutional neural network model, the training process can be: during the current training process, multiple training data in the first training data set can be respectively input into the model to be classified, and the predicted behavior types corresponding to the multiple data to be classified in the current training process are obtained, and then the loss function value in the current training process is obtained based on the predicted behavior type, behavior type, and loss function in the current training process, and the parameters of the model to be classified are updated based on the loss function value in the current training process to obtain the updated classification model in the current training process. If the updated classification model in the current training process meets the target conditions, the training can be stopped, and the classification model updated in the current training process is used as the classification model; if the updated classification model in the current training process does not meet the target conditions, the next training process can be entered, and the classification model updated in the current training process is used as the model to be classified in the next training process.
[0074] The target condition may refer to a loss function value being less than a preset value or the number of training times reaching a preset number of times, etc. The parameters of the model to be classified may refer to parameters such as the weight of the model to be classified.
[0075] Optionally, in order to improve the robustness of the classification model, the first training data set may be divided into a training set and a test set according to a preset ratio (such as 8:2), and the classification model may be trained using the divided first training data set.
[0076] Optionally, in order to obtain an accurate classification model when the data amount of the first training data set is limited, the classification model may be trained by a ten-fold cross validation method.
[0077] S230: Acquire multiple pieces of data to be classified, each piece of the data to be classified includes speed, acceleration, steering wheel angle and position information of the vehicle, and each piece of the data to be classified is collected when the vehicle is used by the same driver.
[0078] S240: Based on the multiple data to be classified and the pre-trained classification model, a behavior sequence corresponding to the multiple data to be classified is obtained, wherein the behavior sequence is a sequence composed of classification results corresponding to the multiple data to be classified based on time order, and the classification results are smooth driving in a straight line, sudden acceleration, sudden deceleration, sudden left turn, sudden right turn, or sudden braking.
[0079] S250: Based on the behavior sequence and a pre-trained hidden Markov model, a driving style sequence corresponding to the behavior sequence is obtained, wherein the driving style sequence includes a driving style corresponding to each of the classification results, and the driving style is cautious, mild, or aggressive.
[0080] S260: Acquire real traffic flow data corresponding to the driving style sequence.
[0081] S270: Performing an autonomous driving simulation based on the real traffic flow data and the driving style sequence.
[0082] It should be noted that in the field of autonomous driving simulation, the driver's behavior can be used as a benchmark for evaluating the performance of the autonomous driving system. By comparing the behavioral differences between the autonomous driving system and the real driver, the performance of the system in different scenarios can be evaluated. If the behavior pattern of the autonomous driving system is similar to the driver's behavior pattern and can adapt to various traffic conditions and driving conditions, then the autonomous driving system can be considered effective and reliable. By training the classification model with the first training data set, the classification model can accurately extract the driver's behavior from multiple pieces of data to be classified, thereby improving the accuracy of subsequent simulations.
[0083] The simulation method provided by the present embodiment can, through the above-mentioned method, after obtaining multiple pieces of data to be classified, input the multiple pieces of data to be classified into a pre-trained classification model to obtain a behavior sequence, then input the behavior sequence into a pre-trained hidden Markov model to obtain a driving style sequence, and obtain the real traffic flow data corresponding to the driving style sequence, and perform automatic driving simulation based on the real traffic flow data and the driving style sequence, so that the automatic driving simulation process is more consistent with the actual driving process of the driver, thereby improving the accuracy of the simulation result. In addition, in the present embodiment, the classification model to be trained is trained by the first training data set, thereby obtaining a trained classification model, so that the driver's behavior can be accurately analyzed based on the trained classification model, thereby improving the accuracy of the simulation.
[0084] See also Figure 3 , an embodiment of the present application provides a simulation method, the method comprising:
[0085] S310: Acquire a second training data set, where the second training data set includes a plurality of training behavior type sequences and training driving style sequences corresponding to the plurality of training behavior type sequences.
[0086] As a method, multiple groups of data to be identified can be obtained, each group of data to be identified can include multiple reference data, the multiple reference data can be arranged from first to last according to the collection time, and each reference data can include the vehicle's speed, acceleration, steering wheel angle and position information; the multiple groups of data to be identified are respectively input into the classification model to obtain multiple training behavior type sequences, each training behavior type sequence can include multiple behavior types, and each behavior type can correspond to a reference data; based on the pre-set second definition rule and the multiple training behavior type sequences, a training driving style sequence is obtained.
[0087] Among them, the pre-set second definition rule may include: if the maximum speed change value or the maximum direction change value in the reference data corresponding to the behavior type does not exceed the corresponding first threshold, the driving style corresponding to the behavior type is determined to be cautious; if the maximum speed change value or the maximum direction change value in the reference data corresponding to the behavior type does not exceed the corresponding second threshold, the driving style corresponding to the behavior type is determined to be moderate; if the maximum speed change value or the maximum direction change value in the reference data corresponding to the behavior type does not exceed the corresponding third threshold, the driving style corresponding to the behavior type is determined to be aggressive, wherein the first threshold is less than the second threshold, and the second threshold is less than the third threshold.
[0088] Optionally, the first threshold, the second threshold, and the third threshold may be determined based on the experience of simulation testers.
[0089] Optionally, the multiple pieces of reference data may be multiple pieces of training data in the first training data set.
[0090] S320: Training the hidden Markov model to be trained based on the second training data set to obtain the hidden Markov model.
[0091] As one approach, the parameters of the hidden Markov model to be trained may be obtained by maximum likelihood estimation based on the second training data set, thereby obtaining the hidden Markov model.
[0092] The parameters of the hidden Markov model to be trained may include an initial probability vector (π), a state transition probability matrix (A), and an observation probability matrix (B).
[0093] S230: Acquire multiple pieces of data to be classified, each piece of the data to be classified includes speed, acceleration, steering wheel angle and position information of the vehicle, and each piece of the data to be classified is collected when the vehicle is used by the same driver.
[0094] S340: Based on the multiple data to be classified and the pre-trained classification model, a behavior sequence corresponding to the multiple data to be classified is obtained, and the behavior sequence is a sequence composed of classification results corresponding to the multiple data to be classified based on time order, and the classification results are straight and smooth driving, sudden acceleration, sudden deceleration, sudden left turn, sudden right turn, or sudden braking.
[0095] S350: Based on the behavior sequence and a pre-trained hidden Markov model, a driving style sequence corresponding to the behavior sequence is obtained, wherein the driving style sequence includes a driving style corresponding to each of the classification results, and the driving style is cautious, mild, or aggressive.
[0096] S360: Acquire real traffic flow data corresponding to the driving style sequence.
[0097] S370: Performing an autonomous driving simulation based on the real traffic flow data and the driving style sequence.
[0098] The simulation method provided in this embodiment can, through the above-mentioned method, after obtaining multiple pieces of data to be classified, input the multiple pieces of data to be classified into a pre-trained classification model to obtain a behavior sequence, then input the behavior sequence into a pre-trained hidden Markov model to obtain a driving style sequence, and obtain the real traffic flow data corresponding to the driving style sequence, and perform automatic driving simulation based on the real traffic flow data and the driving style sequence, so that the automatic driving simulation process is more consistent with the actual driving process of the driver, thereby improving the accuracy of the simulation result. In addition, in this embodiment, the hidden Markov model to be trained is trained by the second training data set, so as to obtain a trained hidden Markov model, so that the driving style of the driver under different behaviors and different times can be accurately analyzed based on the trained hidden Markov model, thereby improving the accuracy of the simulation.
[0099] In order to better understand the solutions of all embodiments of the present application, the basic business process of the simulation method of the present application is introduced below.
[0100] See also Figure 4 , the classification model and the hidden Markov model can be trained based on steps S1 to S4. After the classification model and the hidden Markov model are trained, the autonomous driving simulation and test can be performed based on steps S5 to S8.
[0101] See also Figure 5 The present application provides a simulation device 600, the device 600 comprising:
[0102] The data to be classified acquiring unit 610 is used to acquire multiple pieces of data to be classified, each piece of data to be classified includes the speed, acceleration, steering wheel angle and position information of the vehicle, and each piece of data to be classified is collected when the vehicle is used by the same driver.
[0103] The behavior sequence acquisition unit 620 is used to obtain the behavior sequences corresponding to the multiple data to be classified based on the multiple data to be classified and the pre-trained classification model. The behavior sequence is a sequence composed of classification results corresponding to the multiple data to be classified based on time order, and the classification results are smooth driving in a straight line or sudden acceleration or sudden deceleration or sudden left turn or sudden right turn or sudden braking.
[0104] The driving style acquisition unit 630 is used to obtain a driving style sequence corresponding to the behavior sequence based on the behavior sequence and a pre-trained hidden Markov model, wherein the driving style sequence includes a driving style corresponding to each of the classification results, and the driving style is cautious, mild or aggressive.
[0105] The simulation unit 640 is used to obtain real traffic flow data corresponding to the driving style sequence; and perform automatic driving simulation based on the real traffic flow data and the driving style sequence.
[0106] As a method, the simulation unit 640 is specifically used to construct driving scenes corresponding to each of the multiple driving styles based on the real traffic flow data corresponding to each of the multiple driving styles in the driving style sequence; in the driving scenes, automatic driving simulation is performed based on the driving styles corresponding to the driving scenes.
[0107] The device 600 further includes:
[0108] A model training unit 650 is used to obtain a first training data set, wherein the first training data set includes a plurality of training data and behavior types corresponding to the plurality of training data, each training data includes a speed, acceleration, steering wheel angle and position information of a vehicle;
[0109] The classification model to be trained is trained based on the first training data set to obtain the classification model.
[0110] As a method, the model training unit 650 is specifically used to obtain the multiple training data;
[0111] Based on the preset first definition rule and the plurality of training data, the behavior types corresponding to the plurality of training data are obtained.
[0112] As a method, the model training unit 650 is specifically used to obtain a second training data set, wherein the second training data set includes multiple training behavior type sequences and training driving style sequences corresponding to each of the multiple training behavior type sequences; based on the second training data set, the hidden Markov model to be trained is trained to obtain the hidden Markov model.
[0113] Optionally, the model training unit 650 is specifically used to obtain multiple groups of data to be identified, each group of data to be identified includes multiple reference data, the multiple reference data are arranged from first to last according to the collection time, and each reference data includes the vehicle's speed, acceleration, steering wheel angle and position information; the multiple groups of data to be identified are respectively input into the classification model to obtain the multiple training behavior type sequences, each of the training behavior type sequences includes multiple behavior types, and each behavior type corresponds to one reference data; based on the pre-set second definition rule and the multiple training behavior type sequences, the training driving style sequence is obtained.
[0114] Optionally, the pre-set first definition rule includes: if the maximum speed change value of the training data is less than or equal to the first preset value and the maximum direction change value is less than or equal to the second preset value, the behavior type corresponding to the training data is determined to be straight and stable driving; if the maximum speed change value of the training data is greater than the first preset value, the maximum direction change value is greater than the second preset value, and the steering wheel angle is clockwise, the behavior type corresponding to the training data is determined to be a sharp right turn; if the maximum speed change value of the training data is greater than the first preset value, the maximum direction change value is greater than the second preset value, and the steering wheel angle is counterclockwise, the behavior type corresponding to the training data is determined to be a sharp left turn; if the acceleration of the training data is greater than or equal to the third preset value, and the speed changes from small to large, the behavior type corresponding to the training data is determined to be a sudden acceleration; if the acceleration of the training data is greater than or equal to the third preset value, and the speed changes from large to small, the behavior type corresponding to the training data is determined to be a sudden deceleration; if the acceleration of the training data is greater than or equal to the fourth preset value, and the speed changes from a non-zero value to 0, the behavior type corresponding to the training data is determined to be an emergency brake.
[0115] Optionally, the second definition rule includes: if the maximum speed change value or the maximum direction change value in the reference data corresponding to the behavior type does not exceed the corresponding first threshold, determining that the driving style corresponding to the behavior type is cautious; if the maximum speed change value or the maximum direction change value in the reference data corresponding to the behavior type does not exceed the corresponding second threshold, determining that the driving style corresponding to the behavior type is moderate; if the maximum speed change value or the maximum direction change value in the reference data corresponding to the behavior type does not exceed the corresponding third threshold, determining that the driving style corresponding to the behavior type is aggressive, and the first threshold is less than the second threshold, and the second threshold is less than the third threshold.
[0116] The following will be combined Figure 6 A server provided by this application is described.
[0117] See also Figure 6 Based on the above-mentioned simulation method and device, the embodiment of the present application also provides another simulation device that can execute the above-mentioned simulation method, and the simulation device can be a server 100. The server 100 includes one or more (only one is shown in the figure) processors 102 and a memory 104 coupled to each other. Among them, the memory 104 stores a program that can execute the content of the above-mentioned embodiment, and the processor 102 can execute the program stored in the memory 104.
[0118] Among them, the processor 102 may include one or more processing cores. The processor 102 uses various interfaces and lines to connect various parts within the entire server 100, and executes various functions and processes data of the server 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 104, and calling data stored in the memory 104. Optionally, the processor 102 can be implemented in at least one hardware form of a network processor (Neural network Processing Unit, NPU), a digital signal processing (Digital Signal Processing, DSP), a field programmable gate array (Field-Programmable Gate Array, FPGA), and a programmable logic array (Programmable Logic Array, PLA). The processor 102 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU), a network processor (Neural network Processing Unit, NPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; the NPU is responsible for processing multimedia data such as video and images; and the modem is used to process wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor 102, but may be implemented separately through a communication chip.
[0119] The memory 104 may include a random access memory (RAM) or a read-only memory (ROM). The memory 104 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 104 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the server 100 during use.
[0120] The embodiment of the present application provides a computer-readable storage medium 800. The computer-readable storage medium 800 stores program codes, and the program codes can be called by a processor to execute the method described in the above method embodiment.
[0121] The computer readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 that performs any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 810 can be compressed, for example, in an appropriate form.
[0122] In summary, the present application provides a simulation method and device, after obtaining multiple data to be classified including vehicle speed, acceleration, steering wheel angle and position information collected by the same driver when using the vehicle, based on the multiple data to be classified and a pre-trained classification model, obtain a behavior sequence corresponding to the multiple data to be classified based on a time sequence and including classification results corresponding to each of the multiple data to be classified, wherein the classification results are straight and smooth driving or sudden acceleration or sudden deceleration or sudden left turn or sudden right turn or sudden braking; based on the behavior sequence and a pre-trained hidden Markov model, obtain a driving style sequence corresponding to the behavior sequence including a driving style corresponding to each of the classification results, wherein the driving style is cautious or mild or aggressive; obtain real traffic flow data corresponding to the driving style sequence; and perform automatic driving simulation based on the real traffic flow data and the driving style sequence. Through the above method, after obtaining multiple data to be classified, the multiple data to be classified can be input into a pre-trained classification model to obtain a behavior sequence, and then the behavior sequence can be input into a pre-trained hidden Markov model to obtain a driving style sequence, and the real traffic flow data corresponding to the driving style sequence can be obtained. Based on the real traffic flow data and the driving style sequence, automatic driving simulation is performed, so that the automatic driving simulation process is more consistent with the actual driving process of the driver, thereby improving the accuracy of the simulation results.
[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A simulation method, characterized in that: The method comprises: Acquire source data, where the source data refers to data collected in real time during the driving process of the vehicle, including multiple pieces of data to be classified and real traffic flow data; Acquire the plurality of pieces of data to be classified, each piece of the data to be classified includes the speed, acceleration, steering wheel angle and position information of the vehicle, and each piece of the data to be classified is collected when the vehicle is used by the same driver; Based on the multiple pieces of data to be classified and the pre-trained classification model, a behavior sequence corresponding to the multiple pieces of data to be classified is obtained, wherein the behavior sequence is a sequence composed of classification results corresponding to the multiple pieces of data to be classified based on a time sequence, and the classification results are straight-line steady driving, sudden acceleration, sudden deceleration, sudden left turn, sudden right turn, or sudden braking; Based on the behavior sequence and a pre-trained hidden Markov model, a driving style sequence corresponding to the behavior sequence is obtained, wherein the driving style sequence includes a driving style corresponding to each of the classification results, and the driving style is cautious, mild, or aggressive; Acquire real traffic flow data corresponding to the driving style sequence, wherein the real traffic flow data includes at least two of the number of lanes, movement information of surrounding vehicles, movement information of surrounding pedestrians, and traffic signs on the road; Based on the real traffic flow data and the driving style sequence, an automatic driving simulation is performed.
2. The method according to claim 1, characterized in that The performing of the automatic driving simulation based on the real traffic flow data and the driving style sequence comprises: constructing driving scenes corresponding to the plurality of driving styles based on real traffic flow data corresponding to the plurality of driving styles in the driving style sequence; In the driving scenario, automatic driving simulation is performed based on the driving style corresponding to the driving scenario.
3. The method according to claim 1, characterized in that Before obtaining the plurality of pieces of data to be classified, the method further includes: Acquire a first training data set, the first training data set comprising a plurality of training data and behavior types corresponding to the plurality of training data, each training data comprising speed, acceleration, steering wheel angle and position information of a vehicle; The classification model to be trained is trained based on the first training data set to obtain the classification model.
4. The method according to claim 3, characterized in that The obtaining of a first training data set includes: Acquire the plurality of training data; Based on the preset first definition rule and the plurality of training data, the behavior types corresponding to the plurality of training data are obtained.
5. The method according to claim 4, characterized in that The preset first definition rule includes: If the maximum speed change value of the training data is less than or equal to the first preset value and the maximum direction change value is less than or equal to the second preset value, determining that the behavior type corresponding to the training data is straight-line steady driving; If the maximum speed change value of the training data is greater than the first preset value, the maximum direction change value is greater than the second preset value, and the steering wheel angle is clockwise, it is determined that the behavior type corresponding to the training data is a sharp right turn; If the maximum speed change value of the training data is greater than the first preset value, the maximum direction change value is greater than the second preset value, and the steering wheel angle is counterclockwise, it is determined that the behavior type corresponding to the training data is a sharp left turn; If the acceleration of the training data is greater than or equal to the third preset value, and the speed changes from small to large, it is determined that the behavior type corresponding to the training data is rapid acceleration; If the acceleration of the training data is greater than or equal to the third preset value, and the speed changes from large to small, it is determined that the behavior type corresponding to the training data is a sudden deceleration; If the acceleration of the training data is greater than or equal to a fourth preset value, and the speed changes from a non-zero value to 0, it is determined that the behavior type corresponding to the training data is emergency braking.
6. The method according to claim 1, characterized in that Before obtaining the plurality of pieces of data to be classified, the method further includes: Acquire a second training data set, wherein the second training data set includes a plurality of training behavior type sequences and training driving style sequences corresponding to the plurality of training behavior type sequences; The hidden Markov model to be trained is trained based on the second training data set to obtain the hidden Markov model.
7. The method according to claim 6, characterized in that The obtaining of the second training data set comprises: Acquire multiple groups of data to be identified, each group of the data to be identified includes multiple reference data, the multiple reference data are arranged in descending order according to the acquisition time, and each reference data includes the speed, acceleration, steering wheel angle and position information of the vehicle; Inputting the plurality of groups of to-be-recognized data into the classification model respectively to obtain the plurality of training behavior type sequences, each of the training behavior type sequences including a plurality of behavior types, and each behavior type corresponding to one of the reference data; The training driving style sequence is obtained based on the preset second definition rule and the plurality of training behavior type sequences.
8. The method according to claim 7, characterized in that The second definition rule includes: If the maximum speed change value or the maximum direction change value in the reference data corresponding to the behavior type does not exceed the corresponding first threshold, determining that the driving style corresponding to the behavior type is cautious; If the maximum speed change value or the maximum direction change value in the reference data corresponding to the behavior type does not exceed the corresponding second threshold, determining that the driving style corresponding to the behavior type is a mild type; If the maximum speed change value or the maximum direction change value in the reference data corresponding to the behavior type does not exceed the corresponding third threshold, it is determined that the driving style corresponding to the behavior type is aggressive, the first threshold is less than the second threshold, and the second threshold is less than the third threshold.
9. A simulation device, characterized in that: including one or more processors and memory; One or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, wherein when the program code is run, the method according to any one of claims 1 to 8 is executed.
Citation Information
Patent Citations
Construction method of simulated traffic flow and simulation equipment
CN114091223A
Automatic driving risk prediction method and device, storage medium and electronic equipment
CN115688254A
Automatic driving simulation test scene generation method introducing driver style
CN115952734A
Scene generation method based on deep learning heterogeneous driver model
CN116108669A
System and method for training a machine learning model deployed on a simulation platform
US20190318267A1
