Electric vehicle charging pile fault prediction method and system

By collecting and preprocessing charging pile fault data in real time and using the LSTM model to predict faults, the problem of inaccurate fault prediction in the existing technology is solved, and the operation and maintenance management efficiency and safety of charging piles are improved.

CN119494428APending Publication Date: 2025-02-21NARI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411304561.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

The prior art is difficult to accurately predict the failure of electric vehicle charging piles, resulting in low operation and maintenance management efficiency and insufficient safety.

Method used

By deploying a health monitoring system to collect fault data in real time, perform data preprocessing and visual analysis, mine key features, and build a prediction model based on LSTM for training to improve the accuracy of fault prediction.

Benefits of technology

High accuracy prediction of charging pile failures is achieved, fault risk is reduced, and the overall operating efficiency and safety of charging piles are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119494428A_ABST
    Figure CN119494428A_ABST
Patent Text Reader

Abstract

The invention discloses an electric vehicle charging pile fault prediction method and system, and relates to the field of electric vehicle charging pile fault prediction, and the method comprises the steps: collecting charging pile fault data, and carrying out the data cleaning, event serialization and label generation; analyzing distribution, features and states of fault data through data visualization, and mining new features; determining key features according to a visual analysis result, and constructing model input data; constructing a prediction model based on the input data, and training and storing the model; testing the stored model, and performing visual output to inspect the reliability and practicability of the model; by collecting and analyzing the fault data of the charging pile, the internal law and characteristics of the fault of the charging pile can be revealed, and the accuracy and robustness of fault prediction are improved. And in combination with advanced data analysis and deep learning technologies, a scientific basis is provided for operation and maintenance management of the charging pile, the fault risk is effectively reduced, and the overall operation efficiency and safety of the charging pile are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of fault prediction of electric vehicle charging piles, and in particular to a method and system for predicting faults of electric vehicle charging piles. Background Art

[0002] With the rapid development of the electric vehicle industry, the number and scale of charging facilities, as key infrastructure to ensure their normal operation, are showing a rapid growth trend. However, with the large-scale deployment and use of charging piles, the failure rate is becoming increasingly apparent, becoming an important factor affecting the normal charging of electric vehicles and the efficiency of traffic operation. Charging pile failures may be caused by environmental factors, such as extreme weather, long-term wear, etc., or by human factors such as operating errors or improper maintenance. If these failures cannot be identified and handled in a timely and effective manner, it will not only affect the overall operating efficiency of the charging system, but may also pose a threat to the property and personal safety of users.

[0003] Traditional charging pile fault prediction methods usually rely on fixed patterns or rules. Although this method is simple and easy to implement, it is often difficult to truly reflect the complexity and variability of charging piles in actual operation. In addition, due to the lack of sufficient real fault data support, traditional fault prediction methods often fail to achieve ideal prediction results. In this case, the accuracy and robustness of electric vehicle charging pile fault prediction becomes an urgent problem to be solved. Summary of the invention

[0004] In view of the above-mentioned problems, the present invention is proposed.

[0005] Therefore, the technical problem solved by the present invention is: how to improve the accuracy and robustness of fault prediction, provide a scientific basis for the operation and maintenance management of charging piles, effectively reduce the risk of faults, and improve the overall operating efficiency and safety of charging piles.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, an embodiment of the present invention provides a method for predicting a fault of an electric vehicle charging pile, comprising:

[0008] Fault data during charging pile operation, including fault start and end time, fault cause, and fault duration information;

[0009] Preprocess the acquired fault data. The preprocessing steps include data cleaning, event serialization, and label generation.

[0010] Use data visualization methods to analyze the preprocessed fault data to obtain the distribution, characteristics, and fault status of the fault data in different dimensions, and further mine new features;

[0011] Based on the results of visual analysis, determine the key features of the fault data and construct the input data of the model;

[0012] constructing a prediction model based on the input data;

[0013] Train the prediction model and save the trained model;

[0014] Test the saved model and visualize the test results to verify the reliability and practicality of the model.

[0015] As a preferred solution for the electric vehicle charging pile fault prediction method, the following is a proposed method:

[0016] The acquisition of fault data during operation of the charging pile includes:

[0017] Deploy a charging pile operation health monitoring system on the actual electric vehicle charging piles to monitor the operating status of the charging piles in real time, and monitor the working status and environmental conditions of the charging piles; install a data acquisition card or module to convert the analog signal of the sensor into a digital signal and transmit it to the data server; set up a fault recording system in the data server to record the time when the fault occurred, the time when the fault ended, the name of the charging station to which it belongs, the cause of the fault, the manufacturer information, and save the relevant original data.

[0018] As a preferred solution for the electric vehicle charging pile fault prediction method, the following is a proposed method:

[0019] The preprocessing of the acquired fault data includes:

[0020] Data cleaning: delete abnormal data, delete fault data with negative time and fault duration of 0, delete incomplete data, and delete records with empty values ​​in the charging station name and manufacturer name information;

[0021] Event serialization: Integrate the historical fault records of each charging pile in chronological order to form a continuous time series;

[0022] Label generation: Based on event serialization, the fault status of each charging pile in all time periods in March is counted with a time step of 8 hours; for the historical fault record S of the i-th charging pile i , expressed as:

[0023] S i =[s1,s2,...,s T ]

[0024] Where T represents the length of the sequence of historical fault states of each charging pile, s1 represents the fault state in the first time slice, 0 represents no fault, and 1 represents fault.

[0025] As a preferred solution for the electric vehicle charging pile fault prediction method, the following is a proposed method:

[0026] The pre-processed fault data is analyzed to obtain the distribution, characteristics and fault status of the fault data in different dimensions, and further mine new features including:

[0027] Use data visualization methods to display the distribution and characteristics of the data; sort the fault types in descending order according to the number of occurrences, and count the number of occurrences of the top 80% of different fault types; classify the fault data by the number of faults, and count the number of faulty charging piles corresponding to each fault number interval; classify the fault data by the district or county to which it belongs, and count the distribution of the number of faults in each district or county; classify the fault data by the date of occurrence, and count the distribution of the number of faults from Monday to Sunday of each week.

[0028] As a preferred solution for the electric vehicle charging pile fault prediction method, the following is a proposed method:

[0029] Based on the results of the visualization analysis, the key features of the fault data are determined, and the input data for building the model includes:

[0030] The input features are determined as follows: charging pile ID, charging pile fault status, charging station name, manufacturer name, district code, longitude and latitude, and whether it is a working day;

[0031] Sequentially encode the charging station name and manufacturer name in the input features:

[0032] C i ∈{0,1,2,...,N s -1}

[0033] M i ∈{0,1,2,...,N m -1}

[0034] Among them C i represents the result of sequential coding of the charging stations to which the i-th charging station belongs, N s Represents the total number of charging stations, M i Represents the result of encoding the manufacturer name of the i-th charging station, N m Indicates the total number of manufacturers;

[0035] The sliding window intercepts the data, and for each charging pile fault state sequence S i =[s1,s2,...,s T ], use sliding window size W for each sequence S iThe subsequences of length W are intercepted and generated. Each sliding window slides from the beginning to the end of the sequence, one position at a time. Let k represent the starting position of the sliding window. The sum of the subsequences of the kth sliding window and whether it is a working day is expressed as:

[0036] S i [k:k+W]=[s k ,s k+1 ,...,s k+W-1 ]

[0037] w k+W =is_weekday(s k+W )

[0038] Where k = 1, 2, ..., T-W + 1, T represents the length of the sequence of historical fault states of each charging pile, s k+W represents the time of the state that needs to be predicted for the subsequence starting with k, w k+W A value of 0 indicates that the date is from Monday to Thursday, and a value of 1 indicates that the date is from Friday to Sunday.

[0039] For each charging pile i, the charging station name C i 、Manufacturer NameM i , District and County Code D i , longitude and latitude L i (lat i ,lng i ) and whether it is a working day k+W It is concatenated with the subsequences intercepted by each sliding window to obtain the final input data X of the kth sliding window. i :

[0040] X i [k:k+W]=[s k ,s k+1 ,...,s k+W-1 ,C i ,M i ,D i ,lat i ,lng i ,w k+W ]

[0041] Divide the data set:

[0042] The training set is represented as:

[0043] X train ={[S i [k:k+W],C i ,M i ,D i ,lati ,lng i ,w k+W ]|1≤k≤60}

[0044] The validation set is represented as:

[0045] X val ={[S i [k:k+W],C i ,M i ,D i ,lat i ,lng i ,w k+W ]|61≤k≤67}

[0046] The test set is represented as:

[0047] X test ={[S i [k:k+W],C i ,M i ,D i ,lat i ,lng i ,w k+W ]|68≤k≤75}.

[0048] As a preferred solution for the electric vehicle charging pile fault prediction method, the following is a proposed method:

[0049] The constructing of the prediction model comprises:

[0050] Construct the input layer: the batch size defaults to 1, the number of time steps is t, and the feature dimension is n. A sample is represented as a real sequence matrix R. t×n , remember X i For R t×n The vector representation of the data of the i-th time step in ;

[0051] Construct LSTM network layer: The LSTM neural network structure includes: forget gate, input gate, candidate cell state, update cell state, output gate, hidden state:

[0052]

[0053] where x i is the input of the current time step, h t-1 is the hidden state of the previous time step, f t is the output of the forget gate, i t is the output of the input gate, is the new candidate memory state, C t is the updated memory state, o t is the output of the output gate, h tis the hidden state of the current time step, W f , W i , W C , W o is the weight matrix, b f , b i , b C , b o is the bias term, σ is the sigmoid activation function, which controls the switch state of the gate, and tanh is the tanh activation function, which is used to generate candidate memories and update hidden states.

[0054] Add Dropout layer: randomly discard a certain proportion of neurons during training to prevent overfitting.

[0055] Add a fully connected layer: Use the sigmoid activation function for binary classification and compress the output value.

[0056] Compile the model: Use the Adam optimizer to improve convergence speed and stability, select binary cross entropy as the loss function, and select accuracy as the evaluation metric of the model.

[0057]

[0058] Where N is the total number of samples, y i is the true label of the i-th sample, which takes a value of 0 or 1. is the predicted probability value of the i-th sample, ranging from 0 to 1, TP is the number of true classes correctly predicted, TN is the number of false classes correctly predicted, FP is the number of false classes incorrectly predicted as true classes, and FN is the number of true classes incorrectly predicted as false classes.

[0059] As a preferred solution for the electric vehicle charging pile fault prediction method, the following is a proposed method:

[0060] The training of the prediction model and saving the trained model includes:

[0061] Save the entire model including the model architecture, weights, and optimizer status, import the trained model, collect new electric vehicle charging pile fault status data in a two-week cycle, preprocess and label the collected data, obtain the latest two-week fault status record of the i-th charging pile, merge the latest data with the data of the previous cycle, and obtain the fault status record S of the i-th charging pile i :

[0062] S i =[s1,s2,...,s T+14 ]

[0063] Based on the fault status record S of the i-th charging pile iRedivide the data set, substitute it into the model and retrain the model.

[0064] In a second aspect, an embodiment of the present invention provides an electric vehicle charging pile fault prediction system, comprising:

[0065] An information acquisition module is used to obtain fault data during the operation of the charging pile, including the start and end time of the fault, the cause of the fault, and the duration of the fault;

[0066] The preprocessing module is used to preprocess the acquired fault data. The preprocessing steps include data cleaning, event serialization, and label generation.

[0067] The data analysis module is used to analyze the preprocessed fault data using data visualization methods to obtain the distribution, characteristics and fault status of the fault data in different dimensions, and further mine new features;

[0068] The feature determination module is used to determine the key features of the fault data based on the results of the visual analysis and construct the input data of the model;

[0069] A model building module, used for building a prediction model according to the input data;

[0070] The training module is used to train the prediction model and save the trained model;

[0071] The test module is used to test the saved model and visualize the test results to verify the reliability and practicality of the model.

[0072] In a third aspect, an embodiment of the present invention provides a computing device, including:

[0073] Memory and processor;

[0074] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the one or more programs are executed by the one or more processors, the one or more processors implement the electric vehicle charging pile fault prediction method as described in any embodiment of the present invention.

[0075] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the electric vehicle charging pile fault prediction method.

[0076] Beneficial effects of the present invention: By collecting and analyzing various types of fault data generated during the operation of the charging pile, this method can learn the inherent laws and characteristics of the charging pile fault, thereby realizing effective prediction of the charging pile fault. Based on the acquisition and analysis of real charging pile fault data, combined with advanced data analysis and deep learning models, fault prediction can be performed more accurately; the accuracy and robustness of fault prediction are improved, providing a scientific basis for the operation and maintenance management of the charging pile, effectively reducing the risk of faults, and improving the overall operation efficiency and safety of the charging pile. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0078] Figure 1 is an overall flow chart of the electric vehicle charging pile fault prediction method according to the first embodiment of the present invention;

[0079] Figure 2 is the distribution of the number of charging pile failures in the electric vehicle charging pile failure prediction method described in the first embodiment of the present invention;

[0080] Figure 3 is the number of charging piles that fail every day in the electric vehicle charging pile failure prediction method according to the first embodiment of the present invention;

[0081] Figure 4 The distribution of the number of faults in different districts and counties of the electric vehicle charging pile fault prediction method described in the first embodiment of the present invention;

[0082] Figure 5 is the distribution of the number of failures on each day of the week of the electric vehicle charging pile failure prediction method described in the first embodiment of the present invention;

[0083] Figure 6 It is a flowchart of storing and updating a fault prediction model of the electric vehicle charging pile fault prediction method according to the first embodiment of the present invention;

[0084] Figure 7 is the lost value of model training and verification in the simulation example of the electric vehicle charging pile fault prediction method described in the second embodiment of the present invention;

[0085] Figure 8 The accuracy of model training and verification in the simulation example of the electric vehicle charging pile fault prediction method described in the second embodiment of the present invention

[0086] Fig. 9 is a confusion matrix of the model prediction results in the simulation example of the electric vehicle charging pile fault prediction method described in the second embodiment of the present invention;

[0087] Fig.10 It is a performance indicator of ten prediction results in a simulation example of the electric vehicle charging pile fault prediction method described in the second embodiment of the present invention. DETAILED DESCRIPTION

[0088] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0089] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0090] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0091] Example 1

[0092] Reference Figure 1-Figure 6 , which is the first embodiment of the present invention, and provides a method for predicting faults of an electric vehicle charging pile, comprising:

[0093] S1: Obtain fault data during the operation of the charging pile, including the start and end time of the fault, the cause of the fault, and the duration of the fault;

[0094] In the embodiment of the present application, obtaining fault data during operation of the charging pile includes:

[0095] Deploy a charging pile operation health monitoring system on the actual electric vehicle charging piles to monitor the operating status of the charging piles in real time, and monitor the working status and environmental conditions of the charging piles; install a data acquisition card or module to convert the analog signal of the sensor into a digital signal and transmit it to the data server; set up a fault recording system in the data server to record the time when the fault occurred, the time when the fault ended, the name of the charging station to which it belongs, the cause of the fault, the manufacturer information, and save the relevant original data.

[0096] S2: Preprocess the acquired fault data. The preprocessing steps include data cleaning, event serialization, and label generation.

[0097] In an embodiment of the present application, preprocessing the acquired fault data includes:

[0098] Data cleaning: delete abnormal data, delete fault data with negative time and fault duration of 0, delete incomplete data, and delete records with empty values ​​in the charging station name and manufacturer name information;

[0099] Event serialization: Integrate the historical fault records of each charging pile in chronological order to form a continuous time series;

[0100] Label generation: Based on event serialization, the fault status of each charging pile in all time periods in March is counted with a time step of 8 hours; for the historical fault record S of the i-th charging pile i , expressed as:

[0101] S i =[s1,s2,...,s T ]

[0102] Where T represents the length of the sequence of historical fault states of each charging pile, s1 represents the fault state in the first time slice, 0 represents no fault, and 1 represents fault.

[0103] S3: Use data visualization methods to analyze the preprocessed fault data to obtain the distribution, characteristics, and fault status of the fault data in different dimensions, and further mine new features;

[0104] In the embodiment of the present application, the pre-processed fault data is analyzed to obtain the distribution, characteristics and fault status of the fault data in different dimensions, and further mining new features including:

[0105] Use data visualization methods to display the distribution and characteristics of the data; sort the fault types in descending order according to the number of occurrences, and count the number of occurrences of the top 80% of different fault types; classify the fault data by the number of faults, and count the number of faulty charging piles corresponding to each fault number interval; classify the fault data by the district or county to which it belongs, and count the distribution of the number of faults in each district or county; classify the fault data by the date of occurrence, and count the distribution of the number of faults from Monday to Sunday of each week.

[0106] For example, Figure 2 The figure shows the frequency distribution of different fault types of public charging piles. The horizontal axis is the category of each fault cause, and the vertical axis is the total number of occurrences of this fault type.

[0107] like Figure 3 As shown, the number of charging piles with faults corresponding to each fault frequency interval is shown, wherein the horizontal axis is the interval of the number of faults, and the vertical axis is the number of charging piles in the corresponding interval.

[0108] like Figure 4 As shown in FIG. 1 , the distribution of the number of failures in each district and county in the first 80% of the total number of failures is shown. The horizontal axis is the area code of each district and county, and the vertical axis is the number of failures that occurred.

[0109] like Figure 5 As shown in the figure, the distribution of the number of failures that occur every day from Monday to Sunday. The horizontal axis is Monday to Sunday, and the vertical axis is the number of failures that occur.

[0110] From the data visualization analysis, it can be seen that: from the perspective of fault type, the alarm of charging gun not returning to position and the emergency stop button action fault frequently occur in charging pile faults, which are high-frequency fault types. From the perspective of the distribution of fault times, most charging piles had 0-5 faults in March, and the probability and frequency of faults were low. From the perspective of the district and county to which the charging station belongs, the fault of the charging pile is greatly affected by the district and county, and the number of faults in different districts and counties varies greatly. From the perspective of the date of the fault, the number of faults from Monday to Thursday is less than that from Friday to Sunday, which shows that the frequency of faults during the weekend is higher. In summary, the charging station to which the electric vehicle charging pile belongs, the name of the manufacturer, the district and county to which it belongs, and whether it is a working day have a great influence on the fault status of the charging pile, so these attributes are input into the model as features.

[0111] S4: Based on the results of visual analysis, determine the key features of the fault data and construct the input data of the model;

[0112] In the embodiment of the present application, based on the results of the visual analysis, the key features of the fault data are determined, and the input data for building the model includes:

[0113] The input features are determined as follows: charging pile ID, charging pile fault status, charging station name, manufacturer name, district code, longitude and latitude, and whether it is a working day;

[0114] Sequentially encode the charging station name and manufacturer name in the input features:

[0115] C i ∈{0,1,2,...,N s -1}

[0116] M i ∈{0,1,2,...,N m -1}

[0117] Among them C i represents the result of sequential coding of the charging stations to which the i-th charging station belongs, N s Represents the total number of charging stations, M i Represents the result of encoding the manufacturer name of the i-th charging station, N m Indicates the total number of manufacturers;

[0118] The sliding window intercepts the data, and for each charging pile fault state sequence S i =[s1,s2,...,s T ], use sliding window size W for each sequence S i The subsequences of length W are intercepted and generated. Each sliding window slides from the beginning to the end of the sequence, one position at a time. Let k represent the starting position of the sliding window. The sum of the subsequences of the kth sliding window and whether it is a working day is expressed as:

[0119] S i [k:k+W]=[s k ,s k+1 ,...,s k+W-1 ]

[0120] w k+W =is_weekday(s k+W )

[0121] Where k = 1, 2, ..., T-W + 1, T represents the length of the sequence of historical fault states of each charging pile, s k+W represents the time of the state that needs to be predicted for the subsequence starting with k, w k+W A value of 0 indicates that the date is from Monday to Thursday, and a value of 1 indicates that the date is from Friday to Sunday.

[0122] For each charging pile i, the charging station name C i 、Manufacturer NameM i , District and County Code Di , longitude and latitude L i (lat i ,lng i ) and whether it is a working day k+W It is concatenated with the subsequences intercepted by each sliding window to obtain the final input data X of the kth sliding window. i :

[0123] X i [k:k+W]=[s k ,s k+1 ,...,s k+W-1 ,C i ,M i ,D i ,lat i ,lng i ,w k+W ]

[0124] Divide the data set:

[0125] The training set is represented as:

[0126] X train ={[S i [k:k+W],C i ,M i ,D i ,lat i ,lng i ,w k+W ]|1≤k≤60}

[0127] The validation set is represented as:

[0128] X val ={[S i [k:k+W],C i ,M i ,D i ,lat i ,lng i ,w k+W ]|61≤k≤67}

[0129] The test set is represented as:

[0130] X test ={[S i [k:k+W],C i ,M i ,D i ,lat i ,lng i ,w k+W ]|68≤k≤75}

[0131] S5: constructing a prediction model according to the input data;

[0132] In the embodiment of the present application, constructing a prediction model includes:

[0133] Construct the input layer: the batch size defaults to 1, the number of time steps is t, and the feature dimension is n. A sample is represented as a real sequence matrix R. t×n , remember X i For R t×n The vector representation of the data of the i-th time step in ;

[0134] Construct LSTM network layer: The LSTM neural network structure includes: forget gate, input gate, candidate cell state, update cell state, output gate, hidden state:

[0135]

[0136] where x i is the input of the current time step, h t-1 is the hidden state of the previous time step, f t is the output of the forget gate, i t is the output of the input gate, is the new candidate memory state, C t is the updated memory state, o t is the output of the output gate, h t is the hidden state of the current time step, W f , W i , W C , W o is the weight matrix, b f , b i , b C , b o is the bias term, σ is the sigmoid activation function, which controls the switch state of the gate, and tanh is the tanh activation function, which is used to generate candidate memories and update hidden states.

[0137] Add Dropout layer: randomly discard a certain proportion of neurons during training to prevent overfitting.

[0138] Add a fully connected layer: Use the sigmoid activation function for binary classification and compress the output value.

[0139] Compile the model: Use the Adam optimizer to improve convergence speed and stability, select binary cross entropy as the loss function, and select accuracy as the evaluation metric of the model.

[0140]

[0141] Where N is the total number of samples, y iis the true label of the i-th sample, which takes a value of 0 or 1. is the predicted probability value of the i-th sample, ranging from 0 to 1, TP is the number of true classes correctly predicted, TN is the number of false classes correctly predicted, FP is the number of false classes incorrectly predicted as true classes, and FN is the number of true classes incorrectly predicted as false classes;

[0142] Set the learning rate scheduler: Automatically adjust the learning rate during training to prevent the model from falling into local optimality or overfitting.

[0143] S6: Train the prediction model and save the trained model;

[0144] In an embodiment of the present application, training the prediction model and saving the trained model includes:

[0145] Save the entire model including the model architecture, weights, and optimizer status, import the trained model, collect new electric vehicle charging pile fault status data in a two-week cycle, preprocess and label the collected data, obtain the latest two-week fault status record of the i-th charging pile, merge the latest data with the data of the previous cycle, and obtain the fault status record S of the i-th charging pile i :

[0146] S i =[s1,s2,...,s T+14 ]

[0147] Based on the fault status record S of the i-th charging pile i Redivide the data set, substitute it into the model and retrain the model.

[0148] Specifically, the constructed prediction model is trained using the training set data, and the trained model is saved so that predictions can be made quickly in the future without retraining. In order to ensure that the model can reflect the latest data changes, new data needs to be added regularly and the model needs to be retrained. The specific flow chart is as follows: Figure 6 shown.

[0149] The following are the specific steps for saving and updating the model:

[0150] (1) Use the 'model.save()' method provided by TensorFlow to save the entire model including the model architecture, weights, and optimizer state.

[0151] (2) Use the 'load_model()' method to import the trained model.

[0152] (3) Collect new electric vehicle charging pile fault status data in a two-week cycle.

[0153] (4) Based on (3), the collected data is preprocessed and labels are generated to obtain the fault status record S of the i-th charging pile in the latest two weeks. i :

[0154] S i =[s T+1 ,s T+2 ,...,s T+14 ]

[0155] (5) Based on (4), the latest data is combined with the data of the previous cycle to obtain the fault status record S of the i-th charging pile in the latest two weeks. i :

[0156] S i =[s1,s2,...,s T+14 ]

[0157] (6) Based on (5), the final data is re-divided into the data set and then substituted into the model to retrain the model.

[0158] Repeat step (1).

[0159] S7: Test the saved model and visualize the test results to verify the reliability and practicality of the model.

[0160] Specifically, the prediction results generated by the model are visualized and output. The accuracy of the model training process, as well as the loss value and the confusion matrix between the prediction results and the true value can be used as one of the evaluation criteria for the model performance.

[0161] In another possible implementation, the performance of the model can also be evaluated by calculating the accuracy, precision, recall and F1 score. The calculation formula is as follows:

[0162]

[0163] The above is a schematic scheme of the electric vehicle charging pile fault prediction method of this embodiment. It should be noted that the technical scheme of the electric vehicle charging pile fault prediction system and the technical scheme of the above electric vehicle charging pile fault prediction method belong to the same concept. For details not described in detail in the technical scheme of the electric vehicle charging pile fault prediction system in this embodiment, please refer to the description of the technical scheme of the above electric vehicle charging pile fault prediction method.

[0164] The electric vehicle charging pile fault prediction system in this embodiment includes:

[0165] An information acquisition module is used to obtain fault data during the operation of the charging pile, including the start and end time of the fault, the cause of the fault, and the duration of the fault;

[0166] The preprocessing module is used to preprocess the acquired fault data. The preprocessing steps include data cleaning, event serialization, and label generation.

[0167] The data analysis module is used to analyze the preprocessed fault data using data visualization methods to obtain the distribution, characteristics and fault status of the fault data in different dimensions, and further mine new features;

[0168] The feature determination module is used to determine the key features of the fault data based on the results of the visual analysis and construct the input data of the model;

[0169] A model building module, used for building a prediction model according to the input data;

[0170] The training module is used to train the prediction model and save the trained model;

[0171] The test module is used to test the saved model and visualize the test results to verify the reliability and practicality of the model.

[0172] This embodiment also provides a computing device, which is applicable to the electric vehicle charging pile fault prediction method, including:

[0173] Memory and processor; the memory is used to store computer executable instructions, and the processor is used to execute computer executable instructions to implement the electric vehicle charging pile fault prediction method proposed in the above embodiment.

[0174] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the electric vehicle charging pile fault prediction method proposed in the above embodiment is implemented.

[0175] The storage medium proposed in this embodiment and the electric vehicle charging pile fault prediction method proposed in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0176] Example 2

[0177] Reference Figure 7-10 , which is an embodiment of the present invention, provides a method for predicting faults of electric vehicle charging piles. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through simulation experiments.

[0178] Step 1: Obtain historical fault data

[0179] Deploy a charging pile operation health monitoring system on the actual electric vehicle charging piles, and monitor the working status and environmental conditions of the charging piles by real-time monitoring of the operating status of the charging piles. Install a data acquisition card or module to convert the analog signal of the sensor into a digital signal and transmit it to the data server. Set up a fault recording system in the data server to record the time when the fault occurred, the time when the fault ended, the name of the charging station to which it belongs, the cause of the fault (such as the charging gun not returning to its position, the emergency stop button action failure, etc.), the manufacturer and other information, and save the relevant original data.

[0180] Step 2: Data Preprocessing

[0181] Perform data cleaning event serialization and label generation on the collected data.

[0182] Data cleaning: delete abnormal data, delete fault data with negative time and fault duration of 0, delete incomplete data, and delete records with empty values ​​in information such as charging station name and manufacturer name.

[0183] Event serialization: Event serialization is an important step in processing time series data, especially for the application scenario of electric vehicle charging pile fault prediction. In this process, we integrate the historical fault records of each charging pile in chronological order to form a continuous time series.

[0184] Label generation: Based on event serialization, the fault status of each charging pile in all time periods in March is counted with a time step of 8 hours.

[0185] Step 3: Feature mining

[0186] Use data visualization methods such as charts to display the distribution and characteristics of data.

[0187] Sort the fault types in descending order according to the number of occurrences, and count the number of occurrences of the top 80% of different fault types.

[0188] The fault data is classified according to the number of faults, and the number of faulty charging piles corresponding to each fault number interval is counted.

[0189] The fault data are classified according to the districts and counties to which they belong, and the distribution of the number of faults in each district and county is counted.

[0190] The fault data is classified by the date of occurrence, and the distribution of the number of faults from Monday to Sunday of each week is counted.

[0191] Step 4: Construct input data

[0192] Basic data preparation: The first step is to collect real fault data to ensure that the existing real fault data contains sufficient information about the charging pile ID, fault status, charging station name, manufacturer name, etc. for subsequent fault prediction.

[0193] In the existing electric vehicle charging pile failure data set, we time slice the entire March timeline, and record whether there is a failure in the specific time slice according to the start and end time of the failure. Then, the name of the charging station to which the charging pile belongs and other information are spliced ​​after the fault status data. The charging station name and manufacturer name in the input features are sequentially encoded; the sliding window intercepts the data, and for each charging pile fault status sequence S i =[s1,s2,...,s T ], use sliding window size W for each sequence S i The subsequences are intercepted to generate multiple subsequences of length W, and then each sliding window slides from the beginning to the end of the sequence, one position at a time. Then it is determined whether the predicted time is a weekday.

[0194] Step 5: Build LSTM model

[0195] 1. Construct the input layer:

[0196] The input data is a matrix with a time step of t and a feature dimension of n.

[0197] The data at each time step is represented as a vector X i .

[0198] 2. Build the LSTM network layer:

[0199] Including forget gate, input gate, candidate cell state, updated cell state, output gate and hidden state.

[0200] The activation functions used include sigmoid (for controlling the on / off state of the gate) and tanh (for generating candidate memories and updating hidden states).

[0201] Weight matrices and bias terms are used to tune the operation of these gates.

[0202] 3. Add Dropout layer:

[0203] During the training process, some neurons are randomly discarded to reduce overfitting.

[0204] Add a fully connected layer:

[0205] Binary classification is performed through a fully connected layer and a sigmoid activation function to limit the output value to between 0 and 1.

[0206] 4. Compile the model:

[0207] The Adam optimizer is used to accelerate model convergence and improve stability.

[0208] Binary cross entropy was selected as the loss function, and accuracy was used as the model evaluation metric.

[0209] 5. Set the learning rate scheduler:

[0210] The learning rate is automatically adjusted during training to prevent the model from falling into a local optimum or overfitting.

[0211] Step 6: Save and update the model

[0212] Use the training set data to train the constructed prediction model, and save the trained model so that it can be quickly predicted in the future without retraining. In order to ensure that the model can reflect the latest data changes, new data needs to be added and the model needs to be retrained regularly.

[0213] Step 7: Result visualization and quality assessment

[0214] Visualize the prediction results generated by the model, and the accuracy of the model training process, loss value, and confusion matrix between the prediction results and the true value can be used as one of the evaluation criteria for model performance. For example, Figure 7 , Figure 8 are the loss values ​​of model training and validation and the accuracy of model training, validation and testing, respectively. Fig. 9 The confusion matrix for the model's prediction results.

[0215] This model uses the results of ten predictions to calculate the average of its corresponding indicators. The average accuracy is 0.90. The higher the accuracy of the model prediction, the greater the proportion of correct predictions made by the model as a whole, which means that the model has a better overall prediction effect on whether the charging pile is faulty. The average precision is 0.73. The higher the accuracy of the model prediction, the greater the proportion of actual faults among the charging piles predicted by the model as faulty, which means fewer false alarms of predicted faults but no faults in reality. The average recall is 0.48. The higher the recall, the greater the proportion of charging piles that are correctly predicted as faulty by the model among the charging piles that actually have faults. A high recall means that the possibility of faulty charging piles being detected is higher, reducing the number of missed reports of actual faults that are not predicted. The average F1 score is 0.58. The F1 score is the harmonic mean of precision and recall. The higher the F1 score, the better the balance between precision and recall. A high F1 score indicates that the model can accurately identify faults and cover more actual faults when predicting faults, which is a good measure of the overall performance of the model. The detailed performance indicators of the ten results predicted by the model are as follows: Fig.10 shown.

[0216] Judging from the visualization chart, the model has a high accuracy rate in predicting the failure of electric vehicle charging piles, and can relatively accurately predict whether the charging piles will fail in the future, ensuring the reliability and practicality of the charging pile failure prediction model and meeting subsequent scientific research and application needs.

[0217] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for predicting faults of electric vehicle charging piles, characterized in that: include: Obtain fault data during the operation of the charging pile, including fault start and end time, fault cause, and fault duration information; Preprocess the acquired fault data. The preprocessing steps include data cleaning, event serialization, and label generation. Use data visualization methods to analyze the preprocessed fault data to obtain the distribution, characteristics, and fault status of the fault data in different dimensions, and further mine new features; Based on the results of visual analysis, determine the key features of the fault data and construct the input data of the model; constructing a prediction model based on the input data; Train the prediction model and save the trained model; Test the saved model and visualize the test results to verify the reliability and practicality of the model.

2. The electric vehicle charging pile fault prediction method according to claim 1, characterized in that: The acquisition of fault data during operation of the charging pile includes: Deploy a charging pile operation health monitoring system on the actual electric vehicle charging piles to monitor the operating status of the charging piles in real time, and monitor the working status and environmental conditions of the charging piles; install a data acquisition card or module to convert the analog signal of the sensor into a digital signal and transmit it to the data server; set up a fault recording system in the data server to record the time when the fault occurred, the time when the fault ended, the name of the charging station to which it belongs, the cause of the fault, the manufacturer information, and save the relevant original data.

3. The electric vehicle charging pile fault prediction method according to claim 2, characterized in that: The preprocessing of the acquired fault data includes: Data cleaning: delete abnormal data, delete fault data with negative time and fault duration of 0, delete incomplete data, and delete records with empty values ​​in the charging station name and manufacturer name information; Event serialization: Integrate the historical fault records of each charging pile in chronological order to form a continuous time series; Label generation: Based on event serialization, the fault status of each charging pile in all time periods in March is counted with a time step of 8 hours; for the historical fault record S of the i-th charging pile i , expressed as: S i =[s1,s2,...,s T ] Where T represents the length of the sequence of historical fault states of each charging pile, s1 represents the fault state in the first time slice, 0 represents no fault, and 1 represents fault.

4. The electric vehicle charging pile fault prediction method according to claim 3, characterized in that: The pre-processed fault data is analyzed to obtain the distribution, characteristics and fault status of the fault data in different dimensions, and further mine new features including: Use data visualization methods to display the distribution and characteristics of the data; sort the fault types in descending order according to the number of occurrences, and count the number of occurrences of the top 80% of different fault types; classify the fault data by the number of faults, and count the number of faulty charging piles corresponding to each fault number interval; classify the fault data by the district or county to which it belongs, and count the distribution of the number of faults in each district or county; classify the fault data by the date of occurrence, and count the distribution of the number of faults from Monday to Sunday of each week.

5. The electric vehicle charging pile fault prediction method according to claim 4, characterized in that: Based on the results of the visualization analysis, the key features of the fault data are determined, and the input data for building the model includes: The input features are determined as follows: charging pile ID, charging pile fault status, charging station name, manufacturer name, district code, longitude and latitude, and whether it is a working day; Sequentially encode the charging station name and manufacturer name in the input features: C i ∈{0,1,2,...,N s -1} M i ∈{0,1,2,...,N m -1} Among them C i represents the result of sequential coding of the charging stations to which the i-th charging station belongs, N s Represents the total number of charging stations, M i Represents the result of encoding the manufacturer name of the i-th charging station, N m Indicates the total number of manufacturers; The sliding window intercepts the data, and for each charging pile fault state sequence S i =[s1,s2,...,s T ], use sliding window size W for each sequence S i The subsequences of length W are intercepted and generated. Each sliding window slides from the beginning to the end of the sequence, one position at a time. Let k represent the starting position of the sliding window. The sum of the subsequences of the kth sliding window and whether it is a working day is expressed as: S i [k:k+W]=[s k ,s k+1 ,...,s k+W-1 ] w k+W =is_weekday(s k+W ) Where k = 1, 2, ..., T-W + 1, T represents the length of the sequence of historical fault states of each charging pile, s k+W represents the time of the state that needs to be predicted for the subsequence starting with k, w k+W A value of 0 indicates that the date is from Monday to Thursday, and a value of 1 indicates that the date is from Friday to Sunday. For each charging pile i, the charging station name C i 、Manufacturer NameM i , District and County Code D i , longitude and latitude L i (lat i ,lng i ) and whether it is a working day k+W It is concatenated with the subsequences intercepted by each sliding window to obtain the final input data X of the kth sliding window. i : X i [k:k+W]=[s k ,s k+1 ,...,s k+W-1 ,C i ,M i ,D i ,lat i ,lng i ,w k+W ] Divide the data set: The training set is represented as: X train ={[S i [k:k+W],C i ,M i ,D i ,years i ,lng i ,In k+W ]|1≤k≤60} The validation set is represented as: X val ={[S i [k:k+W],C i ,M i ,D i ,years i ,lng i ,In k+W ]|61≤k≤67} The test set is represented as: X test ={[S i [k:k+W],C i ,M i ,D i ,years i ,lng i ,In k+W ]|68≤k≤75}。 6. The electric vehicle charging pile fault prediction method according to claim 5, characterized in that: The constructing of the prediction model comprises: Construct the input layer: the batch size defaults to 1, the number of time steps is t, and the feature dimension is n. A sample is represented as a real sequence matrix R. t×n , remember X i For R t×n The vector representation of the data of the i-th time step in ; Construct LSTM network layer: The LSTM neural network structure includes: forget gate, input gate, candidate cell state, update cell state, output gate, hidden state: where x i is the input of the current time step, h t-1 is the hidden state of the previous time step, f t is the output of the forget gate, i t is the output of the input gate, is the new candidate memory state, C t is the updated memory state, o t is the output of the output gate, h t is the hidden state of the current time step, W f , W i , W C , W o is the weight matrix, b f , b i , b C , b o is the bias term, σ is the sigmoid activation function, which controls the switch state of the gate, and tanh is the tanh activation function, which is used to generate candidate memories and update hidden states. Add Dropout layer: randomly discard a certain proportion of neurons during training to prevent overfitting. Add a fully connected layer: Use the sigmoid activation function for binary classification and compress the output value. Compile the model: Use the Adam optimizer to improve convergence speed and stability, select binary cross entropy as the loss function, and select accuracy as the evaluation metric of the model. Where N is the total number of samples, y i is the true label of the i-th sample, which takes a value of 0 or 1. is the predicted probability value of the i-th sample, ranging from 0 to 1, TP is the number of true classes correctly predicted, TN is the number of false classes correctly predicted, FP is the number of false classes incorrectly predicted as true classes, and FN is the number of true classes incorrectly predicted as false classes.

7. The electric vehicle charging pile fault prediction method according to claim 6, characterized in that: The training of the prediction model and saving the trained model includes: Save the entire model including the model architecture, weights, and optimizer status, import the trained model, collect new electric vehicle charging pile fault status data in a two-week cycle, preprocess and label the collected data, obtain the latest two-week fault status record of the i-th charging pile, merge the latest data with the data of the previous cycle, and obtain the fault status record S of the i-th charging pile i : S i =[s1,s2,...,s T+14 ] Based on the fault status record S of the i-th charging pile i Redivide the data set, substitute it into the model and retrain the model.

8. A system using the electric vehicle charging pile fault prediction method according to any one of claims 1 to 7, characterized in that: include: An information acquisition module is used to obtain fault data during the operation of the charging pile, including the start and end time of the fault, the cause of the fault, and the duration of the fault; The preprocessing module is used to preprocess the acquired fault data. The preprocessing steps include data cleaning, event serialization, and label generation. The data analysis module is used to analyze the preprocessed fault data using data visualization methods to obtain the distribution, characteristics and fault status of the fault data in different dimensions, and further mine new features; The feature determination module is used to determine the key features of the fault data based on the results of the visual analysis and construct the input data of the model; A model building module, used for building a prediction model according to the input data; The training module is used to train the prediction model and save the trained model; The test module is used to test the saved model and visualize the test results to verify the reliability and practicality of the model.

9. A computing device comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the electric vehicle charging pile fault prediction method described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the electric vehicle charging pile fault prediction method according to any one of claims 1 to 7.