A method for fitting and verifying power source waveform data

By constructing a deep learning model with a dual-branch feature extraction module and an attention mechanism, the problems of waveform distortion identification and model overfitting in power source waveform analysis are solved, achieving high-precision fitting and confidence quantification, and improving the reliability and predictability of power source testing.

CN122491014APending Publication Date: 2026-07-31STATE GRID HEBEI ELECTRIC POWER CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
STATE GRID HEBEI ELECTRIC POWER CO LTD
Filing Date
2026-04-30
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies struggle to capture waveform distortions caused by complex nonlinear loads in power source waveform analysis. Imbalanced samples lead to overfitting of deep learning models, and the lack of quantitative assessment of the confidence level of prediction results makes it difficult to meet the requirements of high-reliability metrology and calibration.

Method used

We construct a deep learning model based on a dual-branch structure feature extraction module and attention mechanism. We extract local spatial and long short-term temporal features through multi-scale convolutional neural networks and long short-term memory networks, combine generative adversarial networks for data augmentation, and use Transformer encoders for context modeling and Monte Carlo Dropout for confidence evaluation.

Benefits of technology

It achieves high-precision fitting of nonlinear transient distortion waveforms, improves the model's generalization ability and confidence quantification under unknown operating conditions, realizes the reliability leap from "numerical prediction" to "confidence quantification", and has the ability to predict faults.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122491014A_ABST
    Figure CN122491014A_ABST
Patent Text Reader

Abstract

This invention relates to a method, system, device, and medium for fitting and verifying waveform data of a power source. The method includes the following steps: acquiring multimodal raw waveform data of a power source; inputting the raw waveform data into a pre-trained deep learning model, the deep learning model including a feature extraction module and a waveform fitting module; utilizing the dual-branch structure of the feature extraction module to extract local spatial features and long- and short-term temporal features of the raw waveform data, and fusing the two; using the attention mechanism in the waveform fitting module to perform contextual modeling on the fused features, reconstructing a high-precision fitted waveform curve; and outputting the verification result of the power source based on the consistency between the fitted waveform curve and the raw waveform data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power electronics technology, and in particular to power source testing and calibration technology, specifically a method, system, device, and medium for fitting and verifying power source waveform data. Background Technology

[0002] As a key device in the testing of power systems and electronic equipment, the quality of the output waveform of a power source directly determines the safety and operating efficiency of the electrical equipment. Traditional power source testing and calibration typically rely on standard instruments such as oscilloscopes and power analyzers for point-by-point measurements. This method primarily depends on manual experience to read the effective values ​​of voltage and current or observe waveform patterns. This process is not only cumbersome and time-consuming, making it difficult to meet the needs of large-scale production or real-time testing scenarios, but also highly susceptible to the influence of the operator's subjective experience, resulting in poor data consistency and traceability.

[0003] With the development of automation technology, some automatic debugging and acquisition methods based on feedback control or rule triggering have emerged in existing technologies. For example, CN112799459A discloses a power source debugging method, which obtains the operating power of the power source under different voltages, uses a PID algorithm to adjust the operating parameters to approximate the desired power, and then fits the detection curve. Its core lies in determining the static "detection curve". However, this method mainly focuses on the point-to-point static calibration of voltage and power values, ignores the spatiotemporal morphological characteristics of the waveform itself, and lacks the ability to perceive the overall waveform morphology and transient distortion. CN118231210A discloses a trigger acquisition mechanism, which presets a specific trigger threshold (such as impedance mismatch or excessive reflected power). When the monitored data reaches the threshold, high-speed acquisition is initiated and compared with a preset normal discharge model. Although this method improves the targeting of acquisition, its core lies in initiating acquisition when the trigger characteristics reach the preset trigger threshold. Its analysis method is limited to comparing the acquired data with the preset "normal discharge data model". It is highly dependent on the preset mathematical model and fixed rules. For waveform distortion caused by complex nonlinear loads or unknown fault modes, it is often difficult to accurately identify them due to a lack of generalization ability.

[0004] With the development of artificial intelligence technology, some studies have attempted to apply machine learning to power data analysis and equipment calibration. For example, CN117220655A discloses an automatic power source matching system and method for power equipment, which achieves automatic switching of power range through hardware circuits. However, this scheme relies on dedicated hardware and does not involve waveform fitting and deep learning. CN117368832A discloses an automatic calibration method for power acquisition data, which uses computer-controlled standard sources for calibration. However, its calibration algorithm still relies on preset mathematical models and rules, has limited intelligence, and fails to utilize large models to learn complex nonlinear mapping relationships from the data. Therefore, the exploration of applying artificial intelligence technology to power source waveform analysis still faces several significant technical bottlenecks: First, the actual operating environment of power sources is complex, with numerous types of waveform distortions caused by nonlinear loads and transient interference. Traditional linear fitting or shallow models struggle to capture the deep spatiotemporal characteristics and dynamic changes in the waveforms. Second, in actual industrial scenarios, there is a massive amount of normal operating data, while critical fault waveforms or abnormal data under extreme conditions are extremely scarce. This extreme imbalance in samples makes it difficult for deep learning models to be adequately trained, easily leading to overfitting. Finally, most existing automated verification methods only output a deterministic predicted value or a binary result of pass / fail, failing to quantitatively assess the confidence or uncertainty of the prediction results. This poses a potential risk in the field of metrology and calibration, where reliability requirements are extremely high, making it difficult for testers to judge the reliability of automated verification results.

[0005] Furthermore, on the one hand, there are differences in understanding among those skilled in the art; on the other hand, the applicant studied a large number of documents and patents when making this invention, but due to space limitations, not all details and contents were listed in detail. However, this does not mean that the present invention does not possess the features of these prior art. On the contrary, the present invention already possesses all the features of the prior art, and the applicant reserves the right to add relevant prior art to the background art. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a method, system, device, and medium for fitting and verifying power source waveform data. This enables high-precision automatic acquisition, intelligent fitting, and reliable verification of power source waveforms, thereby solving at least some of the aforementioned technical problems. Significantly different from existing technologies such as CN118231210A, this invention constructs a feature extraction module based on a dual-branch structure and a waveform fitting module based on an attention mechanism. The dual-branch structure allows for parallel processing of waveform data: one branch captures subtle local spatial features (such as voltage spikes and glitches), while the other captures long-term and short-term temporal features (such as frequency drift and periodic fluctuations), achieving feature fusion of microscopic details and macroscopic trends in the power source waveform. Furthermore, this invention introduces an attention mechanism to perform contextual modeling of the fused features. This allows the model to focus on key distortion regions in the waveform like a human expert, thereby reconstructing a high-precision fitting curve. This architecture overcomes the limitations of CN112799459A, which can only perform linear or simple curve fitting, and CN118231210A, which can only perform threshold judgment, and realizes in-depth verification and accurate diagnosis of power source waveform quality under complex operating conditions.

[0007] In a first aspect, the present invention discloses a method for fitting and verifying power source waveform data, which includes the following steps: Acquire multimodal raw waveform data from the power source; The raw waveform data is input into a pre-trained deep learning model, which includes a feature extraction module and a waveform fitting module. By utilizing the dual-branch structure of the feature extraction module, local spatial features and long-term and short-term temporal features of the original waveform data are extracted separately, and the two are then fused. By utilizing the attention mechanism in the waveform fitting module, contextual modeling is performed on the fused features to reconstruct a high-precision fitted waveform curve. Based on the consistency between the fitted waveform curve and the original waveform data, the verification results of the power source are output.

[0008] According to a preferred embodiment, before inputting the original waveform data into the deep learning model, a preprocessing step is further included: filling null values ​​and correcting error values ​​in the original waveform data; performing adaptive noise filtering on the data using wavelet transform; detecting and removing transient outliers using a sliding window algorithm combined with the interquartile range method or the Z-score algorithm; and normalizing the processed data.

[0009] According to a preferred embodiment, the local spatial features and long-short-term temporal features of the original waveform data are extracted using the dual-branch structure of the feature extraction module. This includes: extracting peaks and spikes in the waveform data as local spatial features through a multi-scale one-dimensional convolutional neural network in the first branch; extracting the dynamic pattern of waveform data evolution over time as long-short-term temporal features through a long-short-term memory network in the second branch; concatenating the local spatial features and long-short-term temporal features along the feature dimension; and performing feature fusion through a fully connected layer.

[0010] According to a preferred embodiment, the training process of the deep learning model employs a data augmentation strategy, which includes: constructing a generative adversarial network (GAN) containing a generator and a discriminator, wherein the generator adopts a U-Net architecture and the discriminator adopts a PatchGAN structure; performing adversarial training on the GAN using historical measured waveform data of the power source until the generator and discriminator reach Nash equilibrium; generating synthetic waveform data using the trained generator, and mixing the synthetic waveform data with the historical measured waveform data as the training set for the deep learning model.

[0011] According to a preferred embodiment, the fused features are contextually modeled using the attention mechanism in the waveform fitting module, including: processing the fused features using a Transformer encoder, which includes a position encoding module and a multi-head self-attention module; adding temporal position information to the feature sequence through the position encoding module; and calculating the correlation weights between data points in the feature sequence in parallel through the multi-head self-attention module to capture long-distance dependencies between waveform segments.

[0012] According to a preferred embodiment, based on the consistency between the fitted waveform curve and the original waveform data, the verification result of the power source is output, including: introducing a Monte Carlo Dropout mechanism to keep the randomly deactivated layer in the model active during the inference phase; performing multiple forward propagations on the same original waveform data to obtain multiple sets of prediction results; calculating the mean of the multiple sets of prediction results as the final fitted waveform curve, and calculating the variance of the multiple sets of prediction results as a confidence index; when the confidence index is lower than a preset threshold, it is determined that the power source waveform has an abnormality or uncertainty risk, and an alarm is triggered.

[0013] According to a preferred embodiment, the verification result of the output power source further includes: calculating key parameters of the fitted waveform curve, including RMS value, harmonic content and distortion; comparing the key parameters with a standard parameter library to generate a test report containing calibration suggestions or fault diagnosis information.

[0014] Secondly, this invention discloses an intelligent fitting and verification system for power source waveform data, comprising: a sensor array for acquiring multimodal raw waveform data of the power source; a feature extraction module having a parallel structure composed of CNN branches and LSTM branches; and a waveform fitting module having a reconstruction structure composed of a Transformer encoder and a random deactivation layer. In the case of multi-condition switching, the CNN branch uses convolutional kernels to establish a local feature extraction relationship with the raw data sequence to capture waveform edge gradients. In the case of long-term monitoring, the LSTM branch uses hidden units to establish a state transfer relationship with the time series to capture frequency envelopes. In the case of inference verification, the waveform fitting module establishes a consistency determination relationship between the variance generated by multiple forward propagations and a standard parameter library to output the verification result of the power source.

[0015] Thirdly, the present invention discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the aforementioned method.

[0016] Fourthly, the present invention discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the aforementioned method.

[0017] Fifthly, this invention discloses a deep learning model construction method for power source waveform verification, comprising: acquiring a historical measured waveform sample set of the power source; constructing a generative adversarial network (GAN) containing a generator and a discriminator, and performing adversarial training on the GAN using the measured waveform sample set; generating synthetic waveform data using the trained generator, and mixing the synthetic waveform data with the measured waveform sample set to form an enhanced training set; and performing supervised training on the waveform fitting model based on the enhanced training set, so that the waveform fitting model learns the waveform distribution law of the power source under different load conditions; wherein, the waveform fitting model is used to reconstruct features and detect anomalies in the real-time output waveform of the power source.

[0018] In a sixth aspect, the present invention discloses a confidence assessment method for the waveform quality of a power source, comprising: acquiring a real-time waveform data sequence of the power source under test; inputting the real-time waveform data sequence into a probabilistic neural network model containing a random deactivation layer; performing multiple forward propagations on the same real-time waveform data sequence during the inference phase, with each forward propagation randomly activating a different subset of neurons to obtain multiple sets of predicted waveforms; calculating the statistical distribution characteristics of the multiple sets of predicted waveforms, including the prediction mean and prediction variance; using the prediction variance as an uncertainty index to measure the waveform fitting quality, and determining that the power source output has an abnormal risk or the model is unreliable when the uncertainty index is higher than a preset threshold.

[0019] In a seventh aspect, the present invention discloses an artificial intelligence-based power source waveform monitoring system, comprising: a sensor array configured to acquire voltage and current signals at the output of a power source; a processor running a waveform reconstruction model based on a Transformer architecture; the processor being configured to: receive discrete or noisy signals acquired by the sensor array; analyze long-distance dependencies in the signals through the multi-head self-attention mechanism of the waveform reconstruction model, and fit virtual waveform data at times or locations not directly acquired by the sensors; compare the fitted waveform data with a standard parameter library to generate a fault warning signal; wherein the system uses the generated virtual waveform data to fill in the transient data loss in the actual sampling.

[0020] Compared with the prior art, the beneficial technical effects of the present invention include: This invention achieves high-precision fitting and feature deconstruction of nonlinear transient distorted waveforms. It overcomes the limitations of traditional power source tuning methods (such as CN112799459A) that rely solely on PID algorithms to adjust scalar parameters (voltage and RMS power values), and also overcomes the shortcomings of trigger-based acquisition methods (such as CN118231210A) that rely on preset fixed mathematical models. This invention constructs a dual-branch feature extraction module with dynamic constraints. The first branch (CNN) of the feature extraction module is configured as a multi-scale structure, with its three convolutional layers configured with 64, 128, and 256 filters respectively, responding to waveform data with additional constraints. Figure 5The spike / glitch pattern shown is located at a local sliding detection position, so that local spatial features are mapped to noise suppression effects; while the second branch (LSTM) is located at a long sequence memory position when the waveform data evolves over time, so that periodicity and frequency drift trends are dynamically captured. Furthermore, the waveform fitting module has a Transformer encoder, whose position encoding module and multi-head self-attention module can establish temporal position correlation when the fused features are in the state of sequence input. Unlike the feature removal of existing technologies (such as Khokhar S, Zin AAM, Memon AP, et al. A new optimal feature selection algorithm for classification of power quality disturbances using discrete wavelet transform and probabilisticneural network[J]. Measurement, 2017, 95:246-259.), this invention uses Transformer to perform context alignment of the spike physical quantities extracted by CNN and the periodic envelope physical quantities extracted by LSTM, and stabilizes the flow of deep gradients through residual connections. This structure enables the model to locate transient change points (such as those shown in the attached diagram) through attention allocation under the condition of limited sampling frequency. Figure 6 The system reconstructs virtual microsecond-level waveform data (shown as a mutation valley value) that was not directly acquired by the hardware. This deeply integrated spatiotemporal modeling architecture enables the system to reconstruct high-precision fitted waveforms containing rich physical details under strong noise and nonlinear load environments, significantly improving its ability to resolve complex waveform distortions.

[0021] This invention addresses the problem of model overfitting and poor generalization ability caused by the scarcity of fault samples. In industrial scenarios, where power sources present a data imbalance characterized by a vast amount of normal samples and a scarcity of fault samples, existing technologies (such as CN118231210A) often only identify faults that have already occurred and conform to preset rules, lacking the ability to predict unknown faults. This invention introduces Generative Adversarial Networks (GANs) for data augmentation. Through adversarial training between the generator (using a U-Net architecture) and the discriminator (using a PatchGAN structure), the generator is forced to learn the deep statistical distribution patterns of real waveform data, rather than simply memorizing pixels. This process generates a large number of synthetic fault waveforms containing realistic details (such as subtle abrupt changes and natural envelope morphology), greatly expanding the diversity and coverage of the training data. This effectively solves the overfitting problem of deep learning models under small sample conditions and significantly enhances the generalization ability and robustness of the validation model when facing unknown operating conditions or rare faults.

[0022] This invention achieves a reliability leap from "numerical prediction" to "confidence quantification." In the field of metrology and calibration, the reliability of results is crucial. However, existing technologies (such as CN112799459A and CN118231210A) can only output deterministic numerical results or binary alarm signals, failing to indicate potential risks of misjudgment. This invention innovatively introduces Monte Carlo Dropout technology, keeping the randomly deactivated layers in the neural network active during the inference phase. By sampling the same input waveform multiple times during forward propagation, a probability distribution of a set of predicted values ​​is obtained. By calculating the variance of this distribution, the system can quantify the uncertainty (confidence level) of the model regarding the current prediction result. This mechanism enables the system to keenly identify anomalous data (manifested as high uncertainty) that is "unseen by the model" or "at the decision boundary," thereby effectively reducing the false alarm rate and false negative rate during automatic verification. This provides a rigorous statistical basis for power source fault early warning and meets the requirements of high reliability testing.

[0023] This invention constructs an end-to-end fully automated intelligent verification system. It integrates high-speed acquisition from a multimodal sensor array, refined preprocessing using wavelet transform and Z-score algorithms, and intelligent analysis based on a large model, forming a complete closed-loop verification system. Compared to existing technologies that rely on manual experience or segmented tools, this invention achieves full automation from physical signal perception to fault diagnosis report generation through system-level integration. This system can not only monitor multi-dimensional information such as voltage, current, frequency, and phase in real time, but also automatically compare fitted waveforms with a standard parameter library, directly outputting specific calibration suggestions (such as gain adjustment) or fault causes (such as component aging), greatly reducing manual intervention and improving testing efficiency. It is particularly suitable for online real-time monitoring and quality control in large-scale production lines.

[0024] This invention achieves proactive fault prediction analysis, moving from "passive perception" to "proactive cognition." Existing technologies (such as CN112799459A and CN118231210A) primarily focus on recording and alarming for over-limit physical quantities (voltage, current) at the current moment, essentially representing a "passive response" after a fault occurs. This invention, through continuous training and deep mining of massive historical waveform data using a deep learning model, achieves "proactive cognition" of the power source's operating status. The large model not only records "what" the waveform is, but also explains "why" the waveform behaves this way by learning the implicit correlations and evolution patterns under different operating conditions. More importantly, based on the Transformer's ability to model long-distance dependencies, the system can identify subtle signs and degradation trends in the waveform before a fault occurs, thus issuing an early warning before the actual fault occurs. This mechanism provides a valuable time window for operation and maintenance decisions, achieving a qualitative leap in power source testing and maintenance from "post-event remediation" to "pre-event defense," and providing predictive analysis capabilities that surpass traditional methods. Attached Figure Description

[0025] Figure 1 This is a structural block diagram of the system / electronic device of the present invention; Figure 2 This is a flowchart of the steps of the method of the present invention; Figure 3 This is a schematic diagram of the structure of the deep learning model CNN-LSTM-Transformer fusion model of the present invention; Figure 4 This is a flowchart of the confidence assessment using Monte Carlo Dropout in this invention; Figure 5 This is an example waveform diagram of waveform fitting according to the present invention; Figure 6 This is a comparison diagram of the voltage and current waveforms of the present invention. Detailed Implementation

[0026] The following is a detailed explanation with reference to the accompanying drawings.

[0027] Example 1 This embodiment provides an intelligent fitting and verification method for power source waveform data, which relies on, as... Figure 1 The hardware system shown executes this, including a computer, control circuitry, output circuitry, and load, and is equipped with a multi-source sensor array. For example... Figure 1 As shown, the computer acts as the host computer, establishing communication connections with both the control circuit and the data acquisition card. The control circuit (e.g., an embedded microcontroller) is connected to the output circuit to control the power output logic of the power source; the output circuit is connected to the load (e.g., resistive, inductive, or capacitive load) to provide electrical energy to the load. The data acquisition card is connected in parallel between the output circuit and the load, acquiring the voltage and current signals of the output circuit in real time through a sensor array (including voltage transformers and current sensors), and transmitting the acquired digital signals back to the computer for subsequent processing and analysis.

[0028] Figure 2 This is a flowchart illustrating the steps of the method of the present invention. Preferably, the method may include the following steps: Acquire multimodal raw waveform data from the power source; The raw waveform data is input into a pre-trained deep learning model, which includes a feature extraction module and a waveform fitting module. By utilizing the dual-branch structure of the feature extraction module, local spatial features and long-term and short-term temporal features of the original waveform data are extracted separately, and the two are then fused. By utilizing the attention mechanism in the waveform fitting module, contextual modeling is performed on the fused features to reconstruct a high-precision fitted waveform curve. Based on the consistency between the fitted waveform curve and the original waveform data, the verification results of the power source are output.

[0029] First, the multi-modal raw waveform data acquisition step is performed. In this embodiment, for an AC power source with an output power of 1000W, a voltage transformer with an accuracy of 0.1 class and a Hall effect current sensor are used, along with a data acquisition card with a sampling rate of not less than 10KS / s and a resolution of 12 bits. The sensor array is connected in parallel to the output circuit that has a loop relationship between the output circuit and the load, enabling the data acquisition card to capture the load data when the power source is in a state of multi-mode switching. Figure 5The current amplitude step is shown. During the acquisition process, the voltage signal acquired by the voltage transformer and the current signal acquired by the Hall effect current sensor establish a time alignment relationship when the power source is under a sudden load change condition. This makes the data output by the acquisition card form a Z-structure containing time-domain sampling sequence, statistical distribution characteristics and frequency-domain parameters, thereby enabling the multi-modal raw waveform data to have multi-dimensional spatial complementary sensing characteristics. Figure 5 The diagram displays typical multimodal waveforms of the power source under sudden load changes. The upper curves (Ua, Ub, Uc) represent the three-phase output voltage waveforms, and curve U0 represents the neutral voltage waveform, showing that the voltage amplitude remains relatively stable at specific moments (such as the trigger point). The lower curves (Ia, Ib, Ic) represent the three-phase output current waveforms, and curve I0 represents the neutral current waveform. Figure 5 As shown, in the latter half of the waveform, the current waveform (Ia, Ib, Ic) exhibits a significant amplitude step change, corresponding to the transient process of load connection or switching. The method of this invention can accurately capture waveform distortion and phase changes in such transient processes. Subsequently, the acquired raw data is preprocessed, specifically using wavelet transform with a db4 wavelet basis (decomposition layer number of 5) for adaptive noise filtering, and using the Z-score algorithm with a window length of 1000 and a threshold of 3 to remove transient outliers. Finally, the data is normalized to construct a standardized model input sequence. It should be noted that, addressing the technical contradiction that a 10KS / s sampling rate (i.e., a 100μs sampling interval) cannot directly capture microsecond-level spikes physically, this invention employs a sub-sampling period feature reconstruction logic. The deep learning model has multi-scale one-dimensional convolutional layers, and its convolutional kernel (Kernel Size=5) establishes shape feature constraints with adjacent sampling points when the original sampling sequence is discretely distributed. Specifically, under load abrupt changes, the CNN branch, with its limited sampling rate, extracts gradient features from the original waveform to characterize peak trends. In feature fusion, the gradient features, under Transformer conditions, nonlinearly fit the prior waveform distribution generated by the GAN. In waveform fitting, the fitted curve is reconstructed from the original discrete points using interpolation. This reconstruction process both compensates for the lack of physical sampling points through deep learning, reconstructing a high-precision fitted curve that exceeds hardware sampling rate limitations, and filters out non-physical noise through the prior rules of the GAN.

[0030] Next, the preprocessed data is input into a pre-trained deep learning model, the core architecture of which is as follows: Figure 3 As shown, it includes a feature extraction module and a waveform fitting module. Figure 3This document details the dual-branch structure of the feature extraction module and the Transformer encoder of the waveform fitting module. In the feature extraction step, the module employs a dual-branch parallel structure to process the input sequence: the first branch is a multi-scale one-dimensional convolutional neural network (CNN) containing three one-dimensional convolutional layers with filter numbers of 64, 128, and 256 respectively, specifically designed to capture local spatial features such as spikes and glitches in the waveform; the second branch is a long short-term memory network (LSTM) containing two LSTM layers, each with 128 hidden units, used to capture the long-term dependencies and dynamic changes in the waveform over time. The feature vectors extracted by the two branches are concatenated along their feature dimensions and fused through a fully connected layer to form a fused feature vector rich in spatiotemporal information.

[0031] Next, the waveform fitting step is performed. The fused features are processed using the Transformer encoder in the waveform fitting module. This encoder is configured with four attention heads, and the model dimension is set to 256. First, temporal positional information is added to the fused features through positional encoding. Then, a multi-head self-attention mechanism is used to calculate the association weights between data points in the feature sequence, thereby globally modeling the contextual relationships between waveform segments. The encoder output is passed through a linear mapping layer to reconstruct a high-precision fitted waveform curve. This fitted curve accurately reflects the true output characteristics of the power source under nonlinear loads and effectively removes measurement noise.

[0032] Finally, the verification result output step is executed. Based on the generated fitted waveform curve, the system automatically calculates its key parameters (such as RMS value, harmonic content, and distortion) and compares the fitted waveform curve with the original acquired waveform data for consistency. When the consistency between the two or the calculated parameters deviate from the preset range of the standard parameter library, the system generates a verification result containing the fault type (such as component aging or abnormal load) and outputs an alarm, thereby realizing automated and intelligent verification of the power source waveform quality. Figure 6The system output verification result interface is displayed, including voltage waveform comparison (top) and current waveform comparison (bottom). In the figures, the blue curve represents the standard waveform (or the fitted reference waveform), and the red curve represents the measured waveform at the terminal (or waveform segments with anomalies). The system automatically calculates and marks key verification parameters in the figures, including: peak / valley comparison: for example, in the voltage waveform, comparing the standard peak change (27.2605V) with the terminal peak change (27.2042V), and the difference between the standard and terminal peak change values ​​in the current waveform (e.g., the terminal peak change shows 0, indicating a possible open circuit or sampling loss); time parameter comparison: marking the standard start time (15:00:18.101000) and the terminal start time (15:00:18.184000), and automatically calculating the time error (0.083s); statistical indicators: displaying the sampling frequency (6400Hz), total number of sampling points (1696), and the duration before / after start-up. Figure 6 Through visual comparison, if the deviation between the measured value (terminal value) and the standard value exceeds the allowable range (such as obvious non-overlap in the current waveform), the system can determine that the power source output is abnormal.

[0033] Example 2 This embodiment is a further improvement on embodiment 1, and repeated content will not be described again.

[0034] This embodiment provides a power source waveform acquisition, fitting, and verification system based on a large model. Its execution process covers the entire process of data acquisition, refined preprocessing, dual-branch feature extraction, GAN data augmentation, Transformer fitting, and uncertainty verification.

[0035] This system includes a computer, embedded control circuitry, output circuitry, and a load. For example, a 1000W AC power source is tested. The data acquisition module uses a high-speed data acquisition card with 12-bit resolution and a maximum sampling rate of 10KS / s. The sensor array uses voltage transformers with 0.1-level accuracy to acquire voltage data and Hall effect current sensors to acquire current data. The system synchronously acquires multi-mode raw waveform data of the power source under resistive, inductive, and capacitive loads, including voltage, current, frequency, and phase information.

[0036] To ensure a high-quality data foundation, this invention employs a multi-level cleaning strategy. First, null value processing is performed; when sampled data is missing but preceding and following data exist, the mean of the preceding and following data is calculated to fill the gap. Second, error value identification is performed, correcting illogical data by setting a percentage threshold. Subsequently, adaptive noise filtering is performed using wavelet transform (using the db4 wavelet basis, with a decomposition level of 5). For outlier handling, either a Z-score-based anomaly detection algorithm (window length set to 1000, threshold set to 3) can be used to remove transient outliers, or the interquartile range (IQR) method can be used for screening. For example, the specific calculation is as follows: first, the 25th quantile Q1 and 75th quantile Q3 of the data are calculated, then IQR = Q3 - Q1, and a lower bound is set. bound =Q1 - 1.5 * IQR and upper bound bound =Q3 + 1.5 * IQR, discard data that exceeds this boundary. Finally, perform max-min normalization on the data.

[0037] In spatiotemporal feature extraction, a dual-branch deep learning model can be constructed. For example, the first branch is a multi-scale one-dimensional convolutional neural network (CNN), focusing on extracting local waveform features. This branch contains three one-dimensional convolutional layers with filter numbers configured as 64, 128, and 256 respectively. The first layer uses 64 convolutional kernels to extract basic features; the second layer uses 128 convolutional kernels to convolve in a higher-dimensional space, and the result of the first convolution is input to obtain further features; the third layer uses 256 convolutional kernels to extract global abstract features, and the result of the second convolution is input to obtain even more abstract and global features; finally, global average pooling is used to compress time-step information, compressing all time-step information for each feature channel into a single scalar. For example, the second branch is a Long Short-Term Memory (LSTM) network, containing two LSTM layers with 128 hidden units each. The first LSTM layer processes time steps sequentially and passes hidden states, while the second layer performs deeper temporal modeling, ultimately outputting a temporal feature vector. Spatial features from the CNN branch and temporal features from the LSTM branch are concatenated along the feature dimension and then fused through a fully connected layer. This dual-branch CNN and LSTM network provides a robust and efficient solution for complex waveform fitting tasks by complementing spatial and temporal features and considering both local details and global context. The network combines the ability to collaboratively capture spatiotemporal features with end-to-end learning and reinforcement characteristics, achieving a balance between accuracy and efficiency. Unlike the traditional "point estimation" mode that only outputs a single predicted value, the dual-branch network can output a more reliable prediction range, successfully achieving an upgrade from "point estimation" to "uncertainty quantification."

[0038] This invention introduces Generative Adversarial Networks (GANs) to address the problems of insufficient training data and overfitting. The generator employs a U-Net architecture with skip connections, while the discriminator uses a PatchGAN structure. The GAN is trained adversarially using collected real waveform data to generate a large number of synthetic waveforms. During training, the two engage in dynamic game theory and alternating optimization: the generator receives random noise and outputs synthetic waveforms, while the discriminator classifies real and synthetic waveforms as true or false until a Nash equilibrium is reached. The resulting high-fidelity synthetic data is added to the training set, not only expanding the data volume but also forcing the model to learn complex characteristics of real waveform distributions that are difficult to describe with simple formulas (such as subtle abrupt changes and natural envelopes) through adversarial training. The core purpose of generating a large number of synthetic waveforms through adversarial training is to solve the data bottleneck and significantly improve the quality of waveform generation, bringing the following key advantages to this invention: (1) Overcoming the limitations of data scarcity and effectively preventing model overfitting in multiple scenarios. In many practical application scenarios, insufficient data can easily lead to overfitting problems in models—that is, they perform well on the training set but have weak generalization ability when faced with new data. GANs learn the underlying statistical distribution of limited real data through adversarial training, thereby generating massive and diverse synthetic waveforms, which is equivalent to greatly expanding the training dataset. This provides rich learning samples for subsequent waveform fitting models, fundamentally enhancing the model's generalization ability.

[0039] (2) Generates high-quality, high-fidelity waveforms, outperforming traditional methods. Waveforms generated by traditional regression methods are often too smooth and blurry, lacking the high-frequency details and natural characteristics of real waveforms. In contrast, GAN's adversarial training constructs an intelligent loss function at the perceptual level: the discriminator does not pursue absolute matching at the pixel level, but focuses on judging whether the waveform is "real". This mechanism forces the generator to learn the complex characteristics of the real waveform distribution that are difficult to describe with simple mathematical formulas (such as subtle abrupt changes, natural envelope morphology, etc.), and finally generate synthetic waveforms with richer details and higher realism.

[0040] (3) Provides high-quality and rich input support for downstream waveform fitting tasks. The performance of subsequent fitting modules such as Transformer is highly dependent on the quality of input features. If training is only based on limited and potentially noisy real data, the performance of downstream modules will be significantly limited. However, the high-quality, large-scale synthetic waveforms generated by GAN provide these modules with a cleaner and more diverse "training ground", enabling feature extraction and waveform fitting modules to learn more robust and accurate mapping relationships, ultimately improving the fitting accuracy and robustness of the entire system.

[0041] In waveform fitting and context modeling, this invention utilizes a Transformer encoder to process fused features. For example, this encoder contains four attention heads and a model dimension (d). model The value is set to 256. First, input projection and position encoding are performed to give the model sequence-awareness capabilities. The formula for integrating input projection and position encoding is as follows: .

[0042] Where X is the original input, referring to the "fused features"; W proj is the projection weight matrix, which maps the dimension of the original input features to the model dimension of the Transformer encoder; PE is the positional encoding; X i This is the final actual input to the Transformer encoder.

[0043] The location coding formula is as follows: , .

[0044] Where pos is the sequence position index, referring to the position of a data point in the "waveform data point sequence"; i is the dimension index, which is the dimension subscript of the position encoding; d model The dimension of the Transformer model is 256; 2i and 2i+1 correspond to the even and odd dimensions of the position encoding, respectively.

[0045] By adding a unique position to each time step, the model becomes aware of the sequential order of waveform data points, overcoming the inherent disorder limitation of the self-attention mechanism. The 256-dimensional model is split into four heads, each independently computing attention in a 64-dimensional subspace. The four heads work in parallel, each focusing on different features of the waveform: fundamental frequency, harmonics, transient changes, and envelope morphology. By calculating the correlation weights between all data points, each point can perceive the contextual information of the entire sequence.

[0046] The core multi-head attention mechanism computes the associations between different subspaces in parallel. The calculation formulas for single-head attention and multi-head attention are as follows: , .

[0047] Where Q, K, and V are the query matrix, key matrix, and value matrix, respectively, and d k QK is the scaling factor. TTo calculate the dot product of the query matrix and the key matrix, Softmax is the normalization function; head1, head2, head3, and head4 are multiple single-head attention outputs, i.e., h sets of single-head attention results calculated after performing different linear transformations on Q, K, and V respectively; Concat is the concatenation operation; W... O This is for outputting the projection matrix.

[0048] The model incorporates residual connections and layer normalization (LayerNorm) between layers. This adds the output of multi-head attention to the original input and performs layer normalization to ensure stable gradient flow in deep networks, mitigating the vanishing / exploding gradient problem. This is crucial for training deep Transformers. The formula is: .

[0049] Among them, X ii The final output features, X, can be used as input to subsequent modules (such as feedforward neural networks). i For multi-head attention input, MultiHead(X) i ) represents the output of the multi-head attention layer, and LayerNorm is the layer normalization operation, which normalizes all feature dimensions of each sample.

[0050] The model layers also include a feedforward neural network (FFN) with nonlinear transformations, used to independently perform nonlinear transformations on the features at each position in the sequence (e.g., a dimensionality transformation path of 256→1024→256). Its core purpose is to introduce nonlinearity into the model, enhancing its fitting effect on complex patterns, while further processing and refining the contextual information extracted by the attention mechanism. The formula is: .

[0051] Here, Output is the final output feature of this feedforward neural network module, which will serve as the input to subsequent modules; FFN is a feedforward neural network consisting of two linear layers and a non-linear activation function, and it processes the features at each position in the sequence independently; LayerNorm is a layer normalization operation, which stabilizes the model's training process and alleviates problems such as gradient fluctuations and vanishing gradients during training; X ii This refers to the input features of this module, namely the contextual features output by the attention mechanism (single-head / multi-head attention).

[0052] Furthermore, residual connections and normalization can be performed again to further stabilize the training process. After processing by N layers of encoders, a feature sequence rich in global contextual information can be obtained.

[0053] When assessing confidence and verifying output, Monte Carlo Dropout technology can be used to automatically verify waveform quality. The specific assessment process is as follows: Figure 4 As shown: First, input the preprocessed waveform data; load the pre-trained model containing a random deactivation (Dropout) layer; set the number of loops N (e.g., 100 times); enter the loop, perform N forward propagation inferences while keeping Dropout active, and save the prediction results for each iteration; after the loop ends, perform statistical calculations on the saved N sets of prediction results, obtain the prediction mean (μ) as the fitting result, and calculate the prediction variance (σ). 2 The system uses a random deactivation layer, a Monte Carlo loop module, and a standard parameter library as the basis for confidence. If the confidence level is higher than a preset threshold, the prediction result is adopted and the process ends; otherwise, low-confidence processing (such as alarms or manual review) is triggered. The verification system of this invention has a random deactivation layer, a Monte Carlo loop module, and a standard parameter library. During the inference phase, the model performs multiple forward propagation operations with the same original waveform data while the random deactivation layer (e.g., a 0.1 dropout rate) is active. Verification consistency refers to the absolute error between the calculated effective value, harmonic content, and distortion of the fitted waveform curve and the nominal value under the corresponding operating condition in the standard parameter library being within a preset allowable range. If the calculated variance is higher than a preset threshold, the fitted curve is in the "model uncertain" position. The system determines that the current waveform shape deviates from the healthy mode in the standard parameter library (e.g., voltage surge peak deviation or current step loss), thereby converting the statistical variance into a deterministic verification indicator of equipment quality and triggering an alarm.

[0054] For example, Dropout (with a dropout rate of 0.1) is enabled during both the model training and inference phases. During inference, 100 forward propagations are performed on the same input data, resulting in 100 predictions P. k (k=1~100). Furthermore, the predicted mean can be calculated using the following formula: .

[0055] The predicted mean calculated based on the above formula can be used as the final waveform fitting output, and the predicted variance can be calculated using the following formula: .

[0056] Prediction variance can be used as a measure of confidence (uncertainty). The smaller the variance, the higher the confidence. When the confidence (inversely represented by variance) is below a preset threshold (e.g., 0.95), the system determines that the waveform is abnormal or has extremely high uncertainty and triggers an alarm. Finally, the system compares the fitted waveform parameters with a standard parameter library to generate calibration suggestions or fault diagnosis reports.

[0057] Applying Monte Carlo Dropout technology to AC waveform analysis offers significant advantages over single prediction models, specifically: the model learns its inherent operating rules through training on massive amounts of historical data, resulting in a smoother waveform and the ability to quantify uncertainty—effectively filtering out noise and glitches compared to the original waveform recorded by a waveform recorder. It also demonstrates a clear performance advantage over ordinary precision waveform recorders, while providing intelligent interpretation and predictive value in its output.

[0058] Furthermore, large-scale model fitting possesses a deeper and more transformative core value: (1) Achieving a leap from "perception" to "cognition". The waveform recorder accurately completes the "perception" function, objectively recording the real operating state of the physical world; while the large model focuses on the "cognition" level, and can learn the potential operating rules and patterns of the power source system under various operating conditions from massive historical data. This means that it can not only clarify "what" the waveform is, but also explain "why it is so" to a certain extent, and even predict "subsequent trends".

[0059] (2) Achieving "virtual sensing" and data augmentation. In some scenarios, directly installing a high-precision waveform recorder can lead to problems such as excessive cost or difficult construction. The large model can fit waveforms of points that are difficult to measure directly based on data from other easily measurable points, which is equivalent to building a "virtual sensor". At the same time, it can also generate a large amount of synthetic data that conforms to physical laws based on existing data, which can not only make up for the scarcity of real data, but also be used for simulation testing under extreme working conditions.

[0060] (3) Providing forward-looking decision support is the core advantage of this invention. Traditional monitoring systems often trace the root cause by analyzing waveform data after a fault or anomaly occurs; however, systems based on large models can achieve forward-looking analysis—fitting the current system state in real time and predicting the operating trend in the short term. Once the fitted waveform is detected to be trending toward a dangerous or inefficient state, an early warning can be issued before the actual fault occurs, reserving a valuable time window for scheduling decisions and achieving a leapfrog transformation from "passive response" to "active defense".

[0061] It should be noted that the specific embodiments described above are exemplary. Those skilled in the art can devise various solutions inspired by the disclosure of this invention, and these solutions all fall within the scope of this invention and its protection. Those skilled in the art should understand that this specification and its accompanying drawings are illustrative and not intended to limit the scope of the claims. The scope of protection of this invention is defined by the claims and their equivalents. This specification contains multiple inventive concepts; terms such as "preferredly," "according to a preferred embodiment," or "optionally" indicate that the corresponding paragraph discloses an independent concept. The applicant reserves the right to file divisional applications based on each inventive concept.

Claims

1. A method for fitting and verifying power source waveform data, characterized in that, Includes the following steps: Acquire multimodal raw waveform data from the power source; The raw waveform data is input into a pre-trained deep learning model, which includes a feature extraction module and a waveform fitting module. Using the dual-branch structure of the feature extraction module, the local spatial features and long-term and short-term temporal features of the original waveform data are extracted respectively, and the two are then fused. By utilizing the attention mechanism in the waveform fitting module, contextual modeling is performed on the fused features to reconstruct a high-precision fitted waveform curve. Based on the consistency between the fitted waveform curve and the original waveform data, the verification result of the power source is output.

2. The method according to claim 1, characterized in that, Before inputting the raw waveform data into the deep learning model, a preprocessing step is also included: padding the raw waveform data with null values ​​and correcting error values; and performing adaptive noise filtering on the data using wavelet transform. Transient outliers are detected and removed by combining the sliding window algorithm with the interquartile range method or the Z-score algorithm. The processed data is then normalized.

3. The method according to claim 1, characterized in that, The step of using the dual-branch structure of the feature extraction module to extract local spatial features and long-short-term temporal features of the original waveform data includes: extracting peaks and spikes in the waveform data as local spatial features through a multi-scale one-dimensional convolutional neural network in the first branch; extracting the dynamic pattern of waveform data evolution over time as long-short-term temporal features through a long-short-term memory network in the second branch; concatenating the local spatial features and the long-short-term temporal features along the feature dimension; and performing feature fusion through a fully connected layer.

4. The method according to claim 1, characterized in that, The training process of the deep learning model employs a data augmentation strategy, which includes: constructing a generative adversarial network (GAN) containing a generator and a discriminator, wherein the generator adopts a U-Net architecture and the discriminator adopts a PatchGAN structure; training the GAN adversarially using historical measured waveform data from a power source until the generator and discriminator reach Nash equilibrium; generating synthetic waveform data using the trained generator, and mixing the synthetic waveform data with the historical measured waveform data as the training set for the deep learning model.

5. The method according to claim 1, characterized in that, The step of using the attention mechanism in the waveform fitting module to perform context modeling on the fused features includes: processing the fused features using a Transformer encoder, which includes a position encoding module and a multi-head self-attention module; adding temporal position information to the feature sequence through the position encoding module; and using the multi-head self-attention module to calculate the association weights between data points in the feature sequence in parallel to capture long-distance dependencies between waveform segments.

6. The method according to claim 1, characterized in that, The step of outputting the power source verification result based on the consistency between the fitted waveform curve and the original waveform data includes: introducing a Monte Carlo Dropout mechanism to keep the randomly deactivated layers in the model active during the inference phase; performing multiple forward propagations on the same original waveform data to obtain multiple sets of prediction results; calculating the mean of the multiple sets of prediction results as the final fitted waveform curve, and calculating the variance of the multiple sets of prediction results as a confidence index; when the confidence index is lower than a preset threshold, determining that the power source waveform has an abnormality or uncertainty risk, and triggering an alarm.

7. The method according to claim 1, characterized in that, The verification results of the output power source also include: calculating the key parameters of the fitted waveform curve, the key parameters including RMS value, harmonic content and distortion; comparing the key parameters with the standard parameter library, and generating a test report containing calibration suggestions or fault diagnosis information.

8. An intelligent fitting and verification system for power source waveform data, characterized in that, include: A sensor array is used to acquire multimodal raw waveform data from a power source; The feature extraction module has a parallel structure consisting of CNN branches and LSTM branches; The waveform fitting module has a reconstruction structure consisting of a Transformer encoder and a random deactivation layer. In the case of multiple operating conditions switching, the CNN branch uses the convolution kernel to establish a local feature extraction relationship with the original data sequence to capture the waveform edge gradient; in the case of long-term monitoring, the LSTM branch uses the hidden unit to establish a state transfer relationship with the time series to capture the frequency envelope; in the case of inference verification, the waveform fitting module establishes a consistency judgment relationship with the standard parameter library according to the variance generated by multiple forward propagations to output the verification result of the power source.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 7.