A charging pile state assessment method and device based on CNN and random forest
By combining convolutional neural network and random forest methods, the problem of inaccurate charging pile status evaluation is solved, and a comprehensive and accurate evaluation of charging pile status is achieved. It is suitable for evaluation under multiple factors, improving the accuracy of the evaluation and stability.
Patent Information
- Application Number
- CN202211287981.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-20
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2042-10-20
AI Technical Summary
It is difficult for the existing technology to conduct a comprehensive and effective status evaluation of charging piles, resulting in the inability to accurately detect faults. Especially in the scenario where the number of charging piles is rapidly increasing, manual inspection is difficult to meet the demand.
Using CNN and random forest methods, the charging pile data is collected for preprocessing, a state hierarchy strategy is established, the training set and test set are divided, and the features are extracted using convolutional neural network and combined with random forests to generate a decision tree to realize the state of the charging pile. comprehensive assessment.
It improves the accuracy and comprehensiveness of charging pile status evaluation, enhances the generalization ability of the model, and can more effectively judge the overall status of the charging pile, and is suitable for charging pile status evaluation under multiple factors.
Smart Images

Figure CN115619271B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric vehicles, and in particular to a charging pile state assessment method and device based on CNN and random forest. Background Art
[0002] With the continuous advancement of the country in the field of new energy, electric vehicles have achieved large-scale development in recent years. Charging piles are an important part between electric vehicles and power supply. The safety and reliability of charging piles will directly affect the safety of electricity use. In the past, the detection of charging pile failures was mainly discovered and processed through manual on-site detection. This operation and maintenance mode is no longer sustainable in the future when the number of charging piles is growing rapidly. Therefore, it has become a current trend to use cloud platforms to store and analyze charging pile data transmitted through wired networks, wireless networks, etc. Through PTZ big data analysis, the status of charging piles can be evaluated.
[0003] For example, patent document CN113205260A discloses a health status assessment method for electric vehicle charging piles based on digital twins, including the following steps: Step 1: According to the charging pile mechanism, the charging pile is divided into an electrical performance evaluation index C and a safety performance evaluation index S, and the electrical performance evaluation index C and the safety performance evaluation index S respectively include several lower-level sub-indicators; Step 2: According to the required evaluation of the charging pile capacity, topological structure, operation mechanism, and surrounding environment, a charging pile digital twin model is established for the charging pile; Step 3: The Monte Carlo method is used to simulate the charging pile digital twin model multiple times to obtain the health status index results evaluated by simulation; Step 4: A variety of evaluation methods are used to evaluate the weights of the sub-indicators of the electrical performance evaluation index C and the safety performance evaluation index S, and the combined weights of the indicators are calculated based on the consistency combination algorithm; Step 5: Based on the health status indicator results and the combined weights, the indicator results of the electrical performance evaluation index C and the safety performance evaluation index S of the electric vehicle charging pile are calculated; Step 6: Based on the health status judgment conditions of the electric vehicle charging pile, the health status of the electric vehicle charging pile is rated, and different response measures are taken for different ratings.
[0004] The method provided in the above patent document simulates the operation of the charging pile based on the digital twin, and evaluates the health status of the charging pile based on multiple evaluation indicators and corresponding weights. However, this method is based on simulation technology, and it is difficult to fully simulate the operating status of the charging pile, resulting in the method being unable to conduct a comprehensive and effective evaluation of the charging pile. Summary of the invention
[0005] The present invention provides a charging pile state assessment method and device based on CNN and random forest, which can comprehensively and effectively assess the state of the charging pile.
[0006] A charging pile status assessment method based on CNN and random forest, comprising:
[0007] Collect charging pile data and pre-process it;
[0008] Establishing a state classification strategy, and classifying the preprocessed charging pile data according to the state classification strategy to obtain a state set;
[0009] Divide the training set and the test set according to the state set;
[0010] A data feature matrix is established for each divided training set, and the data feature matrix is input into a convolutional neural network for training, and convolutional neural network parameters are saved when the convolutional neural network converges;
[0011] According to the convolutional neural network parameters, the fully connected layer features of the convolutional neural network are used as inputs of the random forest, the fully connected layer features are resampled to generate a random charging pile data feature set, a corresponding decision tree is generated according to the random charging pile data feature set, multiple decision trees form a random forest, and the random forest is evaluated according to the test set;
[0012] Real-time charging pile data is collected and processed to obtain a real-time status set, the real-time status set is input into the random forest, the discrimination result of each decision tree is obtained, the mode of the discrimination result of each decision tree is taken, and the real-time status of the charging pile is obtained.
[0013] Furthermore, the charging pile data includes voltage values, current values, current stabilization accuracy, and voltage stabilization accuracy of the charging pile at multiple times within a preset time period.
[0014] Furthermore, preprocessing of the charging pile data includes filtering, cleaning, and supplementing or eliminating missing data.
[0015] Furthermore, the pre-processed charging pile data is classified according to the state classification strategy to obtain a state set, including:
[0016] Determine whether the voltage value, current value, current stabilization accuracy and voltage stabilization accuracy at each moment exceed the corresponding preset thresholds;
[0017] Calculate the corresponding score according to whether each voltage value, current value, current stabilization accuracy and voltage stabilization accuracy exceeds the corresponding preset threshold and the degree to which it exceeds the preset threshold;
[0018] According to the calculated corresponding scores and state classification strategy, the states corresponding to each group of voltage values, current values, current stabilization accuracy and voltage stabilization accuracy are obtained, and the states corresponding to multiple groups of voltage values, current values, current stabilization accuracy and voltage stabilization accuracy form the state set.
[0019] Further, dividing the training set and the test set according to the state set includes:
[0020] Dividing the state set into k groups of data evenly;
[0021] Take one of the data sets as a test set and the remaining k-1 data sets as a training set, and repeat this step until k different test sets and training sets are obtained.
[0022] Furthermore, the data feature matrix is as follows:
[0023]
[0024] Among them, H n*4 represents the data feature matrix, n represents the number of groups of voltage value, current value, current stabilization accuracy and voltage stabilization accuracy, H p1 is the voltage value in the pth group, H p2 is the current value in the pth group, H p3 is the steady flow accuracy in the pth group, H p4 is the voltage regulation accuracy in the pth group.
[0025] Furthermore, the data feature matrix is input into a convolutional neural network for training, including:
[0026] Performing a two-dimensional convolution operation on the data feature matrix to obtain multiple convolution layer feature maps;
[0027] Performing nonlinear processing of the convolutional layer feature map using a relu activation function to obtain a convolutional linear rectification feature;
[0028] Performing standardization on the convolution linear rectification features;
[0029] Perform the maximum pooling operation on the standardized convolution linear rectification features to obtain the pooling layer features;
[0030] A convolution operation is performed on the pooling layer features to obtain fully connected layer features.
[0031] Furthermore, the fully connected layer features are resampled to generate a random charging pile data feature set, including:
[0032] Take multiple fully connected layer features as a data set, randomly select a fully connected layer feature from the data set and put it into a sampling set, then copy the fully connected layer feature in the original data set, and obtain a sampling set containing multiple fully connected layer features after multiple random selections. Repeat the above steps to obtain multiple sampling sets as random charging pile data feature sets.
[0033] Furthermore, a corresponding decision tree is generated according to the random charging pile data feature set, including:
[0034] Each sampling set in the random charging pile data feature set is used as the root node of the decision tree, and the state of the charging pile is used as the leaf node;
[0035] Divide the attributes to form branch nodes: set the number of attributes, randomly select some attributes from multiple attributes as subsets, calculate the Gini index of each attribute in the subset, select the attribute with the smallest Gini index as the optimal partitioning attribute, divide the sampling set to form branch nodes, and repeat the above steps to divide until the Gini index is less than the preset threshold.
[0036] A charging pile state assessment device based on CNN and random forest, comprising:
[0037] Data acquisition module, used to collect charging pile data and perform pre-processing;
[0038] Establishing a state classification strategy for classifying the preprocessed charging pile data according to the state classification strategy to obtain a state set;
[0039] A partitioning module, used for partitioning a training set and a test set according to the state set;
[0040] A training module, used to establish a data feature matrix for each divided training set, and input the data feature matrix into a convolutional neural network for training, and save the convolutional neural network parameters when the convolutional neural network converges;
[0041] A decision module, configured to use the fully connected layer features of the convolutional neural network as input of a random forest according to the convolutional neural network parameters, resample the fully connected layer features, generate a random charging pile data feature set, generate a corresponding decision tree according to the random charging pile data feature set, multiple decision trees form a random forest, and evaluate the random forest according to the test set;
[0042] The evaluation module is used to collect real-time charging pile data for processing to obtain a real-time status set, input the real-time status set into the random forest, obtain the discrimination result of each decision tree, take the mode of the discrimination result of each decision tree, and obtain the real-time status of the charging pile.
[0043] The charging pile status assessment method and device based on CNN and random forest provided by the present invention have at least the following beneficial effects:
[0044] Multi-source indicators of the charging pile during operation were collected, and multi-level and multi-layer divisions were carried out according to different quantitative standards of the indicators; convolutional neural network CNN was used, and convolution kernels of different sizes were used for convolution, so that the feature extraction of the collected charging pile data was more sufficient; in view of the possible insufficient generalization ability of CNN, a combination of CNN and random forest network was used for the evaluation of the charging pile status. The main idea of random forest is to assemble weak classifiers into a strong classifier, which can effectively improve the generalization ability of the model, and use convolutional neural network to extract high-order features for judging the status of charging piles, and then use random forest as a high-order feature classifier, so as to achieve the evaluation of the charging pile status under comprehensive multi-factors, making the judgment of the overall status of the charging pile more comprehensive and accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A flowchart of an embodiment of a charging pile status assessment method based on CNN and random forest provided by the present invention.
[0046] Figure 2 A flowchart of an embodiment of obtaining a state set in the charging pile state assessment method using CNN and random forest provided by the present invention.
[0047] Figure 3 A flowchart of an embodiment of dividing a training set and a test set in a charging pile state assessment method based on CNN and random forest provided by the present invention.
[0048] Figure 4 A flowchart of an embodiment of convolutional neural network training in the charging pile state assessment method of CNN and random forest provided by the present invention.
[0049] Figure 5 A structural schematic diagram of an embodiment of a charging pile state assessment device based on CNN and random forest provided by the present invention. DETAILED DESCRIPTION
[0050] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0051] refer to Figure 1 In some embodiments, a charging pile state assessment method based on CNN and random forest is provided, comprising:
[0052] S1, collect charging pile data and pre-process it;
[0053] S2. Establish a state classification strategy, classify the pre-processed charging pile data according to the state classification strategy, and obtain a state set;
[0054] S3, dividing the training set and the test set according to the state set;
[0055] S4, establishing a data feature matrix for each divided training set, and inputting the data feature matrix into a convolutional neural network for training, and saving the convolutional neural network parameters when the convolutional neural network converges;
[0056] S5. According to the convolutional neural network parameters, the fully connected layer features of the convolutional neural network are used as the input of the random forest, the fully connected layer features are resampled, a random charging pile data feature set is generated, a corresponding decision tree is generated according to the random charging pile data feature set, multiple decision trees form a random forest, and the random forest is evaluated according to the test set;
[0057] S6. Collect real-time charging pile data and process it to obtain a real-time status set, input the real-time status set into the random forest, obtain the discrimination result of each decision tree, and take the mode of the discrimination result of each decision tree as the final evaluation result of the charging pile status.
[0058] Specifically, in step S1, the charging pile data is used as the sample required for training, and there are two main ways to obtain it: one is to use IOT technology to transmit the data of the charging pile under normal operation or various abnormal operation conditions collected by the information sensor to the cloud server; the other is to use circuit simulation software to simulate under normal operation or various abnormal operation conditions to obtain data; considering the complexity of actual conditions, in order to ensure the maximum authenticity of sample collection, the first collection method is preferred for sample collection.
[0059] In some embodiments, the charging pile data includes the voltage value, current value, current stabilization accuracy and voltage stabilization accuracy of the charging pile at multiple times within a preset time period.
[0060] The data collection process may cause data anomalies, noise, and data inconsistency due to electromagnetic interference, changes in ambient temperature and humidity, or data anomalies and missing data due to packet loss, interruption, etc. These problematic samples will affect data analysis and model training. In some embodiments, the preprocessing of the charging pile data includes filtering, cleaning, and supplementing or eliminating missing data.
[0061] Further, refer to Figure 2 In step S2, a state classification strategy is established. According to the quality of the parameters collected when the charging pile is running, the charging pile can be divided into three state levels: healthy, minor fault and serious fault. According to the state classification strategy, the pre-processed charging pile data is classified to obtain a state set, including:
[0062] S21, determining whether the voltage value, current value, current stabilization accuracy, and voltage stabilization accuracy at each moment exceed corresponding preset thresholds;
[0063] S22, calculating a corresponding score according to whether each voltage value, current value, current stabilization accuracy, and voltage stabilization accuracy exceeds a corresponding preset threshold value and the degree to which the values exceed the preset threshold value;
[0064] S23. According to the calculated corresponding scores and state classification strategy, the states corresponding to each group of voltage values, current values, current stabilization accuracy and voltage stabilization accuracy are obtained, and the states corresponding to multiple groups of voltage values, current values, current stabilization accuracy and voltage stabilization accuracy form the state set.
[0065] Specifically, if the collected voltage value does not exceed the preset threshold or exceeds the preset threshold to a certain extent, a corresponding score X1 is given; if the collected current value does not exceed the preset threshold or the preset threshold to a certain extent, a corresponding score X2 is given; if the collected steady current accuracy does not exceed the preset threshold or the preset threshold to a certain extent, a corresponding score X3 is given; if the collected voltage stabilization accuracy does not exceed the preset threshold or the preset threshold to a certain extent, a corresponding score X4 is given; finally, the total score of each group of data is calculated: X = X1 + X2 + X3 + X4. According to the total score X in the preset range, the state level corresponding to the group of data is determined.
[0066] In some embodiments, if the collected data does not exceed the preset threshold, a score of 25 points is assigned; if it exceeds the preset threshold by less than 10%, a score of 20 points is assigned; if it exceeds the preset threshold by more than 10% but less than 20%, a score of 15 points is assigned; if it exceeds the preset threshold by more than 20%, a score of 10 points is assigned. Finally, the total score X is calculated. If the total score X=100, the status is healthy; if the total score X∈(85,100), the status is a minor fault; if the total score X∈(0,85), the status is a serious fault.
[0067] Further, refer to Figure 3 In step S3, dividing the training set and the test set according to the state set includes:
[0068] S31, dividing the state set into k groups of data on average;
[0069] S32. Use one of the groups of data as a test set and the remaining k-1 groups of data as a training set, and repeat this step until k different test sets and training sets are obtained.
[0070] The method of dividing the training set is combined with the actual sample situation. For example, if the number of samples is limited, the efficiency of maximizing the use of data should be considered, so the above-mentioned "cross-validation" method can be used.
[0071] For example, there are 100 status data in the status set, which are evenly divided into 10 groups, each with 10 status data. The first group of data is used as the test set, and the remaining 9 groups of data are used as training sets. After that, the second group of data is used as the test set, and the remaining 9 groups of data are used as training sets. And so on. Repeat 10 times to obtain 10 test sets and 10 training sets.
[0072] Furthermore, in step S4, the data feature matrix is as follows:
[0073]
[0074] Among them, H n*4 represents the data feature matrix, n represents the number of groups of voltage value, current value, current stabilization accuracy and voltage stabilization accuracy, H p1 is the pth voltage value in the training set, H p2 is the pth current value in the training set, H p3 is the pth steady flow accuracy in the training set, H p4 is the p-th voltage regulation accuracy in the training set.
[0075] Further, refer to Figure 4 In step S4, the data feature matrix is input into a convolutional neural network for training, including:
[0076] S41, performing a two-dimensional convolution operation on the data feature matrix to obtain a plurality of convolution layer feature maps;
[0077] S42, performing nonlinear processing of the relu activation function on the convolutional layer feature map to obtain convolution linear rectification features;
[0078] S43, performing standardization processing on the convolution linear rectification feature;
[0079] S44, performing a maximum pooling operation on the standardized convolution linear rectification features to obtain pooling layer features;
[0080] S45. Perform a convolution operation on the pooling layer features to obtain fully connected layer features.
[0081] Specifically, in step S41, the data feature matrix H of the charging pile is n*4 A two-dimensional convolution operation is performed. In order to fully extract features, a convolution kernels of different sizes are selected, represented by {K1, K2, …, Ka}, where the number of each convolution kernel is set to {N1, N2, …, Na}, and N1 = N2 = … = Na = b. This will generate a*b feature maps of the charging pile collection data, and obtain the convolution layer feature map Conv2D = {Conv2D_1, Conv2D_2, …, Conv2D_n}.
[0082] Furthermore, in step S42, the convolutional layer feature map after convolution is subjected to nonlinear processing by a relu activation function to obtain a convolutional linear rectification feature (Conv2D_Relu).
[0083] In step S43, a Batch Normalization operation is used to improve the performance and stability of the artificial neural network, and all the collected charging pile feature data of the convolution linear rectifier feature (Conv2D_Relu) are mapped to the range of 0-1 to obtain the matrix Conv2D_Relu_BN.
[0084] In step S44, the standardized convolution linear rectification feature (Conv2D_Relu_BN) is operated using the maximum pooling method, and the maximum value of the pooling kernel area is selected as the pooled value of the area to obtain the pooling layer feature Conv2D_Relu_BN_Pool = max{Conv2D_1, Conv2D_2, ..., Conv2D_n}.
[0085] In step S45, the above pooling layer features are convolved to obtain the fully connected layer features Conv_All Connection of the input charging pile data. The fully connected layer features are classified by the Softmax classifier in common CNN. The training process uses the random inactivation Dropout method, specifying that 20% of the neurons are inactivated each time to prevent overfitting. In the model compilation, optimize specifies the adam optimizer, and loss specifies the loss function as the mean square error.
[0086] Furthermore, in step S5, the fully connected layer features are resampled to generate a random charging pile data feature set, including:
[0087] Take multiple fully connected layer features as a data set, randomly select a fully connected layer feature from the data set and put it into a sampling set, then copy the fully connected layer feature in the original data set, and obtain a sampling set containing multiple fully connected layer features after multiple random selections. Repeat the above steps to obtain multiple sampling sets as random charging pile data feature sets.
[0088] Specifically, given a data set containing m fully connected layer features, first randomly take out a fully connected layer feature and put it into the sampling set, then copy the fully connected layer feature in the original data set so that the feature can still be selected in the next sampling. After m random sampling operations, we get a sampling set A containing m fully connected layer features. Some samples in the sampling set may appear multiple times, while some samples may never appear. Through this method, we can sample n random charging pile data feature sets containing m fully connected layer features, recorded as {A1,A2,A3,…,A n}.
[0089] Furthermore, a corresponding decision tree is generated according to the random charging pile data feature set, including:
[0090] Each sampling set in the random charging pile data feature set is used as the root node of the decision tree, and the state of the charging pile is used as the leaf node;
[0091] Divide the attributes to form branch nodes: set the number of attributes, randomly select some attributes from multiple attributes as subsets, calculate the Gini index of each attribute in the subset, select the attribute with the smallest Gini index as the optimal partitioning attribute, divide the sampling set to form branch nodes, and repeat the above steps to divide until the Gini index is less than the preset threshold.
[0092] Specifically, when the sampling set of the random charging pile data feature set is input into the random forest model to generate multiple decision trees, a single decision tree is taken as an example: its structure includes three parts: root node, internal node, and leaf node. i The root node contains its corresponding sampling set A i , the leaf nodes correspond to the status of the charging pile, and the other nodes correspond to the test of an attribute.
[0093] When selecting the attributes for partitioning, assuming that there are d attributes in total, for each node of the base decision tree, a subset of g attributes is randomly selected from the attribute set, and then an optimal attribute is selected from the g attributes in this subset for the partitioning of charging pile features. (In the call of the random forest model, we only need to set the number of attributes we want to partition in the random forest, d, without us having to determine the specific practical significance of the current d attributes. The machine does not need to understand its practical significance, and the g value is set according to 0.5-0.9 times the total number of attributes).
[0094] During the partitioning process, the Gini index is used to judge the impurity of the node to select the attribute partitioning. Set the proportion of the h-th class samples in the sampling set to p h (h=1,2,3), the impurity of the sampling set can be expressed by the Gini value as follows:
[0095]
[0096] In the sampling set, a certain attribute a has V possible values {a 1 ,a 2 ,…,a V}, assuming that a is used to divide the sample set, a total of V branch nodes can be obtained, using D v To indicate that the vth branch node contains all the nodes in the sample set whose value is a on attribute a vThe Gini index corresponding to attribute a can be defined as:
[0097]
[0098] In each node candidate attribute set, the attribute with the smallest Gini_index value after division is selected as the optimal division attribute to maximize the purity of the decision tree branch node.
[0099] Repeat the above process to divide the nodes until Gini_index is lower than the threshold or there are no features to select.
[0100] Furthermore, multiple sampling sets form multiple decision trees, thereby forming a random forest. The test set is input into the random forest, and the random forest can be evaluated based on the output results. For example, the random forest can be evaluated using precision, recall, etc.
[0101] The evaluation indicators use accuracy, recall, and F1-score as evaluation criteria, and the formula is as follows:
[0102] Accuracy:
[0103] Accuracy=(TP+TN) / (TP+FP+TN+FN)
[0104] Recall:
[0105] Recall=TP / (TP+FN)
[0106] F1 value:
[0107] F1=(2*Precision*Recall) / (Precision+Recall)
[0108] Where TP represents the number of actual positive samples and predicted positive samples;
[0109] Where TN represents the number of actual positive samples and predicted negative samples;
[0110] FP indicates the number of samples that are actually negative and predicted to be positive.
[0111] Where FN represents the number of actual negative samples and predicted negative samples.
[0112] In step S6, the collected real-time charging pile data is preprocessed, and a real-time state set is obtained according to a state classification strategy, and the real-time state set is input into the random forest to obtain the discrimination result of each decision tree, and the mode of the discrimination result of each decision tree is taken to obtain the real-time state of the charging pile.
[0113] Specifically, the random forest is composed of many decision trees, each of which is equivalent to a base learner, and different decision trees are independent of each other. When we perform the task of evaluating the status of the charging pile, it is actually a classification task. When the newly input state set enters the random forest model, each decision tree in the random forest will make judgments and classifications respectively, and each decision tree will obtain a classification result of the charging pile status that it has independently obtained. Among the multiple decision tree classification results contained in the random forest, whichever one has the most classifications, the random forest model will judge this classification result as the final state of the charging pile.
[0114] In the state classification of charging piles, we can train n corresponding base decision trees {T1, T2, T3, …, T n}, where the base decision tree T i A label is predicted from the class label set {c1, c2, c3} = {healthy, minor fault, major fault}. Among them, the output state of healthy is recorded as a positive sample, and the output state of minor fault and major fault is recorded as a negative sample. We will T i The output predicted on sample A is represented as a vector (T 1 i (A); T 2 i (A); T 3 i (A); T 4 i (A)), where T j i (A) is T i In category mark c j The output of the model on the final state can be expressed as follows:
[0115]
[0116] The method provided in the above embodiment has at least the following beneficial effects:
[0117] Multi-source indicators of the charging pile during operation were collected, and multi-level and multi-layer divisions were carried out according to different quantitative standards of the indicators; convolutional neural network CNN was used, and convolution kernels of different sizes were used for convolution, so that the feature extraction of the collected charging pile data was more sufficient; in view of the possible insufficient generalization ability of CNN, a solution combining CNN and random forest network was used for the evaluation of the charging pile status. The main idea of random forest is to assemble weak classifiers into a strong classifier, which can effectively improve the generalization ability of the model, and use convolutional neural network to extract high-order features for judging the status of charging piles, and then use random forest as a high-order feature classifier, so as to achieve the evaluation of the charging pile status under comprehensive multi-factors, making the judgment on the overall status of the charging pile more representative and accurate.
[0118] refer to Figure 5 In some embodiments, a charging pile state assessment device based on CNN and random forest is provided, comprising:
[0119] Data acquisition module 201, used to collect charging pile data and perform pre-processing;
[0120] Establishing a state classification strategy 202, for classifying the pre-processed charging pile data according to the state classification strategy to obtain a state set;
[0121] A division module 203, used for dividing the state set into a training set and a test set;
[0122] A training module 204 is used to establish a data feature matrix for each divided training set, and input the data feature matrix into a convolutional neural network for training, and save the convolutional neural network parameters when the convolutional neural network converges;
[0123] A decision module 205 is used to use the fully connected layer features of the convolutional neural network as the input of the random forest according to the convolutional neural network parameters, resample the fully connected layer features, generate a random charging pile data feature set, generate a corresponding decision tree according to the random charging pile data feature set, multiple decision trees form a random forest, and evaluate the random forest according to the test set;
[0124] The evaluation module 206 is used to collect real-time charging pile data for processing to obtain a real-time status set, input the real-time status set into the random forest, obtain the discrimination result of each decision tree, and take the mode of the discrimination result of each decision tree as the final evaluation result of the charging pile status.
[0125] The working principle of each module can be referred to the above embodiment and will not be described in detail here.
[0126] Although preferred embodiments of the present invention have been described, additional changes and modifications may be made to these embodiments by those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention. Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A charging pile status assessment method based on CNN and random forest, characterized in that: include: Collect charging pile data and pre-process it; Establishing a state classification strategy, and classifying the preprocessed charging pile data according to the state classification strategy to obtain a state set; Divide the training set and the test set according to the state set; A data feature matrix is established for each divided training set, and the data feature matrix is input into a convolutional neural network for training, and convolutional neural network parameters are saved when the convolutional neural network converges; According to the convolutional neural network parameters, the fully connected layer features of the convolutional neural network are used as inputs of the random forest, the fully connected layer features are resampled to generate a random charging pile data feature set, a corresponding decision tree is generated according to the random charging pile data feature set, multiple decision trees form a random forest, and the random forest is evaluated according to the test set; Collecting real-time charging pile data for processing to obtain a real-time status set, inputting the real-time status set into the random forest, obtaining the discrimination result of each decision tree, taking the mode of the discrimination result of each decision tree, and obtaining the real-time status of the charging pile; The charging pile data includes the voltage value, current value, current stabilization accuracy and voltage stabilization accuracy of the charging pile at multiple times within a preset period of time; The pre-processed charging pile data is classified according to the state classification strategy to obtain a state set, including: Determine whether the voltage value, current value, current stabilization accuracy and voltage stabilization accuracy at each moment exceed the corresponding preset thresholds; Calculate the corresponding score according to whether each voltage value, current value, current stabilization accuracy and voltage stabilization accuracy exceeds the corresponding preset threshold and the degree to which it exceeds the preset threshold; According to the calculated corresponding scores and state classification strategy, the states corresponding to each group of voltage values, current values, current stabilization accuracy and voltage stabilization accuracy are obtained, and the states corresponding to multiple groups of voltage values, current values, current stabilization accuracy and voltage stabilization accuracy form the state set; Inputting the data feature matrix into a convolutional neural network for training includes: Performing a two-dimensional convolution operation on the data feature matrix to obtain multiple convolution layer feature maps; Performing nonlinear processing of the convolutional layer feature map using a relu activation function to obtain a convolutional linear rectification feature; Performing standardization on the convolution linear rectification features; Perform the maximum pooling operation on the standardized convolution linear rectification features to obtain the pooling layer features; Performing a convolution operation on the pooling layer features to obtain fully connected layer features; Generate a corresponding decision tree according to the random charging pile data feature set, including: Each sampling set in the random charging pile data feature set is used as the root node of the decision tree, and the state of the charging pile is used as the leaf node; Divide the attributes to form branch nodes: set the number of attributes, randomly select some attributes from multiple attributes as subsets, calculate the Gini index of each attribute in the subset, select the attribute with the smallest Gini index as the optimal partitioning attribute, divide the sampling set to form branch nodes, and repeat the above steps to divide until the Gini index is less than the preset threshold.
2. The method according to claim 1, characterized in that: The preprocessing of the charging pile data includes filtering, cleaning, and supplementing or eliminating missing data.
3. The method according to claim 1, characterized in that: Dividing the training set and the test set according to the state set includes: Dividing the state set into k groups of data evenly; Take one of the data sets as a test set and the remaining k-1 data sets as a training set, and repeat this step until k different test sets and training sets are obtained.
4. The method according to claim 1, characterized in that: The data feature matrix is as follows: Among them, H n*4 represents the data feature matrix, n represents the number of groups of voltage value, current value, current stabilization accuracy and voltage stabilization accuracy, H p1 is the voltage value in the pth group, H p2 is the current value in the pth group, H p3 is the steady flow accuracy in the pth group, H p4 is the voltage regulation accuracy in the pth group.
5. The method according to claim 1, characterized in that The fully connected layer features are resampled to generate a random charging pile data feature set, including: Take multiple fully connected layer features as a data set, randomly select a fully connected layer feature from the data set and put it into a sampling set, then copy the fully connected layer feature in the original data set, and obtain a sampling set containing multiple fully connected layer features after multiple random selections. Repeat the above steps to obtain multiple sampling sets as random charging pile data feature sets.
6. A charging pile status assessment device based on CNN and random forest, characterized in that: include: Data acquisition module, used to collect charging pile data and perform pre-processing; Establishing a state classification strategy for classifying the preprocessed charging pile data according to the state classification strategy to obtain a state set; A partitioning module, used for partitioning a training set and a test set according to the state set; A training module, used to establish a data feature matrix for each divided training set, and input the data feature matrix into a convolutional neural network for training, and save the convolutional neural network parameters when the convolutional neural network converges; A decision module, configured to use the fully connected layer features of the convolutional neural network as input of a random forest according to the convolutional neural network parameters, resample the fully connected layer features, generate a random charging pile data feature set, generate a corresponding decision tree according to the random charging pile data feature set, multiple decision trees form a random forest, and evaluate the random forest according to the test set; An evaluation module, used to collect real-time charging pile data for processing to obtain a real-time status set, input the real-time status set into the random forest, obtain the discrimination result of each decision tree, take the mode of the discrimination result of each decision tree, and obtain the real-time status of the charging pile; The pre-processed charging pile data is classified according to the state classification strategy to obtain a state set, including: Determine whether the voltage value, current value, current stabilization accuracy and voltage stabilization accuracy at each moment exceed the corresponding preset thresholds; Calculate the corresponding score according to whether each voltage value, current value, current stabilization accuracy and voltage stabilization accuracy exceeds the corresponding preset threshold and the degree to which it exceeds the preset threshold; According to the calculated corresponding scores and state classification strategy, the states corresponding to each group of voltage values, current values, current stabilization accuracy and voltage stabilization accuracy are obtained, and the states corresponding to multiple groups of voltage values, current values, current stabilization accuracy and voltage stabilization accuracy form the state set; Inputting the data feature matrix into a convolutional neural network for training includes: Performing a two-dimensional convolution operation on the data feature matrix to obtain multiple convolution layer feature maps; Performing nonlinear processing of the convolutional layer feature map using a relu activation function to obtain a convolutional linear rectification feature; Performing standardization on the convolution linear rectification features; Perform the maximum pooling operation on the standardized convolution linear rectification features to obtain the pooling layer features; Performing a convolution operation on the pooling layer features to obtain fully connected layer features; Generate a corresponding decision tree according to the random charging pile data feature set, including: Each sampling set in the random charging pile data feature set is used as the root node of the decision tree, and the state of the charging pile is used as the leaf node; Divide the attributes to form branch nodes: set the number of attributes, randomly select some attributes from multiple attributes as subsets, calculate the Gini index of each attribute in the subset, select the attribute with the smallest Gini index as the optimal partitioning attribute, divide the sampling set to form branch nodes, and repeat the above steps to divide until the Gini index is less than the preset threshold.
