Road condition data screening method, device, computer equipment and storage medium
By extracting and encoding features of traffic data, calculating feature similarity, and filtering out features with high similarity, the problem of low accuracy in screening traffic data in the traffic information service system is solved, and the accuracy of traffic jam prediction and travel are improved. timely evacuation of the victims.
Patent Information
- Application Number
- CN201911317438.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-19
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2039-12-19
AI Technical Summary
The existing traffic information service system cannot effectively predict and warn traffic jams, resulting in delayed evacuation of travelers, and conventional model learning is difficult to accurately represent the real-time conditions of the road conditions, resulting in low accuracy of road condition data screening.
By obtaining the traffic sample data set, it is divided into training and verification data sets, feature extraction and encoding are performed, feature similarity is calculated, and features with similarity greater than the threshold are extracted to improve the accuracy and stability of data screening.
It improves the accuracy and stability of traffic data screening, ensures the accuracy of prediction, and solves the problem of untimely evacuation of traffic jams.
Smart Images

Figure CN111178407B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a road condition data screening method, device, computer equipment and storage medium. Background Art
[0002] With the continuous development of Internet technology, advanced traffic information service systems obtain various types of traffic information and conduct comprehensive processing on the basis of a perfect information network, providing the society with comprehensive and accurate road traffic congestion information in real time. However, since the data source of the advanced traffic information service system is obtained in real time, it can only feedback real-time road condition information, and cannot predict the road condition to warn travelers, which often leads to the phenomenon of untimely evacuation of traffic jams. Therefore, using historical road condition data to predict road conditions is one of the important means to solve the problem of untimely evacuation of traffic jams. However, since the road condition data during rush hour often fluctuates more significantly than the road condition data during normal time periods, the results obtained by using only conventional model learning cannot well represent the real-time situation of the road condition. Therefore, there are often high requirements for the characteristics of the acquired road condition data, such as: the stability of the characteristics of the historical road condition data, the diversity of the characteristics of the historical road condition data, and the balance of the characteristics of the historical road condition data, so as to better ensure the accuracy of subsequent predictions. Summary of the invention
[0003] The embodiments of the present invention provide a method, an apparatus, a computer device and a storage medium for screening road condition data to solve the problem of low accuracy in screening road condition data.
[0004] A method for screening road condition data, comprising:
[0005] Acquire a traffic condition sample data set, and divide the traffic condition sample data set into a training traffic condition data set and a verification traffic condition data set;
[0006] Performing feature extraction on each training road condition data in the training road condition data set to obtain N groups of training feature values of the training road condition data set;
[0007] Performing feature extraction on each verification road condition data in the verification road condition data set to obtain M groups of verification feature values of the verification road condition data set;
[0008] Performing feature coding on each of the training feature values in the training road condition data set to obtain a training feature code of the training road condition data set, wherein the training feature code is a code corresponding to each road condition feature in the training road condition data set;
[0009] Performing feature coding on each of the verification feature values in the verification road condition data set to obtain a verification feature code of the verification road condition data set, wherein the verification feature code is a code corresponding to each road condition feature in the verification road condition data set;
[0010] Calculating the feature similarity between the training feature code of each of the road condition features in the training road condition data set and the verification feature code of the corresponding road condition feature in the verification road condition data set;
[0011] The road condition features whose feature similarity is greater than a similarity threshold are extracted to obtain target road condition features.
[0012] A road condition data screening device, comprising:
[0013] A traffic sample data set acquisition module, used to acquire a traffic sample data set, and divide the traffic sample data set into a training traffic data set and a verification traffic data set;
[0014] A first feature extraction module, used for performing feature extraction on each training road condition data in the training road condition data set to obtain N groups of training feature values of the training road condition data set;
[0015] A second feature extraction module is used to extract features from each verification road condition data in the verification road condition data set to obtain M groups of verification feature values of the verification road condition data set;
[0016] A first feature encoding module, used for performing feature encoding on each of the training feature values in the training road condition data set to obtain a training feature code of the training road condition data set, wherein the training feature code is a code corresponding to each road condition feature in the training road condition data set;
[0017] A second feature coding module is used to perform feature coding on each of the verification feature values in the verification road condition data set to obtain a verification feature code of the verification road condition data set, wherein the verification feature code is a code corresponding to each road condition feature in the verification road condition data set;
[0018] A feature similarity calculation module, used to calculate the feature similarity between the training feature code of each of the road condition features in the training road condition data set and the verification feature code of the corresponding road condition feature in the verification road condition data set;
[0019] The target road condition feature generation module is used to extract the road condition features whose feature similarity is greater than a similarity threshold to obtain the target road condition features.
[0020] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the above-mentioned road condition data screening method is implemented when the processor executes the computer program.
[0021] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned road condition data screening method is implemented.
[0022] The above-mentioned road condition data screening method, device, computer equipment and storage medium obtain a road condition sample data set, divide the road condition sample data set into a training road condition data set and a verification road condition data set; perform feature extraction on each training road condition data in the training road condition data set to obtain N training feature values of the training road condition data set; perform feature extraction on each verification road condition data in the verification road condition data set to obtain M verification feature values of the verification road condition data set; perform feature encoding on each training feature value in the training road condition data set to obtain a training feature encoding of the training road condition data set, wherein the training feature encoding is the encoding corresponding to each road condition feature in the training road condition data set; perform feature encoding on each verification feature value in the verification road condition data set Encoding, obtaining the verification feature coding of the verification road condition data set, the verification feature coding is the coding corresponding to each road condition feature in the verification road condition data set; calculating the feature similarity between the training feature coding of each road condition feature in the training road condition data set and the verification feature coding of the corresponding road condition feature in the verification road condition data set; extracting the road condition features whose feature similarity is greater than the similarity threshold, obtaining the target road condition features; by comparing the feature similarity of the training feature coding of the training road condition data set with the verification feature coding of the verification road condition data set, screening out the target road condition features whose feature similarity is greater than the similarity threshold, thereby ensuring the stability and accuracy of the generated target road condition features, and improving the accuracy of screening the road condition data. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0024] Figure 1 is a schematic diagram of an application environment of a road condition data screening method in an embodiment of the present invention;
[0025] Figure 2 is an example diagram of a method for screening road condition data in one embodiment of the present invention;
[0026] Figure 3is another example diagram of a method for screening road condition data in one embodiment of the present invention;
[0027] Figure 4 is another example diagram of a method for screening road condition data in one embodiment of the present invention;
[0028] Figure 5 is another example diagram of a method for screening road condition data in one embodiment of the present invention;
[0029] Figure 6 is another example diagram of a method for screening road condition data in one embodiment of the present invention;
[0030] Figure 7 is a principle block diagram of a road condition data screening device in one embodiment of the present invention;
[0031] Figure 8 is another principle block diagram of a road condition data screening device in one embodiment of the present invention;
[0032] Fig. 9 is another principle block diagram of a road condition data screening device in one embodiment of the present invention;
[0033] Fig.10 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] The road condition data screening method provided by the embodiment of the present invention can be applied as follows: Figure 1 Specifically, the traffic data screening method is applied in a traffic data screening system, and the traffic data screening system includes: Figure 1 The client and server shown in the figure communicate with each other through the network to solve the problem of low accuracy in filtering traffic data. The client, also known as the user end, refers to a program corresponding to the server that provides local services to customers. The client can be installed on, but not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server can be implemented with an independent server or a server cluster consisting of multiple servers.
[0036] In one embodiment, if Figure 2 As shown, a road condition data screening method is provided, and the method is applied in Figure 1 The server in the example is used as an example to illustrate the following steps:
[0037] S10: Obtain a road condition sample data set, and divide the road condition sample data set into a training road condition data set and a verification road condition data set.
[0038] The road condition sample data set refers to the road condition data to be processed. In this embodiment, the road condition sample data set is the historical road condition data of at least the most recent three months. Specifically, the historical road condition data can be the real-time road condition data on the main roads in Shenzhen City in the most recent three months obtained through Baidu Maps. The historical road condition data may include road speed, traffic congestion, traffic accident occurrence, etc. Specifically, the road condition sample data set is a data set composed of a plurality of road condition sample data.
[0039] Among them, the training road condition data set refers to the data set used to establish the model. The verification road condition data set refers to the data set used to verify the effect of the established model. Specifically, the road condition sample data set can be divided into the training road condition data set and the verification road condition data set by random division or cross-checking method; after the division, the ratio of the training road condition data set to the verification road condition data set can be: training road condition data set: verification road condition data set = 5:5, training road condition data set: verification road condition data set = 6:4, or training road condition data set: verification road condition data set = 7:3, etc. In a specific embodiment, in order to improve the accuracy of subsequent model training, the number of training road condition data sets is greater than the number of verification road condition data sets. In this step, 75% of the acquired road condition sample data set is used as the training road condition data set for training the model; 25% of the acquired road condition sample data set is used as the verification road condition data set for evaluating the effect of the trained model.
[0040] S20: extracting features from each training road condition data in the training road condition data set to obtain N groups of training feature values of the training road condition data set.
[0041] Among them, the training feature value refers to a set of feature values that can reflect the nature of the training road condition data. For example, the training feature value can be the value corresponding to the date, road and time window. For example, the values corresponding to the date are Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday; the values corresponding to the road are the main roads in the city, and each road is distinguished by the road name, such as the set of all road units of Beijing's main lines, West Second Ring Road, Xueyuan Road, etc. The values corresponding to the time window are 08:00, 08:05, 08:10, 08:15, etc. Among them, the time window is obtained by dividing every preset time from 00:00 to 23:59, such as a time window set obtained by dividing every 5 minutes. It should be noted that different dates contain the same time window set.
[0042] Specifically, feature extraction is performed on each training road condition data in the training road condition data set, data with road condition features are extracted from each training road condition data, and the data with road condition features are used as training feature values of the training road condition data. It can be understood that each training road condition data corresponds to a set of training feature values. The number N of training feature values is equal to the number of training road condition data contained in the training road condition data set. Specifically, a feature extraction algorithm can be used to automatically extract features from each training road condition data set to obtain N sets of training feature values of the training road condition data set. Among them, the feature extraction algorithm can be linear feature extraction (PCA) or nonlinear feature extraction. Preferably, in order to ensure that more comprehensive and accurate training feature values can be extracted from the training road condition data set, a pre-compiled feature extraction script can also be obtained from the database of the server, and then the corresponding feature extraction script can be used to perform feature extraction on each training road condition data in the training road condition data set.
[0043] S30: Perform feature extraction on each verification road condition data in the verification road condition data set to obtain M verification feature values of the verification road condition data set.
[0044] Among them, the verification characteristic value refers to a set of characteristic data that can reflect the nature of the verification road condition data. It can be understood that since the verification road condition data and the training road condition data belong to the same type of sample data. Therefore, the verification characteristic value obtained after feature extraction of each verification road condition data in the verification road condition data set and the training characteristic value belong to the value of the same road condition feature. It can be understood that each verification road condition data corresponds to a set of verification characteristic values. The number M of verification characteristic values is equal to the number of verification road condition data contained in the verification road condition data set.
[0045] Specifically, the specific method and process of extracting features from each verification road condition data in the verification road condition data set in this step are similar to the specific method and process of extracting features from each training road condition data in the training road condition data set in step S20, and are not redundantly described here.
[0046] S40: performing feature coding on each training feature value in the training road condition data set to obtain a training feature code of the training road condition data set, where the training feature code is a code corresponding to each road condition feature in the training road condition data set.
[0047] The training feature code refers to the code corresponding to each road condition feature in the training road condition data set. The road condition feature refers to the pre-set feature information that can reflect the road condition properties of the training road condition data set. For example, feature information such as "date", "road", and "time window". It can be understood that the road condition features corresponding to each training feature data in the training road condition data set are the same.
[0048] Specifically, One-Hot coding or FM algorithm can be used to feature encode each training feature value in the training road condition data set to obtain the training feature coding of the training road condition data set. Preferably, in order to avoid the imagination of underfitting after subsequent road condition feature screening. In this embodiment, the GBDT algorithm is used to feature encode each training feature value in the training road condition data set to obtain the training feature coding of the training road condition data set. Among them, GBDT is a gradient boosting decision tree. The GBDT algorithm is an iterative decision tree algorithm, which consists of multiple decision trees. It can be understood that when the GBDT algorithm is used to feature encode each training feature value in the training road condition data set, feature construction will be performed at the same time, thereby avoiding the imagination of underfitting after subsequent road condition feature screening.
[0049] It can be understood that since the generated training feature code is based on each road condition feature, if the number of training feature data in the training road condition data set is different, the vector length of the training feature code obtained after feature encoding will also be different, that is, the vector length of the training feature code depends on the number of training feature data in the training road condition data set.
[0050] For example, if the training road condition data set includes:
[0051] The training feature data A1 is: date: Monday, road: West Second Ring Road, time window: 08:00;
[0052] The training feature data A2 is: date: Tuesday, road: Xueyuan Road, time window: 08:05;
[0053] The training feature data A3 is: date: Wednesday, road: Beijing Road, time window: 08:10;
[0054] After feature encoding for each training feature value in the road condition training data set, the training feature code corresponding to the road condition feature "date" is [1,0,0,0,0,1,0,0,0,1]; the training feature code corresponding to the road condition feature "road" is [1,0,0,0,0,0,0,0,0,0]; and the training feature code corresponding to the road condition feature "time window" is [1,0,0,0,0,0,0,0,0,1].
[0055] S50: Perform feature coding on each verification feature value in the verification road condition data set to obtain a verification feature code of the verification road condition data set, where the verification feature code is a code corresponding to each road condition feature in the verification road condition data set.
[0056] The verification feature code refers to the code corresponding to each road condition feature in the verification road condition data set. In this embodiment, the road condition feature corresponding to the verification road condition data set is the same as the road condition feature corresponding to the training road condition data set.
[0057] Specifically, the specific method and process of feature encoding each verification feature value in the verification road condition data set in this step are similar to the specific method and process of feature encoding each training feature value in the training road condition data set in step S40, and no redundant description is made here. It can be understood that since the generated verification feature code is based on each road condition feature, if the number of verification feature data in the verification road condition data set is different, the vector length of the verification feature code obtained after feature encoding is also different, that is, the vector length of the verification feature code depends on the number of verification feature data in the verification road condition data set.
[0058] In a specific embodiment, if the number of verification feature data in the verification road condition data set is the same as the number of training feature data in the training road condition data set, then the vector length of the verification feature code corresponding to each road condition feature generated is the same as the training feature code. If the number of verification feature data in the verification road condition data set is different from the number of training feature data in the training road condition data set, then the vector length of the verification feature code corresponding to each road condition feature generated is different from the training feature code.
[0059] S60: Calculate the feature similarity between the training feature code of each road condition feature in the training road condition data set and the verification feature code of the corresponding road condition feature in the verification road condition data set.
[0060] It can be seen from step S40 and step S50 that the training feature code is the code corresponding to each road condition feature in the training road condition data set, and the verification feature code is the code corresponding to each road condition feature in the verification road condition data set, and the road condition features included in the verification road condition data set are the same as the road condition features included in the training road condition data set. Therefore, the training feature code corresponding to each road condition feature in the training road condition data set has a verification feature code corresponding to the same road condition feature in the verification road condition data set.
[0061] Specifically, a string matching method is first used to match each road condition feature in the training road condition data set with each road condition feature in the verification road condition data set, and then the training feature code and the verification feature code corresponding to the successfully matched road condition features are determined as feature code pairs for feature similarity calculation, and then a cosine similarity algorithm is used to calculate the feature similarity between the training feature code and the corresponding verification feature code in each feature code pair, thereby obtaining the feature similarity between the training feature code and the corresponding verification feature code in each feature code pair.
[0062] For example, if the training traffic data set includes the training feature code [1,0,0,0,1,0,0,0,1] corresponding to the traffic feature "date", and the training feature code [1,0,0,0,0,0,0,0,0] corresponding to the traffic feature "road"; the verification traffic data set includes the verification feature code [1,1,0,0,1,0,0,1,0] corresponding to the traffic feature "date", and the verification feature code [1,1,0,0,0,0,0,0,0] corresponding to the traffic feature "road", then the training traffic data set is calculated. The feature similarity between the training feature code [1,0,0,0,1,0,0,0,1] corresponding to the road condition feature “date” in the verification road condition dataset and the verification feature code [1,1,0,0,1,0,0,1,0] corresponding to the road condition feature “date” in the verification road condition dataset; the feature similarity between the training feature code [1,0,0,0,0,0,0,0,0,0] corresponding to the road condition feature “road” in the training road condition dataset and the verification feature code [1,1,0,0,0,0,0,0,0,0] corresponding to the road condition feature “road” in the verification road condition dataset.
[0063] S70: extracting road condition features whose feature similarity is greater than a similarity threshold, and obtaining target road condition features.
[0064] Specifically, after calculating the feature similarity of the training feature code of each road condition feature in the training road condition data set and the verification feature code of the corresponding road condition feature in the verification road condition data set according to step S60, and determining the feature similarity corresponding to each road condition feature, the feature similarity of each road condition feature is compared one by one with the preset similarity threshold, and the road condition features whose feature similarity is greater than the similarity threshold are extracted to obtain the target road condition feature. Among them, the similarity threshold refers to a pre-set threshold for evaluating whether the training feature code and the verification feature code are similar. Optionally, the similarity threshold can be set to 80%, 85% or 90%, and the user can customize the setting according to the actual situation.
[0065] For example, if the similarity threshold is set to 85%, the feature similarity corresponding to the road condition feature "date" is calculated to be 80%; the feature similarity corresponding to the road condition feature "road" is 87%; then the road condition feature "road" is extracted as the target road condition feature.
[0066] In this embodiment, a road condition sample data set is obtained, and the road condition sample data set is divided into a training road condition data set and a verification road condition data set; feature extraction is performed on each training road condition data in the training road condition data set to obtain N training feature values of the training road condition data set; feature extraction is performed on each verification road condition data in the verification road condition data set to obtain M verification feature values of the verification road condition data set; feature encoding is performed on each training feature value in the training road condition data set to obtain a training feature encoding of the training road condition data set, and the training feature encoding is the encoding corresponding to each road condition feature in the training road condition data set; feature encoding is performed on each verification feature value in the verification road condition data set to obtain a verification road condition data set. Verification feature coding of the data set, the verification feature coding is the coding corresponding to each road condition feature in the verification road condition data set; calculating the feature similarity between the training feature coding of each road condition feature in the training road condition data set and the verification feature coding of the road condition feature in the corresponding verification road condition data set; extracting the road condition features with feature similarity greater than a similarity threshold, and obtaining the target road condition features; by comparing the feature similarity of the training feature coding of the training road condition data set with the verification feature coding of the verification road condition data set, screening out the target road condition features with feature similarity greater than the similarity threshold, thereby ensuring the stability and accuracy of the generated target road condition features and improving the accuracy of screening the road condition data.
[0067] In one embodiment, if Figure 3 As shown, after feature encoding is performed on each verification feature value in the verification road condition data set, and before calculating the feature similarity between the training feature code of each road condition feature in the training road condition data set and the verification feature code of the corresponding road condition feature in the verification road condition data set, the road condition data screening method further specifically includes the following steps:
[0068] S51: Determine whether there is a missing code value between the training feature code and the verification feature code.
[0069] Since the number of training road condition data in the training road condition data set may be different from the number of verification feature data in the verification road condition data set, that is, the vector length of the generated training feature code and the vector length of the verification feature code may be different. Therefore, in order to improve the accuracy of the subsequent calculation of the feature similarity between the training feature code and the corresponding verification feature code, it is first determined whether there is a missing code value between the training feature code and the verification feature code, that is, whether the vector length of the training feature code and the vector length of the verification feature code are the same.
[0070] Specifically, the vector length of each training feature code and the vector length of each verification feature code are calculated first, and then the vector length of each training feature code is compared with the vector length of the corresponding verification feature code. If the vector length of the training feature code is the same as the vector length of the corresponding verification feature code, it is determined that there is no missing code value between the training feature code and the verification feature code; if the vector length of the training feature code is different from the vector length of the corresponding verification feature code, it is determined that there is a missing code value between the training feature code and the verification feature code.
[0071] S52: If there are missing code values between the training feature code and the verification feature code, the missing value is filled using a regularized maximum expectation algorithm to obtain a target training feature code and a target verification feature code.
[0072] If it is determined according to step S51 that there are missing code values between the training feature code and the verification feature code, the regularized maximum expectation algorithm is used to fill the missing values of the feature code with a shorter vector length, and the missing code values are regarded as unobservable hidden code values to ensure that the vector lengths of the target training feature code and the target verification feature code are the same.
[0073] Among them, the regularized maximum expectation algorithm is an iterative optimization algorithm, and its calculation method is that each iteration is divided into an expectation (E) step and a maximum (M) step. Specifically, the expectation (E) is calculated first, and the maximum likelihood estimate is calculated using the existing estimated value of the hidden variable; then maximize (M), maximize the maximum likelihood value obtained in the expectation (E) step to calculate the value of the parameter, and the parameter estimate found in the maximization (M) step is used in the next expectation (E) step calculation. This process is continuously alternating to achieve the missing code value as an unobservable hidden code value, and obtain the target training feature code and the target verification feature code.
[0074] Preferably, in order to ensure the accuracy of the generated target training feature code and target verification feature code, the standard error (RMSE) can be used to evaluate the filling effect of the missing code value. The RMSE (using standard error) can well reflect the degree of deviation between the filled data and the real data. The smaller the RMSE value, the smaller the deviation between the filled data and the real data, and the higher the accuracy. Conversely, the larger the RMSE (using standard error), the greater the deviation between the filled data and the real data. The mathematical expression of RMSE (using standard error) is as follows:
[0075]
[0076] Where n is the number of samples; X obs,i represents the hidden code value of the i-th observation; X model,iRepresents X obs,i The predicted value of .
[0077] In this embodiment, by judging whether there are missing code values between the training feature code and the verification feature code, if there are missing code values between the training feature code and the verification feature code, the missing values are filled by using the regularized maximum expectation algorithm to obtain the target training feature code and the target verification feature code, thereby improving the accuracy of the subsequent calculation of the feature similarity of the training feature code and the verification feature code.
[0078] In one embodiment, if Figure 4 As shown, after calculating the feature similarity between the training feature code of each road condition feature in the training road condition data set and the verification feature code of the corresponding road condition feature in the verification road condition data set, the road condition data screening further specifically includes the following steps:
[0079] S61: extracting road condition features whose feature similarity is greater than a similarity threshold as normal features, and extracting road condition features whose feature similarity is less than or equal to the similarity threshold as abnormal features.
[0080] Among them, normal features refer to relatively stable features obtained after screening. Abnormal features refer to relatively unstable features obtained after screening. In this embodiment, after calculating the feature similarity between the training feature code of each road condition feature in the training road condition data set and the verification feature code of the road condition feature in the corresponding verification road condition data set, the road condition features with feature similarity greater than the similarity threshold are extracted as normal features; and the road condition features with feature similarity less than or equal to the similarity threshold are extracted as normal features.
[0081] S62: Label the normal features and the abnormal features respectively to obtain label information.
[0082] Among them, label information refers to an identifier for distinguishing normal features from abnormal features. Label information can be represented by any identifier such as uppercase and lowercase letters or Arabic numerals. Specifically, after determining the normal features and abnormal features, in order to facilitate subsequent distinction, labels are set for the normal features and abnormal features respectively. For example: the normal feature label can be set to 1 and the abnormal feature label can be set to 0; or the normal feature label can be set to A and the abnormal feature label can be set to a, etc.
[0083] S63: Based on the label information, the normal features and the abnormal features are stored in a preset information database.
[0084] The preset information database refers to a pre-set database for storing road condition features. Specifically, after labeling normal features and abnormal features respectively, the normal features are associated with the corresponding label information, and the abnormal features are associated with the corresponding label information and stored in the preset information database, so that the corresponding features can be directly obtained according to the label information for model training in the future.
[0085] In this embodiment, road condition features whose feature similarity is greater than a similarity threshold are extracted as normal features, and road condition features whose feature similarity is less than or equal to the similarity threshold are extracted as abnormal features; labels are set for normal features and abnormal features respectively to obtain label information; based on the label information, the normal features and abnormal features are stored in a preset information database; so that the required road condition features can be directly obtained from the database according to actual conditions in the future.
[0086] In one embodiment, if Figure 5 As shown, feature encoding is performed on each training feature value in the training road condition data set to obtain the training feature encoding of the training road condition data set, which specifically includes the following steps:
[0087] S401: Obtain each training feature value in the training road condition data set, train each training feature value, and generate a gradient boosting decision tree model.
[0088] The gradient boosting decision tree model refers to a decision tree model with N trees constructed after performing decision tree training according to each training feature value in the training road condition data set. Specifically, each training feature value in the acquired training road condition data set is input into a preset decision tree for training to construct a gradient boosting decision tree model with N trees.
[0089] S402: Input each training feature value into the gradient boosting decision tree model for feature encoding to obtain the training feature encoding of the training road condition data set.
[0090] Specifically, each training feature value is input into the gradient boosting decision tree model for feature encoding, and the training feature encoding of the training road condition data set can be obtained. It can be understood that when the training feature value is input into the gradient boosting decision tree model for feature encoding, the gradient boosting decision tree model will perform feature construction on the training feature value, so the generated training feature encoding belongs to combined feature encoding.
[0091] For example, if the gradient boosting decision tree model is composed of two trees, the first tree has 3 leaf nodes, and the second tree has 2 leaf nodes. If a training feature value x is input, and it finally falls on the second leaf node in the first tree, and finally falls on the first leaf node in the second tree; then after feature encoding through the gradient boosting decision tree model, the generated training feature encoding is [0,1,0,1,0], where the first three digits in the vector correspond to the 3 leaf nodes of the first tree, and the last two digits correspond to the 2 leaf nodes of the second tree.
[0092] In this embodiment, each training feature value in the training road condition data set is obtained, each training feature value is trained, and a gradient boosting decision tree model is generated; each training feature value is input into the gradient boosting decision tree model for feature encoding, and the training feature encoding of the training road condition data set is obtained; thereby ensuring the accuracy of the generated training feature encoding and verification feature encoding.
[0093] In one embodiment, if Figure 6 As shown, feature extraction is performed on each training road condition data in the training road condition data set to obtain N groups of training feature values of the training road condition data set, which specifically includes the following steps:
[0094] S201: Acquire a feature parameter set, where the feature parameter set includes L parameter identifiers, where L is a positive integer.
[0095] The feature parameter set refers to a feature set of a training road condition data set that is pre-set to be extracted. Specifically, the feature parameter set includes L parameter identifiers, where L is a positive integer. The parameter identifier refers to an identification number assigned to each feature parameter. For example, the parameter identifier of a date can be day; the parameter identifier of a road can be road; and the parameter identifier of a time window can be time.
[0096] S202: Obtain the corresponding feature extraction script according to each parameter identifier.
[0097] The feature extraction script refers to a text that can directly extract features from each training road condition data in the training road condition data set. In this embodiment, the feature extraction script is pre-compiled and stored in the database of the server, so the corresponding feature extraction script can be directly obtained from the database of the server according to the obtained parameter identifier. For example: according to the parameter identifier day of the date, the corresponding feature extraction script can be obtained from the database of the server <day>; According to the road parameter identifier road, the corresponding feature extraction script can be obtained from the server database <road>; According to the parameter identifier time of the time window, the corresponding feature extraction script can be obtained from the database on the server side <time>wait.
[0098] S203: Using a feature extraction script to perform feature extraction on each training road condition data in the training road condition data set to obtain N groups of training feature values of the training road condition data set.
[0099] Specifically, since each feature extraction script has the function of directly extracting features from each training road condition data in the training road condition data set, the feature extraction script obtained according to step S202 can be directly used to extract features from each training road condition data in the training road condition data set to obtain N groups of training feature values for the training road condition data set.
[0100] In this embodiment, a feature parameter set is obtained, and the feature parameter set includes L parameter identifiers, where L is a positive integer; a corresponding feature extraction script is obtained according to each parameter identifier; the feature extraction script is used to perform feature extraction on each training road condition data in the training road condition data set to obtain N groups of training feature values of the training road condition data set; thereby ensuring the accuracy and effectiveness of the generated training road condition values.
[0101] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0102] In one embodiment, a road condition data screening device is provided, and the road condition data screening device corresponds to the road condition data screening method in the above embodiment. Figure 7 As shown, the road condition data screening device includes a road condition sample data set acquisition module 10, a first feature extraction module 20, two Feature extraction module 30, first feature encoding module 40, second feature encoding module 50, feature similarity calculation module 60 and target road condition feature generation module 70. Each functional module is described in detail as follows:
[0103] The traffic sample data set acquisition module 10 is used to acquire the traffic sample data set and divide the traffic sample data set into a training traffic data set and a verification traffic data set;
[0104] A first feature extraction module 20 is used to extract features from each training road condition data in the training road condition data set to obtain N sets of training feature values of the training road condition data set;
[0105] No. two A feature extraction module 30 is used to extract features from each verification road condition data in the verification road condition data set to obtain M groups of verification feature values of the verification road condition data set;
[0106] A first feature encoding module 40 is used to perform feature encoding on each training feature value in the training road condition data set to obtain a training feature code of the training road condition data set, where the training feature code is a code corresponding to each road condition feature in the training road condition data set;
[0107] The second feature coding module 50 is used to perform feature coding on each verification feature value in the verification road condition data set to obtain the verification feature code of the verification road condition data set, where the verification feature code is the code corresponding to each road condition feature in the verification road condition data set;
[0108] A feature similarity calculation module 60 is used to calculate the feature similarity between the training feature code of each road condition feature in the training road condition data set and the verification feature code of the corresponding road condition feature in the verification road condition data set;
[0109] The target road condition feature generation module 70 is used to extract road condition features whose feature similarity is greater than a similarity threshold to obtain target road condition features.
[0110] Preferably, if Figure 8 As shown, the road condition data screening device also includes:
[0111] A judging module 51 is used to judge whether there is a missing code value between the training feature code and the verification feature code;
[0112] The missing value filling module 52 is used to fill in the missing values when there are missing code values between the training feature code and the verification feature code by using a regularized maximum expectation algorithm to obtain a target training feature code and a target verification feature code.
[0113] Preferably, if Fig. 9 As shown, the road condition data screening device also includes:
[0114] An extraction module 61 is used to extract road condition features whose feature similarity is greater than a similarity threshold as normal features, and to extract road condition features whose feature similarity is less than or equal to the similarity threshold as abnormal features;
[0115] The label setting module 62 is used to set labels for normal features and abnormal features respectively to obtain label information;
[0116] The storage module 63 is used to store the normal features and abnormal features into a preset information database based on the label information.
[0117] Preferably, the first feature encoding module 40 includes:
[0118] A gradient boosting decision tree model generating unit is used to obtain each training feature value in the training road condition data set, train each training feature value, and generate a gradient boosting decision tree model;
[0119] The feature encoding unit is used to input each training feature value into the gradient boosting decision tree model for feature encoding to obtain the training feature encoding of the training road condition data set.
[0120] Preferably, the first feature extraction module 20 includes:
[0121] A feature parameter set acquisition unit, used to acquire a feature parameter set, wherein the feature parameter set includes L parameter identifiers, where L is a positive integer;
[0122] The feature extraction script acquisition unit is used to acquire the corresponding feature extraction script according to each parameter identifier.
[0123] The feature extraction unit is used to extract features from each training road condition data in the training road condition data set using a feature extraction script to obtain N groups of training feature values of the training road condition data set.
[0124] For the specific definition of the road condition data screening device, please refer to the definition of the road condition data screening method above, which will not be repeated here. Each module in the above-mentioned road condition data screening device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0125] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data used in the road condition data screening method in the above embodiment. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a road condition data screening method is implemented.
[0126] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the road condition data screening method in the above embodiment is implemented.
[0127] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the road condition data screening method in the above embodiment is implemented.
[0128] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0129] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0130] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.< / time> < / road> < / day>
Claims
1. A method for screening road condition data, It is characterized in that include: Acquire a traffic condition sample data set, and divide the traffic condition sample data set into a training traffic condition data set and a verification traffic condition data set; Performing feature extraction on each training road condition data in the training road condition data set to obtain N groups of training feature values of the training road condition data set; Performing feature extraction on each verification road condition data in the verification road condition data set to obtain M groups of verification feature values of the verification road condition data set; Obtaining each of the training feature values in the training road condition data set, training each of the training feature values, and generating a gradient boosting decision tree model; Input each of the training feature values into the gradient boosting decision tree model for feature encoding to obtain a training feature code for the training road condition data set, wherein the training feature code is a code corresponding to each road condition feature in the training road condition data set; Performing feature coding on each of the verification feature values in the verification road condition data set to obtain a verification feature code of the verification road condition data set, wherein the verification feature code is a code corresponding to each road condition feature in the verification road condition data set; Calculating the feature similarity between the training feature code of each of the road condition features in the training road condition data set and the verification feature code of the corresponding road condition feature in the verification road condition data set; Extracting the road condition features whose feature similarity is greater than a similarity threshold to obtain target road condition features; Wherein, after feature encoding each of the verification feature values in the verification road condition data set, and before calculating the feature similarity between the training feature code of each of the road condition features in the training road condition data set and the verification feature code of the corresponding road condition feature in the verification road condition data set, the road condition data screening method further includes: Determine whether there is a missing code value between the training feature code and the verification feature code; If there is a missing code value between the training feature code and the verification feature code, the missing value is filled using a regularized maximum expectation algorithm to obtain a target training feature code and a target verification feature code; Wherein, after calculating the feature similarity between the training feature code of each of the road condition features in the training road condition data set and the verification feature code of the road condition features in the corresponding verification road condition data set, the road condition data screening further includes: Extracting the road condition features whose feature similarity is greater than the similarity threshold as normal features, and extracting the road condition features whose feature similarity is less than or equal to the similarity threshold as abnormal features; Labeling the normal features and the abnormal features respectively to obtain label information; Based on the label information, the normal features and the abnormal features are stored in a preset information database.
2. The method for screening road condition data according to claim 1, It is characterized in that The step of extracting features from each training road condition data in the training road condition data set to obtain N sets of training feature values of the training road condition data set includes: Acquire a feature parameter set, wherein the feature parameter set includes L parameter identifiers, where L is a positive integer; Obtain a corresponding feature extraction script according to each of the parameter identifiers; The feature extraction script is used to perform feature extraction on each training road condition data in the training road condition data set to obtain N groups of training feature values of the training road condition data set.
3. A road condition data screening device, It is characterized in that include: A traffic sample data set acquisition module, used to acquire a traffic sample data set, and divide the traffic sample data set into a training traffic data set and a verification traffic data set; A first feature extraction module, used for performing feature extraction on each training road condition data in the training road condition data set to obtain N groups of training feature values of the training road condition data set; A second feature extraction module is used to extract features from each verification road condition data in the verification road condition data set to obtain M groups of verification feature values of the verification road condition data set; A first feature encoding module is used to obtain each of the training feature values in the training road condition data set, train each of the training feature values, and generate a gradient boosting decision tree model; input each of the training feature values into the gradient boosting decision tree model for feature encoding, and obtain a training feature code of the training road condition data set, wherein the training feature code is a code corresponding to each road condition feature in the training road condition data set; A second feature coding module is used to perform feature coding on each of the verification feature values in the verification road condition data set to obtain a verification feature code of the verification road condition data set, wherein the verification feature code is a code corresponding to each road condition feature in the verification road condition data set; A feature similarity calculation module, used to calculate the feature similarity between the training feature code of each of the road condition features in the training road condition data set and the verification feature code of the corresponding road condition feature in the verification road condition data set; A target road condition feature generation module is used to extract road condition features whose feature similarity is greater than a similarity threshold to obtain target road condition features; The road condition data screening device further includes a judgment module for judging whether there is a missing code value between the training feature code and the verification feature code; A missing value filling module is used to fill in the missing value by using a regularized maximum expectation algorithm when the missing code value exists between the training feature code and the verification feature code, so as to obtain a target training feature code and a target verification feature code; The road condition data screening device further includes an extraction module, which is used to extract the road condition features whose feature similarity is greater than a similarity threshold as normal features, and extract the road condition features whose feature similarity is less than or equal to the similarity threshold as abnormal features; A label setting module, used to set labels for the normal features and the abnormal features respectively to obtain label information; A storage module is used to store the normal features and the abnormal features into a preset information database based on the label information.
4. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the road condition data screening method as described in any one of claims 1 to 2 is implemented.
5. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the road condition data screening method as described in any one of claims 1 to 2 is implemented.
