Method for early warning of failure of alternating current charging pile and related product
By constructing a random forest prediction model and using the working data of charging piles for fault diagnosis, the problem of low accuracy in charging pile fault diagnosis in existing technologies has been solved, and more efficient fault identification and early warning have been achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN POWER SUPPLY BUREAU
- Filing Date
- 2024-09-19
- Publication Date
- 2026-04-14
AI Technical Summary
Existing charging pile fault diagnosis methods rely on a single threshold judgment, resulting in low diagnostic accuracy and an inability to fully identify electrical faults and safety hazards in charging piles.
A random forest prediction model is adopted. By acquiring the working data of charging piles, training and test sets are constructed. The advantages of decision trees are used to handle nonlinear relationships and improve the accuracy of fault diagnosis.
It improves the accuracy of charging pile fault diagnosis, reduces the risk of overfitting, can more accurately identify the working status of charging piles, and improves the reliability and safety during use.
Smart Images

Figure CN119272147B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of charging pile technology in data identification, and in particular to a fault early warning method for AC charging piles and related products. Background Technology
[0002] In recent years, the electric vehicle market has continued to grow. In order to support the popularization and use of electric vehicles, the construction of charging infrastructure has received more attention. More and more charging piles are being installed in urban roads, commercial buildings and residential areas to meet the charging needs of electric vehicles.
[0003] According to market research data on charging piles, the damage rate of public charging piles has reached 20%, and the equipment failure rate accounts for nearly one-third. Charging pile malfunctions may involve electrical faults, overloads, or other safety hazards. Currently, fault diagnosis mainly relies on manually preset thresholds. If a charging pile exceeds the threshold, it is considered faulty. This approach considers only a single, insufficient factor, resulting in low accuracy in fault diagnosis. Therefore, improving the accuracy of charging pile fault diagnosis is an urgent issue that needs to be addressed. Summary of the Invention
[0004] This application provides a fault early warning method and related products for AC charging piles, which improves the accuracy of charging pile fault diagnosis.
[0005] In a first aspect, embodiments of this application provide a fault early warning method for AC charging piles, applied to a server of an intelligent early warning system, the method comprising:
[0006] Obtain the first working data of the target AC charging pile within the first preset time period, and obtain n first working datasets; n is a positive integer.
[0007] Determine the fault data and normal data of each of the n first working datasets to obtain n first fault datasets and n first normal datasets;
[0008] The n first fault datasets are preprocessed according to a preset preprocessing algorithm to obtain target fault data;
[0009] The n first normal datasets are preprocessed according to the preset preprocessing algorithm to obtain the target normal data;
[0010] The target normal data and the target fault data are divided into a training set and a test set according to the target ratio;
[0011] Construct a target random forest prediction model based on the training set and the test set;
[0012] Obtain the second working data of the target AC charging pile at the current moment, and obtain n second working data points;
[0013] The n second working data are input into the target random forest prediction model to obtain the target diagnosis result;
[0014] Determine the target fault corresponding to the target diagnostic result;
[0015] Based on the target fault, a corresponding fault control command is generated, and the intelligent early warning system is controlled to perform corresponding early warning operations through the fault control command.
[0016] Secondly, embodiments of this application provide a fault early warning device for AC charging piles, applied to a server of an intelligent early warning system. The device includes: an acquisition unit, a control unit, and an early warning unit, wherein:
[0017] The acquisition unit is used to acquire the first working data of the target AC charging pile within a first preset time period, and obtain n first working datasets; n is a positive integer.
[0018] The control unit is configured to: determine the first fault data and the first normal data in each of the n first working datasets to obtain n first fault datasets and n first normal datasets; preprocess the n first fault datasets according to a preset preprocessing algorithm to obtain target fault data; preprocess the n first normal datasets according to the preset preprocessing algorithm to obtain target normal data; divide the target normal data (n first normal datasets) and the target fault data into a training set and a test set according to a target ratio; and construct a target random forest prediction model based on the training set and the test set.
[0019] The acquisition unit is further configured to acquire the second working data of the target AC charging pile at the current moment, and obtain n second working data; the second preset time is later than the end time of the first preset time period; input the n second working data into the target random forest prediction model to obtain the target diagnosis result; and determine the target fault corresponding to the target diagnosis result.
[0020] The early warning unit is used to generate corresponding fault control commands based on the target fault, and to control the intelligent early warning system to perform corresponding early warning operations through the fault control commands.
[0021] Thirdly, this application provides an electronic device, including: a processor and a memory, the memory being used to store one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, the programs including instructions for performing the steps in the first aspect of this application.
[0022] Fourthly, this application provides a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in the first aspect of this application.
[0023] Fifthly, this application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in the first aspect of this application. The computer program product may be a software installation package.
[0024] Implementing this application will have the following beneficial effects:
[0025] As can be seen, the fault early warning method for AC charging piles described in this application is applied to the server of an intelligent early warning system. The method includes: acquiring first working data of a target AC charging pile within a first preset time period to obtain n first working datasets; determining fault data and normal data in each of the n first working datasets to obtain n first fault datasets and n first normal datasets; preprocessing the n first fault datasets according to a preset preprocessing algorithm to obtain target fault data; preprocessing the n first normal datasets according to a preset preprocessing algorithm to obtain target normal data; and dividing the target normal data and target fault data into training sets and training sets according to a target ratio. The test set is used to construct a target random forest prediction model based on the training and test sets. Second working data of the target AC charging pile at the current moment is obtained, resulting in n second working data points. These n second working data points are then input into the target random forest prediction model to obtain the target diagnosis result. The target fault corresponding to the diagnosis result is determined. Based on the target fault, corresponding fault control commands are generated, and the intelligent early warning system is controlled to perform corresponding early warning operations through these commands. The random forest prediction model, combined with the advantages of multiple decision trees, can handle complex nonlinear relationships, reduce the risk of overfitting, and more accurately diagnose faults in the working data of the target AC charging pile, effectively improving the accuracy of fault diagnosis. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application or the background art will be described below.
[0027] Figure 1 This is a schematic diagram of the structure of an intelligent early warning system provided in an embodiment of this application;
[0028] Figure 2This is a flowchart of a fault early warning method for an AC charging pile provided in an embodiment of this application;
[0029] Figure 3 This is a functional unit block diagram of a fault early warning device for an AC charging pile provided in an embodiment of this application;
[0030] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0031] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0032] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0033] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0034] The electronic device described in the embodiments of this application can be a server, such as a cloud server.
[0035] The following will explain some of the technical terms used in this application:
[0036] Decision trees are tree-like structures similar to flowcharts, used for data classification and prediction. They make decisions by performing a series of logical judgments on data features (e.g., "greater than," "less than," etc.), ultimately arriving at a classification result or predicted value.
[0037] Random forest prediction models are ensemble learning methods consisting of multiple decision trees. Multiple training subsets are generated through random sampling (bootstrap sampling), and a decision tree is built on each subset. During prediction, the results from multiple decision trees are combined through voting or averaging to obtain more accurate and stable predictions. Random forest prediction models can handle high-dimensional data and have good resistance to overfitting and generalization ability.
[0038] CEEMDAN decomposition, also known as "Adaptive Integrated Empirical Mode Decomposition," is a signal decomposition method used to decompose complex non-stationary signals into multiple intrinsic mode functions (IMFs) and a residual term. This decomposition method can adaptively process signals with different frequency components, which is of great significance for analyzing and processing complex data.
[0039] Mahalanobis distance is a measure of similarity between samples. It takes into account the distribution and covariance structure of the data, eliminating the influence of correlation between variables and more accurately reflecting the true distance between samples.
[0040] The Savitzky-Golay Filtering algorithm is a method for smoothing and filtering data. It achieves smoothing by performing polynomial fitting on local data points, effectively preserving the shape, width, and trend of the signal while removing noise.
[0041] Singular Spectrum Analysis (SSA) is an analytical method based on time series data. In terms of noise reduction, it removes noise and retains useful information by decomposing the time series into different components, filtering and reconstructing them according to their importance.
[0042] Please see Figure 1 , Figure 1 This is a schematic diagram of the structure of an intelligent early warning system provided in an embodiment of this application; as shown... Figure 1 As shown, the intelligent early warning system (hereinafter referred to as the system) may include: a data acquisition module, a system database, a data preprocessing module, a prediction model training module, a server, a fault early warning module, etc., which are not limited here.
[0043] The data acquisition module can be physically or communicatively connected to the AC charging pile and is responsible for collecting relevant data from the AC charging pile. This data may include the operating voltage, operating current, ambient temperature, and ambient humidity of the AC charging pile, etc., which are not limited here. It is the entry point for the entire system to obtain raw data.
[0044] It should be explained that AC charging piles can be used to charge electric vehicles. During the charging process of an electric vehicle, a data acquisition module can be activated to collect data from the AC charging pile in order to obtain the raw working data of the AC charging pile.
[0045] The system database stores the data collected by the data acquisition module, as well as various intermediate and result data generated during system operation, providing data support for subsequent data processing, analysis, and querying.
[0046] The data preprocessing module is used to perform preprocessing operations such as cleaning, filtering, and normalizing on the data of AC charging piles, and to process the data into a form suitable for subsequent analysis and modeling.
[0047] The prediction model training module is used to build a random forest prediction model using preprocessed data. This random forest prediction model is used to predict the operating status of AC charging piles in order to determine whether there is a fault in the AC charging piles.
[0048] The server is used to provide computing and storage resources for the entire system, ensure the normal operation of each module, and process and distribute data and instructions.
[0049] The fault early warning module is used to determine whether there are potential fault risks based on the output of the prediction model and the preset early warning rules, and to issue an alarm in a timely manner to notify relevant personnel to take measures.
[0050] In this way, the intelligent early warning system can detect AC charging pile faults in advance and take corresponding early warning actions, thereby improving the reliability and safety of AC charging piles during use.
[0051] Please see Figure 2 , Figure 2 This is a flowchart illustrating a fault early warning method for AC charging piles provided in an embodiment of this application. This method can be applied to, for example... Figure 1 The server in the intelligent early warning system shown includes, but is not limited to, the following steps:
[0052] S201. Obtain the first working data of the target AC charging pile within the first preset time period, and obtain n first working datasets; n is a positive integer.
[0053] In this embodiment of the application, the first preset time period can be preset in advance or defaulted.
[0054] In a specific embodiment, the data acquisition module of the intelligent early warning system can collect data from the target AC charging pile to obtain n first working data. Specifically, the data acquisition module can include acquisition devices such as voltage sensors, current sensors, temperature sensors, and humidity sensors. These acquisition devices are placed inside or around the target AC charging pile to monitor the target AC charging pile in real time, thereby obtaining n first working data.
[0055] It should be explained that, in some embodiments, the data acquisition module can also monitor whether the target AC charging pile is charging other devices (e.g., electric vehicles), that is, whether the target AC charging pile is in working condition. When the target AC charging pile is in working condition, data can be collected from it through the data acquisition module. Conversely, if the target AC charging pile is not in working condition, data will not be collected from it to save system resources.
[0056] S202. Determine the fault data and normal data of each of the n first working datasets to obtain n first fault datasets and n first normal datasets.
[0057] In this embodiment, the fault type of the fault data can be determined first. During the operation of the target AC charging pile, there are mainly fault types such as overcurrent fault, overvoltage fault, and overtemperature fault. Then, corresponding fault thresholds can be set for these fault types to obtain a variety of fault thresholds, such as fault current threshold, fault voltage threshold, and fault temperature threshold.
[0058] Furthermore, the n first working datasets can be checked sequentially based on these multiple fault thresholds. If the voltage, current, or temperature of a certain data in the n first working datasets exceeds any of the aforementioned multiple fault thresholds, it is marked as fault data and assigned to the corresponding first fault dataset. Otherwise, it is assigned to the corresponding first normal dataset. In this way, n first fault datasets and n first normal datasets can be obtained.
[0059] S203. Preprocess the n first fault datasets according to the preset preprocessing algorithm to obtain the target fault data.
[0060] In this embodiment of the application, the preset preprocessing algorithm can be preset in advance or defaulted.
[0061] In a specific embodiment, a preset preprocessing algorithm can be used to process the n first fault datasets to obtain the target fault data.
[0062] Optionally, step S203, which involves preprocessing the n first fault datasets according to a preset preprocessing algorithm to obtain the target fault data, may include the following steps:
[0063] A1. Extract the data corresponding to the voltage data type and the current data type from the n first fault datasets to obtain the target monitoring data;
[0064] A2. Decompose the target monitoring data according to the preset modal decomposition formula to obtain k modal components; k is a positive integer; the modal decomposition formula is as follows:
[0065]
[0066] in, The target monitoring data is represented by the superscript 0, indicating that it is raw data; the subscript q indicates the data type label corresponding to the target monitoring data, and each data type label corresponds to a data type; t represents time; c j R(t) represents the j-th modal component among the k modal components, where j is a positive integer less than or equal to k; R(t) represents the residual term.
[0067] A3. Calculate the similarity for each of the k modal components according to the preset Mahalanobis distance calculation formula to obtain k similarities; the Mahalanobis distance calculation formula is as follows:
[0068]
[0069] Where S(j) represents the similarity between the j-th mode component among the k mode components and the corresponding j-th original signal in the n first fault datasets; D M Let X represent the Mahalanobis distance; X represent the probability density function of the j-th modal component; Y represent the probability density function of the j-th original signal; (XY) T Denotes the transpose matrix of XY; ∑ -1 (XY) represents the inverse of the covariance matrix of XY;
[0070] A4. Determine the similarity scores among the k similarity scores that are greater than a preset similarity threshold, and obtain a similarity scores; a is a natural number less than or equal to k;
[0071] A5. Determine that the modal components corresponding to the a similarities in the k modal components are effective modal components, and obtain a effective modal components;
[0072] A6. Determine the similarity among the k similarities that is equal to the similarity threshold to obtain b similarities; b is a natural number less than or equal to k, and the sum of a and b is not greater than k;
[0073] A7. Determine that the modal components corresponding to the b similarities in the k modal components are aliased modal components, and obtain b aliased modal components;
[0074] A8. Filter the b aliased mode components according to the preset filtering algorithm to obtain b filtered mode components;
[0075] A9. Determine the target fault data based on the a effective mode components and the b filtered mode components.
[0076] In this embodiment of the application, the similarity threshold can be preset or defaulted in advance; each of the n first fault datasets corresponds to a data type, including the following data types: voltage data type, current data type, temperature data type, humidity data type, that is, n can be equal to 4.
[0077] In a specific embodiment, data of corresponding voltage and current data types can be extracted from n first fault datasets to obtain two first fault datasets, that is, the target monitoring data includes two first fault datasets; then, CEEMDAN decomposition can be performed on the target monitoring data. Specifically, the target monitoring data can be decomposed according to a preset modal decomposition formula to obtain k modal components (modal components can be abbreviated as IMFs); the modal decomposition formula is as follows:
[0078]
[0079] in, This represents the target monitoring data. The superscript 0 indicates that the data has undergone 0 data processing operations, meaning it is raw, unprocessed data. The subscript q represents the data type label corresponding to the target monitoring data. Each data type label corresponds to a data type; for example, q=1 represents voltage data type, q=2 represents current data type; t represents time; c j r(t) represents the j-th modal component among the k modal components, where j is a positive integer less than or equal to k; r(t) represents the residual term.
[0080] Based on the above formula, the target monitoring data can be decomposed into k modal components. Then, the similarity can be calculated for each of the k modal components according to the preset Mahalanobis distance calculation formula to obtain k similarities. The Mahalanobis distance calculation formula is as follows:
[0081]
[0082] Where S(j) represents the similarity between the j-th mode component in the k modal components and the corresponding j-th original signal in the n first fault datasets; D MLet X represent the Mahalanobis distance; let X represent the probability density function of the j-th modal component; let Y represent the probability density function of the j-th original signal; (XY) T Denotes the transpose matrix of XY; ∑ -1 (XY) represents the inverse of the covariance matrix of XY.
[0083] Next, we can compare the magnitude of each of the k similarities with the similarity threshold to obtain all similarities greater than the similarity threshold, i.e., a similarities. Since these a similarities are all greater than the similarity threshold, it means that their noise component is small. We can determine the modal components corresponding to these a similarities in the k modal components as effective modal components, thus obtaining a effective modal components.
[0084] Furthermore, we can find the similarity scores among the k similarities that equal the similarity threshold, obtaining b similarities; generally, b is equal to 1. Next, we can determine the modal components corresponding to the b similarities among the k modal components as aliased modal components, obtaining b aliased modal components. Then, we can filter the b aliased modal components according to a preset filtering algorithm to remove noise, obtaining b filtered modal components. Finally, we can determine the target fault data based on a effective modal components and b filtered modal components.
[0085] Thus, target monitoring data is extracted from n first fault datasets; the target monitoring data is decomposed according to a preset mode decomposition formula to obtain k modal components; the k modal components are calculated according to a preset Mahalanobis distance calculation formula to obtain k similarities; a similarities greater than a similarity threshold are determined from the k similarities; the modal components corresponding to the a similarities in the k modal components are determined as effective modal components, resulting in a effective modal components; b similarities equal to the similarity threshold are determined from the k similarities; the modal components corresponding to the b similarities in the k modal components are determined as aliased modal components, resulting in b aliased modal components. The system filters b aliased mode components according to a preset filtering algorithm to obtain b filtered mode components. Based on a effective mode components and b filtered mode components, the target fault data is determined. On the one hand, by extracting specific voltage and current data types, parameters closely related to electrical faults can be focused on, and the fault situation can be analyzed more specifically, reducing the interference of irrelevant information and improving the accuracy of fault location. On the other hand, by using Mahalanobis distance to calculate similarity, the degree of difference between each mode component and the original signal can be objectively quantified, and fault characteristics that deviate significantly from the original signal can be quickly identified, providing a clear basis for fault diagnosis.
[0086] Optionally, in step A8, the preset filtering algorithm includes the SG filtering algorithm, and the filtering of the b aliasing mode components according to the preset filtering algorithm to obtain b filtered mode components may include the following steps:
[0087] B1. Obtain the target aliasing mode component; the target aliasing mode component is any one of the b aliasing mode components;
[0088] B2. Obtain the length of the first window corresponding to the SG filtering algorithm, 2L+1; where L is a positive integer.
[0089] B3. Obtain the preset polynomial corresponding to the SG filtering algorithm; the preset polynomial is as follows:
[0090]
[0091] Where N1 is the power of the preset polynomial, and N1 is less than or equal to 2L+1; a j For x j The coefficient; x is the independent variable;
[0092] B4. Calculate the target aliasing mode components according to the preset polynomial approximation calculation formula to obtain the polynomial approximation deviation value; the specific polynomial approximation calculation formula is as follows:
[0093]
[0094] Where, ε N This represents the approximate deviation value of the polynomial; This represents the target aliasing mode component;
[0095] B5. When the approximate deviation value of the polynomial is less than or equal to a preset value, the filter mode component corresponding to the target aliasing mode component is determined according to the preset polynomial.
[0096] In this embodiment, both the preset polynomial and the preset value can be preset in advance or defaulted. For example, the preset value can be 10. -3 .
[0097] In a specific embodiment, the target aliased mode component can be obtained from b aliased mode components; then, the first window length 2L+1 corresponding to the SG filtering algorithm can be obtained. Specifically, the target data type corresponding to the target aliased mode component can be obtained. A preset mapping relationship between data types and window lengths can be stored in advance, and the first window length 2L+1 corresponding to the target data type can be determined based on this mapping relationship; next, the preset polynomial corresponding to the SG filtering algorithm can be obtained. The preset polynomial is as follows:
[0098]
[0099] Where N1 is a power of a predefined polynomial, and N1 is less than or equal to 2L+1; a j For x j The coefficients are denoted by x; x is the independent variable; the target aliasing mode components are calculated according to the preset polynomial approximation calculation formula to obtain the polynomial approximation deviation value; the specific polynomial approximation calculation formula is as follows:
[0100]
[0101] Where, ε N This represents the approximate deviation value of the polynomial; The target aliasing mode component is indicated by the superscript 1, which indicates that it is an aliasing mode component, and the subscript j indicates that it is the j-th aliasing mode component among b aliasing mode components.
[0102] In ε N When p(x) is less than or equal to the preset value, it indicates that p(x) has a high similarity to the target aliasing mode component, and p(x) can be used to replace the target aliasing mode component, that is, p(x) can be used as the filtering mode component: as follows:
[0103]
[0104] Conversely, if ε N If the value is greater than the preset value, then the value of N1 is increased to obtain a new N1, and ε is recalculated based on the new N1. N If the new ε N If it is still greater than the preset value, then continue to increase N1 until ε N If the value is less than or equal to a preset value, the target aliasing mode component is replaced by a preset polynomial to obtain the filtered mode component.
[0105] Thus, by obtaining the target aliasing mode components; obtaining the first window length 2L+1 corresponding to the SG filtering algorithm; obtaining the preset polynomial corresponding to the SG filtering algorithm; calculating the target aliasing mode components according to the preset polynomial approximation calculation formula to obtain the polynomial approximation deviation value; and in ε N When the value is less than or equal to a preset value, the filter mode component corresponding to the target aliasing mode component is determined based on p(x), and ε is judged. N Whether the value is less than or equal to a preset value ensures the accuracy and reliability of the filtering results. Determining the filtering mode components only when the error requirements are met helps improve the quality of data processing.
[0106] Optionally, step A9, determining the target fault data based on the a effective mode components and the b filtered mode components, may include the following steps:
[0107] C1. Reconstruct the a effective mode components and the b filtered mode components according to a preset signal reconstruction formula to obtain reference fault data; the preset signal reconstruction formula is as follows:
[0108]
[0109] in, The reference fault data, For the i-th filter mode component among the b filter mode components, It is the j-th effective modal component among the a effective modal components;
[0110] C2. Determine the first time series corresponding to the reference fault data;
[0111] C3. Determine the target sequence length N2 and the second window length M corresponding to the first time series;
[0112] C4. Calculate the third window length Z based on the second window length M and the target sequence length N2;
[0113] C5. Convert the first time series into a target trajectory matrix according to the second window length M and the third window length Z;
[0114] C6. Perform singular value decomposition on the target trajectory matrix according to the preset singular value decomposition formula to obtain a diagonal matrix; the specific singular value decomposition formula is as follows:
[0115]
[0116] in, The target trajectory matrix is represented by U; the left matrix is represented by ∑; the diagonal matrix is represented by ∑, where the diagonal elements are singular values; and the right matrix is represented by V. T This represents the transpose of the right matrix;
[0117] C7. Obtain the singular values in the diagonal matrix to get the target singular value data;
[0118] C8. Reconstruct the first time series based on the target singular value data to obtain the target fault data.
[0119] In this embodiment, the preset signal reconstruction formula and the singular value decomposition formula can both be preset in advance or defaulted.
[0120] In a specific embodiment, the above-mentioned a effective mode components and b filtered mode components can be reconstructed according to a preset signal reconstruction formula to obtain reference fault data; the preset signal reconstruction formula is as follows:
[0121]
[0122] in, For reference, the superscript 1 indicates that it has undergone 1 data processing operation, and the subscript q indicates its corresponding data type label; Let i be the i-th filter mode component among b filter mode components, with the superscript 1 indicating that it is a filter mode component; Let be the j-th effective modal component among a effective modal components, with the superscript 2 indicating that it is an effective modal component.
[0123] Next, singular value decomposition is performed on the reference fault data to determine the first time series corresponding to the reference fault data. Specifically, the acquisition time of each data point in the reference fault data can be obtained, resulting in multiple acquisition times. The data in the reference fault data are sorted and combined according to the chronological order of these multiple acquisition times to obtain the first time series. Then, the target sequence length N2 and the second window length M corresponding to the first time series can be determined. Specifically, the number of data points in the first time series, i.e., the target sequence length N2, can be obtained first. Then, the second window length M can be determined based on the size of the target sequence length N2. A preset mapping relationship between sequence length and window length can be stored in advance. The second window length corresponding to the target sequence length can be determined based on this mapping relationship. In addition, M and N2 satisfy the relationship that M < N2 / 2.
[0124] Furthermore, the third window length Z is calculated based on the second window length M and the target sequence length N2, with the specific calculation formula being Z = N2 - M + 1; then, the first time series can be converted into the target trajectory matrix based on the second window length M and the third window length Z.
[0125] Let me illustrate with an example. Suppose the first time series is... Then, based on the second window length M and the third window length Z, the first time series is converted into the target trajectory matrix, which is as follows:
[0126]
[0127] It can be seen that the target trajectory matrix is an M-row, Z-column matrix.
[0128] Then, the target trajectory matrix can be decomposed using a preset singular value decomposition formula to obtain the target singular vector and target singular values; the specific singular value decomposition formula is as follows:
[0129]
[0130] in, Let V represent the target trajectory matrix; U represents the left matrix; ∑ represents the diagonal matrix, where the elements on the diagonal are singular values, arranged in descending order, and all elements except those on the diagonal are zero; V T Let represent the transpose of the right matrix; according to the above singular value decomposition formula, the target trajectory matrix can be decomposed into 3 matrices. Since singular value decomposition is an existing technology, the specific decomposition process will not be described here.
[0131] Next, we can directly obtain all the elements on the diagonal of the diagonal matrix, i.e., the singular values, to get the target singular value data. For example, let's assume the diagonal matrix is as follows:
[0132]
[0133] Therefore, the target singular value data is [1140, 19.6, 14.9, 13.1].
[0134] Finally, the first time series can be reconstructed based on the target singular value data to obtain the target fault data.
[0135] Thus, by reconstructing the signals of *a* effective mode components and *b* filtered mode components according to a preset signal reconstruction formula, reference fault data is obtained; the first time series corresponding to the reference fault data is determined; the target sequence length N2 and the second window length M corresponding to the first time series are determined; the third window length Z is calculated based on the second window length M and the target sequence length N2; the first time series is converted into a target trajectory matrix based on the second window length M and the third window length Z; the target trajectory matrix is subjected to singular value decomposition according to a preset singular value decomposition formula to obtain a diagonal matrix; the singular values in the diagonal matrix are obtained to obtain target singular value data; the first time series is reconstructed based on the target singular value data to obtain target fault data. On the one hand, obtaining reference fault data by reconstructing the signals of effective mode components and filtered mode components can more accurately capture the essential characteristics of the fault, helping to separate key information related to the fault from complex data and improve the pertinence of subsequent analysis. On the other hand, performing singular value decomposition on the reference fault data reduces the complexity of the data and can also remove some noise and interference, making the processed target fault data clearer and more reliable, thereby improving the accuracy of fault diagnosis.
[0136] Optionally, step C8, reconstructing the first time series based on the target singular value data to obtain the target fault data, may include the following steps:
[0137] D1. Group the target singular value data according to the preset singular value grouping method to obtain multiple groups of singular values;
[0138] D2. Group the first time series according to the multiple sets of singular values to obtain multiple sets of time series;
[0139] D3. Sort the multiple time series according to the multiple sets of singular values to obtain the first time series order; the larger the singular value, the earlier the order.
[0140] D4. Select the c time series that appear first in the first time series sequence, and combine the c time series to form a new time series to obtain the second time series; c is a positive integer;
[0141] D5. Reconstruct the second time series according to the preset sequence reconstruction formula to obtain the target fault data; the sequence reconstruction formula is as follows:
[0142]
[0143] in, The target fault data is indicated by the superscript 2, which indicates that it has undergone 2 data processing operations, and the subscript q indicates its corresponding data type label. This represents the second time series.
[0144] In this embodiment of the application, the singular value grouping method can be preset or defaulted.
[0145] In a specific embodiment, the target singular value data can be grouped according to a preset singular value grouping method to obtain multiple groups of singular values. For example, the preset singular value grouping method can be equidistant grouping, which divides the target singular value data into several groups according to the size range of the singular values. For example, assuming the target singular value data is [1140, 19.6, 14.9, 13.1], the range of the singular values can be 0 to 1200, and it can be divided into 3 groups. Then the range of each group is 0 to 400, 400 to 800, and 800 to 1200. Then the target singular value data can be divided into 2 groups of singular values. The first group of singular values includes 19.6, 14.9, and 13.1, and the second group of singular values only includes 1140.
[0146] Next, the first time series can be grouped according to multiple sets of singular values to obtain multiple sets of time series. Specifically, the correspondence between each singular value in the multiple sets of singular values and the data in the first time series can be obtained first. Then, the data corresponding to each set of singular values in the multiple sets of singular values can be determined according to the singular value correspondence to obtain multiple sets of data, that is, multiple sets of time series. For example, assuming the first time series is [12, 45, 70, 20], 12, 45, and 70 correspond to the first set of singular values mentioned above. Then these 3 data will be divided into one set of time series, and 20 corresponds to the second set of singular values mentioned above and is divided into another set of time series. In this way, two sets of time series can be obtained.
[0147] Furthermore, multiple time series can be sorted based on multiple sets of singular values to obtain a first time series order. Specifically, the time series can be sorted according to the magnitude of the singular values; the larger the singular value, the earlier the time series appears, thus obtaining the first time series order. Then, the first c time series in the first time series order can be selected and combined into a new time series in chronological order to obtain a second time series. Finally, the second time series can be reconstructed according to a preset sequence reconstruction formula to obtain the target fault data. The sequence reconstruction formula is as follows:
[0148]
[0149] in, Indicates target fault data; This represents the second time series.
[0150] Thus, by grouping the target singular value data according to a preset singular value grouping method, multiple sets of singular values are obtained; the first time series is grouped according to the multiple sets of singular values, resulting in multiple time series; the multiple time series are sorted according to the multiple sets of singular values to obtain the first time series order; the c time series with the highest order in the first time series order are selected and combined to form a new time series, resulting in the second time series; the second time series is reconstructed according to the sequence reconstruction formula to obtain the target fault data. By grouping singular values, time series, and sorting, time series components with important characteristics can be selected, and the time series with the highest order can be prioritized for reconstruction, thus improving data processing efficiency.
[0151] S204. Preprocess the n first normal datasets according to the preset preprocessing algorithm to obtain the target normal data.
[0152] In this embodiment of the application, n first normal datasets can be preprocessed according to a preset preprocessing algorithm to obtain target normal data. Specifically, the method for obtaining target normal data is the same as the method for obtaining target fault data.
[0153] S205. Divide the target normal data and the target fault data into a training set and a test set according to the target ratio value.
[0154] In this embodiment of the application, the target ratio is equal to the amount of data in the training set divided by the amount of data in the test set.
[0155] In a specific embodiment, data from the target normal data and target fault data can be allocated to the training set or the test set according to the target ratio value, thereby obtaining the training set and the test set. For example, assuming the target ratio value = 4, then for every data point allocated from the target normal data or target fault data to the test set, 4 data points need to be allocated to the training set.
[0156] Optionally, the method may further include the following steps:
[0157] S51. Obtain the type of the target AC charging pile corresponding to the target AC charging pile;
[0158] S52. Determine the reference ratio value corresponding to the target AC charging pile type;
[0159] S53. Obtain the target failure rate corresponding to the target AC charging pile type;
[0160] S54. Determine the first influence coefficient corresponding to the target failure rate;
[0161] S55. Obtain the working data of the target AC charging pile within the second preset time period to obtain historical working data; the end time of the second preset time period is earlier than the start time of the first preset time period.
[0162] S56. Determine the proportion of fault data to all working data in the historical working data to obtain the historical fault ratio;
[0163] S57. Determine the target optimization factor corresponding to the historical failure ratio;
[0164] S58. Optimize the first influence coefficient according to the target optimization factor to obtain the second influence coefficient;
[0165] S59. Adjust the reference ratio value according to the second influence coefficient to obtain the target ratio value.
[0166] In this embodiment of the application, the target AC charging pile type may include one of the following: home AC charging pile, public AC charging pile, fast AC charging pile, etc., which are not limited here;
[0167] In a specific embodiment, the target AC charging pile type can be obtained. Specifically, the identification information of the target AC charging pile can be collected by the data acquisition module, and the corresponding target AC charging pile type can be determined based on this identification information. Next, the reference ratio value corresponding to the target AC charging pile type can be determined. Specifically, a preset mapping relationship between AC charging pile types and ratio values can be stored in advance, and the reference ratio value corresponding to the target AC charging pile type can be determined based on this mapping relationship. Then, the target failure rate corresponding to the target AC charging pile type can be obtained. Specifically, the manufacturer of the target AC charging pile can be identified first, and the target failure rate can be obtained by visiting the manufacturer's website, or the target failure rate of the target AC charging pile type can be directly searched online. Next, the first influence coefficient corresponding to the target failure rate can be determined. For example, a preset mapping relationship between failure rates and influence coefficients can be stored in advance, and the first influence coefficient corresponding to the target failure rate can be determined based on this mapping relationship. The value range of the first influence coefficient can be -0.2 to 0.2.
[0168] Furthermore, the data acquisition module can be used to obtain the operating data of the target AC charging pile within the second preset time period to obtain historical operating data. Then, the frequency of fault data occurrences in the historical operating data can be determined, and the proportion of that fault data to all operating data can be calculated, as follows:
[0169] Historical failure rate = Number of occurrences of failure data / Total number of occurrences of historical working data;
[0170] The historical failure rate can be calculated using the above formula. Next, the target optimization factor corresponding to the historical failure rate can be determined. Specifically, a pre-stored mapping relationship between failure rates and optimization factors can be used to determine the target optimization factor corresponding to the historical failure rate. The target optimization factor can range from -0.12 to 0.12. The first influence coefficient is then optimized based on the target optimization factor to obtain the second influence coefficient, as follows:
[0171] Second influence coefficient = First influence coefficient × (1 + target optimization factor);
[0172] Finally, the reference ratio value can be adjusted based on the second influence coefficient to obtain the target ratio value, as follows:
[0173] Target ratio = Reference ratio × (1 + Second influence coefficient);
[0174] The target ratio can be calculated using the formula above.
[0175] Thus, by obtaining the target AC charging pile type; determining the reference ratio value corresponding to the target AC charging pile type; obtaining the target failure rate corresponding to the target AC charging pile type; determining the first influence coefficient corresponding to the target failure rate; obtaining the working data of the target AC charging pile within a second preset time period to obtain historical working data; determining the proportion of failure data in the historical working data to all working data to obtain the historical failure ratio; determining the target optimization factor corresponding to the historical failure ratio; optimizing the first influence coefficient according to the target optimization factor to obtain the second influence coefficient; and adjusting the reference ratio value according to the second influence coefficient to obtain the target ratio value, by obtaining the specific type of the target AC charging pile, relevant reference ratio values and failure rates can be determined in a targeted manner, making subsequent analysis and processing more in line with the characteristics of this type of charging pile, and improving the accuracy and targeting of the processing.
[0176] S206. Construct a target random forest prediction model based on the training set and the test set.
[0177] Optionally, step S206, constructing the target random forest prediction model based on the training set and the test set, may include the following steps:
[0178] S61. The training set and the test set are processed by a preset normalization method to obtain a first training set and a first test set;
[0179] S62. The first training set is sampled according to a preset resampling method to obtain h sub-training sets; h is an integer greater than 1.
[0180] S63. Following the decision tree generation method in steps S1-S2, generate h decision trees, each corresponding to a sub-training set, to obtain a reference random forest prediction model. The reference random forest prediction model includes the h decision trees, specifically:
[0181] S1. Generate a first reference decision tree based on the first sub-training set. Randomly extract d features from a preset feature set and use the d features as a feature subset of the first reference decision tree to obtain a first feature subset; d is a positive integer less than or equal to q; the first sub-training set is any sub-training set in the h sub-training sets.
[0182] S2. Based on the principle of minimizing the Gini index, select a partitioning attribute from the first feature subset, and partition the first reference decision tree according to the partitioning attribute to obtain the first target decision tree.
[0183] S64. Test the reference random forest prediction model using the first test set to obtain a first accuracy.
[0184] S65. When the first accuracy rate is greater than or equal to a preset accuracy rate threshold, the target random forest prediction model is determined according to the reference random forest prediction model.
[0185] In this embodiment of the application, the normalization method can be preset or defaulted.
[0186] In a specific embodiment, the training set and test set can be processed using a preset normalization method to obtain a first training set and a first test set. Assume the training set is data Q. i ={p1, p2, ..., p i , ···, p N3}, data Q i There are N3 data points, where N3 is a positive integer. The normalization formula for the normalization method is as follows:
[0187]
[0188] in, p is the i-th data after normalization. i For data Q i The i-th data in p; max The above data Q i The largest data in p min The above data Q i The smallest data in the set. Thus, by processing the training set according to this normalization formula, the first training set can be obtained. Similarly, the test set can be processed according to this normalization formula to obtain the first test set.
[0189] Next, the first training set can be randomly sampled h times with replacement according to a preset resampling method (e.g., bootstrap resampling method) to obtain h subsets of training sets; then, h decision trees can be generated according to the decision tree generation method in steps S1-S2 below, that is, referring to the random forest prediction model, specifically:
[0190] S1. Generate a first reference decision tree based on the first sub-training set. Randomly extract d features from the preset feature set and use the d features as the feature subset of the first reference decision tree to obtain the first feature subset. The first sub-training set is any sub-training set in the h sub-training sets.
[0191] Specifically, all the data in the first training subset can be placed in a root node to obtain the first reference decision tree, which only includes the root node. Then, the preset feature set can contain four elements: voltage, current, temperature, and humidity. d can be equal to 2. d features can be randomly extracted from the preset feature set using a random number generator, and these d features are used as the first feature subset.
[0192] S2. Based on the principle of minimizing the Gini index, select the splitting attribute from the first feature subset, and split the first reference decision tree according to the splitting attribute to obtain the first target decision tree;
[0193] Specifically, for each feature in the first feature subset, its corresponding Gini index can be calculated. The feature with the smallest Gini index is taken as the splitting attribute. Based on the selected splitting attribute and its value, the node data in the first reference decision tree is divided into different subsets. New child nodes are created for each subset, thus completing the splitting of the first reference decision tree and obtaining the first target decision tree.
[0194] Furthermore, the reference random forest prediction model can be tested on the first test set to obtain the first accuracy. Specifically, the reference random forest prediction model can be used for decision-making, and the decision formula is as follows:
[0195]
[0196] Where H(x) is the reference random forest prediction model; arg max Y This means finding, among all possible values of the output variable Y, the value of Y that maximizes the given expression; h i (x) represents the i-th decision tree among h decision trees; x represents any test sample in the first test set; V represents the output variable of the reference random forest prediction model, i.e., the classification label; I represents the indicator function, which is used when h i When (x) = V, I = 1; otherwise, h i If (x)≠V, then I=0.
[0197] It should be explained that the value of V is any one of 1, 2, 3, or 4, where 1 represents normal, 2 represents overvoltage, 3 represents overcurrent, and 4 represents overtemperature.
[0198] By applying the above decision formula to each test sample in the first test set, a diagnostic result table can be obtained, which is as follows:
[0199]
[0200] In the table, TP represents the number of positive samples that are correctly predicted as positive, that is: Ai (i = 1, 2, 3, 4) represents the number of samples that are predicted as fault type i and actually have fault type i.
[0201] FP represents the number of negative samples that are incorrectly predicted as positive, that is: Bi (i = 1, 2, 3, 4) represents the number of samples that are diagnosed as fault type i but are actually fault type j;
[0202] FN represents the number of positive samples that are incorrectly predicted as the negative class, that is: Ci (i = 1, 2, 3, 4) represents the number of samples that are diagnosed as fault type j but are actually fault type i;
[0203] The F1 score is an evaluation metric that comprehensively considers precision and recall, that is:
[0204] Di(i=1, 2, 3, 4)=Ai / (Ai+0.5×(Bi+Ci));
[0205] Next, the first accuracy rate can be calculated using the following formula:
[0206]
[0207] Among them, A cc The first accuracy rate is indicated by the formula above. When the first accuracy rate is greater than or equal to the preset accuracy rate threshold (e.g., 90%), it indicates that the accuracy rate of the reference random forest prediction model is high and can meet the usage requirements. The reference random forest prediction model can be used as the target random forest prediction model.
[0208] When the first accuracy is less than the preset accuracy threshold, it indicates that the accuracy of the reference random forest prediction model is low and cannot meet the usage requirements. It is necessary to adjust the reference random forest prediction model, or to build a new random forest prediction model and test it again until the first accuracy is greater than or equal to the preset accuracy threshold, thus obtaining the target random forest prediction model.
[0209] Thus, by processing the training and test sets using a preset normalization method, a first training set and a first test set are obtained. The first training set is then sampled using a preset resampling method to obtain h sub-training sets. Following the decision tree generation method in steps S1-S2, h decision trees are generated to obtain a reference random forest prediction model. The reference random forest prediction model is tested using the first test set to obtain a first accuracy rate. When the first accuracy rate is greater than or equal to a preset accuracy threshold, the target random forest prediction model is determined based on the reference random forest prediction model. On the one hand, the normalized data has relatively small fluctuations, reducing the impact of extreme values on the target random forest prediction model, making the target random forest prediction model more stable during training and less prone to large deviations due to individual outlier data points. On the other hand, by resampling the first training set, multiple different sub-training sets can be obtained. Each sub-training set contains a portion of the original data, but they are not completely identical, increasing data diversity and making the generated decision trees more diverse, thereby improving the generalization ability of the final generated target random forest prediction model.
[0210] S207. Obtain the second working data of the target AC charging pile at the current moment, and obtain n second working data.
[0211] In this embodiment of the application, the second working data of the target AC charging pile at the current moment can be collected by the data acquisition module, thereby obtaining n second working data.
[0212] S208. Input the n second working data into the target random forest prediction model to obtain the target diagnosis result.
[0213] In this embodiment of the application, the above-mentioned n second working data can be input into the target random forest prediction model, and the working status of the target AC charging pile can be diagnosed by the target random forest prediction model to obtain the target diagnosis result.
[0214] S209. Determine the target fault corresponding to the target diagnostic result.
[0215] In this embodiment of the application, the target diagnosis result is the classification label V. Specifically, the value of V is any one of 1, 2, 3, and 4. 1 indicates that the target AC charging pile is in normal condition, 2 indicates that the target fault is overvoltage, 3 indicates that the target fault is overcurrent, and 4 indicates that the target fault is overtemperature.
[0216] Optionally, the method further includes:
[0217] Obtain the fault type corresponding to the target fault to obtain the target fault type;
[0218] Determine the fault threshold corresponding to the target fault type to obtain the target fault threshold;
[0219] Determine the working data corresponding to the target fault type in the n second working data to obtain the target working data;
[0220] The target working data is sampled to obtain multiple sample working data; each sample working data corresponds to a sampling time.
[0221] A target straight line is obtained by fitting a straight line to the multiple sample working data and their corresponding sampling times; the horizontal axis of the target straight line is time, and the vertical axis is working data.
[0222] The first part of the straight line is obtained by identifying the portion of the target straight line that is greater than the target fault threshold.
[0223] Determine the time ratio between the first part of the straight line and the target straight line to obtain the target time ratio;
[0224] Determine the fault severity value corresponding to the target duration ratio to obtain a reference fault severity value;
[0225] Obtain the target slope corresponding to the target straight line;
[0226] Determine the target adjustment parameters corresponding to the target slope;
[0227] The reference fault severity value is adjusted according to the target adjustment parameters to obtain the target fault severity value;
[0228] When the target fault severity value is less than the preset fault severity value, the step of generating a corresponding fault control command based on the target fault and controlling the intelligent early warning system to perform corresponding early warning operations through the fault control command is executed.
[0229] In this embodiment of the application, the target fault type may include one of the following: voltage fault type, current fault type, temperature fault type, etc., which are not limited here; the fault severity value is used to indicate the severity of the fault of the target AC charging pile, and its value range can be 1 to 100.
[0230] In a specific embodiment, the fault type corresponding to the target fault can be obtained, thus obtaining the target fault type. Specifically, it can be determined based on the target diagnostic result V, where V=2 indicates that the target fault type is a voltage fault, V=3 indicates that the target fault type is a current fault, and V=4 indicates that the target fault type is a temperature fault. Next, the fault threshold corresponding to the target fault type can be determined, thus obtaining the target fault threshold. For example, assuming the target fault type is a voltage fault, then the target fault threshold is the fault voltage threshold. Then, the working data corresponding to the target fault type in n second working data can be determined, thus obtaining the target working data. For example, assuming the target fault type is a voltage fault, then the target working data is the voltage working data in the n second working data.
[0231] Next, the target working data can be sampled. The sampling method can be equidistant sampling, sampling the target working data at fixed time intervals to obtain multiple sample working data. Then, these multiple sample working data can be fitted with a straight line, using the least squares method, to obtain the target straight line. Next, the portion of the target straight line whose ordinate is greater than the target fault threshold can be identified, obtaining the first part of the straight line. Specifically, a threshold line parallel to the horizontal axis can be drawn based on the target fault threshold; the part of the target straight line above this threshold line is the first part of the straight line. Next, the starting and ending coordinates of the first part of the straight line can be obtained. Subtracting the x-coordinate of the starting coordinate from the x-coordinate of the ending coordinate yields the first duration. Then, the duration of the target straight line can be obtained to obtain the second duration, resulting in the target duration ratio. The specific calculation formula is as follows:
[0232] Target duration ratio = First duration / Second duration;
[0233] The target duration ratio can be obtained from the above formula. Next, the fault severity value corresponding to the target duration ratio can be determined, resulting in a reference fault severity value. Specifically, a pre-stored mapping relationship between duration ratios and fault severity values can be used to determine the reference fault severity value corresponding to the target duration ratio. Then, the target slope corresponding to the target line can be obtained. The equation of the target line, y = ax + b, can be obtained first, where y is the value of the working data, x is the time point, a is the target slope, and b is the intercept. The target slope can be obtained from this equation. Further, the target adjustment parameter corresponding to the target slope can be determined. Specifically, a pre-stored mapping relationship between slopes and adjustment parameters can be used to determine the target adjustment parameter corresponding to the target slope. The target adjustment parameter can range from -0.3 to 0.3. Then, the reference fault severity value can be adjusted according to the target adjustment parameter to obtain the target fault severity value, as detailed below:
[0234] Target fault severity value = Reference fault severity value × (1 + Target adjustment parameter);
[0235] The target fault severity value can be calculated using the above formula. When the target fault severity value is less than the preset fault severity value, it indicates that the fault severity of the target AC charging pile is not very serious. The steps of generating corresponding fault control commands based on the target fault and controlling the intelligent early warning system to perform corresponding early warning operations through the fault control commands can be executed.
[0236] When the target fault severity value is greater than or equal to the preset fault severity value, it indicates that the fault severity of the target AC charging pile is very serious. The target AC charging pile can be directly stopped from working. Then, the intelligent early warning system will issue an early warning and notify the staff to inspect and repair the target AC charging pile to prevent accidents and improve the safety of the target AC charging pile.
[0237] S210. Generate a corresponding fault control command based on the target fault, and control the intelligent early warning system to perform corresponding early warning operations through the fault control command.
[0238] In this embodiment, a corresponding fault control command can be generated based on the target fault. A preset mapping relationship between faults and control commands can be stored in advance. Based on the mapping relationship, the fault control command corresponding to the target fault can be determined. Then, the intelligent early warning system can be controlled to perform corresponding early warning operations through the fault control command. The early warning operations can include at least one of the following: overvoltage early warning, overcurrent early warning, and overtemperature early warning.
[0239] Implementing this application will have the following beneficial effects:
[0240] As can be seen, the fault early warning method for AC charging piles described in this application is applied to the server of an intelligent early warning system. The method includes: acquiring first working data of a target AC charging pile within a first preset time period to obtain n first working datasets; determining fault data and normal data in each of the n first working datasets to obtain n first fault datasets and n first normal datasets; preprocessing the n first fault datasets according to a preset preprocessing algorithm to obtain target fault data; preprocessing the n first normal datasets according to a preset preprocessing algorithm to obtain target normal data; and dividing the target normal data and target fault data into training sets and training sets according to a target ratio. The test set is used to construct a target random forest prediction model based on the training and test sets. Second working data of the target AC charging pile at the current moment is obtained, resulting in n second working data points. These n second working data points are then input into the target random forest prediction model to obtain the target diagnosis result. The target fault corresponding to the diagnosis result is determined. Based on the target fault, corresponding fault control commands are generated, and the intelligent early warning system is controlled to perform corresponding early warning operations through these commands. The random forest prediction model, combined with the advantages of multiple decision trees, can handle complex nonlinear relationships, reduce the risk of overfitting, and more accurately diagnose faults in the working data of the target AC charging pile, effectively improving the accuracy of fault diagnosis.
[0241] Please see Figure 3 , Figure 3 This application provides a functional unit block diagram of a fault early warning device 300 for an AC charging pile, applied to a server of an intelligent early warning system. The fault early warning device 300 for the AC charging pile includes: an acquisition unit 301, a control unit 302, and an early warning unit 303, wherein:
[0242] The acquisition unit 301 is used to acquire the first working data of the target AC charging pile within a first preset time period, and obtain n first working datasets; n is a positive integer.
[0243] The control unit 302 is configured to determine the first fault data and the first normal data in each of the n first working datasets, thereby obtaining n first fault datasets and n first normal datasets; preprocess the n first fault datasets according to a preset preprocessing algorithm to obtain target fault data; preprocess the n first normal datasets according to the preset preprocessing algorithm to obtain target normal data; divide the target normal data (n first normal datasets) and the target fault data into a training set and a test set according to a target ratio; and construct a target random forest prediction model based on the training set and the test set.
[0244] The acquisition unit 301 is further configured to acquire the second working data of the target AC charging pile at the current moment, and obtain n second working data; the second preset time is later than the end time of the first preset time period; input the n second working data into the target random forest prediction model to obtain the target diagnosis result; and determine the target fault corresponding to the target diagnosis result.
[0245] The early warning unit 303 is used to generate corresponding fault control commands based on the target fault, and to control the intelligent early warning system to perform corresponding early warning operations through the fault control commands.
[0246] Optionally, each of the n first fault datasets corresponds to a data type, including one of the following: voltage data type, current data type, temperature data type, and humidity data type; in terms of preprocessing the n first fault datasets according to a preset preprocessing algorithm to obtain target fault data, the control unit 302 is specifically used for:
[0247] Extract the data corresponding to the voltage data type and the current data type from the n first fault datasets to obtain the target monitoring data;
[0248] The target monitoring data is decomposed according to a preset mode decomposition formula to obtain k modal components; k is a positive integer; the specific mode decomposition formula is as follows:
[0249]
[0250] in, The target monitoring data is represented by the superscript 0, indicating that it is raw data; the subscript q indicates the data type label corresponding to the target monitoring data, and each data type label corresponds to a data type; t represents time; c j R(t) represents the j-th modal component among the k modal components, where j is a positive integer less than or equal to k; R(t) represents the residual term.
[0251] The similarity is calculated for each of the k modal components according to the preset Mahalanobis distance calculation formula to obtain k similarity scores; the Mahalanobis distance calculation formula is as follows:
[0252]
[0253] Where S(j) represents the similarity between the j-th mode component among the k mode components and the corresponding j-th original signal in the n first fault datasets; D M Let X represent the Mahalanobis distance; X represent the probability density function of the j-th modal component; Y represent the probability density function of the j-th original signal; (XY)T Denotes the transpose matrix of XY; ∑ -1 (XY) represents the inverse of the covariance matrix of XY;
[0254] Determine the similarity scores among the k similarity scores that are greater than a preset similarity threshold to obtain a similarity scores; where a is a natural number less than or equal to k.
[0255] The modal components corresponding to the a similarities in the k modal components are determined to be effective modal components, thus obtaining a effective modal components;
[0256] Determine the similarity among the k similarities that is equal to the similarity threshold to obtain b similarities; b is a natural number less than or equal to k, and the sum of a and b is not greater than k;
[0257] The modal components corresponding to the b similarities in the k modal components are determined to be aliased modal components, thus obtaining b aliased modal components;
[0258] The b aliased mode components are filtered according to a preset filtering algorithm to obtain b filtered mode components;
[0259] The target fault data is determined based on the a effective mode components and the b filtered mode components.
[0260] Optionally, the preset filtering algorithm includes the SG filtering algorithm. In the process of filtering the b aliased mode components according to the preset filtering algorithm to obtain b filtered mode components, the control unit 302 is specifically used for:
[0261] Obtain the target aliasing mode component; the target aliasing mode component is any one of the b aliasing mode components;
[0262] Obtain the length of the first window corresponding to the SG filtering algorithm as 2L+1; where L is a positive integer.
[0263] Obtain the preset polynomial corresponding to the SG filtering algorithm; the preset polynomial is as follows:
[0264]
[0265] Where N1 is the power of the preset polynomial, and N1 is less than or equal to 2L+1; a j For x j The coefficient; x is the independent variable;
[0266] The target aliasing mode components are calculated according to a preset polynomial approximation calculation formula to obtain the polynomial approximation deviation value; the specific polynomial approximation calculation formula is as follows:
[0267]
[0268] Where, ε N This represents the approximate deviation value of the polynomial; This represents the target aliasing mode component;
[0269] When the polynomial approximation deviation value is less than or equal to a preset value, the filter mode component corresponding to the target aliasing mode component is determined according to the preset polynomial.
[0270] Optionally, in determining the target fault data based on the a effective mode components and the b filtered mode components, the control unit 302 is specifically configured to:
[0271] The a effective mode components and the b filtered mode components are reconstructed according to a preset signal reconstruction formula to obtain reference fault data; the preset signal reconstruction formula is as follows:
[0272]
[0273] in, The reference fault data, For the i-th filter mode component among the b filter mode components, It is the j-th effective modal component among the a effective modal components;
[0274] Determine the first time series corresponding to the reference fault data;
[0275] Determine the target sequence length N2 and the second window length M corresponding to the first time series;
[0276] Calculate the third window length Z based on the second window length M and the target sequence length N2;
[0277] The first time series is converted into a target trajectory matrix based on the second window length M and the third window length Z;
[0278] The target trajectory matrix is subjected to singular value decomposition according to a preset singular value decomposition formula to obtain a diagonal matrix; the specific singular value decomposition formula is as follows:
[0279]
[0280] in, The target trajectory matrix is represented by U; the left matrix is represented by Σ; the diagonal matrix is represented by Σ, where the diagonal elements are singular values; and the right matrix is represented by V. T This represents the transpose of the right matrix;
[0281] Obtain the singular values in the diagonal matrix to obtain the target singular value data;
[0282] The first time series is reconstructed based on the target singular value data to obtain the target fault data.
[0283] Optionally, in reconstructing the first time series based on the target singular value data to obtain the target fault data, the control unit 302 is specifically configured to:
[0284] The target singular value data is grouped according to a preset singular value grouping method to obtain multiple groups of singular values;
[0285] The first time series is grouped according to the multiple sets of singular values to obtain multiple sets of time series;
[0286] The multiple time series are sorted according to the multiple sets of singular values to obtain a first time series order; the larger the singular value, the earlier the order.
[0287] Select the c earliest time series from the first time series sequence, and combine the c time series to form a new time series to obtain the second time series; c is a positive integer;
[0288] The second time series is reconstructed according to a preset sequence reconstruction formula to obtain the target fault data; the sequence reconstruction formula is as follows:
[0289]
[0290] in, This represents the target fault data; This represents the second time series.
[0291] Optionally, in constructing the target random forest prediction model based on the training set and the test set, the control unit 302 is specifically used for:
[0292] The training set and the test set are processed by a preset normalization method to obtain a first training set and a first test set;
[0293] The first training set is sampled according to a preset resampling method to obtain h sub-training sets; h is an integer greater than 1.
[0294] Following the decision tree generation method in steps S1-S2, generate h decision trees, each corresponding to a subset of the training set, to obtain a reference random forest prediction model. The reference random forest prediction model includes the h decision trees, specifically:
[0295] S1. Generate a first reference decision tree based on the first sub-training set. Randomly extract d features from a preset feature set and use the d features as a feature subset of the first reference decision tree to obtain a first feature subset; d is a positive integer less than or equal to q; the first sub-training set is any sub-training set in the h sub-training sets.
[0296] S2. Based on the principle of minimizing the Gini index, select partitioning attributes from the first feature subset, and partition the first reference decision tree according to the partitioning attributes to obtain the first target decision tree;
[0297] The reference random forest prediction model is tested using the first test set to obtain a first accuracy rate;
[0298] When the first accuracy rate is greater than or equal to a preset accuracy rate threshold, the target random forest prediction model is determined based on the reference random forest prediction model.
[0299] Optionally, the fault early warning device 300 of the AC charging pile is further specifically used for:
[0300] Obtain the type of the target AC charging pile corresponding to the target AC charging pile;
[0301] Determine the reference ratio value corresponding to the target AC charging pile type;
[0302] Obtain the target failure rate corresponding to the target AC charging pile type;
[0303] Determine the first influence coefficient corresponding to the target failure rate;
[0304] Obtain the working data of the target AC charging pile within the second preset time period to obtain historical working data; the end time of the second preset time period is earlier than the start time of the first preset time period.
[0305] Determine the proportion of fault data to all working data in the historical working data to obtain the historical fault ratio;
[0306] Determine the target optimization factor corresponding to the historical failure ratio;
[0307] The first influence coefficient is optimized based on the target optimization factor to obtain the second influence coefficient;
[0308] The reference ratio value is adjusted according to the second influence coefficient to obtain the target ratio value.
[0309] In specific implementations, the fault warning device 300 for AC charging piles described in the embodiments of the present invention can also execute other implementation methods described in the fault warning method for AC charging piles provided in the embodiments of the present invention, which will not be repeated here.
[0310] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device includes a processor, a memory, and one or more programs. The electronic device may also include a communication interface. The processor, memory, and communication interface are interconnected via a bus. The one or more programs are stored in the memory and configured to be executed by the processor. The one or more programs include some or all of the steps for performing any of the methods described in the above method embodiments, which will not be repeated here.
[0311] This application also provides a computer storage medium storing a computer program for electronic data interchange, which causes a computer to perform some or all of the steps of any of the methods described in the above method embodiments, wherein the computer includes an electronic device.
[0312] This application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. The computer program product may be a software installation package, and the computer may include an electronic device.
[0313] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0314] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0315] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0316] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0317] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0318] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0319] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A fault early warning method for AC charging piles, characterized in that, The method, applied to a server in an intelligent early warning system, includes: Obtain the first working data of the target AC charging pile within the first preset time period, and obtain n first working datasets; n is a positive integer. Determine the fault data and normal data of each of the n first working datasets to obtain n first fault datasets and n first normal datasets; The n first fault datasets are preprocessed according to a preset preprocessing algorithm to obtain target fault data; The n first normal datasets are preprocessed according to the preset preprocessing algorithm to obtain the target normal data; The target normal data and the target fault data are divided into a training set and a test set according to the target ratio; Construct a target random forest prediction model based on the training set and the test set; Obtain the second working data of the target AC charging pile at the current moment, and obtain n second working data points; The n second working data are input into the target random forest prediction model to obtain the target diagnosis result; Determine the target fault corresponding to the target diagnostic result; Based on the target fault, a corresponding fault control command is generated, and the intelligent early warning system is controlled to perform corresponding early warning operations through the fault control command. Wherein, each of the n first fault datasets corresponds to a data type, including any one of the following: voltage data type, current data type, temperature data type, and humidity data type; the step of preprocessing the n first fault datasets according to a preset preprocessing algorithm to obtain target fault data includes: Extract the data corresponding to the voltage data type and the current data type from the n first fault datasets to obtain the target monitoring data; The target monitoring data is decomposed according to a preset mode decomposition formula to obtain k modal components; k is a positive integer; the specific mode decomposition formula is as follows: in, The target monitoring data is represented by the superscript 0, which indicates that it is raw data; the subscript q indicates the data type label corresponding to the target monitoring data, and each data type label corresponds to a data type; t represents time. This represents the j-th modal component among the k modal components, where j is a positive integer less than or equal to k; Represents the residual term; The similarity is calculated for each of the k modal components according to the preset Mahalanobis distance calculation formula to obtain k similarity scores; the Mahalanobis distance calculation formula is as follows: in, This represents the similarity between the j-th modal component among the k modal components and the corresponding j-th original signal in the n first fault datasets; X represents the Mahalanobis distance; Y represents the probability density function of the j-th modal component; and Y represents the probability density function of the j-th original signal. Represents the transpose of XY; Let X be the inverse of the covariance matrix of XY; Determine the similarity scores among the k similarity scores that are greater than a preset similarity threshold to obtain a similarity scores; where a is a natural number less than or equal to k. The modal components corresponding to the a similarities in the k modal components are determined to be effective modal components, thus obtaining a effective modal components; Determine the similarity among the k similarities that is equal to the similarity threshold to obtain b similarities; b is a natural number less than or equal to k, and the sum of a and b is not greater than k; The modal components corresponding to the b similarities in the k modal components are determined to be aliased modal components, thus obtaining b aliased modal components; The b aliased mode components are filtered according to a preset filtering algorithm to obtain b filtered mode components; The target fault data is determined based on the a effective mode components and the b filtered mode components.
2. The method as described in claim 1, characterized in that, The preset filtering algorithm includes the SG filtering algorithm. The step of filtering the b aliasing mode components according to the preset filtering algorithm to obtain b filtered mode components includes: Obtain the target aliasing mode component; the target aliasing mode component is any one of the b aliasing mode components; Obtain the length of the first window corresponding to the SG filtering algorithm as 2L+1; where L is a positive integer. Obtain the preset polynomial corresponding to the SG filtering algorithm; the preset polynomial is as follows: Wherein, N1 is the power of the preset polynomial, and N1 is less than or equal to 2L+1; for The coefficient; As the independent variable; The target aliasing mode components are calculated according to a preset polynomial approximation calculation formula to obtain the polynomial approximation deviation value; the specific polynomial approximation calculation formula is as follows: in, This represents the approximate deviation value of the polynomial; This represents the target aliasing mode component; When the polynomial approximation deviation value is less than or equal to a preset value, the filter mode component corresponding to the target aliasing mode component is determined according to the preset polynomial.
3. The method as described in claim 1, characterized in that, Determining the target fault data based on the a effective mode components and the b filtered mode components includes: The a effective mode components and the b filtered mode components are reconstructed according to a preset signal reconstruction formula to obtain reference fault data; the preset signal reconstruction formula is as follows: in, The reference fault data, For the i-th filter mode component among the b filter mode components, It is the j-th effective modal component among the a effective modal components; Determine the first time series corresponding to the reference fault data; Determine the target sequence length N2 and the second window length M corresponding to the first time series; Calculate the third window length Z based on the second window length M and the target sequence length N2; The first time series is converted into a target trajectory matrix based on the second window length M and the third window length Z; The target trajectory matrix is subjected to singular value decomposition according to a preset singular value decomposition formula to obtain a diagonal matrix; the specific singular value decomposition formula is as follows: in, The target trajectory matrix is represented by U; the left matrix is represented by U. This indicates that the diagonal matrix contains singular values on its diagonal. Represents the right matrix; This represents the transpose of the right matrix; Obtain the singular values in the diagonal matrix to obtain the target singular value data; The first time series is reconstructed based on the target singular value data to obtain the target fault data.
4. The method as described in claim 3, characterized in that, The step of reconstructing the first time series based on the target singular value data to obtain the target fault data includes: The target singular value data is grouped according to a preset singular value grouping method to obtain multiple groups of singular values; The first time series is grouped according to the multiple sets of singular values to obtain multiple sets of time series; The multiple time series are sorted according to the multiple sets of singular values to obtain a first time series order; the larger the singular value, the earlier the order. Select the c earliest time series from the first time series sequence, and combine the c time series to form a new time series to obtain the second time series; c is a positive integer; The second time series is reconstructed according to a preset sequence reconstruction formula to obtain the target fault data; the sequence reconstruction formula is as follows: in, This represents the target fault data; This represents the second time series.
5. The method according to any one of claims 1-4, characterized in that, The step of constructing a target random forest prediction model based on the training set and the test set includes: The training set and the test set are processed by a preset normalization method to obtain a first training set and a first test set; The first training set is sampled according to a preset resampling method to obtain h sub-training sets; h is an integer greater than 1. Following the decision tree generation method in steps S1-S2, generate h decision trees, each corresponding to a subset of the training set, to obtain a reference random forest prediction model. The reference random forest prediction model includes the h decision trees, specifically: S1. Generate a first reference decision tree based on the first sub-training set. Randomly extract d features from a preset feature set and use the d features as a feature subset of the first reference decision tree to obtain the first feature subset; d is a positive integer less than or equal to q; the first sub-training set is any sub-training set in the h sub-training sets. S2. Based on the principle of minimizing the Gini index, select partitioning attributes from the first feature subset, and partition the first reference decision tree according to the partitioning attributes to obtain the first target decision tree; The reference random forest prediction model is tested using the first test set to obtain a first accuracy rate; When the first accuracy rate is greater than or equal to a preset accuracy rate threshold, the target random forest prediction model is determined based on the reference random forest prediction model.
6. The method according to any one of claims 1-4, characterized in that, The method further includes: Obtain the type of the target AC charging pile corresponding to the target AC charging pile; Determine the reference ratio value corresponding to the target AC charging pile type; Obtain the target failure rate corresponding to the target AC charging pile type; Determine the first influence coefficient corresponding to the target failure rate; Obtain the working data of the target AC charging pile within the second preset time period to obtain historical working data; the end time of the second preset time period is earlier than the start time of the first preset time period. Determine the proportion of fault data to all working data in the historical working data to obtain the historical fault ratio; Determine the target optimization factor corresponding to the historical failure ratio; The first influence coefficient is optimized based on the target optimization factor to obtain the second influence coefficient; The reference ratio value is adjusted according to the second influence coefficient to obtain the target ratio value.
7. A fault early warning device for an AC charging pile, characterized in that, A server applied to an intelligent early warning system, the device comprising: an acquisition unit, a control unit, and an early warning unit, wherein: The acquisition unit is used to acquire the first working data of the target AC charging pile within a first preset time period, and obtain n first working datasets; n is a positive integer. The control unit is configured to: determine the first fault data and the first normal data in each of the n first working datasets to obtain n first fault datasets and n first normal datasets; preprocess the n first fault datasets according to a preset preprocessing algorithm to obtain target fault data; preprocess the n first normal datasets according to the preset preprocessing algorithm to obtain target normal data; divide the target normal data (n first normal datasets) and the target fault data into a training set and a test set according to a target ratio; and construct a target random forest prediction model based on the training set and the test set. The acquisition unit is further configured to acquire the second working data of the target AC charging pile at the current moment, and obtain n second working data; input the n second working data into the target random forest prediction model to obtain the target diagnosis result; and determine the target fault corresponding to the target diagnosis result. The early warning unit is used to generate a corresponding fault control command based on the target fault, and to control the intelligent early warning system to perform corresponding early warning operations through the fault control command. Wherein, each of the n first fault datasets corresponds to a data type, including any one of the following: voltage data type, current data type, temperature data type, and humidity data type; in terms of preprocessing the n first fault datasets according to a preset preprocessing algorithm to obtain target fault data, the control unit is specifically used for: Extract the data corresponding to the voltage data type and the current data type from the n first fault datasets to obtain the target monitoring data; The target monitoring data is decomposed according to a preset mode decomposition formula to obtain k modal components; k is a positive integer; the specific mode decomposition formula is as follows: in, The target monitoring data is represented by the superscript 0, which indicates that it is raw data; the subscript q indicates the data type label corresponding to the target monitoring data, and each data type label corresponds to a data type; t represents time. This represents the j-th modal component among the k modal components, where j is a positive integer less than or equal to k; Represents the residual term; The similarity is calculated for each of the k modal components according to the preset Mahalanobis distance calculation formula to obtain k similarity scores; the Mahalanobis distance calculation formula is as follows: in, This represents the similarity between the j-th modal component among the k modal components and the corresponding j-th original signal in the n first fault datasets; X represents the Mahalanobis distance; Y represents the probability density function of the j-th modal component; and Y represents the probability density function of the j-th original signal. Represents the transpose of XY; Let X be the inverse of the covariance matrix of XY; Determine the similarity scores among the k similarity scores that are greater than a preset similarity threshold to obtain a similarity scores; where a is a natural number less than or equal to k. The modal components corresponding to the a similarities in the k modal components are determined to be effective modal components, thus obtaining a effective modal components; Determine the similarity among the k similarities that is equal to the similarity threshold to obtain b similarities; b is a natural number less than or equal to k, and the sum of a and b is not greater than k; The modal components corresponding to the b similarities in the k modal components are determined to be aliased modal components, thus obtaining b aliased modal components; The b aliased mode components are filtered according to a preset filtering algorithm to obtain b filtered mode components; The target fault data is determined based on the a effective mode components and the b filtered mode components.
8. An electronic device, characterized in that, include: A processor and a memory, the memory being used to store one or more programs and configured to be executed by the processor, the programs including instructions for performing the steps of the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, A computer program for storing electronic data interchange is provided, wherein the computer program causes a computer to perform the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Charging pile state evaluation method and device based on CNN and random forest
CN115619271A
Direct current charging pile fault early warning method based on soft classification
CN115659236A