Driving behavior prediction method and device, computer device, and storage medium
By acquiring and labeling driving behavior sample sets, a driving behavior prediction model is trained, which solves the problem that existing technologies do not consider driver behavior characteristics and achieves more accurate driving behavior prediction and assisted driving.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DATUO (SHANDONG) INTERNET OF THINGS TECH CO LTD
- Filing Date
- 2023-01-04
- Publication Date
- 2026-07-03
Smart Images

Figure CN116022154B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a driving behavior prediction method, device, computer equipment, and storage medium. Background Technology
[0002] With the development of computer technology, the application of intelligent driving technology has gradually become more widespread. Intelligent driving mainly includes three aspects: network navigation, autonomous driving, and human intervention. Among them, network navigation is dedicated to locating the user and planning the route; autonomous driving mainly involves automatically controlling the vehicle's movement through an onboard intelligent system; and human intervention refers to providing intelligent prompts to the driver to assist them in driving.
[0003] In current scenarios involving human intervention in intelligent driving, the typical approach involves collecting road condition images and then providing intelligent prompts based on those images. While driving itself can be described in text, it also contains a wealth of behavioral characteristics; however, current intelligent driving technologies do not consider these characteristics. Summary of the Invention
[0004] The purpose of this application is to propose a driving behavior prediction method, device, computer equipment, and storage medium to realize intelligent driving from a new dimension.
[0005] To address the aforementioned technical problems, this application provides a driving behavior prediction method, which employs the following technical solution:
[0006] Obtain the driving behavior sample set corresponding to each driving path. Each driving behavior sample in the driving behavior sample set includes a sampling timestamp and driving behavior.
[0007] For each driving path, a driving behavior sample set is defined based on the sampling timestamp, and a driving behavior label is determined for each driving behavior sample in the driving behavior sample set.
[0008] Each driving behavior sample in the driving behavior sample set is input into the initial driving behavior prediction model to obtain the driving behavior prediction result corresponding to each driving behavior sample.
[0009] The prediction error is calculated based on the driving behavior prediction results and driving behavior labels corresponding to each driving behavior sample.
[0010] The initial driving behavior prediction model is adjusted based on the prediction error until the prediction error meets the training stop condition to obtain a driving behavior prediction model, which corresponds to the driving path corresponding to the driving behavior sample set.
[0011] Obtain the driving sample set and the current driving sample;
[0012] The driving path corresponding to the driving sample set is determined, and the driving sample is input into the driving behavior prediction model corresponding to the driving path to obtain the driving behavior prediction result, so as to remind the driver to drive the vehicle.
[0013] To address the aforementioned technical problems, this application also provides a driving behavior prediction device, which employs the following technical solution:
[0014] The sample set acquisition module is used to acquire the driving behavior sample set corresponding to each driving path. Each driving behavior sample in the driving behavior sample set includes a sampling timestamp and driving behavior.
[0015] The label determination module is used to determine the driving behavior label corresponding to each driving behavior sample in the driving behavior sample set based on the sampling timestamp for each driving path.
[0016] The sample input module is used to input each driving behavior sample in the driving behavior sample set into the initial driving behavior prediction model to obtain the driving behavior prediction result corresponding to each driving behavior sample.
[0017] The error calculation module is used to calculate the prediction error based on the driving behavior prediction results and driving behavior labels corresponding to each driving behavior sample.
[0018] The model adjustment module is used to adjust the initial driving behavior prediction model according to the prediction error until the prediction error meets the training stop condition to obtain the driving behavior prediction model, which corresponds to the driving path corresponding to the driving behavior sample set.
[0019] The sample acquisition module is used to acquire the driving sample set and the current driving sample;
[0020] The behavior prediction module is used to determine the driving path corresponding to the driving sample set, and input the driving sample into the driving behavior prediction model corresponding to the driving path to obtain the driving behavior prediction result, so as to remind the driver to drive the vehicle.
[0021] To address the aforementioned technical problems, this application also provides a computer device, which includes a memory and a processor. The memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the driving behavior prediction method described above.
[0022] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the steps of the driving behavior prediction method described above.
[0023] Compared with the prior art, the embodiments of this application have the following main advantages: They obtain driving behavior sample sets corresponding to each driving path. Each driving behavior sample in the sample set is generated by sampling when the vehicle is driving on the driving path, including a sampling timestamp and driving behavior. The sampling timestamp reflects the chronological order of sampling time. For each driving behavior sample in the driving behavior sample set, based on the sampling timestamp, the driving behavior of its next driving behavior sample is determined as its driving behavior label. Each driving behavior sample in the sample set is input into an initial driving behavior prediction model to obtain driving behavior prediction results. The prediction error is calculated based on the driving behavior prediction results and driving behavior labels. The model is adjusted based on the prediction error until the prediction error meets the training stopping condition, thus obtaining a driving behavior prediction model corresponding to the driving path. In application, the driving sample set and the latest driving samples are obtained. The driving path corresponding to the driving sample set is determined, and the driving samples are input into the driving behavior prediction model corresponding to the driving path to obtain driving behavior prediction results. This application realizes the prediction of subsequent driving behaviors based on the current driving behavior according to a specific driving path, thereby assisting the driver in driving. Attached Figure Description
[0024] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;
[0026] Figure 2 This is a flowchart of an embodiment of the driving behavior prediction method according to this application;
[0027] Figure 3 This is a schematic diagram of one embodiment of the driving behavior prediction device according to this application;
[0028] Figure 4 This is a schematic diagram of the structure of one embodiment of the computer device according to this application. Detailed Implementation
[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.
[0030] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0031] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0032] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0033] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.
[0034] Terminal devices 101, 102, and 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), laptops, and desktop computers, etc.
[0035] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on terminal devices 101, 102, and 103.
[0036] It should be noted that the driving behavior prediction method provided in this application embodiment is generally executed by a terminal device, and correspondingly, the driving behavior prediction device is generally installed in the terminal device.
[0037] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0038] Continue to refer to Figure 2 A flowchart of an embodiment of the driving behavior prediction method according to this application is shown. The driving behavior prediction method includes the following steps:
[0039] Step S201: Obtain the driving behavior sample set corresponding to each driving path. Each driving behavior sample in the driving behavior sample set includes a sampling timestamp and driving behavior.
[0040] In this embodiment, the driving behavior prediction method operates on an electronic device (e.g., Figure 1 The terminal device shown can communicate via wired or wireless connection. It should be noted that the aforementioned wireless connection methods may include, but are not limited to, 3G / 4G / 5G connections, WiFi connections, Bluetooth connections, WiMAX connections, Zigbee connections, UWB (ultrawideband) connections, and other currently known or future known wireless connection methods.
[0041] Specifically, this application predicts driving behavior based on specific driving routes. Multiple driving routes can be set based on specific starting points and ending points. For example, when a user A drives from home to work, they can choose different driving routes based on traffic, weather, and other conditions, but ultimately there are several common driving routes to choose from.
[0042] Each driving path corresponds to a driving behavior sample set, which contains multiple driving behavior samples. Each driving behavior sample includes a sampling timestamp and the driving behavior itself. All driving behavior samples in the driving behavior sample set can cover the driving path corresponding to the driving behavior sample set. When the vehicle is driving on the driving path, the intelligent driving system in the vehicle will periodically acquire the user's driving behavior. Therefore, each driving behavior corresponds to a sampling timestamp, which can include the sampling time point or record the specific time point at which the sampling was performed.
[0043] This application specifies the following vehicle speed behaviors: starting, stopping, short acceleration, normal, long acceleration, light braking, and emergency braking, and specifies the following vehicle directional behaviors: left turn, normal, and right turn. The combination of vehicle speed behaviors and vehicle directional behaviors constitutes driving behavior. It can be understood that there are 7 × 3, or a total of 21 types of driving behaviors.
[0044] Furthermore, before step S201, the method may further include: for each driving path, acquiring the vehicle speed behavior and vehicle direction behavior at each sampling timestamp while the vehicle is driving on the driving path, wherein the vehicle speed behavior is determined based on the vehicle's speed and acceleration; determining the driving behavior corresponding to each sampling timestamp based on the acquired vehicle speed behavior and vehicle direction behavior; generating each driving behavior sample based on each sampling timestamp and its corresponding driving behavior, and generating a driving behavior sample set corresponding to the driving path based on each driving behavior sample.
[0045] Specifically, for each preset driving path, the vehicle speed behavior and vehicle direction behavior at each sampling timestamp are obtained when the vehicle is driving on the driving path. The time point when the vehicle starts from the starting point is recorded as the zero point of time. At this time, the sampling timestamp represents the interval between the sampling time point and the zero point of time.
[0046] This application defines the following vehicle speed behaviors: starting, stopping, short acceleration, normal, long acceleration, light braking, and emergency braking, specifically as follows: 1. Vehicle starting behavior: refers to the behavior of a vehicle starting from its destination or increasing its speed from zero when the traffic light turns green. 2. Vehicle stopping behavior: refers to the normal deceleration and stopping of a vehicle upon reaching its destination or encountering a red light, etc. 3. Normal vehicle behavior: refers to a vehicle whose initial speed is not 0 km / h, whose acceleration is less than a certain threshold, and whose steering wheel turns left or right by less than a certain angle. 4. Vehicle short acceleration behavior: refers to a vehicle whose initial speed is not 0 km / h, whose acceleration is greater than a certain threshold, and whose acceleration time is less than a certain time T (T = 2s). 5. Vehicle long acceleration behavior: refers to a vehicle whose initial speed is not 0 km / h, whose acceleration is greater than a certain threshold, and whose acceleration time is greater than a certain time T (T = 2s). 6. Light braking behavior: refers to a vehicle whose absolute deceleration is less than a certain threshold. 7. Emergency braking behavior: refers to stopping at maximum deceleration when encountering a sudden situation.
[0047] Intelligent driving systems acquire acceleration parameters through accelerometers. An accelerometer is a sensor capable of measuring acceleration and typically consists of a mass block, a damper, an elastic element, a sensitive element, and an adaptation circuit. During vehicle operation, the accelerometer measures the inertial force acting on the mass block and obtains the acceleration value using Newton's second law. This application determines vehicle speed behavior based on Table 1, where v0 is the initial vehicle velocity and v1 is the final vehicle velocity.
[0048] Vehicle speed behavior <![CDATA[Magnitude of acceleration (m / s 2 )]]> Start <![CDATA[v0=0m / s,0<a≤1.1]]> parking <![CDATA[v0≠0m / s,0>a≥-1.5,v1=0m / s]]> Short acceleration <![CDATA[v0≠0m / s,a≥1.5,2s>t>0s]]> normal <![CDATA[v0≠0m / s,0<a<1.5]]> Long acceleration <![CDATA[v0≠0m / s,a>1.5,t>2s]]> Light braking <![CDATA[v0≠0m / s,0>a>-1.5,v1≠0m / s]]> Emergency braking <![CDATA[v0≠0m / s,a<-1.5,v1=0m / s]]>
[0049] Table 1
[0050] This application specifies the following vehicle directional behaviors: left turn, normal turn, and right turn. The intelligent driving system acquires the steering wheel angle using a steering angle signal collector. The collector generates pulse signals based on the rotation of the steering column and sends these pulse signals to a steering angle signal processor. The processor counts the received pulse signals and calculates the corresponding steering wheel angle based on the count, sending this result to the intelligent driving system. The intelligent driving system obtains and records the steering wheel rotation angle data based on the count. This application determines vehicle directional behavior based on Table 2.
[0051] Vehicle directional behavior Steering wheel angle Turn left α<-45° normal -45°≤α≤45° Turn right α>45°
[0052] Table 2
[0053] Based on vehicle speed behavior and vehicle direction behavior, this application constructs a driving behavior table, as shown in Table 3. The output values of the acceleration sensor and the corner signal collector are sampled at each sampling timestamp, and then the driving behavior corresponding to each sampling timestamp is determined by querying the driving behavior table.
[0054]
[0055] Table 3
[0056] Based on each sampling timestamp and its corresponding driving behavior, a driving behavior sample is generated, and a driving behavior sample set corresponding to the driving path is generated based on each driving behavior sample. This application requires pre-generating a driving behavior sample set for each driving path.
[0057] It is understandable that multiple driving behavior sample sets can exist for each driving route, avoiding the limitations of a single driving behavior sample set. Alternatively, after the driving behavior sample set is collected, it can be corrected to ensure the accuracy of the data.
[0058] This application samples a driving behavior sample every 30 seconds (the time is relative to the time the vehicle starts from the starting point A) on a specific driving path, such as driving path A->B. Table 4 is an example of a driving behavior sample set for a certain driving path in one embodiment. Table 4 also includes the vehicle's acceleration and steering wheel angle.
[0059] time <![CDATA[Acceleration (m / s 2 )]]> Steering wheel angle (degrees) Driving behavior 00:00:00 0.5 -50 Behavior 0 00:00:30 1.5 -22 Behavior 10 00:01:00 1.3 13 Behavior 9 00:01:30 0.2 -22 Behavior 9 ... ... ... ...
[0060] Table 4
[0061] In this embodiment, for each driving path, the vehicle speed behavior and vehicle direction behavior at each sampling timestamp are obtained when the vehicle is driving on the driving path. Based on the vehicle speed behavior and vehicle direction behavior, the driving behavior corresponding to each sampling timestamp is determined, thereby generating each driving behavior sample. Based on each driving behavior sample, a driving behavior sample set corresponding to the driving path is generated to prepare data for model training.
[0062] Step S202: For each driving path corresponding to the driving behavior sample set, based on the sampling timestamp, determine the driving behavior label corresponding to each driving behavior sample in the driving behavior sample set.
[0063] Furthermore, the steps described above for determining the driving behavior label corresponding to each driving behavior sample in the driving behavior sample set based on the sampling timestamp may include: for each driving behavior sample, obtaining the sampling timestamp in the driving behavior sample; determining the subsequent timestamp corresponding to the sampling timestamp; in the driving behavior sample set, finding the driving behavior sample that matches the subsequent timestamp as the subsequent sample; and determining the driving behavior in the subsequent sample as the driving behavior label corresponding to the driving behavior sample.
[0064] Specifically, for each driving behavior sample, the sampling timestamp of the driving behavior sample is obtained. Since each driving behavior sample is obtained through timed sampling, the sampling timestamp can be used to determine the sampling order of each driving behavior sample, i.e., the chronological order, thereby connecting the driving behavior samples together.
[0065] Based on the sampling timestamp in the current driving behavior sample, its corresponding subsequent timestamp can be determined. In the driving behavior sample set, a driving behavior sample that matches the subsequent timestamp is found and identified as the subsequent sample. It can be understood that the sampling timestamp in the subsequent sample is the same as the subsequent timestamp. The driving behavior in the subsequent sample is identified as the driving behavior label corresponding to the driving behavior sample, thereby obtaining the label corresponding to the driving behavior prediction result of the driving behavior sample.
[0066] For example, suppose a driving behavior sample is generated by sampling every 30 seconds. The sampling timestamp of driving behavior sample A is 00:00:30, and the timestamp of the next adjacent driving behavior sample B is 00:01:00. 00:01:00 is the successor timestamp of 00:00:30. Driving behavior sample B is a successor sample of driving behavior sample A. If the driving behavior in driving behavior sample B is driving behavior 11, then driving behavior 11 will be used as the label data of driving behavior sample A.
[0067] In this embodiment, for each driving behavior sample, the sampling timestamp in the driving behavior sample is obtained, and the subsequent timestamp corresponding to the sampling timestamp is determined. The order of each driving behavior sample can be determined by the sampling timestamp. Therefore, the driving behavior sample that matches the subsequent timestamp can be found as the subsequent sample, and the driving behavior corresponding to it can be determined as the driving behavior label corresponding to the driving behavior sample, so that subsequent error calculation and model training can continue.
[0068] Step S203: Input each driving behavior sample in the driving behavior sample set into the initial driving behavior prediction model to obtain the driving behavior prediction result corresponding to each driving behavior sample.
[0069] Specifically, for each driving behavior sample set corresponding to a driving path, each driving behavior sample in the driving behavior sample set is input into the initial driving behavior prediction model. The initial driving behavior prediction model can integrate the information in each driving behavior sample according to the sampling timestamp and make predictions for each driving behavior sample. This prediction is to predict the driving behavior after the sampling timestamp in the driving behavior sample and output the driving behavior prediction results corresponding to each driving behavior sample.
[0070] Step S204: Calculate the prediction error based on the prediction results and driving behavior labels corresponding to each driving behavior sample.
[0071] Specifically, each driving behavior sample already has a driving behavior prediction result and a driving behavior label. The driving behavior prediction result is the model's prediction of the next driving behavior, and the driving behavior label is the true value of the next driving behavior. The prediction error can be calculated based on both.
[0072] Step S205: Adjust the initial driving behavior prediction model according to the prediction error until the prediction error meets the training stop condition to obtain the driving behavior prediction model, which corresponds to the driving path corresponding to the driving behavior sample set.
[0073] Specifically, with the goal of reducing prediction error, the model parameters of the initial driving behavior prediction model are adjusted. After the parameter adjustment, iterative training is performed based on the driving behavior sample set until the newly calculated prediction error meets the training stopping condition, at which point training stops and the driving behavior prediction model is obtained. The training stopping condition can be that the prediction error is less than a preset error threshold.
[0074] It can be understood that a driving behavior prediction model corresponds to a driving path corresponding to a set of driving behavior samples. When there are multiple driving paths, there are multiple sets of driving behavior samples, requiring the training of multiple driving behavior prediction models. There is a single chain correspondence between driving paths, sets of driving behavior samples, and driving behavior prediction models.
[0075] Step S206: Obtain the driving sample set and the current driving sample.
[0076] Specifically, when applying the model, a driving sample set and the current driving sample are acquired. The driving sample set is a collection of samples obtained from the driver's current driving activity, sampled according to a preset sampling timestamp. The driving sample set contains multiple driving samples, each with a sampling timestamp and driving behavior. The driving sample generated during driving behavior prediction is recorded as the current driving sample, which is the most recent driving sample.
[0077] The current driving sample may or may not come from the driving sample set. For example, if the driving sample set contains 10 driving samples, the 10th driving sample can be used as the current driving sample, and driving behavior prediction can start from the 10th driving sample. Alternatively, the 11th driving sample can be used as the current driving sample, and driving behavior prediction can start from the 11th driving sample.
[0078] Step S207: Determine the driving path corresponding to the driving sample set, and input the driving sample into the driving behavior prediction model corresponding to the driving path to obtain the driving behavior prediction result, so as to remind the driver to drive the vehicle.
[0079] Specifically, the driving sample set is compared with each driving behavior sample set. Since the number of samples in the driving sample set and each driving behavior sample set may be different, the comparison is only performed within the same sampling timestamp range to determine the driving behavior sample set most similar to the driving sample set. The driving path corresponding to the driving behavior sample set is taken as the driving path corresponding to the driving sample set, and the driving behavior prediction model corresponding to the driving path is obtained.
[0080] The current driving sample is then input into the driving behavior prediction model, which processes the sample and predicts the driving behavior that may be required next in the current driving path, thus obtaining the driving behavior prediction result.
[0081] Intelligent driving systems can transmit driving behavior predictions to the driver via voice and / or images to provide reminders. Alternatively, they can automatically control the vehicle based on the driving behavior predictions.
[0082] Furthermore, the driving sample set contains multiple driving samples. The steps for determining the driving path corresponding to the driving sample set may include: calculating the similarity coefficient between the driving sample set and each driving behavior sample set based on the driving samples and driving behavior samples; selecting the driving behavior sample set corresponding to the maximum similarity coefficient; and determining the driving path corresponding to the selected driving behavior sample set as the driving path corresponding to the driving sample set.
[0083] Specifically, the driving sample set contains multiple driving samples. Based on the sampling timestamps of these driving samples, multiple driving behavior samples can be obtained accordingly. Then, the similarity coefficient between the driving sample set and each driving behavior sample set can be calculated.
[0084] This application uses the Jaccard similarity coefficient, which represents the intersection-union ratio of two sets, as shown in formula (1):
[0085]
[0086] Here, A represents the driving sample set, and B represents the driving behavior sample set. Since this application provides a standardized definition of driving behavior, all driving behaviors are included in the driving behavior table in Table 3. The Jaccard similarity coefficient between driving sample set A and driving behavior sample set B can be calculated through comparison.
[0087] Select the driving behavior sample set corresponding to the maximum similarity coefficient, and determine the driving path corresponding to the selected driving behavior sample set as the driving path corresponding to the driving sample set.
[0088] In this embodiment, the driving sample set contains multiple driving samples. By comparing the driving samples and driving behavior samples, the similarity coefficient between the driving sample set and each driving behavior sample set is calculated. The driving behavior sample set corresponding to the largest similarity coefficient is selected, and its corresponding driving path is determined as the driving path corresponding to the driving sample set, thereby determining the current driving path. Thus, the corresponding driving behavior prediction model can be selected for driving behavior prediction.
[0089] In this embodiment, a driving behavior sample set corresponding to each driving path is obtained. Each driving behavior sample in the sample set is generated by sampling when the vehicle is driving on the driving path, including a sampling timestamp and driving behavior. The sampling timestamp reflects the chronological order of sampling time. For a driving behavior sample in the driving behavior sample set, based on the sampling timestamp, the driving behavior of the next driving behavior sample is determined as its driving behavior label. Each driving behavior sample in the sample set is input into an initial driving behavior prediction model to obtain a driving behavior prediction result. The prediction error is calculated based on the driving behavior prediction result and the driving behavior label. The model is adjusted based on the prediction error until the prediction error meets the training stopping condition, thus obtaining a driving behavior prediction model corresponding to the driving path. In application, a driving sample set and the latest driving sample are obtained. The driving path corresponding to the driving sample set is determined, and the driving sample is input into the driving behavior prediction model corresponding to the driving path to obtain a driving behavior prediction result. This application realizes the prediction of the next driving behavior based on the current driving behavior based on a specific driving path, thereby assisting the driver in driving.
[0090] Furthermore, the initial driving behavior prediction model includes an encoding model, a temporal modeling network, a normalization network, and an activation function. The steps described above, which involve inputting each driving behavior sample from the driving behavior sample set into the initial driving behavior prediction model to obtain the driving behavior prediction result corresponding to each driving behavior sample, may include: inputting each driving behavior sample from the driving behavior sample set into the encoding model to obtain the sample encoding corresponding to each driving behavior sample; inputting each sample encoding into the temporal modeling network to obtain the temporal modeling result corresponding to each driving behavior sample; inputting each temporal modeling result into the normalization network to obtain the normalization result corresponding to each driving behavior sample; and inputting each normalization result into the activation function to obtain the driving behavior prediction result corresponding to each driving behavior sample.
[0091] Specifically, the initial driving behavior prediction model can be composed of multiple models / networks, including encoding models, temporal modeling networks, normalization networks, and activation functions.
[0092] First, each driving behavior sample in the driving behavior sample set is input into the encoding model for encoding processing to obtain the sample code corresponding to each driving behavior sample. The sample code represents the information in the driving behavior sample in the form of a vector.
[0093] Furthermore, the steps described above, which involve inputting each driving behavior sample in the driving behavior sample set into the encoding model to obtain the sample code corresponding to each driving behavior sample, may include: for each driving behavior sample in the driving behavior sample set, generating sample text of the driving behavior sample, the sample text including timestamp text and behavior text arranged in a fixed format; for each character in the sample text, generating character vectors, position vectors, and segment vectors of the character based on the character vector matrix, position vector matrix, and segment vector matrix in the encoding model; summing the character vectors, position vectors, and segment vectors of the character to obtain the character vector of the character, and generating the sample vector of the driving behavior sample based on the character vector of each character; and inputting each sample vector into the encoding network in the encoding model to obtain the sample code corresponding to each driving behavior sample.
[0094] Specifically, for each driving behavior sample in the driving behavior sample set, a sample text of the driving behavior sample is generated. The sample text represents the information in the driving behavior sample in a fixed format. It can include timestamp text and behavior text, where the timestamp text is used to represent the sampling timestamp in the driving behavior sample, and the behavior text is used to represent the driving behavior in the driving behavior sample.
[0095] The encoding model in this application includes an encoding network, which performs the final encoding. This encoding network can be built based on the MacBERT model, a variant of BERT. MacBERT is a large-scale pre-trained model for word vectors, generating more accurate word vectors with richer information. In MacBERT, the input sequence contains "[CLS]" and "[SEP]" at both ends, and their IDs in the dictionary are fixed. Typically, "[CLS]" is used as the semantic representation of the entire sentence for classification. "[SEP]" is used to separate the two sentences in the input sequence, distinguishing their composition. Therefore, the driving behavior sample needs to be reconstructed to fit the MacBERT input. Assuming the driving behavior sample is: "0:10:30, Behavior Nine", the reconstructed sample text would be: "[CLS]0:10:30 [SEP]Behavior Nine".
[0096] The sample text contains multiple characters. For example, in the above "[CLS]0:10:30[SEP]behavior 9", including [CLS] and [SEP], there are a total of 12 characters. This application requires generating a character vector, position vector, and segment vector for each character separately.
[0097] The encoding model can determine the unique identifier (ID) of a character by querying a pre-defined vocabulary (vocab). Each character has a different identifier. Then, based on the ID, a corresponding one-hot encoding (q) is constructed. tokenThe encoding model has a word vector matrix W. token Randomly initialize the word vector matrix W token q in one-hot representation token With the character vector matrix W token Multiplying them together yields the currently initialized word vector E. token The specific calculation formula is as follows:
[0098] E i token =W token ·q token ,i∈[1,n] (2)
[0099] The calculation of position vectors is similar to that of word vectors; it also involves initializing the position vector matrix W in the encoding model. pos For the position of each character, one-hot encoding is used to obtain n. pos Position vector matrix W pos One-hot representation of character position n pos Multiplication yields the character's position vector E. pos The specific calculation formula is as follows:
[0100] E i pos =W pos ·n i pos ,i∈[1,n] (3)
[0101] This application segments the timestamp text and the behavior text, then concatenates them to obtain the sample text. The segment vector is used to distinguish whether a character belongs to the timestamp text or the behavior text. First, the segment vector matrix W in the encoding model... seg During initialization, the timestamp text and action text types can be one-hot encoded. seg Sentence 1 (timestamped text) is represented as 0, and sentence 2 (behavior) is represented as 1. Therefore, the segmented vector is calculated as follows:
[0102] E i seg =W seg ·n i seg ,i∈[1,n] (4)
[0103] The character vector, position vector, and segment vector of each character are summed to obtain the character vector of the character:
[0104]
[0105] Based on the character vectors of each character in the sample text, a sample vector of the driving behavior sample corresponding to the sample text can be generated. For example, the sample vector can be obtained by adding the character vectors of each character, or by using the matrix formed by the character vectors of each character as the sample vector.
[0106] Then, the sample vectors of each driving behavior sample are input into the encoding network in the encoding model to obtain the sample codes corresponding to each driving behavior sample.
[0107] In this embodiment, sample text of driving behavior samples is first generated, and then the character vector, position vector and segment vector of each character in the sample text are generated. The character vector, position vector and segment vector of the character are accumulated to obtain the character vector of the character. This fully integrates the information of each dimension of the character, improves the accuracy of the character vector representation, thereby improving the accuracy of the sample vector of the driving behavior sample generated from the character vector, and improving the accuracy of the information representation of the final sample encoding.
[0108] After obtaining the sample codes, each sample code is input into the temporal modeling network. Since the driving behavior samples contain sampling timestamps, each driving behavior sample is data with contextual features, or in other words, temporal features, which are naturally included in the sample codes. Therefore, the temporal features and contextual information in the sample codes can be learned through the temporal modeling network.
[0109] In one embodiment, the temporal modeling network can be a Bi-LSTM (Bi-directional Long Short-Term Memory) network, which can acquire and integrate forward and backward text information. A Bi-LSTM network comprises one forward LSTM network and one backward LSTM network. Each LSTM network contains multiple LSTM units, which are composed of forget gates, memory gates, cell state gates, and output gates. The gating mechanism filters information from the neuron states to transmit useful information, and the hidden layer state is output at each time step. This application uses a Bi-LSTM network, combining the forward and backward LSTM networks to connect the hidden layer representations from both directions, obtaining the final context-relevant representation, which contains more feature information from the input text, and outputs the temporal modeling result for each driving behavior sample.
[0110] The temporal modeling results of each driving behavior sample are input into the normalization network. The normalization network CLN (Conditional Layer Normalization) can achieve conditional hierarchical normalization, which is a method of data processing. The normalization network will output the normalized processing results of each driving behavior sample.
[0111] The Common Linear Network (CLN) can distribute data as much as possible in the linear region, avoiding the saturation region and thus preventing the gradient vanishing problem. Text data often involves padding operations, so CLN is used for normalization. Time and behavior are used as conditional information for prediction. Based on CLN, the conditional information is further fused to improve the prediction accuracy.
[0112] The normalization results are then input into an activation function, which can be a sigmoid function. For each driving behavior, a corresponding sigmoid function can be set to output the model's prediction for that behavior. The output of the sigmoid function is a probability value for the behavior; if the probability value is greater than a preset threshold, it is set to 1, indicating that the corresponding driving behavior is predicted to occur; otherwise, it is set to 0, indicating that the corresponding driving behavior is predicted not to occur. The prediction of driving behavior is represented as follows:
[0113] P(y j ) = Sigmoid(W result ·G+b result (6)
[0114] Where, P(y j W represents the probability value of the i-th driving behavior. result Let G represent the trainable weights, G represent the temporal modeling result of the i-th driving behavior sample, and b represent the trainable weights. result This represents the trainable bias.
[0115] In this embodiment, each driving behavior sample is input into an encoding model to obtain sample codes, thereby realizing the vectorized representation of the driving behavior samples. Each sample code is then input into a temporal modeling network to learn the contextual representation in the samples, resulting in temporal modeling results for each driving behavior sample. Each temporal modeling result is then input into a normalization network to obtain normalization processing results for each driving behavior sample, further fusing time and behavior to improve prediction accuracy. Finally, each normalization processing result is input into an activation function to obtain driving behavior prediction results for each driving behavior sample, thus accurately completing the driving behavior prediction.
[0116] Furthermore, the steps described above for adjusting the initial driving behavior prediction model based on the prediction error may include: adjusting the parameters of the encoding model, the temporal modeling network, and the normalization network in the initial driving behavior prediction model with the goal of reducing the prediction error.
[0117] Specifically, the parameters of the initial driving behavior prediction model are adjusted with the goal of reducing prediction error. The initial driving behavior prediction model includes an encoding model, a temporal modeling network, and a normalization network. Each adjustment simultaneously modifies the parameters of the encoding model, the temporal modeling network, and the normalization network. The encoding model further includes a word vector matrix, a position vector matrix, a segmented vector matrix, and the encoding network. When adjusting the parameters of the encoding model, the parameters of the word vector matrix, the position vector matrix, the segmented vector matrix, and the encoding network are adjusted simultaneously.
[0118] In this embodiment, the adjustment direction is to reduce the prediction error. At the same time, the parameters of the encoding model, the temporal modeling network and the normalization network in the initial driving behavior prediction model are adjusted to ensure the correctness of the parameter adjustment and improve the accuracy of the final driving behavior prediction model.
[0119] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When executed, the program can include the processes of the embodiments of the above methods. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).
[0120] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0121] Further reference Figure 3 As a response to the above Figure 2 The present application provides an embodiment of a driving behavior prediction device, which is similar to the method shown. Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0122] like Figure 3As shown, the driving behavior prediction device 300 described in this embodiment includes: a sample set acquisition module 301, a label determination module 302, a sample input module 303, an error calculation module 304, a model adjustment module 305, a sample acquisition module 306, and a behavior prediction module 307, wherein:
[0123] The sample set acquisition module 301 is used to acquire the driving behavior sample set corresponding to each driving path. Each driving behavior sample in the driving behavior sample set includes a sampling timestamp and driving behavior.
[0124] The label determination module 302 is used to determine the driving behavior label corresponding to each driving behavior sample in the driving behavior sample set based on the sampling timestamp for each driving path;
[0125] The sample input module 303 is used to input each driving behavior sample in the driving behavior sample set into the initial driving behavior prediction model to obtain the driving behavior prediction result corresponding to each driving behavior sample.
[0126] The error calculation module 304 is used to calculate the prediction error based on the driving behavior prediction results and driving behavior labels corresponding to each driving behavior sample.
[0127] The model adjustment module 305 is used to adjust the initial driving behavior prediction model according to the prediction error until the prediction error meets the training stop condition to obtain the driving behavior prediction model, which corresponds to the driving path corresponding to the driving behavior sample set.
[0128] The sample acquisition module 306 is used to acquire the driving sample set and the current driving sample;
[0129] The behavior prediction module 307 is used to determine the driving path corresponding to the driving sample set, and input the driving sample into the driving behavior prediction model corresponding to the driving path to obtain the driving behavior prediction result, so as to remind the driver to drive the vehicle.
[0130] In this embodiment, a driving behavior sample set corresponding to each driving path is obtained. Each driving behavior sample in the sample set is generated by sampling when the vehicle is driving on the driving path, including a sampling timestamp and driving behavior. The sampling timestamp reflects the chronological order of sampling time. For a driving behavior sample in the driving behavior sample set, based on the sampling timestamp, the driving behavior of the next driving behavior sample is determined as its driving behavior label. Each driving behavior sample in the sample set is input into an initial driving behavior prediction model to obtain a driving behavior prediction result. The prediction error is calculated based on the driving behavior prediction result and the driving behavior label. The model is adjusted based on the prediction error until the prediction error meets the training stopping condition, thus obtaining a driving behavior prediction model corresponding to the driving path. In application, a driving sample set and the latest driving sample are obtained. The driving path corresponding to the driving sample set is determined, and the driving sample is input into the driving behavior prediction model corresponding to the driving path to obtain a driving behavior prediction result. This application realizes the prediction of the next driving behavior based on the current driving behavior based on a specific driving path, thereby assisting the driver in driving.
[0131] In some optional implementations of this embodiment, the driving behavior prediction device 300 may further include: a behavior acquisition module, a driving determination module, and a sample set generation module, wherein:
[0132] The behavior acquisition module is used to acquire the vehicle speed behavior and vehicle direction behavior at each sampling timestamp when the vehicle is driving on each driving path. The vehicle speed behavior is determined based on the vehicle's speed and acceleration.
[0133] The driving determination module is used to determine the driving behavior corresponding to each sampling timestamp based on the acquired vehicle speed and direction behavior.
[0134] The sample set generation module is used to generate each driving behavior sample based on each sampling timestamp and its corresponding driving behavior, and to generate the driving behavior sample set corresponding to the driving path based on each driving behavior sample.
[0135] In this embodiment, for each driving path, the vehicle speed behavior and vehicle direction behavior at each sampling timestamp are obtained when the vehicle is driving on the driving path. Based on the vehicle speed behavior and vehicle direction behavior, the driving behavior corresponding to each sampling timestamp is determined, thereby generating each driving behavior sample. Based on each driving behavior sample, a driving behavior sample set corresponding to the driving path is generated to prepare data for model training.
[0136] In some optional implementations of this embodiment, the label determination module 302 may include: a timestamp acquisition submodule, a successor determination submodule, a sample determination submodule, and a label determination submodule, wherein:
[0137] The timestamp acquisition submodule is used to obtain the sampling timestamp of each driving behavior sample.
[0138] The successor determination submodule is used to determine the successor timestamp corresponding to the sampling timestamp.
[0139] The sample determination submodule is used to find driving behavior samples that match subsequent timestamps in the driving behavior sample set as subsequent samples.
[0140] The label determination submodule is used to determine the driving behavior labels corresponding to the driving behavior samples in subsequent samples.
[0141] In this embodiment, for each driving behavior sample, the sampling timestamp in the driving behavior sample is obtained, and the subsequent timestamp corresponding to the sampling timestamp is determined. The order of each driving behavior sample can be determined by the sampling timestamp. Therefore, the driving behavior sample that matches the subsequent timestamp can be found as the subsequent sample, and the driving behavior corresponding to it can be determined as the driving behavior label corresponding to the driving behavior sample, so that subsequent error calculation and model training can continue.
[0142] In some optional implementations of this embodiment, the initial driving behavior prediction model includes an encoding model, a temporal modeling network, a normalization network, and an activation function. Therefore, the sample input module 303 may include: an encoding input submodule, a temporal modeling submodule, a normalization processing submodule, and an activation input submodule, wherein:
[0143] The encoding input submodule is used to input each driving behavior sample in the driving behavior sample set into the encoding model to obtain the sample code corresponding to each driving behavior sample.
[0144] The temporal modeling submodule is used to input the encoding of each sample into the temporal modeling network to obtain the temporal modeling results corresponding to each driving behavior sample.
[0145] The normalization processing submodule is used to input the time series modeling results into the normalization network to obtain the normalization processing results corresponding to each driving behavior sample.
[0146] The activation input submodule is used to input the normalization processing results into the activation function to obtain the driving behavior prediction results corresponding to each driving behavior sample.
[0147] In this embodiment, each driving behavior sample is input into an encoding model to obtain sample codes, thereby realizing the vectorized representation of the driving behavior samples. Each sample code is then input into a temporal modeling network to learn the contextual representation in the samples, resulting in temporal modeling results for each driving behavior sample. Each temporal modeling result is then input into a normalization network to obtain normalization processing results for each driving behavior sample, further fusing time and behavior to improve prediction accuracy. Finally, each normalization processing result is input into an activation function to obtain driving behavior prediction results for each driving behavior sample, thus accurately completing the driving behavior prediction.
[0148] In some optional implementations of this embodiment, the encoding input submodule may include: a text generation unit, a vector generation unit, a sample generation unit, and an encoding input unit, wherein:
[0149] The text generation unit is used to generate sample text for each driving behavior sample in the driving behavior sample set. The sample text includes timestamp text and behavior text arranged in a fixed format.
[0150] The vector generation unit is used to generate the character vector, position vector, and segment vector for each character in the sample text, based on the character vector matrix, position vector matrix, and segment vector matrix in the encoding model.
[0151] The sample generation unit is used to accumulate the character vector, position vector and segment vector of a character to obtain the character vector of the character, and generate the sample vector of the driving behavior sample based on the character vector of each character.
[0152] The encoding input unit is used to input each sample vector into the encoding network in the encoding model to obtain the sample encoding corresponding to each driving behavior sample.
[0153] In this embodiment, sample text of driving behavior samples is first generated, and then the character vector, position vector and segment vector of each character in the sample text are generated. The character vector, position vector and segment vector of the character are accumulated to obtain the character vector of the character. This fully integrates the information of each dimension of the character, improves the accuracy of the character vector representation, thereby improving the accuracy of the sample vector of the driving behavior sample generated from the character vector, and improving the accuracy of the information representation of the final sample encoding.
[0154] In some optional implementations of this embodiment, the model adjustment module 305 can also be used to adjust the parameters of the encoding model, the temporal modeling network, and the normalization network in the initial driving behavior prediction model with the aim of reducing the prediction error.
[0155] In this embodiment, the adjustment direction is to reduce the prediction error. At the same time, the parameters of the encoding model, the temporal modeling network and the normalization network in the initial driving behavior prediction model are adjusted to ensure the correctness of the parameter adjustment and improve the accuracy of the final driving behavior prediction model.
[0156] In some optional implementations of this embodiment, the behavior prediction module 307 may include: a coefficient calculation submodule and a path determination submodule, wherein:
[0157] The coefficient calculation submodule is used to calculate the similarity coefficient between the driving sample set and each driving behavior sample set based on driving samples and driving behavior samples, respectively.
[0158] The path determination submodule is used to select the driving behavior sample set corresponding to the maximum similarity coefficient, and determine the driving path corresponding to the selected driving behavior sample set as the driving path corresponding to the driving sample set.
[0159] In this embodiment, the driving sample set contains multiple driving samples. By comparing the driving samples and driving behavior samples, the similarity coefficient between the driving sample set and each driving behavior sample set is calculated. The driving behavior sample set corresponding to the largest similarity coefficient is selected, and its corresponding driving path is determined as the driving path corresponding to the driving sample set, thereby determining the current driving path. Thus, the corresponding driving behavior prediction model can be selected for driving behavior prediction.
[0160] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0161] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected via a system bus. It should be noted that only the computer device 4 with components 41-43 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0162] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.
[0163] The memory 41 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 4. Of course, the memory 41 may include both the internal storage unit and its external storage device of the computer device 4. In this embodiment, the memory 41 is typically used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions for driving behavior prediction methods. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or will be output.
[0164] In some embodiments, the processor 42 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to execute computer-readable instructions stored in the memory 41 or to process data, such as executing computer-readable instructions for the driving behavior prediction method.
[0165] The network interface 43 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 4 and other electronic devices.
[0166] The computer device provided in this embodiment can execute the driving behavior prediction method described above. The driving behavior prediction method here can be any of the driving behavior prediction methods described in the various embodiments above.
[0167] In this embodiment, a driving behavior sample set corresponding to each driving path is obtained. Each driving behavior sample in the sample set is generated by sampling when the vehicle is driving on the driving path, including a sampling timestamp and driving behavior. The sampling timestamp reflects the chronological order of sampling time. For a driving behavior sample in the driving behavior sample set, based on the sampling timestamp, the driving behavior of the next driving behavior sample is determined as its driving behavior label. Each driving behavior sample in the sample set is input into an initial driving behavior prediction model to obtain a driving behavior prediction result. The prediction error is calculated based on the driving behavior prediction result and the driving behavior label. The model is adjusted based on the prediction error until the prediction error meets the training stopping condition, thus obtaining a driving behavior prediction model corresponding to the driving path. In application, a driving sample set and the latest driving sample are obtained. The driving path corresponding to the driving sample set is determined, and the driving sample is input into the driving behavior prediction model corresponding to the driving path to obtain a driving behavior prediction result. This application realizes the prediction of the next driving behavior based on the current driving behavior based on a specific driving path, thereby assisting the driver in driving.
[0168] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by at least one processor to cause the at least one processor to perform the steps of the driving behavior prediction method described above.
[0169] In this embodiment, a driving behavior sample set corresponding to each driving path is obtained. Each driving behavior sample in the sample set is generated by sampling when the vehicle is driving on the driving path, including a sampling timestamp and driving behavior. The sampling timestamp reflects the chronological order of sampling time. For a driving behavior sample in the driving behavior sample set, based on the sampling timestamp, the driving behavior of the next driving behavior sample is determined as its driving behavior label. Each driving behavior sample in the sample set is input into an initial driving behavior prediction model to obtain a driving behavior prediction result. The prediction error is calculated based on the driving behavior prediction result and the driving behavior label. The model is adjusted based on the prediction error until the prediction error meets the training stopping condition, thus obtaining a driving behavior prediction model corresponding to the driving path. In application, a driving sample set and the latest driving sample are obtained. The driving path corresponding to the driving sample set is determined, and the driving sample is input into the driving behavior prediction model corresponding to the driving path to obtain a driving behavior prediction result. This application realizes the prediction of the next driving behavior based on the current driving behavior based on a specific driving path, thereby assisting the driver in driving.
[0170] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0171] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.
Claims
1. A method for predicting driving behavior, characterized in that, Includes the following steps: Obtain the driving behavior sample set corresponding to each driving path. Each driving behavior sample in the driving behavior sample set includes a sampling timestamp and driving behavior. For each driving path, a driving behavior sample set is defined based on the sampling timestamp, and a driving behavior label is determined for each driving behavior sample in the driving behavior sample set. Each driving behavior sample in the driving behavior sample set is input into the initial driving behavior prediction model to obtain the driving behavior prediction result corresponding to each driving behavior sample. The prediction error is calculated based on the driving behavior prediction results and driving behavior labels corresponding to each driving behavior sample. The initial driving behavior prediction model is adjusted based on the prediction error until the prediction error meets the training stop condition to obtain a driving behavior prediction model, which corresponds to the driving path corresponding to the driving behavior sample set. Obtain the driving sample set and the current driving sample; The driving path corresponding to the driving sample set is determined, and the driving sample is input into the driving behavior prediction model corresponding to the driving path to obtain the driving behavior prediction result, so as to remind the driver to drive the vehicle. The step of determining the driving behavior label corresponding to each driving behavior sample in the driving behavior sample set based on the sampling timestamp includes: For each driving behavior sample, obtain the sampling timestamp in the driving behavior sample; Determine the subsequent timestamp corresponding to the sampling timestamp; In the set of driving behavior samples, find the driving behavior sample that matches the subsequent timestamp as the subsequent sample; The driving behaviors in the subsequent samples are identified as the driving behavior labels corresponding to the driving behavior samples; The driving sample set contains multiple driving samples, and the step of determining the driving path corresponding to the driving sample set includes: Based on driving samples and driving behavior samples, the similarity coefficients between the driving sample set and each driving behavior sample set are calculated respectively. Select the driving behavior sample set corresponding to the maximum similarity coefficient, and determine the driving path corresponding to the selected driving behavior sample set as the driving path corresponding to the driving sample set.
2. The driving behavior prediction method according to claim 1, characterized in that, Before the step of obtaining the driving behavior sample set corresponding to each driving path, the method further includes: For each driving path, the vehicle speed behavior and vehicle direction behavior at each sampling timestamp are obtained when the vehicle is traveling on the driving path, wherein the vehicle speed behavior is determined based on the vehicle's speed and acceleration; Based on the acquired vehicle speed and direction behavior, the driving behavior corresponding to each sampling timestamp is determined. Based on each sampling timestamp and its corresponding driving behavior, a driving behavior sample is generated, and a driving behavior sample set corresponding to the driving path is generated based on each driving behavior sample.
3. The driving behavior prediction method according to claim 1, characterized in that, The initial driving behavior prediction model includes an encoding model, a temporal modeling network, a normalization network, and an activation function. The step of inputting each driving behavior sample from the driving behavior sample set into the initial driving behavior prediction model to obtain the driving behavior prediction result corresponding to each driving behavior sample includes: Each driving behavior sample in the driving behavior sample set is input into the coding model to obtain the sample code corresponding to each driving behavior sample. Each sample code is input into the temporal modeling network to obtain the temporal modeling results corresponding to each driving behavior sample. The time series modeling results are input into the normalization network to obtain the normalization processing results corresponding to each driving behavior sample. The normalization results are input into the activation function to obtain the driving behavior prediction results corresponding to each driving behavior sample.
4. The driving behavior prediction method according to claim 3, characterized in that, The step of inputting each driving behavior sample in the driving behavior sample set into the encoding model to obtain the sample code corresponding to each driving behavior sample includes: For each driving behavior sample in the driving behavior sample set, generate sample text for the driving behavior sample. The sample text includes timestamp text and behavior text arranged in a fixed format. For each character in the sample text, based on the character vector matrix, position vector matrix, and segment vector matrix in the encoding model, the character vector, position vector, and segment vector of the character are generated respectively. The character vector, position vector, and segment vector of the character are summed to obtain the character vector of the character, and the sample vector of the driving behavior sample is generated based on the character vector of each character. Each sample vector is input into the encoding network of the encoding model to obtain the sample encoding corresponding to each driving behavior sample.
5. The driving behavior prediction method according to claim 3, characterized in that, The step of adjusting the initial driving behavior prediction model based on the prediction error includes: With the goal of reducing the prediction error, the parameters of the encoding model, the temporal modeling network, and the normalization network in the initial driving behavior prediction model are adjusted.
6. A driving behavior prediction device, characterized in that, The driving behavior prediction device implements the steps of the driving behavior prediction method as described in any one of claims 1 to 5, wherein the driving behavior prediction device comprises: The sample set acquisition module is used to acquire the driving behavior sample set corresponding to each driving path. Each driving behavior sample in the driving behavior sample set includes a sampling timestamp and driving behavior. The label determination module is used to determine the driving behavior label corresponding to each driving behavior sample in the driving behavior sample set based on the sampling timestamp for each driving path. The sample input module is used to input each driving behavior sample in the driving behavior sample set into the initial driving behavior prediction model to obtain the driving behavior prediction result corresponding to each driving behavior sample. The error calculation module is used to calculate the prediction error based on the driving behavior prediction results and driving behavior labels corresponding to each driving behavior sample. The model adjustment module is used to adjust the initial driving behavior prediction model according to the prediction error until the prediction error meets the training stop condition to obtain the driving behavior prediction model, which corresponds to the driving path corresponding to the driving behavior sample set. The sample acquisition module is used to acquire the driving sample set and the current driving sample; The behavior prediction module is used to determine the driving path corresponding to the driving sample set, and input the driving sample into the driving behavior prediction model corresponding to the driving path to obtain the driving behavior prediction result, so as to remind the driver to drive the vehicle.
7. A computer device comprising a memory and a processor, the memory storing computer-readable instructions, wherein the processor, when executing the computer-readable instructions, implements the steps of the driving behavior prediction method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the driving behavior prediction method as described in any one of claims 1 to 5.