Feedback-based adaptive sliding window based charging fault diagnosis method and system
Patent Information
- Application Number
- CN202611000940.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-07
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2046-07-07
AI Technical Summary
然而,充电器故障多表现为短时序功率突变,电池故障呈现长时序功率变化趋势,无价值数据具有短时不连续的特点,固定滑动窗难以适配不同故障的时序特征差异;采用固定窗处理时,若窗口过长,会导致突变故障被冗余数据干扰,无法捕捉到短时序的突变特征;若窗口过短,则难以捕捉电池故障的长时序趋势,造成趋势故障特征遗漏,最终导致诊断精度较低、误判率偏高,无法满足实际工程应用中的安全防护需求
[0043]This invention addresses the problems of poor adaptability and low diagnostic accuracy of fixed sliding windows in existing electric bicycle charging fault diagnosis methods. It proposes a diagnostic scheme based on an adaptive sliding window for the charging stage, offering the following advantages: First, it boasts strong adaptability. By combining the characteristics of the constant current, constant voltage, and trickle charging stages with the differences in fault timing, the window parameters are dynamically adjusted to match the short-term abrupt changes in charger problems with the long-term trends in battery problems, avoiding feature omissions or redundant interference. Second, it provides high diagnostic accuracy. The window's adaptive function is achieved through feedback based on category-weighted accuracy, effectively improving the accuracy of identifying the three types of data and reducing the false fault rate. Third, it offers strong versatility. It can be directly adapted to existing charging pile power acquisition systems without additional hardware costs, balancing diagnostic performance and engineering application value, and effectively preventing safety accidents caused by charging faults.
Smart Images

Figure CN122506284B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electronic digital data processing technology, and relates to electric bicycle charging fault diagnosis, specifically to a charging fault diagnosis method and system based on a feedback-based adaptive sliding window. Background Technology
[0002] my country's electric bicycle industry is large and growing rapidly. With the increasing number of years of use, there are a large number of safety hazards. Safety issues during the charging process are becoming increasingly prominent. Fires and equipment damage caused by charger failures and battery aging occur frequently during charging. Therefore, a universal diagnostic technology that can accurately and in real time diagnose charging faults for electric bicycles of different types, brands, models and years of use is of great importance.
[0003] Current charging fault diagnosis technologies generally use fixed sliding windows to process time-series power data, without setting different adaptive sliding windows for different charging stages and charging faults. However, charger faults often manifest as short-term power abrupt changes, while battery faults exhibit long-term power variation trends. Valuable data is characterized by short-term discontinuities, making it difficult for fixed sliding windows to adapt to the differences in the time-series characteristics of different faults. When using a fixed window, if the window is too long, abrupt faults will be interfered with by redundant data, making it impossible to capture short-term abrupt changes. If the window is too short, it will be difficult to capture the long-term trends of battery faults, resulting in the omission of trend fault characteristics. Ultimately, this leads to low diagnostic accuracy and a high false positive rate, failing to meet the safety protection requirements of practical engineering applications. Summary of the Invention
[0004] To address the problems existing in the prior art, this invention proposes a charging fault diagnosis method and system based on a feedback adaptive sliding window for the charging process of electric bicycles. By using a dynamic feedback multi-branch TCN model to adjust the adaptive window parameters to match fault features and extract time-series and text features from power data, the method combines a diagnostic model to achieve accurate and efficient fault identification.
[0005] In one aspect, this invention proposes a charging fault diagnosis method based on a feedback-adaptive sliding window for the charging process of electric bicycles, the steps of which are as follows:
[0006] Step 1: Data Acquisition and Preprocessing. Electric bicycle charging power data is collected and stored in a database; data augmentation is performed on the charging power data to expand its scale; a minimum sequence length for the effective power sequence is set, and data meeting the minimum sequence length condition is standardized and labeled. The fault classification dataset is divided into three categories based on fault type: "Normal," "Battery Fault," and "Charger Fault"; the charging stage dataset is divided into three stages based on the charging process: "Constant Current Stage," "Constant Voltage Stage," and "Trickle Charge Stage."
[0007] Step 2: For the preprocessed electric bicycle charging power data from Step 1, calculate the rate of change of the charging power data, and the existing power sequence. The specific calculation is as follows: Power change rate Defined as the ratio of the power difference between two adjacent sampling points to the power of the previous sampling point.
[0008] Step 3: Based on the power change rate of the charging power data, use the charging stage dataset labeled in Step 1 to divide the electric bicycle charging stages (constant current stage, constant voltage stage, trickle charging stage) and initialize the adaptive sliding window.
[0009] 1. Calculate the data characteristics of the constant current phase (peak power change rate, fluctuation intensity, power trend slope), and initialize the sliding window for the constant current phase based on these characteristics: existing power sequence The specific judgment rules are as follows:
[0010] (1) Peak power change rate during constant current phase Power change rate in the current stage The absolute maximum value reflects the severity of power fluctuations.
[0011] (2) Fluctuation intensity during constant current phase The standard deviation of the power series in the current stage reflects the overall fluctuation range of power.
[0012] (3) Power trend slope during constant current stage Linear regression is used to fit the power sequence of the current stage, and the slope of the trend line of the fitting result is obtained, which reflects the overall trend of power change.
[0013] The constant pressure stage and trickle stage affect the peak power change rate. Fluctuation intensity and power trend slope The calculation is the same as in the constant current stage, and the peak power change rate for the corresponding constant voltage stage is obtained respectively. Fluctuation intensity Power trend slope and the peak power change rate during the trickle phase Fluctuation intensity Power trend slope .
[0014] 2. Initialize the sliding window parameters (window length W, window step S) for different charging stages. First, set the basic parameters. : Baseline window length; : Reference step size; Window scaling factor; Step scaling factor; , Window size upper and lower limits; , : Upper and lower limits of step size.
[0015] The specific process for initializing the sliding window is as follows:
[0016] Initialize the sliding window parameters for different charging stages, including window length W and window step size S; set basic parameters: The baseline window length; Used as the reference step size; This is the window scaling factor; This is the step size scaling factor; , These are the upper and lower limits for the window size; , This represents the upper and lower limits of the step size.
[0017] (1) Constant current stage: using a medium window Medium step length A sliding window is used to balance the efficiency of capturing and calculating charging fault type features.
[0018] The middle window The calculation is as follows: First, the peak power change rate is... and fluctuation intensity First, sum the values. Then, compare the summed values with the fluctuation intensity. The minimum upper limit value is multiplied by the window scaling factor plus one to obtain the middle window factor value, and the base window length is used as the reference. Divide by the medium window coefficient to get the medium window value .
[0019] The middle step The calculation is as follows: First, the peak power change rate is... and fluctuation intensity First, sum the values. Then, compare the summed values with the fluctuation intensity. The upper limit is taken as the minimum value, multiplied by the step size scaling factor, and then one is added to obtain the middle window step size factor value. The base step size is then used. Divide by the medium window step size coefficient to get the medium step size. .
[0020] (2) Constant pressure stage: short window is used and large stride A sliding window captures details of mutations.
[0021] The short window The calculation is as follows: First, the peak power change rate is... and fluctuation intensity First, sum the results; then, multiply the sum by the window scaling factor. Add one to get the short window coefficient value, and set the base window length. Divide by the short window coefficient to obtain the short window adaptive value, compare the short window adaptive value with the lower limit of the window size, and take the maximum value as the short window. .
[0022] The large step size The calculation is as follows: First, the peak power change rate is... and fluctuation intensity First, sum the results. Then, multiply the sum by the step scaling factor. Add one to obtain the large step size coefficient value, and then combine the large step size coefficient value with the base step size. The product of the product and the upper limit of the step size. Compare the values and take the minimum value as the larger step size. .
[0023] (3) Trickle stage: using a long window and small step length The sliding window captures the continuous upward and downward trends of power data.
[0024] The long window The calculation is as follows: the slope of the power trend. Take the absolute value and the window scaling factor, and the base window length. Calculate the product, compare the result with the upper limit of the window size, and take the minimum value as the long window. .
[0025] The small step size The calculation is as follows: the slope of the power trend. Take the absolute value and the step scaling factor Multiply and add one to get the small step size coefficient value, and then set the base step size. Divide the value by the small step size coefficient to obtain the small step size adaptive value; compare the small step size adaptive value with the lower limit of the step size, and take the minimum value as the small step size. .
[0026] Step 4: Construct a multi-branch temporal convolutional network (TCN) model, and use the adaptive sliding window initialized in step 3 to extract features from the fault classification dataset and train the model.
[0027] The multi-branch TCN model includes three parallel TCN branches, corresponding to the constant current stage branch, the constant voltage stage branch, and the trickle stage branch. Each branch receives the time-series feature vectors extracted from the three charging stages through an adaptive sliding window. Finally, the time-series feature vectors extracted from the three branches are weighted and fused, and then the charging fault type is output through a classifier.
[0028] The time-series feature vectors extracted from the three branches are then weighted and fused. The weights are calculated as follows:
[0029] Peak power change rate at each stage Fluctuation intensity and power trend slope Summing the absolute values yields the weight coefficients for each of the three stages. , and ; Calculate the weighting coefficients corresponding to the three stages. , and The sum of, denoted as The branch weights in the three-part weighted fusion are respectively the weight coefficients of each branch and... The ratio of .
[0030] Step 5: During training, the misclassification rate of the multi-branch TCN model for each charging fault type is used as a feedback indicator to dynamically fine-tune the sliding window parameters, achieving adaptive optimization of the sliding window and further improving the fault identification accuracy. Since the initial sliding window parameters are calculated based on the initial features of each stage, there may be insufficient adaptability. By using the feedback of the model's misclassification rate to achieve closed-loop optimization, the sliding window parameters can continuously adapt to changes in fault characteristics, improving the robustness and adaptability of the model.
[0031] When the false positive rate for charger issues exceeds the false positive rate for battery issues and the false positive rate for normal data, adjust the short window. and large stride : Peak power change rate during constant voltage phase Fluctuation intensity Sum and then multiply by the window length and learning factor Get value For Mid-window of time , will the middle window Multiply The obtained value is related to the lower limit of the window size. Compare and take the maximum value as Mid-window of time The peak power change rate during the constant voltage stage Fluctuation intensity Sum and then multiply by the window step size and learning coefficient Get value For The large stride of time , will take a big step Multiply The obtained value and the lower limit of the step size Compare the values and take the minimum value as the minimum. The large stride of time .
[0032] When the false positive rate for battery issues exceeds the false positive rate for charger issues and the false positive rate for normal data, adjust the long window. and small step length : The slope of the power trend during the trickle phase The absolute value and window length of the learning coefficient Multiplying gives the value ; for Long window of time long window Multiply The obtained value is related to the upper limit of the window size. Compare the values and take the minimum value as the minimum. Long window of time ; the slope of the power trend during the trickle phase The absolute value and window step size of the learning coefficient Multiplying gives the value ; for Small step size of time , small step size Multiply The obtained value and the lower limit of the step size Compare and take the maximum value as Small step size of time .
[0033] When the percentage of false positives for normal data exceeds the percentage of false positives for charger issues and battery issues, adjust the window. Medium step length : Targeting Mid-window of time ,Will Mid-window of time With reference window length Perform a weighted sum, where the sum of the two weights is 1, and The weight is greater than Weights; for Mid-step of time ,Will Mid-step of time With reference step size Perform a weighted sum, where the sum of the two weights is 1, and The weight is greater than The weight.
[0034] Step 6: The data to be tested is identified by a multi-branch TCN model after dynamically fine-tuning the window parameters to obtain the fault diagnosis result. Specifically, the charging power data of the electric bicycle to be tested is processed sequentially through the data preprocessing in Step 1, the charging stage division and adaptive sliding window feature extraction in Step 3, and the multi-branch TCN model identification in Step 4 to obtain the final fault diagnosis result and corresponding probability value.
[0035] In another aspect, the present invention also provides an electric bicycle charging fault diagnosis system based on an adaptive sliding window, which implements the electric bicycle charging fault diagnosis method and includes the following modules:
[0036] The data acquisition module is used to collect electric bicycle charging power data, perform preprocessing, and construct fault classification datasets and charging stage datasets.
[0037] The data feature calculation module is used to calculate the rate of change of charging power data for preprocessed electric bicycle charging power data.
[0038] The adaptive sliding window initialization module, based on the power change rate of charging power data, uses the charging stage dataset to divide the electric bicycle charging stages and initialize the adaptive sliding window.
[0039] The multi-branch TCN module is used to build a multi-branch TCN model, which uses an initialized adaptive sliding window to obtain features from the fault classification dataset and train it.
[0040] The dynamic fine-tuning feedback-adaptive sliding window parameter module is used to dynamically fine-tune the sliding window parameters during training by using the misclassification rate of the multi-branch TCN model for each charging fault type as a feedback index, thereby achieving adaptive optimization of the sliding window.
[0041] The diagnostic result output module is used to identify the data to be tested through a multi-branch TCN model after dynamically fine-tuning the window parameters, and obtain the fault diagnosis result.
[0042] Beneficial effects of this invention:
[0043] This invention addresses the problems of poor adaptability and low diagnostic accuracy of fixed sliding windows in existing electric bicycle charging fault diagnosis methods. It proposes a diagnostic scheme based on an adaptive sliding window for the charging stage, offering the following advantages: First, it boasts strong adaptability. By combining the characteristics of the constant current, constant voltage, and trickle charging stages with the differences in fault timing, the window parameters are dynamically adjusted to match the short-term abrupt changes in charger problems with the long-term trends in battery problems, avoiding feature omissions or redundant interference. Second, it provides high diagnostic accuracy. The window's adaptive function is achieved through feedback based on category-weighted accuracy, effectively improving the accuracy of identifying the three types of data and reducing the false fault rate. Third, it offers strong versatility. It can be directly adapted to existing charging pile power acquisition systems without additional hardware costs, balancing diagnostic performance and engineering application value, and effectively preventing safety accidents caused by charging faults. Attached Figure Description
[0044] Figure 1 This is a schematic diagram of a charging fault diagnosis method based on a feedback-adaptive sliding window.
[0045] Figure 2 This is a flowchart of a charging fault diagnosis method based on a feedback-adaptive sliding window.
[0046] Figure 3 This is the normal power variation curve of electric bicycles during the three stages of charging;
[0047] Figure 4 This is a typical battery power change curve during the three stages of charging for electric bicycles.
[0048] Figure 5 This is a typical charger power variation curve for the three stages of electric bicycle charging.
[0049] Figure 6 This is a schematic diagram of the experimental training curve. Detailed Implementation
[0050] In one aspect, this invention provides a method for diagnosing charging faults in electric bicycles based on a feedback-based adaptive sliding window, the principle of which is as follows: Figure 1 As shown, the fault diagnosis method flow is as follows: Figure 2 As shown, the specific steps are as follows:
[0051] Step 1: Data Acquisition and Preprocessing: Electric bicycle charging power data is collected using the charging pile's power sensor at a sampling frequency of 60 seconds per sampling point and stored in a database. Data augmentation is performed to expand the data scale. A minimum effective power sequence length is set; data with too few sampling times is considered "worthless" and excluded from subsequent fault diagnosis processes. Data meeting the minimum sequence length condition is standardized and labeled. The fault classification dataset is divided into three categories based on fault type: "Normal Data," "Battery Problem," and "Charger Problem." The charging stage dataset is divided into three stages based on the charging process: "Constant Current Stage," "Constant Voltage Stage," and "Trickle Charge Stage." The normal charging power change curve for electric bicycles in these three stages is shown below. Figure 3 As shown; the power change curves of typical battery problems in the three-stage charging of electric bicycles are as follows. Figure 4 As shown; the power change curve of a typical charger for the three-stage charging of electric bicycles is as follows. Figure 5 As shown.
[0052] Step 2: For the preprocessed electric bicycle charging power data from Step 1, calculate the rate of change of the charging power data, and the existing power sequence. The specific calculations are as follows:
[0053] Power change rate : Defined as the ratio of the power difference between two adjacent sampling points to the power of the previous sampling point, the formula is:
[0054]
[0055] Step 3: Based on the power change rate of the charging power data, and using the charging stage dataset labeled in Step 1, we perform the division of the electric bicycle charging stages (constant current stage, constant voltage stage, and trickle charging stage) and the initialization of the adaptive sliding window. Since the power characteristics of different charging stages of electric bicycles are significantly different, and different faults manifest differently in each stage (charger faults mostly occur in the constant voltage stage, and battery faults mostly occur in the trickle charging stage), it is a key prerequisite to achieve accurate fault identification by first completing the division of charging stages and then dynamically initializing the sliding window parameters according to the power characteristics of each stage. This can avoid the problem of insufficient adaptation of fixed windows to fault characteristics of different stages.
[0056] (1) Calculate the data characteristics of the constant current stage (peak power change rate, fluctuation intensity, power trend slope), and initialize the sliding window for the constant current stage based on the above characteristics: existing power sequence The specific judgment rules are as follows:
[0057] 1. Peak power change rate during constant current phase Power change rate in the current stage The absolute maximum value reflects the severity of power fluctuations:
[0058]
[0059] Where [a,b] represents the sampling point interval. The peak power change rate R can accurately capture the maximum power fluctuation within the stage. If R is too large, it indicates that there is an abnormal instantaneous fluctuation in the constant current stage. This feature is used to adjust the sliding window's ability to capture instantaneous fluctuations.
[0060] 2. Fluctuation intensity during constant current phase The standard deviation of the power series in the current stage reflects the overall fluctuation range of power.
[0061]
[0062] in, This represents the average power value within the current sampling interval. The fluctuation intensity V quantifies the overall dispersion of power during the constant current phase. In normal data, the power fluctuation intensity is within a small range. If V deviates from the normal range, it indicates abnormal overall power fluctuation, which may indicate a charger problem. This feature is used to adjust the window length of the sliding window to accommodate different overall fluctuation ranges.
[0063] 3. Power trend slope during constant current phase Linear regression is used to fit the power sequence of the current stage, and the slope of the trend line of the fitting result is obtained, which reflects the overall trend of power change.
[0064]
[0065] The power trend slope K reflects the long-term direction and magnitude of power change during the constant current phase. Normally, the power trend slope tends to be 0 during the trickle phase. If K is positive and has a large absolute value, it indicates that the power is continuously increasing, which may indicate a battery problem. This feature is used to adjust the sliding window's ability to capture long-term trends.
[0066] The constant pressure stage and trickle stage affect the peak power change rate. Fluctuation intensity and power trend slope The calculation is the same as in the constant current stage, and the peak power change rate for the corresponding constant voltage stage is obtained respectively. Fluctuation intensity Power trend slope and the peak power change rate during the trickle phase Fluctuation intensity Power trend slope .
[0067] (2) Initialize the sliding window parameters (window length W, window step size S) for different charging stages. First, set the basic parameters. : Baseline window length; : Reference step size; Window scaling factor; Step scaling factor; , Window size upper and lower limits; , : Upper and lower limits of step size;
[0068] Secondly, the specific formula is as follows:
[0069] 1. Constant current stage: A sliding window with "medium window + medium step size" is adopted to balance the efficiency of feature capture and calculation for the three types of charging faults.
[0070]
[0071]
[0072] in, For fluctuation intensity Upper limit.
[0073] 2. Constant voltage stage: Charger problems are more likely to appear during the constant voltage stage. Therefore, a sliding window with a "short window + large step size" is used to capture abrupt changes and improve the ability to identify charger problems.
[0074]
[0075]
[0076] 3. Trickle Phase: Battery problems are likely to appear during the trickle phase, so a sliding window with a "long window + small step size" is used to capture the continuous rising and falling trends of power data and improve the ability to identify battery problems.
[0077]
[0078]
[0079] in, , , , , , These are the window length and step size for the constant current stage, constant pressure stage, and trickle stage, respectively.
[0080] Step 4: Construct a multi-branch temporal convolutional network (TCN) model. Use the adaptive sliding window initialized in step 3 to extract features from the fault classification dataset and train the model. TCN has a powerful temporal feature extraction capability, which can effectively capture the long-term and short-term dependencies of power sequences and adapt to the temporal feature differences of charging faults. The multi-branch structure is adopted to adapt to the differences in power features and fault distribution in the three charging stages. The sliding window parameters and feature types of the three stages are different. A single-branch model cannot adapt to the features of the three stages at the same time. The multi-branch structure allows the features of each stage to be extracted and processed specifically, thereby improving the diagnostic accuracy of the model.
[0081] The multi-branch TCN model consists of four layers: input layer, multi-branch feature extraction layer, feature fusion layer, and output layer. The functions of each layer are as follows:
[0082] (1) Input layer: Receives the temporal feature vectors extracted by the adaptive sliding window from the three charging stages.
[0083] (2) Multi-branch feature extraction layer: It contains three parallel TCN branches, which correspond to the constant current stage branch, constant pressure stage branch and trickle stage branch respectively. Each branch has the same structure but independent parameters to adapt to the fault feature differences of each stage.
[0084] (3) Feature fusion layer: The normalized values of the peak power change rate, fluctuation intensity, and power trend slope of each stage are used as the basis for weight calculation to achieve adaptive fusion, and the branch weight of the constant current stage is calculated. The calculation formula is as follows:
[0085] Constant pressure phase weight Trickle phase weights The calculation method is the same as above.
[0086] (4) Output layer: Outputs three types of charging faults (normal data, battery problem, charger problem) and their probability values.
[0087] Step 5: During training, the misclassification rate of the multi-branch TCN model for each charging fault type is used as a feedback metric to dynamically fine-tune the window parameters, achieving adaptive optimization of the sliding window and further improving fault identification accuracy. Because the initial sliding window parameters are calculated based on the initial features of each stage, there may be insufficient adaptability. Through closed-loop optimization based on the model's misclassification rate feedback, the sliding window parameters can continuously adapt to changes in fault characteristics, improving the model's robustness and adaptability. The dynamic adjustment formula is as follows:
[0088]
[0089] in, , , These are the percentages of misjudgments due to charger issues, battery issues, and normal data. The learning coefficient is the window length. The learning coefficient is the window step size. This represents the current iteration number. , This refers to the adjusted window length and step size.
[0090] Step 6: The data to be tested is identified by a multi-branch TCN model with dynamically adjusted window parameters to obtain the fault diagnosis result. Specifically, the charging power data of the electric bicycle to be tested is processed sequentially through the data preprocessing in Step 1, the charging stage division and feedback adaptive sliding window feature extraction in Step 3, and the multi-branch TCN model identification in Step 4 to obtain the final fault diagnosis result and corresponding probability value.
[0091] In another aspect, the present invention also provides an electric bicycle charging fault diagnosis system based on an adaptive sliding window, which implements the electric bicycle charging fault diagnosis method and includes the following modules:
[0092] The data acquisition module is used to collect electric bicycle charging power data, perform preprocessing, and construct fault classification datasets and charging stage datasets.
[0093] The data feature calculation module is used to calculate the rate of change of charging power data for preprocessed electric bicycle charging power data.
[0094] The feedback-based adaptive sliding window initialization module, based on the power change rate of charging power data, uses the charging stage dataset to divide the electric bicycle charging stages and initialize the adaptive sliding window.
[0095] The multi-branch TCN module is used to build a multi-branch TCN model, which uses an initialized adaptive sliding window to obtain features from the fault classification dataset and train it.
[0096] The dynamic fine-tuning feedback-adaptive sliding window parameter module is used to dynamically fine-tune the window parameters during training by using the misclassification rate of the multi-branch TCN model for each charging fault type as a feedback index, thereby achieving adaptive optimization of the sliding window.
[0097] The diagnostic result output module is used to identify the data to be tested through a multi-branch TCN model after dynamically fine-tuning the window parameters, and obtain the fault diagnosis result.
[0098] This invention is not limited to the specific embodiments described above. Various modifications and variations can be made without departing from the technical essence of this invention. Any modifications, equivalent substitutions, or improvements made based on the technical principles of this invention should be considered within the scope of protection of this invention.
[0099] experiment:
[0100] (1) Experimental environment
[0101] Hardware configuration: CPU is Intel Core i9-12900H, memory is 16GB, graphics card is NVIDIA RTX 3060, hard drive is 1TB.
[0102] Software environment: Operating system Windows 11, programming language Python 3.10, deep learning framework PyTorch, database MySQL, data processing tools Pandas and NumPy.
[0103] (2) Experimental data
[0104] The power acquisition module collects real-time power data from electric bicycle charging stations every minute. The collected power data is then arranged chronologically to form a charging power data sequence. The dataset has been expanded multiple times, reaching a total of approximately 60,000 records. Three electrical engineering professionals manually labeled the data, categorizing it into "normal data," "charger problem," and "battery problem," with approximately 20,000 records in each category.
[0105] (3) Comparative experiment
[0106] Three sets of comparative experiments were set up:
[0107] 1. Experimental group: The method of this invention (adaptive sliding window + multi-branch improved TCN model).
[0108] 2. Comparison Group 1: Fixed sliding window + traditional TCN model.
[0109] 3. Comparison Group 2: Fixed sliding window + CNN model.
[0110] (4) Experimental indicators
[0111] 1. Accuracy: The number of correctly diagnosed samples / the total number of samples, reflecting the overall diagnostic performance of the model.
[0112] 2. Accuracy: The number of samples correctly diagnosed for a certain type of fault / the number of samples diagnosed as positive for that type of fault. It reflects the accuracy of the model's diagnosis and reduces misjudgments.
[0113] 3. Recall: The number of correctly diagnosed samples of a certain type of fault / the actual number of samples of that type of fault. It reflects the model's ability to capture faults and reduce false negatives.
[0114] 4. F1 score: The harmonic mean of precision and recall.
[0115] (4) Experimental results
[0116] The performance metrics of the three sets of experiments on the test set are compared in Table 1 below, and the specific diagnostic accuracy of each stage is also recorded.
[0117] Table 1
[0118]
[0119] (5) Analysis of experimental results
[0120] The training curve of this invention is as follows: Figure 6 As shown, the accuracy, precision, recall, and F1 score of the experimental group (the method of this invention) reached 98.2%, 97.5%, 97.6%, and 97.5%, respectively, all higher than those of control group 1 (95.4%, 94.5%, 93.7%, 92.9%) and control group 2 (91.3%, 90.2%, 89.6%, 88.8%), with improvements ranging from 4.9% to 9.7%. This indicates that the adaptive sliding window proposed in this invention can effectively match the temporal characteristics of different faults, and the improved multi-branch TCN model can enhance feature extraction, improve diagnostic accuracy, and solve the problems of poor adaptability and low diagnostic accuracy of existing fixed window methods.
[0121] This invention is not limited to the specific embodiments described above. Various modifications and variations can be made without departing from the technical essence of this invention. Any modifications, equivalent substitutions, or improvements made based on the technical principles of this invention should be considered within the scope of protection of this invention.
Claims
1. A charging fault diagnosis method based on a feedback-based adaptive sliding window, characterized in that, Includes the following steps: Step 1: Collect electric bicycle charging power data, preprocess it, and construct a fault classification dataset and a charging stage dataset; Step 2: For the preprocessed charging power data, calculate the rate of change of charging power data; Step 3: Based on the power change rate of the charging power data, use the charging stage dataset to perform adaptive sliding window initialization; Step 4: Construct a multi-branch TCN model, use the initialized adaptive sliding window to obtain features of the fault classification dataset and train it; The multi-branch TCN model includes three parallel TCN branches, corresponding to the constant current stage branch, the constant voltage stage branch, and the trickle stage branch. Each branch receives the time-series feature vectors extracted by the three charging stages through an adaptive sliding window. Finally, the time-series feature vectors extracted by the three branches are weighted and fused, and then the charging fault type is output through a classifier. Constant current stage: using a medium window Medium step length A sliding window is used to balance the efficiency of capturing and calculating charging fault type features; Constant pressure stage: Short window adopted and large stride A sliding window captures details of sudden changes; Trickle stage: using a long window and small step length The sliding window captures the continuous upward and downward trends of power data; Step 5: During training, the misclassification rate of the multi-branch TCN model for each charging fault type is used as a feedback metric to dynamically fine-tune the sliding window parameters and achieve adaptive optimization of the sliding window. Step 6: The data to be tested is identified by the multi-branch TCN model after dynamic fine-tuning of window parameters to obtain the fault diagnosis results.
2. The charging fault diagnosis method based on a feedback-adaptive sliding window according to claim 1, characterized in that, The preprocessing includes: collecting electric bicycle charging power data through the power sensor of the charging pile; performing data augmentation on the charging power, setting the minimum sequence length of the effective power sequence, and standardizing and labeling the data that meets the minimum sequence length condition; Construct a fault classification dataset and a charging stage dataset. The fault classification dataset includes fault types of normal, battery fault, and charger fault. The charging stage dataset is divided into constant current stage, constant voltage stage, and trickle stage according to the charging process.
3. The charging fault diagnosis method based on a feedback-adaptive sliding window according to claim 2, characterized in that, The power change rate of the charging power data is defined as the ratio of the power difference between two adjacent sampling points to the power of the previous sampling point.
4. The charging fault diagnosis method based on a feedback-adaptive sliding window according to claim 3, characterized in that, Step 3 is specifically implemented as follows: First, a convolutional neural network classification model is trained using the charging stage dataset to achieve the three-stage division of the charging process; then, based on the classification results output by the convolutional neural network classification model, the data features of each charging stage are calculated and a sliding window is initialized.
5. The charging fault diagnosis method based on a feedback-adaptive sliding window according to claim 4, characterized in that, The specific data characteristics for each charging stage are calculated as follows: Peak power change rate during constant current phase The maximum absolute value of the rate of change of power within the current stage; Fluctuation intensity during constant current phase Standard deviation of the power series within the current stage; Power trend slope during constant current phase Linear regression is used to fit the power sequence of the current stage, and the slope of the trend line of the fitting result is obtained. The constant pressure stage and trickle stage affect the peak power change rate. Fluctuation intensity and power trend slope The calculation is the same as in the constant current stage, and the peak power change rate for the corresponding constant voltage stage is obtained respectively. Fluctuation intensity Power trend slope and the peak power change rate during the trickle phase Fluctuation intensity Power trend slope .
6. The charging fault diagnosis method based on a feedback-adaptive sliding window according to claim 5, characterized in that, The specific process for initializing the sliding window is as follows: Initialize the sliding window parameters for different charging stages, including window length W and window step size S; set basic parameters: The baseline window length; Used as the reference step size; This is the window scaling factor; This is the step size scaling factor; , These are the upper and lower limits for the window size; , These are the upper and lower limits of the step size; During the constant current phase, the middle window The calculation is as follows: First, the peak power change rate is... and fluctuation intensity First, sum the values. Then, compare the summed values with the fluctuation intensity. The minimum upper limit value is multiplied by the window scaling factor plus one to obtain the middle window factor value, and the base window length is used as the reference. Divide by the medium window coefficient to get the medium window value ; The middle step The calculation is as follows: First, the peak power change rate is... and fluctuation intensity First, sum the values. Then, compare the summed values with the fluctuation intensity. The upper limit is taken as the minimum value, multiplied by the step size scaling factor, and then one is added to obtain the middle window step size factor value. The base step size is then used. Divide by the medium window step size coefficient to get the medium step size. ; During the constant pressure phase, the short window The calculation is as follows: First, the peak power change rate is... and fluctuation intensity First, sum the results; then, multiply the sum by the window scaling factor. Add one to get the short window coefficient value, and set the base window length. Divide by the short window coefficient to obtain the short window adaptive value, compare the short window adaptive value with the lower limit of the window size, and take the maximum value as the short window. ; The large step size The calculation is as follows: First, the peak power change rate is... and fluctuation intensity First, sum the results. Then, multiply the sum by the step scaling factor. Add one to obtain the large step size coefficient value, and then combine the large step size coefficient value with the base step size. The product of the product and the upper limit of the step size. Compare the values and take the minimum value as the larger step size. ; During the trickle phase, the long window The calculation is as follows: the slope of the power trend. Take the absolute value and the window scaling factor, and the base window length. Calculate the product, compare the result with the upper limit of the window size, and take the minimum value as the long window. ; The small step size The calculation is as follows: the slope of the power trend. Take the absolute value and the step scaling factor Multiply and add one to get the small step size coefficient value, and then set the base step size. Divide the value by the small step size coefficient to obtain the small step size adaptive value; compare the small step size adaptive value with the lower limit of the step size, and take the minimum value as the small step size. .
7. The charging fault diagnosis method based on a feedback-adaptive sliding window according to claim 6, characterized in that, The time-series feature vectors extracted from the three branches are then weighted and fused. The weights are calculated as follows: Peak power change rate at each stage Fluctuation intensity and power trend slope Summing the absolute values yields the weight coefficients for each of the three stages. , and ; Calculate the weight coefficients for the three stages. , and The sum of, denoted as ; The branch weights for the three-part weighted fusion are respectively the weight coefficients of each branch and The ratio of .
8. The charging fault diagnosis method based on a feedback-adaptive sliding window according to claim 7, characterized in that, The process of dynamically fine-tuning the window parameters is as follows: When the false positive rate for charger issues exceeds the false positive rate for battery issues and the false positive rate for normal data, adjust the short window. and large stride : Peak power change rate during constant voltage phase Fluctuation intensity Sum and then multiply by the window length and learning factor Get value For Mid-window of time , will the middle window Multiply The obtained value is related to the lower limit of the window size. Compare and take the maximum value as Mid-window of time ; The peak power change rate during the constant voltage phase Fluctuation intensity Sum and then multiply by the window step size and learning coefficient Get value For The large stride of time , will take a big step Multiply The obtained value and the lower limit of the step size Compare the values and take the minimum value as the minimum. The large stride of time ; When the false positive rate for battery issues exceeds the false positive rate for charger issues and the false positive rate for normal data, adjust the long window. and small step length : The slope of the power trend during the trickle phase The absolute value and window length of the learning coefficient Multiplying gives the value ; for Long window of time long window Multiply The obtained value is related to the upper limit of the window size. Compare the values and take the minimum value as the minimum. Long window of time ; The slope of the power trend during the trickle phase The absolute value and window step size of the learning coefficient Multiplying gives the value ; for Small step size of time , small step size Multiply The obtained value and the lower limit of the step size Compare and take the maximum value as Small step size of time ; When the percentage of false positives for normal data exceeds the percentage of false positives for charger issues and battery issues, adjust the window. Medium step length : Targeting Mid-window of time ,Will Mid-window of time With reference window length Perform a weighted sum, where the sum of the two weights is 1, and The weight is greater than Weights; for Mid-step of time ,Will Mid-step of time With reference step size Perform a weighted sum, where the sum of the two weights is 1, and The weight is greater than The weight.
9. A charging fault diagnosis system based on a feedback-adaptive sliding window, used to implement the charging fault diagnosis method according to any one of claims 1 to 8, characterized in that, Includes the following modules: The data acquisition module is used to collect electric bicycle charging power data for preprocessing and to build fault classification datasets and charging stage datasets. The data feature calculation module is used to calculate the rate of change of charging power data for preprocessed electric bicycle charging power data. The adaptive sliding window initialization module, based on the power change rate of charging power data, uses the charging stage dataset to divide the electric bicycle charging stages and initialize the adaptive sliding window. The multi-branch TCN module is used to build a multi-branch TCN model, which uses an initialized adaptive sliding window to obtain features of the fault classification dataset and train it. The dynamic fine-tuning feedback adaptive sliding window parameter module is used to dynamically fine-tune the sliding window parameters by taking the misclassification rate of the multi-branch TCN model for each charging fault type as a feedback index during training, thereby achieving adaptive optimization of the sliding window. The diagnostic result output module is used to identify the data to be tested through a multi-branch TCN model after dynamically fine-tuning the window parameters, and obtain the fault diagnosis result.
Citation Information
Patent Citations
Transformer mechanical fault diagnosis method and device based on vibration signal detection, and storage medium
CN121637233A
Method for training transformer fault detection model, fault diagnosis method, and related device
US20250370068A1