Driving condition data vacancy filling method and device, computer equipment and storage medium
The missing data in the vehicle driving condition data is processed through the KNN nearest neighbor filling algorithm, which solves the problem of wasted data set information and inaccurate mining results in the prior art, and improves the integrity and analysis efficiency of the data set.
Patent Information
- Application Number
- CN202411116618.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-12-13
AI Technical Summary
In the prior art, when processing vehicle driving working conditions data, the missing data processing method is limited, resulting in waste of data set information and inaccuracy and inobjectivity of data mining results.
Using the KNN nearest neighbor filling algorithm, by obtaining the Euclidean distance between the data set to be detected and the driving working condition data set, the Euclidean distance with the Euclidean distance smaller than the preset threshold is selected as the target working condition data, and according to the target working condition data The missing data in the detected data set is filled and the nearest neighbor weight is used to calculate the numerical value of the missing data.
Effectively process missing and redundant data, improve data accuracy and reliability, ensure the integrity of the data set, provide high-quality input for data analysis and model training, and improve data mining efficiency and model robustness.
Smart Images

Figure CN119128401A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of driving data processing, and in particular to a method, device, computer equipment, computer-readable storage medium and computer program product for filling in missing driving condition data. Background Art
[0002] In the analysis and application of automobile driving condition data, data preprocessing is a crucial step. The driving condition data contains various types of information, such as alarm information, motor status, battery status, etc., and there may be a large amount of redundant and missing data in these data. Data preprocessing can not only improve data quality, but also significantly improve the accuracy and efficiency of data mining. According to statistics, data preprocessing accounts for 60% of the data mining process, far exceeding the 10% of learning and training.
[0003] Since there are a lot of redundant and missing data in the working condition data, the choice of missing data processing method directly affects the efficiency and accuracy of data processing, so it is very necessary to choose an appropriate way to deal with missing data. At present, the application of methods for dealing with incomplete data problems is very limited. Dealing with incomplete data problems will cause the loss of original information in the data set, which is easy to lead to the waste of useful information in the data. At the same time, the discard of information affects the correctness and objectivity of data mining results to a certain extent.
[0004] Therefore, there is an urgent need for a method, device, computer equipment, computer-readable storage medium and computer program product for filling gaps in driving condition data, which can fully utilize the information of the data itself and make the estimated filling value as close as possible to the original data true value. Summary of the invention
[0005] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for filling gaps in driving condition data, which can fully utilize the information of the data itself and make the estimated filling value as close as possible to the original data true value.
[0006] In a first aspect, the present application provides a method for filling in missing driving condition data, comprising:
[0007] Obtaining a data set to be tested of a driving condition;
[0008] When there is missing data in the data set to be detected, obtaining a set of attribute columns and data types of the missing data;
[0009] Obtain a driving condition data set with complete data;
[0010] The missing data of the to-be-detected data set are filled according to the driving condition data set, the attribute column set of the missing data, and the data type.
[0011] In one embodiment, filling the missing data of the to-be-detected data set according to the driving condition data set, the attribute column set of the missing data, and the data type includes:
[0012] Using a KNN nearest neighbor filling algorithm, obtaining the Euclidean distance between the to-be-detected data set and the driving condition data set;
[0013] Filtering the driving condition data set to obtain driving condition data whose Euclidean distance is less than a preset distance threshold, and using the driving condition data as target condition data corresponding to the missing data;
[0014] The missing data in the to-be-detected data set are filled according to the target operating condition data.
[0015] In one embodiment, filling missing data in the to-be-detected data set according to the target operating condition data includes:
[0016] Obtaining the nearest neighbor weight corresponding to the target operating condition data;
[0017] Obtaining the value of the missing data according to the target operating condition data and the corresponding nearest neighbor weights;
[0018] The missing data in the to-be-detected data set is filled according to the value of the missing data.
[0019] In one embodiment, the calculation formula for obtaining the nearest neighbor weight corresponding to the target operating condition data is:
[0020] ;
[0021] Among them, d i (z i , g) is the Euclidean distance between the to-be-detected data set and the driving condition data set, and the calculation formula of the Euclidean distance is:
[0022] ;
[0023] Among them, z i is the feature of the data set to be detected, and g is the nearest neighbor data of the target operating condition data.
[0024] In one embodiment, the calculation formula for obtaining the value of the missing data according to the target operating condition data and the corresponding nearest neighbor weight is:
[0025] ;
[0026] Among them, x iis the value of the nearest neighbor data of the target operating condition data.
[0027] In one embodiment, the step of obtaining a data set to be detected of a driving condition includes:
[0028] Collect real-time driving condition data;
[0029] The real-time driving condition data is cleaned to obtain a data set of driving conditions to be tested.
[0030] In a second aspect, the present application further provides a device for filling in missing driving condition data, comprising:
[0031] An acquisition module, used to acquire a data set to be tested of a driving condition;
[0032] The acquisition module is further used to acquire the attribute column set and data type of the missing data when there is missing data in the data set to be detected;
[0033] The acquisition module is also used to acquire a driving condition data set with complete data;
[0034] A filling module is used to fill the missing data of the data set to be detected according to the driving condition data set, the attribute column set of the missing data and the data type.
[0035] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0036] Obtaining a data set to be tested of a driving condition;
[0037] When there is missing data in the data set to be detected, obtaining a set of attribute columns and data types of the missing data;
[0038] Obtain a driving condition data set with complete data;
[0039] The missing data of the to-be-detected data set are filled according to the driving condition data set, the attribute column set of the missing data, and the data type.
[0040] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0041] Obtaining a data set to be tested of a driving condition;
[0042] When there is missing data in the data set to be detected, obtaining a set of attribute columns and data types of the missing data;
[0043] Obtain a driving condition data set with complete data;
[0044] The missing data of the to-be-detected data set are filled according to the driving condition data set, the attribute column set of the missing data, and the data type.
[0045] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0046] Obtaining a data set to be tested of a driving condition;
[0047] When there is missing data in the data set to be detected, obtaining a set of attribute columns and data types of the missing data;
[0048] Obtain a driving condition data set with complete data;
[0049] The missing data of the to-be-detected data set are filled according to the driving condition data set, the attribute column set of the missing data, and the data type.
[0050] The above-mentioned driving condition data filling method, device, computer equipment, computer-readable storage medium and computer program product ensure the integrity of the data set by filling missing values, and provide comprehensive data support for data analysis and model training. Effectively handle missing and redundant data, improve the accuracy and reliability of data, and provide high-quality input for data mining. Through data completion, data analysis and pattern recognition can be performed faster, improving the overall efficiency of data mining. The processed data set can be better generalized to different driving environments and conditions, improving the robustness of the model. Since this method is specifically aimed at missing data processing, it can significantly reduce the time for data preprocessing, especially for large-scale data sets. The missing problems in the data are uniformly handled, so that different data sets or different records in the same data set have better consistency. Through intelligent gap filling methods, the original characteristics and information of the data are retained to the maximum extent, avoiding oversimplification or misinterpretation. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0052] FIG1 is a diagram showing an application environment of a method for filling a gap in driving condition data in one embodiment;
[0053] FIG2 is a schematic flow chart of a method for filling a gap in driving condition data in one embodiment;
[0054] FIG3 is a schematic flow chart of a method for filling a gap in driving condition data in another embodiment;
[0055] FIG4 is a schematic diagram of the overall process of the method for filling in missing driving condition data in an embodiment of the present application;
[0056] FIG5 is a structural block diagram of a device for filling in missing driving condition data in one embodiment;
[0057] FIG. 6 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0059] The method for filling in missing driving condition data provided in the embodiment of the present application can be applied in the application environment shown in FIG1 . In which, the terminal 102 communicates with the server 104 via a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers.
[0060] The server 104 obtains a data set to be tested of driving conditions; if there is missing data in the data set to be tested, obtains a set of attribute columns and data types of the missing data; obtains a driving condition data set with complete data; and fills in the missing data of the data set to be tested according to the driving condition data set, the set of attribute columns and data types of the missing data.
[0061] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices may be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 104 may be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.
[0062] In an exemplary embodiment, as shown in FIG2 , a method for filling in missing driving condition data is provided, which is described by taking the method applied to the server in FIG1 as an example, and includes the following steps S202 to S208 . Among them:
[0063] Step S202, obtaining a data set to be tested of the driving condition.
[0064] Specifically, first, various types of driving condition data generated during driving are collected from the vehicle's sensors and data recording systems, such as alarm information, motor information, battery information, location information, time information, and fault information. Integrate data from different sources and types to form a comprehensive driving condition data set, which may include data from different vehicles and different time periods. Identify and process inconsistent, erroneous, or abnormal data points in the data set to ensure the accuracy and reliability of the data set. Taking the information collected by a big data platform as an example, the collected data includes event type, time, longitude and latitude, vehicle speed, acceleration, altitude, ambient temperature, battery cell temperature, battery voltage, battery cell voltage, battery current, battery SOC, motor speed, actual motor output torque, motor temperature, air conditioning switch, air conditioning set temperature, cockpit temperature, air conditioning compressor power, date, province, city, etc. The collection frequency can be 10s per frame.
[0065] The date, province and city are quality data and cannot be expressed by data. Other data such as speed, acceleration, actual output torque of the motor, etc. are data that need to be pre-processed.
[0066] Step S204: when there is missing data in the data set to be detected, obtain the attribute column set and data type of the missing data.
[0067] Specifically, first, you need to identify which attribute columns (columns) in the dataset have missing values. This can be done in Pandas using functions such as isnull() or notnull(). Once the columns with missing values are identified, these columns are formed into a set for subsequent processing. For these attribute columns with missing values, it is necessary to clarify the data type of each column, such as numeric, categorical, time series, etc. According to the distribution of missing values (completely missing at random MCAR, random missing MAR, non-random missing MNAR) and data type, choose the most appropriate missing value processing method. Processing methods may include deleting rows or columns with missing values, using mean or median filling, forward or backward filling, linear interpolation, regression model prediction, KNN algorithm filling, etc.
[0068] Step S206: Acquire a driving condition data set with complete data.
[0069] Specifically, filter out data records from the original data set that have no missing values on all relevant attributes. This means that these records have valid measurements or observations in all considered attribute columns. After filtering out data records without missing values, it may be necessary to further cleanse these data to ensure their quality. This may include removing outliers, correcting erroneous or inconsistent data, etc. The filtered and cleaned data are integrated into a separate data set, which will be used for subsequent analysis. While creating the complete data set, keep a backup of the original data set so that you can make comparisons or use the original data for other types of analysis when needed.
[0070] Step S208, filling the missing data of the dataset to be detected according to the driving condition dataset, the attribute column set of the missing data and the data type.
[0071] Specifically, first, analyze the complete driving condition data set to understand the distribution, statistical characteristics and potential data patterns of the data. Determine which attribute columns in the data set to be tested have missing values and record the set of these attribute columns. Pay attention to the data type of the attribute column with missing data, such as numeric (integer or floating point), categorical (string or Boolean), time series, etc. Select the most appropriate missing value filling strategy based on the data type of the attribute column and the mode of missing data (completely missing at random MCAR, random missing MAR, non-random missing MNAR). For numeric data, the mean, median, mode or model-based methods (such as KNN, regression) may be used to fill missing values. For categorical data, mode filling or pattern recognition-based methods can be used to select the most appropriate filling value. For time series data, forward filling, backward filling or time series analysis methods (such as linear interpolation, polynomial fitting) may be used to fill missing values. Use machine learning models such as decision trees, random forests or KNN to predict the values of missing attributes based on other attributes. When necessary, use multiple imputation methods to generate multiple filling versions to evaluate the uncertainty of the filling results. After filling the missing values, verify the consistency and rationality of the data set to ensure that the filling results are consistent with the statistical characteristics of the data.
[0072] In the above-mentioned driving condition data filling method, the integrity of the data set is ensured by filling the missing values, providing comprehensive data support for data analysis and model training. Effectively handle missing and redundant data, improve the accuracy and reliability of data, and provide high-quality input for data mining. Through data completion, data analysis and pattern recognition can be performed faster, improving the overall efficiency of data mining. The processed data set can be better generalized to different driving environments and conditions, improving the robustness of the model. Since this method is specifically aimed at missing data processing, it can significantly reduce the time for data preprocessing, especially for large-scale data sets. The missing problems in the data are uniformly handled, so that different data sets or different records in the same data set have better consistency. Through intelligent gap filling methods, the original characteristics and information of the data are retained to the maximum extent, avoiding oversimplification or misinterpretation.
[0073] In an exemplary embodiment, as shown in FIG3 , the missing data of the to-be-detected data set are filled according to the driving condition data set, the attribute column set of the missing data, and the data type, including:
[0074] Step S302, using the KNN nearest neighbor filling algorithm to obtain the Euclidean distance between the to-be-detected data set and the driving condition data set;
[0075] Step S304, filtering out driving condition data whose Euclidean distance is less than a preset distance threshold from the driving condition data set, and using the driving condition data as target condition data corresponding to the missing data;
[0076] Step S306: fill in the missing data in the to-be-detected data set according to the target operating condition data.
[0077] Specifically, KNN is a distance-based algorithm used for classification and regression tasks. In missing data processing, KNN is used to fill in missing values by finding the K neighbors closest to the target data point. First, the Euclidean distance between each record in the dataset to be tested and each record in the driving condition dataset is calculated. Euclidean distance is a common method for measuring the straight-line distance between two points in multidimensional space.
[0078] Based on the calculated Euclidean distance, the driving condition data records with a distance less than a preset threshold are screened out. This threshold is used to determine which records are "close" enough to the target record to be used as a reference to fill the missing values. From the screened neighboring data, the K nearest records are selected as the target driving condition data. These data will be used to estimate the missing values. The missing values are filled in according to the target driving condition data. For numerical attributes, the mean or weighted mean of the K nearest neighbors is usually used for filling; for categorical attributes, the mode or distance-based weighted voting can be used to determine the filling value. If the dataset contains categorical attributes, KNN filling may involve finding the K nearest records and filling the missing values based on the mode of these records. In some cases, the values of the neighbors can be weighted according to the distance between them and the target data point. The closer the neighbors are, the greater the contribution to the filling value. For each missing data point in the dataset to be tested, repeat the above steps until all missing values are filled. After the filling is completed, verify the rationality of the filling results and ensure the consistency and accuracy of the dataset. The filled dataset to be tested is updated to make it a complete dataset, which can be used for subsequent data analysis, modeling or decision support.
[0079] In this embodiment, by adopting the KNN algorithm to fill missing values, the existing information in the data set can be effectively used to estimate the missing values, thereby improving the completeness of the data set and the accuracy of subsequent analysis.
[0080] In an exemplary embodiment, filling missing data in a to-be-detected data set according to target operating condition data includes:
[0081] Obtain the nearest neighbor weight corresponding to the target working condition data;
[0082] According to the target working condition data and the corresponding nearest neighbor weights, the value of the missing data is obtained;
[0083] Fill the missing data in the dataset to be tested according to the value of the missing data.
[0084] Specifically, in the KNN algorithm, each nearest neighbor data point is given a weight based on its distance from the target data point. Usually, the weight is inversely proportional to the distance, that is, the closer the point is, the greater the weight.
[0085] Use the value of each nearest neighbor data point and the corresponding weight to calculate the estimated value of the missing data. If you are dealing with numerical data, this usually involves the calculation of a weighted average. For categorical data, it may involve a weighted voting mechanism. For each missing attribute, calculate a weighted average or weighted mode based on the values and weights of its K nearest neighbors. The weight ensures that neighbors closer to the target data point have a greater influence on the filled value. Fill the calculated value of the missing data into the corresponding missing position in the dataset to be tested. In this way, the originally missing data point is assigned an estimated value. If there are multiple missing values in the dataset to be tested, repeat the above steps to calculate and fill an estimated value for each missing value. After filling, check the consistency and logical rationality of the dataset to ensure that the filled values are consistent in the dataset. Update the dataset to be tested to include the filled missing values. Now this dataset is complete and can be used for further analysis or model training. Record the parameters used in the filling process, such as K value, distance threshold, weight calculation method, etc., to facilitate subsequent analysis and reproduction of results. When using KNN for filling, it is necessary to consider the distribution characteristics of the data to ensure that the filled values are statistically consistent with the existing data. Finally, to verify the filling effect, methods such as cross-validation can be used to evaluate whether the performance of the model after filling has improved.
[0086] In this embodiment, through this process, the missing values can be estimated using the existing information in the data set, thereby improving the completeness of the data and the accuracy of the analysis. This method is particularly suitable for situations where the amount of missing data is large or the missing data pattern is complex.
[0087] In an exemplary embodiment, the calculation formula for obtaining the nearest neighbor weight corresponding to the target operating condition data is:
[0088] ;
[0089] Among them, d i (z i , g) is the Euclidean distance between the dataset to be tested and the driving condition dataset. The calculation formula of the Euclidean distance is:
[0090] ;
[0091] Among them, z i is the feature of the data set to be detected, and g is the nearest neighbor data of the target working condition data.
[0092] In an exemplary embodiment, according to the target operating condition data and the corresponding nearest neighbor weight, the calculation formula for obtaining the value of the missing data is:
[0093] ;
[0094] Among them, x i is the value of the nearest neighbor data of the target working condition data.
[0095] In an exemplary embodiment, obtaining a to-be-detected data set of a driving condition includes:
[0096] Collect real-time driving condition data;
[0097] The real-time driving condition data is cleaned and processed to obtain the data set of the driving condition to be tested.
[0098] Specifically, as shown in FIG4 , the collected real-time driving condition data is preprocessed to remove invalid or erroneous data points to ensure the quality of the data set. Data cleaning steps may include removing outliers, filling missing values, unifying formats, removing duplicate records, etc. Integrate data from different sources and types into a unified data set for subsequent analysis and processing. Perform necessary data conversions, such as unit conversion and data type conversion, to meet the needs of analysis. According to specific analysis objectives or model requirements, filter out useful data fields and records, and remove irrelevant or redundant data. Construct the cleaned and processed data into a structured data set to be tested, which is "clean" and ready to be used for further analysis and model training. Store the constructed data set to be tested in a suitable database or data warehouse for use in data analysis and mining.
[0099] In this embodiment, through this series of steps, it can be ensured that the data obtained from the real-time driving conditions of the vehicle are of high quality and high availability, providing a solid foundation for subsequent data analysis and decision-making.
[0100] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0101] Based on the same inventive concept, the embodiment of the present application also provides a driving condition data filling device for implementing the driving condition data filling method involved in the above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more driving condition data filling devices provided below can refer to the limitations of the driving condition data filling method above, and will not be repeated here.
[0102] In an exemplary embodiment, as shown in FIG5 , a device for filling in missing driving condition data is provided, comprising: an acquisition module 502 for acquiring a data set to be detected of a driving condition;
[0103] The acquisition module 502 is also used to acquire the attribute column set and data type of the missing data when there is missing data in the data set to be detected;
[0104] The acquisition module 502 is also used to acquire a driving condition data set with complete data;
[0105] The filling module 504 is used to fill the missing data of the to-be-detected data set according to the driving condition data set, the attribute column set of the missing data, and the data type.
[0106] In an exemplary embodiment, the filling module 504 is also used to adopt the KNN nearest neighbor filling algorithm to obtain the Euclidean distance between the data set to be detected and the driving condition data set; filter out driving condition data whose Euclidean distance is less than a preset distance threshold from the driving condition data set, and use the driving condition data as the target condition data corresponding to the missing data; and fill the missing data in the data set to be detected according to the target condition data.
[0107] In an exemplary embodiment, the filling module 504 is also used to obtain the nearest neighbor weight corresponding to the target operating condition data; obtain the value of the missing data according to the target operating condition data and the corresponding nearest neighbor weight; and fill the missing data in the data set to be detected according to the value of the missing data.
[0108] In an exemplary embodiment, the calculation formula for obtaining the nearest neighbor weight corresponding to the target operating condition data is:
[0109] ;
[0110] Among them, d i (z i , g) is the Euclidean distance between the dataset to be tested and the driving condition dataset. The calculation formula of the Euclidean distance is:
[0111] ;
[0112] Among them, z i is the feature of the data set to be detected, and g is the nearest neighbor data of the target working condition data.
[0113] In an exemplary embodiment, according to the target operating condition data and the corresponding nearest neighbor weight, the calculation formula for obtaining the value of the missing data is:
[0114] ;
[0115] Among them, x i is the value of the nearest neighbor data of the target working condition data.
[0116] In an exemplary embodiment, the acquisition module 502 is also used to collect real-time driving condition data;
[0117] The processing module is used to perform data cleaning on the real-time driving condition data to obtain a data set of the driving condition to be tested.
[0118] Each module in the above driving condition data supplementation device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0119] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG6. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. 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 a data set to be detected for driving conditions. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication 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 method for filling a gap in driving condition data is implemented.
[0120] Those skilled in the art will understand that the structure shown in FIG. 6 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0121] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0122] Obtaining a data set to be tested of a driving condition;
[0123] When there is missing data in the data set to be tested, obtain the attribute column set and data type of the missing data;
[0124] Obtain a driving condition data set with complete data;
[0125] According to the driving condition dataset, the attribute column set of missing data and the data type, the missing data of the dataset to be tested are filled.
[0126] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0127] The KNN nearest neighbor filling algorithm is used to obtain the Euclidean distance between the dataset to be tested and the driving condition dataset;
[0128] Filtering driving condition data whose Euclidean distance is less than a preset distance threshold from the driving condition data set, and using the driving condition data as target condition data corresponding to the missing data;
[0129] According to the target working condition data, the missing data in the data set to be tested are filled.
[0130] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0131] Obtain the nearest neighbor weight corresponding to the target working condition data;
[0132] According to the target working condition data and the corresponding nearest neighbor weights, the value of the missing data is obtained;
[0133] Fill the missing data in the dataset to be tested according to the value of the missing data.
[0134] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0135] The calculation formula for obtaining the nearest neighbor weight corresponding to the target working condition data is:
[0136] ;
[0137] Among them, d i (z i , g) is the Euclidean distance between the dataset to be tested and the driving condition dataset. The calculation formula of the Euclidean distance is:
[0138] ;
[0139] Among them, z i is the feature of the data set to be detected, and g is the nearest neighbor data of the target working condition data.
[0140] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0141] According to the target operating condition data and the corresponding nearest neighbor weights, the calculation formula for obtaining the value of the missing data is:
[0142] ;
[0143] Among them, x i is the value of the nearest neighbor data of the target working condition data.
[0144] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0145] Collect real-time driving condition data;
[0146] The real-time driving condition data is cleaned and processed to obtain the data set of the driving condition to be tested.
[0147] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0148] Obtaining a data set to be tested of a driving condition;
[0149] When there is missing data in the data set to be tested, obtain the attribute column set and data type of the missing data;
[0150] Obtain a driving condition data set with complete data;
[0151] According to the driving condition dataset, the attribute column set of missing data and the data type, the missing data of the dataset to be tested are filled.
[0152] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0153] The KNN nearest neighbor filling algorithm is used to obtain the Euclidean distance between the dataset to be tested and the driving condition dataset;
[0154] Filtering driving condition data whose Euclidean distance is less than a preset distance threshold from the driving condition data set, and using the driving condition data as target condition data corresponding to the missing data;
[0155] According to the target working condition data, the missing data in the data set to be tested are filled.
[0156] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0157] Obtain the nearest neighbor weight corresponding to the target working condition data;
[0158] According to the target working condition data and the corresponding nearest neighbor weights, the value of the missing data is obtained;
[0159] Fill the missing data in the dataset to be tested according to the value of the missing data.
[0160] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0161] The calculation formula for obtaining the nearest neighbor weight corresponding to the target working condition data is:
[0162] ;
[0163] Among them, d i (z i , g) is the Euclidean distance between the dataset to be tested and the driving condition dataset. The calculation formula of the Euclidean distance is:
[0164] ;
[0165] Among them, z i is the feature of the data set to be detected, and g is the nearest neighbor data of the target working condition data.
[0166] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0167] According to the target operating condition data and the corresponding nearest neighbor weights, the calculation formula for obtaining the value of the missing data is:
[0168] ;
[0169] Among them, x i is the value of the nearest neighbor data of the target working condition data.
[0170] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0171] Collect real-time driving condition data;
[0172] The real-time driving condition data is cleaned and processed to obtain the data set of the driving condition to be tested.
[0173] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0174] Obtaining a data set to be tested of a driving condition;
[0175] When there is missing data in the data set to be tested, obtain the attribute column set and data type of the missing data;
[0176] Obtain a driving condition data set with complete data;
[0177] According to the driving condition dataset, the attribute column set of missing data and the data type, the missing data of the dataset to be tested are filled.
[0178] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0179] The KNN nearest neighbor filling algorithm is used to obtain the Euclidean distance between the dataset to be tested and the driving condition dataset;
[0180] Filtering driving condition data whose Euclidean distance is less than a preset distance threshold from the driving condition data set, and using the driving condition data as target condition data corresponding to the missing data;
[0181] According to the target working condition data, the missing data in the data set to be tested are filled.
[0182] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0183] Obtain the nearest neighbor weight corresponding to the target working condition data;
[0184] According to the target working condition data and the corresponding nearest neighbor weights, the value of the missing data is obtained;
[0185] Fill the missing data in the dataset to be tested according to the value of the missing data.
[0186] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0187] The calculation formula for obtaining the nearest neighbor weight corresponding to the target working condition data is:
[0188] ;
[0189] Among them, d i (z i, g) is the Euclidean distance between the dataset to be tested and the driving condition dataset. The calculation formula of the Euclidean distance is:
[0190] ;
[0191] Among them, z i is the feature of the data set to be detected, and g is the nearest neighbor data of the target working condition data.
[0192] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0193] According to the target operating condition data and the corresponding nearest neighbor weights, the calculation formula for obtaining the value of the missing data is:
[0194] ;
[0195] Among them, x i is the value of the nearest neighbor data of the target working condition data.
[0196] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0197] Collect real-time driving condition data;
[0198] The real-time driving condition data is cleaned and processed to obtain the data set of the driving condition to be tested.
[0199] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0200] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method 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 the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0201] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0202] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for filling in gaps in driving condition data, It is characterized in that The method comprises: Obtaining a data set to be tested of a driving condition; When there is missing data in the data set to be detected, obtaining a set of attribute columns and data types of the missing data; Obtain a driving condition data set with complete data; The missing data of the to-be-detected data set are filled according to the driving condition data set, the attribute column set of the missing data, and the data type.
2. The method according to claim 1, It is characterized in that The filling of the missing data of the to-be-detected data set according to the driving condition data set, the attribute column set of the missing data, and the data type includes: Using a KNN nearest neighbor filling algorithm, obtaining the Euclidean distance between the to-be-detected data set and the driving condition data set; Filtering the driving condition data set to obtain driving condition data whose Euclidean distance is less than a preset distance threshold, and using the driving condition data as target condition data corresponding to the missing data; The missing data in the to-be-detected data set are filled according to the target operating condition data.
3. The method according to claim 2, It is characterized in that The step of filling missing data in the to-be-detected data set according to the target operating condition data includes: Obtaining the nearest neighbor weight corresponding to the target operating condition data; Obtaining the value of the missing data according to the target operating condition data and the corresponding nearest neighbor weights; The missing data in the to-be-detected data set is filled according to the value of the missing data.
4. The method according to claim 3, It is characterized in that The calculation formula for obtaining the nearest neighbor weight corresponding to the target operating condition data is: ; Among them, d i (z i , g) is the Euclidean distance between the to-be-detected data set and the driving condition data set, and the calculation formula of the Euclidean distance is: ; Among them, z i is the feature of the data set to be detected, and g is the nearest neighbor data of the target operating condition data.
5. The method according to claim 3, It is characterized in that The calculation formula for obtaining the value of the missing data according to the target operating condition data and the corresponding nearest neighbor weight is: ; Among them, x i is the value of the nearest neighbor data of the target operating condition data.
6. The method according to claim 1, It is characterized in that The step of obtaining a data set to be detected of a driving condition includes: Collect real-time driving condition data; The real-time driving condition data is cleaned to obtain a data set of driving conditions to be tested.
7. A device for filling in missing driving condition data, It is characterized in that The device comprises: An acquisition module, used to acquire a data set to be detected of a driving condition; The acquisition module is further used to acquire the attribute column set and data type of the missing data when there is missing data in the data set to be detected; The acquisition module is also used to acquire a driving condition data set with complete data; A filling module is used to fill the missing data of the data set to be detected according to the driving condition data set, the attribute column set of the missing data and the data type.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Vehicle control method, electronic device, vehicle, computer medium and product
CN120003488A
