A driving condition construction method, device, electronic device and storage medium
Through the combination of deep clustering algorithms and genetic algorithms, the problem of inaccurate clustering results of traditional clustering algorithms relying on parameter settings and clustering results is solved, and more efficient and accurate driving conditions are achieved.
Patent Information
- Application Number
- CN202411092310.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-08-09
AI Technical Summary
The existing driving conditions construction methods are relatively low. Traditional clustering algorithms require setting parameters. The clustering results depend on parameter selection, making it difficult to obtain good clustering results.
Deep clustering algorithm and genetic algorithm are used to build driving conditions. First, the car driving data is divided into kinematic segment data and feature encoding is performed. Then, the deep clustering algorithm is used to perform clustering operations to obtain the results of kinematic fragment clustering. Finally, the genetic algorithm is used to optimize the clustering results and construct the driving conditions.
Effective aggregation is achieved on data sets of different sizes, and the number of cluster clusters is adjusted by itself, which improves the quality of clustering operations and the accuracy of driving conditions.
Smart Images

Figure CN118965031B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of driving condition construction, and in particular to a driving condition construction method, device, electronic equipment and storage medium. Background Art
[0002] A driving condition is a speed-time curve that reflects the typical driving behavior of a specific vehicle type in a specific area. It can reflect the kinematic characteristics of a car's road driving. It is an important, common basic technology in the automotive industry, the basis for vehicle energy consumption, emission testing and setting limit standards, and the main benchmark for optimizing various performance indicators of a car.
[0003] The existing driving condition construction usually processes the original data into kinematic segments, and then processes the kinematic segments into K clusters by clustering. Each cluster represents a type of condition, and then selects kinematic segments from the K clusters to form a driving condition. For example, at this stage, traditional parameter clustering algorithms and traditional non-parametric clustering methods are used to build driving conditions. Traditional parameter clustering algorithms usually use K-means algorithms or HDBSCAN algorithms to build driving conditions. The use of traditional parameter clustering algorithms requires certain parameters to be set in advance to help complete the clustering task, and the clustering results of traditional parameter clustering algorithms are closely related to the parameter settings. For example, the K-means algorithm needs to set the number of clusters, and the clustering results are very dependent on the choice of K, so it is difficult to obtain a good clustering result. For example, HDBSCAN needs to set the domain radius R and MinPts, and it is also difficult to obtain a good clustering result. Traditional non-parametric clustering algorithms often use spectral clustering algorithms, but the clustering effect of the spectral clustering algorithm depends on the similarity matrix. The final clustering effects obtained by different similarity matrices may be very different. And if there are too many clusters, it is difficult for the spectral clustering algorithm to achieve a good clustering result. Since it is difficult to obtain a good clustering result through the above clustering algorithms, the accuracy of the driving condition construction is low. Summary of the invention
[0004] The present invention provides a driving condition establishment method, a device, an electronic device and a storage medium, which can improve the accuracy of driving condition establishment.
[0005] To achieve the above purpose, the present invention provides a driving condition construction method, comprising:
[0006] Acquire vehicle driving data, and divide the vehicle driving data into kinematic segment data;
[0007] Performing feature encoding on the kinematic segment data to obtain kinematic segment features, and performing clustering operation on the kinematic segment features using a deep clustering algorithm to obtain a kinematic segment clustering result;
[0008] The kinematic segment clustering results are used to construct driving conditions using a genetic algorithm to obtain the driving conditions of the vehicle driving data.
[0009] Optionally, dividing the vehicle driving data into kinematic segment data includes:
[0010] Extracting continuous motion segment data from the vehicle driving data to obtain a motion segment data set;
[0011] Extracting idle segment data from the vehicle driving data according to the speed and the stop time to obtain an idle segment data set;
[0012] The motion segment data set and the idle segment data set are integrated to obtain the kinematic segment data.
[0013] Optionally, the clustering operation of the kinematic segment features using a deep clustering algorithm to obtain a kinematic segment clustering result includes:
[0014] Calculating the soft cluster distribution of the kinematic segment using the clustering network of the deep clustering algorithm to obtain a first soft distribution value, and dividing the kinematic segment into a plurality of segment subclusters according to the first soft distribution value;
[0015] Inputting the first soft distribution value of each fragment sub-cluster of the plurality of fragment sub-clusters into the sub-clustering network of the deep clustering algorithm to calculate the second soft distribution value of each fragment sub-cluster;
[0016] Dividing each fragment subcluster into a plurality of subcluster distributions according to the second soft distribution value, performing splitting and merging operations on the subcluster distributions to obtain updated cluster values;
[0017] The kinematic segments are re-clustered according to the updated cluster values to obtain the kinematic segment clustering results.
[0018] Optionally, before calculating the soft cluster distribution of the kinematic segment using the clustering network of the deep clustering algorithm, the method further includes training the clustering network using a pre-constructed clustering loss formula.
[0019] Optionally, the adopting a pre-constructed clustering loss formula to train the clustering network includes:
[0020] The pre-built clustering loss formula uses the following loss formula:
[0021]
[0022] Among them, L cl is the clustering network loss value, N is the number of samples in the kinematic segment, K is the number of cluster categories, r i is the actual distribution of the clustering network, is the expected distribution of the clustering network, The difference between the actual and expected distributions of the ith kinematic segment.
[0023] Optionally, the clustering results of the kinematic segments are used to construct a driving condition using a genetic algorithm, including:
[0024] Selecting a preset number of groups of clustering results from the kinematic segment clustering results to construct a population set, and constructing an initial driving condition based on the population set;
[0025] Calculating the fitness of each population in the population set according to an error rate formula, and selecting the population with the smallest fitness from the population set as a candidate driving condition according to a tournament selection method;
[0026] Selecting kinematic segments from the candidate driving conditions according to a random selection principle and a crossover operation principle to replace the kinematic segments in the same cluster in the initial driving condition, and calculating the error rate of the replaced driving condition until a minimum error rate of the driving condition is obtained;
[0027] The driving condition with the minimum error rate is used as the driving condition of the vehicle driving data.
[0028] Optionally, selecting kinematic segments from the candidate driving conditions according to a random selection principle and a cross operation principle to replace kinematic segments in the same cluster in the initial driving condition includes:
[0029] Performing a random extraction operation on the kinematic segments in the initial driving condition according to a random extraction principle, and selecting kinematic segments in the same cluster from the candidate driving conditions for replacement;
[0030] And according to the single-point crossover principle in the crossover operation principle, a kinematic segment is randomly selected, and then the kinematic segments after the position of the kinematic segment in the candidate driving condition are exchanged.
[0031] In order to solve the above problems, the present invention further provides a driving condition building device, the device comprising:
[0032] A vehicle driving data processing module is used to obtain vehicle driving data and divide the vehicle driving data into kinematic segment data;
[0033] A kinematic segment clustering module, used for performing feature encoding on the kinematic segment data to obtain kinematic segment features, and performing clustering operation on the kinematic segment features using a deep clustering algorithm to obtain kinematic segment clustering results;
[0034] The driving condition building module is used to build the driving condition of the vehicle driving data by using the genetic algorithm to cluster the kinematic fragments.
[0035] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0036] at least one processor; and,
[0037] a memory communicatively connected to the at least one processor; wherein,
[0038] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the driving condition establishment method described above.
[0039] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned driving condition establishment method.
[0040] The present invention obtains kinematic segment features by feature encoding the kinematic segment data, and clusters the kinematic segment features using a deep clustering algorithm, thereby achieving effective aggregation on data sets of different sizes, thereby achieving excellent aggregation effects. In addition, the deep clustering algorithm can also adjust the number of clustering clusters to meet different clustering scenarios without relying on the limitation of specifying parameters in traditional clustering schemes, thereby improving the quality of aggregation in clustering operations and further improving the accuracy of driving condition construction. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A schematic diagram of a flow chart of a driving condition establishment method provided by an embodiment of the present invention;
[0042] Figure 2 A clustering network model diagram of a deep clustering algorithm of a driving condition building method provided in one embodiment of the present invention;
[0043] Figure 3 An overall flow chart of a preferred embodiment of a driving condition building method provided by an embodiment of the present invention;
[0044] Figure 4 A functional module diagram of a driving condition building device provided by one embodiment of the present invention;
[0045] Figure 5 A schematic diagram of the structure of an electronic device for implementing a driving condition establishment method provided in one embodiment of the present invention.
[0046] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0047] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0048] The embodiment of the present application provides a method for setting up a driving condition. The execution subject of the method for setting up a driving condition includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the method for setting up a driving condition can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0049] Reference Figure 1 FIG. 1 is a flow chart of a driving condition establishment method provided by an embodiment of the present invention. In this embodiment, the driving condition establishment method includes:
[0050] S1. Acquire vehicle driving data, and divide the vehicle driving data into kinematic segment data.
[0051] In the embodiment of the present invention, the vehicle driving data refers to relevant data of the vehicle during the entire driving process collected by a motion recording device, such as acceleration vehicle driving data, deceleration vehicle driving data, or parking waiting data.
[0052] As an embodiment of the present invention, dividing the vehicle driving data into kinematic segment data includes:
[0053] Extracting continuous motion segment data from the vehicle driving data to obtain a motion segment data set;
[0054] Extracting idle segment data from the vehicle driving data according to the speed and the stop time to obtain an idle segment data set;
[0055] The motion segment data set and the idle segment data set are integrated to obtain the kinematic segment data.
[0056] In the embodiment of the present invention, the idle segment data refers to the speed being 0 and the idle time not exceeding 180 seconds. When the speed is 0 and the idle time exceeds 180 seconds, the idle segment data is judged to be abnormal data and cannot be used as kinematic segment data. At this time, the state of the car is a parking state or a damaged state.
[0057] S2. Feature encoding is performed on the kinematic segment data to obtain kinematic segment features, and the kinematic segment features are clustered using a deep clustering algorithm to obtain a kinematic segment clustering result.
[0058] In the embodiment of the present invention, the feature encoding of the kinematic segment data is performed using a deep clustering encoder DEC to convert the kinematic segment data into kinematic segment features.
[0059] In the embodiment of the present invention, the kinematic segment features refer to features that characterize the motion of the vehicle, including but not limited to average speed, maximum speed, driving speed, acceleration, and the like.
[0060] In the embodiment of the present invention, the deep clustering algorithm adopts a deep clustering algorithm that combines a variant of DeepDPM with Divcluster, a loss for controlling cluster diversity.
[0061] As an embodiment of the present invention, the kinematic segment features are clustered using a deep clustering algorithm to obtain a kinematic segment clustering result, including:
[0062] Calculating the soft cluster distribution of the kinematic segment using the clustering network of the deep clustering algorithm to obtain a first soft distribution value, and dividing the kinematic segment into a plurality of segment subclusters according to the first soft distribution value;
[0063] Inputting the first soft distribution value of each fragment sub-cluster of the plurality of fragment sub-clusters into the sub-clustering network of the deep clustering algorithm to calculate the second soft distribution value of each fragment sub-cluster;
[0064] Dividing each fragment subcluster into a plurality of subcluster distributions according to the second soft distribution value, performing splitting and merging operations on the subcluster distributions to obtain updated cluster values;
[0065] The kinematic segments are re-clustered according to the updated cluster values to obtain the kinematic segment clustering results.
[0066] Furthermore, before calculating the soft cluster distribution of the kinematic segment using the clustering network of the deep clustering algorithm, the method further includes training the clustering network using a pre-constructed clustering loss formula.
[0067] As an embodiment of the present invention, the adopting a pre-constructed clustering loss formula to train the clustering network includes:
[0068] The pre-built clustering loss formula uses the following loss formula:
[0069]
[0070] Among them, L cl is the clustering network loss value, N is the number of samples in the kinematic segment, K is the number of cluster categories, r i is the actual distribution of the clustering network, is the expected distribution of the clustering network, The difference between the actual and expected distributions of the ith kinematic segment.
[0071] Furthermore, the The following formula is used to calculate the expected distribution of the clustering network:
[0072]
[0073] Among them, π k is the prior probability of the kth cluster, that is, the proportion of cluster k in all clusters, is a Gaussian distribution at data point x i The probability density function value at k is the mean vector of the kth cluster, ∑ k is the covariance matrix of the kth cluster, It is the weighted sum of the probability density function values of all clusters, and the value of the weighted sum is 1.
[0074] Furthermore, the ∑ k The following Gaussian kernel function is used for calculation:
[0075]
[0076] Among them, K ij is a kinematic segment sample x j and kinematic fragment sample x i is the similarity measure between them, and σ is the parameter of the Gaussian kernel function.
[0077] S3. Using a genetic algorithm to construct a driving condition based on the kinematic segment clustering results, to obtain the driving condition of the vehicle driving data.
[0078] In the embodiment of the present invention, the genetic algorithm refers to an optimization algorithm that simulates the natural evolution process and is used to solve complex optimization problems.
[0079] As an embodiment of the present invention, the kinematic segment clustering results are constructed using a genetic algorithm for driving condition construction, including:
[0080] Selecting a preset number of groups of clustering results from the kinematic segment clustering results to construct a population set, and constructing an initial driving condition based on the population set;
[0081] Calculating the fitness of each population in the population set according to an error rate formula, and selecting the population with the smallest fitness from the population set as a candidate driving condition according to a tournament selection method;
[0082] Selecting kinematic segments from the candidate driving conditions according to a random selection principle and a crossover operation principle to replace the kinematic segments in the same cluster in the initial driving condition, and calculating the error rate of the replaced driving condition until a minimum error rate of the driving condition is obtained;
[0083] The driving condition with the minimum error rate is used as the driving condition of the vehicle driving data.
[0084] Furthermore, the selecting kinematic segments from the candidate driving conditions according to the random selection principle and the cross operation principle to replace the kinematic segments in the same cluster in the initial driving condition includes:
[0085] Performing a random extraction operation on the kinematic segments in the initial driving condition according to a random extraction principle, and selecting kinematic segments in the same cluster from the candidate driving conditions for replacement;
[0086] And according to the single-point crossover principle in the crossover operation principle, a kinematic segment is randomly selected, and then the kinematic segments after the position of the kinematic segment in the candidate driving condition are exchanged.
[0087] In the embodiment of the present invention, in order to solve the problem that the data quality has a great influence on the result in the construction of the driving condition, the constructed driving condition is processed by using the data adjustment method, and the steps of optimizing the error rate are as follows:
[0088] Step 1: Calculate the error rate of the original data, and use the average speed error rate, driving speed error rate, acceleration section average acceleration error rate, deceleration section average acceleration error rate, idle time percentage error rate, acceleration time percentage error rate, deceleration time percentage error rate and uniform speed time percentage error rate to form the total error rate. The formula can be expressed as x i Represents actual characteristics, represents the standard feature, that is, the value obtained for the entire data set;
[0089] Step 2: Randomly select the built driving conditions to perform a small disturbance, which can be expressed as the formula V =
[0090] V+α, α is a random number, which is limited to a set range [-0.05, 0.05];
[0091] Step 3: Calculate the new error rate after adding the disturbance error to get error1, compare error with error1, if error1 becomes smaller, and after the data is adjusted, when all speeds are greater than or equal to 0, accept the adjustment;
[0092] Step 4: Repeat steps 2-3 until the specified number of iterations is reached;
[0093] Step 5: Compare the fine-tuned data with the original data and use the formula If error2 is within the set range, the adjustment is acceptable and completed; otherwise, it will be readjusted.
[0094] In an optional embodiment, in order to solve the problem that the data quality has a great impact on the results in the driving condition construction, the optimization error rate can also adopt the following time series generation method: using LSTM time series generation network, using a custom loss function, Loss = αLoss e +βLoss r , where Loss e is the error rate loss, which is used to measure the error ratio between the generated data and the standard data. r is the reconstruction loss, which is used to measure the similarity between the generated data and the original data. α and β are weight parameters. This time series generation method uses the average speed error rate, driving speed error rate, average acceleration error rate of the acceleration segment, average acceleration error rate of the deceleration segment, idle time percentage error rate, acceleration time percentage error rate, deceleration time percentage error rate and uniform speed time percentage error rate to form the error rate loss. Its formula can be expressed as x i Represents actual characteristics, represents the standard feature, that is, the value obtained for the entire data set. The mean square error is used as the reconstruction loss, which can be expressed as the formula In order to ensure that the speed of generating data is greater than 0, a ReLU activation function is added to the output layer of LSTM.
[0095] The embodiment of the present invention performs feature encoding on the kinematic segment data to obtain kinematic segment features, and performs clustering operations on the kinematic segment features using a deep clustering algorithm, thereby achieving effective aggregation on data sets of different sizes, thereby achieving excellent aggregation effects. In addition, the deep clustering algorithm can also adjust the number of clustering clusters to meet different clustering scenarios without relying on the limitation of specifying parameters in traditional clustering schemes, thereby improving the quality of aggregation in clustering operations and further improving the accuracy of driving condition construction.
[0096] like Figure 2 As shown, it is a clustering network model diagram of the deep clustering algorithm of the driving condition building method provided in one embodiment of the present invention.
[0097] Exemplarily, in the processing flow chart of the clustering network model of the deep clustering algorithm, step 1, input the kinematic segment data into the DEC encoder to obtain the encoded feature encode_feature, and then pass the encode_feature to Div-DeepDPM. In the Div-DeepDPM clustering network, the encode_feature is first input into the clustering network clustering net, and then the soft cluster distribution of each group of data (i.e., the probability distribution of the data belonging to the 0-K class) is output. This process can be expressed as: where r i,k is the soft distribution of the sample point to cluster k (also called the responsibility value of cluster k to sample point x, the probability of sample point x being assigned to cluster k). Step 2: Before being input into the subclustering network, the soft distribution value will be processed into a hard distribution value (i.e., the distribution of which class each kinematic segment data belongs to), and then the hard distribution value will be input into the K subclustering nets, and the output is the soft distribution value of each subcluster. This process can be expressed as: Step 3. The learned sub-cluster distribution will be used for split / merge operation. (For these 1+K networks (1 clustering network, K sub-clustering networks), they are all MLP (Multilayer Perceptron) plus a single hidden layer. The last layer of the clustering network has K neurons, and the last layer of the sub-clustering network has 2 neurons). Step 4. The split / merge operation allows the K value to be changed through the Metropolis-Hastings model. In the split operation, a cluster is divided into two clusters (that is, a split increases K by 1). The use of the split operation is randomly accepted with a probability of min(1,H s ), H s is calculated by the Metropolis-Hastings model. Similarly, the probability of acceptance is After the classification / fusion operation, a new K value will appear as the cluster value for the next iteration.
[0098] like Figure 3 As shown, it is an overall flow chart of a preferred embodiment of a driving condition building method provided by an embodiment of the present invention.
[0099] like Figure 4, which is a functional module diagram of a driving condition building device provided by one embodiment of the present invention.
[0100] The driving condition construction device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the driving condition construction device 100 can include a vehicle driving data processing module 101, a kinematic segment clustering module 102 and a driving condition construction module 103.
[0101] The module described in the present invention may also be referred to as a unit, which refers to a series of computer program segments that can be executed by a processor of an electronic device and can complete fixed functions, and is stored in a memory of the electronic device.
[0102] In this embodiment, the functions of each module / unit are as follows:
[0103] The vehicle driving data processing module 101 is used to obtain vehicle driving data and divide the vehicle driving data into kinematic segment data.
[0104] In the embodiment of the present invention, the vehicle driving data refers to relevant data of the vehicle during the entire driving process collected by a motion recording device, such as acceleration vehicle driving data, deceleration vehicle driving data, or parking waiting data.
[0105] As an embodiment of the present invention, dividing the vehicle driving data into kinematic segment data includes:
[0106] Extracting continuous motion segment data from the vehicle driving data to obtain a motion segment data set;
[0107] Extracting idle segment data from the vehicle driving data according to the speed and the stop time to obtain an idle segment data set;
[0108] The motion segment data set and the idle segment data set are integrated to obtain the kinematic segment data.
[0109] In the embodiment of the present invention, the idle segment data refers to the speed being 0 and the idle time not exceeding 180 seconds. When the speed is 0 and the idle time exceeds 180 seconds, the idle segment data is judged to be abnormal data and cannot be used as kinematic segment data. At this time, the state of the car is a parking state or a damaged state.
[0110] The kinematic segment clustering module 102 is used to perform feature encoding on the kinematic segment data to obtain kinematic segment features, and to perform clustering operations on the kinematic segment features using a deep clustering algorithm to obtain kinematic segment clustering results.
[0111] In the embodiment of the present invention, the feature encoding of the kinematic segment data is performed using a deep clustering encoder DEC to convert the kinematic segment data into kinematic segment features.
[0112] In the embodiment of the present invention, the kinematic segment features refer to features that characterize the motion of the vehicle, including but not limited to average speed, maximum speed, driving speed, acceleration, and the like.
[0113] In the embodiment of the present invention, the deep clustering algorithm adopts a deep clustering algorithm that combines a variant of DeepDPM with Divcluster, a loss for controlling cluster diversity.
[0114] As an embodiment of the present invention, the kinematic segment features are clustered using a deep clustering algorithm to obtain a kinematic segment clustering result, including:
[0115] Calculating the soft cluster distribution of the kinematic segment using the clustering network of the deep clustering algorithm to obtain a first soft distribution value, and dividing the kinematic segment into a plurality of segment subclusters according to the first soft distribution value;
[0116] Inputting the first soft distribution value of each fragment sub-cluster of the plurality of fragment sub-clusters into the sub-clustering network of the deep clustering algorithm to calculate the second soft distribution value of each fragment sub-cluster;
[0117] Dividing each fragment subcluster into a plurality of subcluster distributions according to the second soft distribution value, performing splitting and merging operations on the subcluster distributions to obtain updated cluster values;
[0118] The kinematic segments are re-clustered according to the updated cluster values to obtain the kinematic segment clustering results.
[0119] Furthermore, before calculating the soft cluster distribution of the kinematic segment using the clustering network of the deep clustering algorithm, the method further includes training the clustering network using a pre-constructed clustering loss formula.
[0120] As an embodiment of the present invention, the adopting a pre-constructed clustering loss formula to train the clustering network includes:
[0121] The pre-built clustering loss formula uses the following loss formula:
[0122]
[0123] Among them, L cl is the clustering network loss value, N is the number of samples in the kinematic segment, K is the number of cluster categories, r i is the actual distribution of the clustering network, is the expected distribution of the clustering network, The difference between the actual and expected distributions of the ith kinematic segment.
[0124] Furthermore, the The following formula is used to calculate the expected distribution of the clustering network:
[0125]
[0126] Among them, π k is the prior probability of the kth cluster, that is, the proportion of cluster k in all clusters, is a Gaussian distribution at data point x i The probability density function value at k is the mean vector of the kth cluster, ∑ k is the covariance matrix of the kth cluster, It is the weighted sum of the probability density function values of all clusters, and the value of the weighted sum is 1.
[0127] Furthermore, the ∑ k The following Gaussian kernel function is used for calculation:
[0128]
[0129] Among them, K ij is a kinematic segment sample x j and kinematic fragment sample x i is the similarity measure between them, and σ is the parameter of the Gaussian kernel function.
[0130] The driving condition building module 103 is used to build a driving condition based on the kinematic segment clustering results using a genetic algorithm to obtain the driving condition of the vehicle driving data.
[0131] In the embodiment of the present invention, the genetic algorithm refers to an optimization algorithm that simulates the natural evolution process and is used to solve complex optimization problems.
[0132] As an embodiment of the present invention, the kinematic segment clustering results are constructed using a genetic algorithm for driving condition construction, including:
[0133] Selecting a preset number of groups of clustering results from the kinematic segment clustering results to construct a population set, and constructing an initial driving condition based on the population set;
[0134] Calculating the fitness of each population in the population set according to an error rate formula, and selecting the population with the smallest fitness from the population set as a candidate driving condition according to a tournament selection method;
[0135] Selecting kinematic segments from the candidate driving conditions according to a random selection principle and a crossover operation principle to replace the kinematic segments in the same cluster in the initial driving condition, and calculating the error rate of the replaced driving condition until a minimum error rate of the driving condition is obtained;
[0136] The driving condition with the minimum error rate is used as the driving condition of the vehicle driving data.
[0137] Furthermore, the selecting kinematic segments from the candidate driving conditions according to the random selection principle and the cross operation principle to replace the kinematic segments in the same cluster in the initial driving condition includes:
[0138] Performing a random extraction operation on the kinematic segments in the initial driving condition according to a random extraction principle, and selecting kinematic segments in the same cluster from the candidate driving conditions for replacement;
[0139] And according to the single-point crossover principle in the crossover operation principle, a kinematic segment is randomly selected, and then the kinematic segments after the position of the kinematic segment in the candidate driving condition are exchanged.
[0140] In the embodiment of the present invention, in order to solve the problem that the data quality has a great influence on the result in the construction of the driving condition, the constructed driving condition is processed by using the data adjustment method, and the steps of optimizing the error rate are as follows:
[0141] Step 1: Calculate the error rate of the original data, and use the average speed error rate, driving speed error rate, acceleration section average acceleration error rate, deceleration section average acceleration error rate, idle time percentage error rate, acceleration time percentage error rate, deceleration time percentage error rate and uniform speed time percentage error rate to form the total error rate. The formula can be expressed as x i Represents actual characteristics, represents the standard feature, that is, the value obtained for the entire data set;
[0142] Step 2: Randomly select the established driving conditions to perform a small disturbance, which can be expressed as the formula V=V+α, where α is a random number limited to a set range of [-0.05, 0.05];
[0143] Step 3: Calculate the new error rate after adding the disturbance error to get error1, compare error with error1, if error1 becomes smaller, and after the data is adjusted, when all speeds are greater than or equal to 0, accept the adjustment;
[0144] Step 4: Repeat steps 2-3 until the specified number of iterations is reached;
[0145] Step 5: Compare the fine-tuned data with the original data and use the formula If error2 is within the set range, the adjustment is acceptable and completed; otherwise, it will be readjusted.
[0146] In an optional embodiment, in order to solve the problem that the data quality has a great impact on the results in the driving condition construction, the optimization error rate can also adopt the following time series generation method: using LSTM time series generation network, using a custom loss function, Loss = αLoss e +βLoss r , where Loss e is the error rate loss, which is used to measure the error ratio between the generated data and the standard data. r is the reconstruction loss, which is used to measure the similarity between the generated data and the original data. α and β are weight parameters. This time series generation method uses the average speed error rate, driving speed error rate, average acceleration error rate of the acceleration segment, average acceleration error rate of the deceleration segment, idle time percentage error rate, acceleration time percentage error rate, deceleration time percentage error rate and uniform speed time percentage error rate to form the error rate loss. Its formula can be expressed as x i Represents actual characteristics, represents the standard feature, that is, the value obtained for the entire data set. The mean square error is used as the reconstruction loss, which can be expressed as the formula In order to ensure that the speed of generating data is greater than 0, a ReLU activation function is added to the output layer of LSTM.
[0147] like Figure 5 , is a schematic diagram of the structure of an electronic device for implementing a driving condition building method provided by an embodiment of the present invention.
[0148] The electronic device may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a driving condition establishment method program.
[0149] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing a driving condition building method program, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device and process data.
[0150] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of a driving condition construction method program, but also can be used to temporarily store data that has been output or is to be output.
[0151] The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0152] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0153] Figure 5 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0154] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0155] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0156] The driving condition establishment method program stored in the memory 11 of the electronic device is a combination of multiple instructions. When running in the processor 10, it can achieve:
[0157] Acquire vehicle driving data, and divide the vehicle driving data into kinematic segment data;
[0158] Performing feature encoding on the kinematic segment data to obtain kinematic segment features, and performing clustering operation on the kinematic segment features using a deep clustering algorithm to obtain a kinematic segment clustering result;
[0159] The kinematic segment clustering results are used to construct driving conditions using a genetic algorithm to obtain the driving conditions of the vehicle driving data.
[0160] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.
[0161] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0162] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:
[0163] Acquire vehicle driving data, and divide the vehicle driving data into kinematic segment data;
[0164] Performing feature encoding on the kinematic segment data to obtain kinematic segment features, and performing clustering operation on the kinematic segment features using a deep clustering algorithm to obtain a kinematic segment clustering result;
[0165] The kinematic segment clustering results are used to construct driving conditions using a genetic algorithm to obtain the driving conditions of the vehicle driving data.
[0166] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0167] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0168] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0169] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0170] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0171] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0172] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0173] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0174] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A driving condition construction method, characterized in that: The method comprises: Acquire vehicle driving data, and divide the vehicle driving data into kinematic segment data; The kinematic segment data is feature encoded to obtain a kinematic segment feature, and the kinematic segment feature is clustered using a deep clustering algorithm to obtain a kinematic segment clustering result, wherein the kinematic segment feature is clustered using a deep clustering algorithm to obtain a kinematic segment clustering result, including: using a clustering network of the deep clustering algorithm to calculate a soft cluster distribution of the kinematic segment to obtain a first soft distribution value, and dividing the kinematic segment into a plurality of segment sub-clusters according to the first soft distribution value; inputting the first soft distribution value of each segment sub-cluster in the plurality of segment sub-clusters into the deep clustering algorithm; The method comprises the following steps: calculating a second soft distribution value of each fragment subcluster in a subcluster network of a deep clustering algorithm; dividing each fragment subcluster into a plurality of subcluster distributions according to the second soft distribution value, performing splitting and merging operations on the subcluster distributions to obtain updated cluster cluster values; re-clustering the kinematic fragments according to the updated cluster cluster values to obtain the kinematic fragment clustering results; wherein, before calculating the soft cluster distribution of the kinematic fragments using the cluster network of the deep clustering algorithm, the method further comprises training the cluster network using a pre-constructed cluster loss formula, and the pre-constructed cluster loss formula uses the following loss formula: Among them, L cl is the clustering network loss value, N is the number of samples in the kinematic segment, K is the number of cluster categories, r i is the actual distribution of the clustering network, is the expected distribution of the clustering network, The difference between the actual distribution and the expected distribution of the ith kinematic segment; The kinematic segment clustering results are used to construct driving conditions using a genetic algorithm to obtain the driving conditions of the vehicle driving data.
2. The driving condition construction method according to claim 1, characterized in that: The step of dividing the vehicle driving data into kinematic segment data includes: Extracting continuous motion segment data from the vehicle driving data to obtain a motion segment data set; Extracting idle segment data from the vehicle driving data according to the speed and the stop time to obtain an idle segment data set; The motion segment data set and the idle segment data set are integrated to obtain the kinematic segment data.
3. The driving condition construction method according to claim 1, characterized in that: The method of using a genetic algorithm to construct a driving condition based on the kinematic segment clustering results includes: Selecting a preset number of groups of clustering results from the kinematic segment clustering results to construct a population set, and constructing an initial driving condition based on the population set; Calculating the fitness of each population in the population set according to an error rate formula, and selecting the population with the smallest fitness from the population set as a candidate driving condition according to a tournament selection method; Selecting kinematic segments from the candidate driving conditions according to a random selection principle and a crossover operation principle to replace the kinematic segments in the same cluster in the initial driving condition, and calculating the error rate of the replaced driving condition until a minimum error rate of the driving condition is obtained; The driving condition with the minimum error rate is used as the driving condition of the vehicle driving data.
4. The driving condition construction method according to claim 3, characterized in that: The step of selecting kinematic segments from the candidate driving conditions according to the random selection principle and the cross operation principle to replace the kinematic segments in the same cluster in the initial driving conditions includes: Performing a random extraction operation on the kinematic segments in the initial driving condition according to a random extraction principle, and selecting kinematic segments in the same cluster from the candidate driving conditions for replacement; And according to the single-point crossover principle in the crossover operation principle, a kinematic segment is randomly selected, and then the kinematic segments after the position of the kinematic segment in the candidate driving condition are exchanged.
5. A driving condition construction device, characterized in that: The device can implement the driving condition construction method according to any one of claims 1 to 4, and the device includes: A vehicle driving data processing module is used to obtain vehicle driving data and divide the vehicle driving data into kinematic segment data; A kinematic segment clustering module is used to perform feature encoding on the kinematic segment data to obtain kinematic segment features, and to perform clustering operations on the kinematic segment features using a deep clustering algorithm to obtain kinematic segment clustering results, wherein the kinematic segment features are clustered using a deep clustering algorithm to obtain the kinematic segment clustering results, including: using a clustering network of the deep clustering algorithm to calculate the soft cluster distribution of the kinematic segment to obtain a first soft distribution value, and dividing the kinematic segment into a plurality of segment sub-clusters according to the first soft distribution value; the first soft distribution value of each segment sub-cluster in the plurality of segment sub-clusters is calculated; The second soft distribution value of each fragment subcluster is calculated by inputting it into the subclustering network of the deep clustering algorithm; each fragment subcluster is divided into a plurality of subcluster distributions according to the second soft distribution value, and the subcluster distributions are split and merged to obtain updated clustering cluster values; the kinematic fragments are re-clustered according to the updated clustering cluster values to obtain the kinematic fragment clustering results; wherein, before the soft cluster distribution of the kinematic fragment is calculated by the clustering network of the deep clustering algorithm, the clustering network is trained by using a pre-constructed clustering loss formula, and the pre-constructed clustering loss formula uses the following loss formula: Among them, L cl is the clustering network loss value, N is the number of samples in the kinematic segment, K is the number of cluster categories, r i is the actual distribution of the clustering network, is the expected distribution of the clustering network, The difference between the actual distribution and the expected distribution of the ith kinematic segment; The driving condition building module is used to build the driving condition of the vehicle driving data by using the genetic algorithm to cluster the kinematic fragments.
6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the driving condition establishment method as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the driving condition establishment method as described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Working condition identification control method of pure electric vehicle
CN111907342A
Vehicle driving condition construction method, electronic equipment and storage medium
CN115601855A