Non-stationary data quantification processing method based on dynamic volatility perception
By combining online dynamic feature perception and a learnable non-uniform quantizer with dynamic composite loss function and gradient feedback optimization, the shortcomings of existing quantization methods in non-stationary data processing are addressed, achieving efficient and robust data quantization suitable for data processing such as photovoltaic power in edge devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING INST OF NEW ENE STOR MATER & EQUIP
- Filing Date
- 2025-12-25
- Publication Date
- 2026-04-14
AI Technical Summary
Existing quantization methods struggle to adaptively track drastic changes in data distribution when dealing with highly volatile and non-stationary energy time-series data. They also lack robustness to anomalous noise, leading to frequent quantization interval failures, sharp increases in errors, disruption of the time gradient structure, and impact on the performance of downstream tasks.
We employ an online dynamic feature sensing method based on the Welford algorithm, combined with a learnable non-uniform quantizer and a dynamic composite loss function. Through gradient feedback, we adaptively update the parameters to achieve end-to-end optimization of the non-uniform quantizer, ensuring that the quantization process maintains robustness and temporal characteristics under data fluctuations.
This system efficiently processes non-stationary data on resource-constrained edge devices, achieving high-precision quantification of data such as photovoltaic power while maintaining temporal dynamic characteristics. This enhances the system's robustness and prediction accuracy under complex operating conditions and reduces the difficulty of engineering implementation.
Smart Images

Figure CN121864102A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of data processing compression and machine learning technology, and more specifically, to a method for quantizing non-stationary data based on dynamic volatility perception. Background Technology
[0002] With the popularization of artificial intelligence and data acquisition technologies, more and more energy systems are beginning to record time-series data such as photovoltaic power, wind power output, and meter readings at high frequency. This type of data usually exhibits significant non-stationarity, and its statistical distribution changes rapidly in a short period of time due to external factors such as weather, shading, and equipment status, accompanied by violent fluctuations and sudden noise. In order to achieve real-time processing and transmission of this data on edge devices with limited resources, numerical quantization has become a commonly used compression method. However, traditional quantization methods generally rely on fixed intervals or static strategies, assuming that the data distribution is relatively stable. Therefore, when faced with non-stationary energy time-series data, they often cannot adapt to its dynamic changes, leading to frequent quantization interval failures, sharp increases in errors, increased noise sensitivity, and further disruption of the original time gradient structure, resulting in a significant decline in the performance of downstream tasks such as prediction, control, and anomaly detection. Especially on embedded nodes with only low-frequency CPUs and minimal storage space, it is difficult for existing methods to simultaneously ensure high robustness and high signal-to-noise ratio of quantization while retaining key time trend information. Therefore, there is an urgent need for a new quantization technology that can adaptively adjust to data fluctuations and maintain the dynamic characteristics of time. Summary of the Invention
[0003] This invention provides a non-stationary data quantization processing method based on dynamic volatility perception. The technical problem it solves is that existing quantization methods are difficult to adaptively track drastic changes in data distribution when processing energy time series data (such as photovoltaic power) with high volatility and non-stationary characteristics, and lack robustness to abnormal noise.
[0004] The objective of this invention is achieved through the following technical solution:
[0005] A non-stationary data quantification method based on dynamic volatility perception is characterized by the following steps:
[0006] Step 1, online dynamic feature perception, specifically includes:
[0007] S1: Continuously track and update photovoltaic data stream based on Welford algorithm Real-time volatility statistics ;
[0008] S2: Time dynamic feature calculation, which calculates the first-order difference sequence of the data stream in parallel;
[0009] Step 2: Learnable non-uniform quantizer geometry definition, specifically including:
[0010] S3: Quantizer parameter definition and initialization. Addressing the significant non-Gaussian distribution of photovoltaic power data, a quantizer parameter is defined using learnable parameters. The non-uniform quantizer is constructed;
[0011] Step 3: Dynamic composite loss function, specifically including:
[0012] S4: Construct a dynamic, time-aware composite loss function :
[0013]
[0014] in, For the dynamically robust distribution loss term, To preserve the loss term for the time structure, This is a balance coefficient used to weigh the relative importance between the fidelity of the statistical distribution and the preservation of its time dynamic characteristics;
[0015] S5: Calculate the dynamic robust distribution loss term ;
[0016] S6: Calculate the time structure preservation loss term ;
[0017] Step 4: End-to-end differentiable engine steps, specifically including:
[0018] S7: Uses a soft rounding function to approximate the discrete operation;
[0019] S8: Parameter adaptive update based on dynamic gradient feedback and N2UQ implementation.
[0020] The beneficial effects of this invention are:
[0021] This invention is particularly suitable for processing non-stationary, highly volatile time-series data collected and processed on resource-constrained edge computing devices (such as microcontrollers and IoT sensors), such as photovoltaic power generation data, wind power generation data, or smart meter data.
[0022] This invention combines differentiable optimization with N2UQ (non-uniform to uniform) strategy. On the one hand, it automatically learns the optimal non-uniform threshold through gradient descent, making it perfectly adaptable to the non-Gaussian multi-peak distribution of photovoltaic data. On the other hand, it ensures that the quantization output is a standard uniform integer stream through a mapping mechanism. Attached Figure Description
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described below with reference to the accompanying drawings.
[0024] A detailed description of the steps, including:
[0025] Figure 1 This is a schematic diagram of the overall process framework of the non-stationary data quantization processing method based on dynamic volatility perception of the present invention. Detailed Implementation
[0026] The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be understood that the preferred embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0027] like Figure 1 As shown in the figure, this invention provides a non-stationary data quantization processing method based on dynamic volatility perception. This method is designed as an end-to-end online processing pipeline, mainly comprising four tightly coupled processing steps: Step 1, online dynamic feature perception; Step 2, learnable non-uniform quantizer geometric definition; Step 3, dynamic composite loss function construction; Step 4, end-to-end differentiable optimization engine. The specific implementation principles of each step and its sub-steps are explained in detail below.
[0028] Step 1: Online Dynamic Feature Perception
[0029] The core of this step is to solve the problems of high latency and high storage consumption in traditional offline statistical methods when processing streaming data, while avoiding the loss of precision in floating-point calculations.
[0030] Specifically, the following steps are included:
[0031] S1: Real-time volatility tracking based on the Welford algorithm. In an online processing flow, the computationally efficient and numerically stable Welford online algorithm is used to continuously track and update the photovoltaic data stream. Real-time volatility statistics .
[0032] Furthermore, S1 specifically includes the following steps:
[0033] S11: State variable initialization. Before the processing flow begins, three scalar state variables are initialized in memory: time step counter. running average and the sum of aggregated squared differences These three variables only occupy register-level storage space and do not require caching of historical data windows.
[0034] S12: Incremental recursive update for each newly arrived data point To perform a single-pass update operation, first update the running mean using the following formula:
[0035]
[0036] Subsequently, the aggregated squared difference is updated using the difference between the running means before and after the update, as shown in the following formula:
[0037]
[0038] This recursive method avoids the "large number eats small number" phenomenon (catastrophic cancellation) that may occur when directly calculating the sum of squares, thus ensuring numerical stability.
[0039] S13: Real-time volatility estimation, based on current updates and Real-time calculation of volatility measures (i.e., standard deviation):
[0040]
[0041] This volatility measure Dynamically, it reflects the dispersion of the photovoltaic power signal. When the value is small, it indicates that the data distribution is stable; when A larger value indicates a violent fluctuation.
[0042] S2: Time dynamic feature calculation, which calculates the first-order difference sequence of the data stream in parallel.
[0043] Furthermore, S2 specifically includes:
[0044] S21: Differential feature extraction, calculating the data point at the current time. Compared with the data points of the previous time step The difference:
[0045]
[0046] This feature Physically, it represents the instantaneous rate of change of photovoltaic power data (e.g., the photovoltaic ramp rate).
[0047] This step explicitly extracts... This is intended to impose strong constraints on it in subsequent steps to prevent the loss of key trend information during the quantification process.
[0048] Step 2: Geometric Definition of Learnable Non-Uniform Quantizer
[0049] S3: Quantizer parameter definition and initialization. For photovoltaic power data exhibiting significant non-Gaussian distribution characteristics (such as multi-peak or skewed distribution), this embodiment defines a quantizer parameter that can be learned. The non-uniform quantizer is constructed.
[0050] Furthermore, S3 specifically includes the following steps:
[0051] S31: The parameters Includes a set of dynamically adjustable non-uniform input thresholds And an asymmetric zero-point parameter for correcting data center offset. These two types of parameters, together with the fixed uniform output level, constitute a deterministic mapping relationship from non-uniform to uniform (N2UQ).
[0052] Furthermore, the non-uniform input threshold Physical quantization intervals of varying widths are defined in the real number domain, and their intervals automatically scale with the data distribution density; while the zero-point parameters This serves as an anchor point to align the physical zeros of the data to a specific integer index; during quantization, it will fall into the range determined by adjacent non-uniform thresholds. All input data within the defined physical interval are forcibly mapped to the corresponding, evenly spaced standard integer indices in the output set.
[0053] This geometric definition ingeniously establishes a transformation structure that is "non-uniformly adapted to input and uniformly universal to output". It not only uses variable thresholds to achieve high-precision fitting of non-stationary energy data, but also ensures that the output data stream can be directly adapted to the standard integer arithmetic logic of general-purpose hardware.
[0054] S32: Quantile Initialization. To avoid getting stuck in local optima during the early stages of training, a quantile initialization strategy is adopted. Before training begins, a small batch of data is collected and the empirical cumulative distribution function (CDF) is calculated. Based on the target bit width, the values corresponding to the equally probable intervals on the CDF curve are selected as the initial thresholds. This ensures that each quantization interval contains approximately the same amount of data at the initial moment, maximizing the initial information entropy.
[0055] Step 3: Dynamic composite loss function
[0056] S4: Construct a dynamic, time-aware composite loss function As a "guide" for optimization:
[0057]
[0058] in, For the dynamically robust distribution loss term, To preserve the loss term for the time structure, This is a balance coefficient used to weigh the relative importance between the fidelity of the statistical distribution and the preservation of its temporal dynamic characteristics.
[0059] S5: Calculate the dynamic robust distribution loss term In this embodiment, Beta divergence is used as the core statistical metric, and a dynamic control mechanism is introduced.
[0060] Furthermore, S5 specifically includes the following steps:
[0061] S51: Beta divergence calculation is performed on the original data according to the generalized definition. And quantitative reconstruction of data Differences between them:
[0062]
[0063] in, It means Quantized reconstruction of data at each moment, representing the original data. The value obtained after mapping and dequantization by the non-uniform quantizer (step S3) is... The discretized approximation is given by this term. The existence of this term allows the loss function to directly assess the information distortion introduced by the quantization process.
[0064] This is a dynamic robustness parameter, which is the shape control parameter in the Beta divergence formula, used to adjust the sensitivity of the loss function to errors of different magnitudes. In this invention, It is not a fixed constant, but rather the real-time volatility calculated in step S1. Time-varying parameters that are dynamically determined.
[0065] S52: High-fidelity response during stable periods, assessing real-time volatility. (i.e., the first threshold) determines that the signal is stable.
[0066] At this time Set to approach 1 (e.g.) At this point, the Beta divergence converges to the KL divergence, and the loss function is very sensitive to subtle differences in the distribution, forcing the quantizer to fit the details of the data distribution to the extreme.
[0067] S53: Robust Response During Fluctuations
[0068] Judging if real-time volatility (i.e., the second threshold) determines whether the signal exhibits drastic fluctuations or outliers, at which point... Set to a value greater than 2 (e.g.) In this mode, the gradient penalty of the loss function on large error samples is significantly blunted, thereby automatically ignoring occasional spike noise in the optimization process and preventing the quantization threshold from being skewed by individual outliers.
[0069] S6: Calculate the time structure preservation loss term The loss term explicitly penalizes the difference between the first-order difference sequences before and after quantization.
[0070] Furthermore, S6 specifically includes the following steps:
[0071] S61: Quantization Differential Calculation
[0072] Calculate the first-order difference sequence of the quantized reconstructed data:
[0073] .
[0074] in,
[0075] for Quantized reconstruction of data at each moment, representing the original data. The value obtained after mapping and dequantization by a non-uniform quantizer (step S3).
[0076] S62: Trend consistency constraint, calculate the original difference. (Step S2) and the first-order difference of the quantized reconstructed data Mean squared error (MSE) between:
[0077]
[0078] By minimizing this term, it is enforced that the quantized data trajectory must maintain the same rising and falling trend as the original data, which is crucial for downstream prediction tasks that rely on gradient information.
[0079] Step 4: End-to-end Differentiable Engine Steps
[0080] S7: The discretization operation is approximated by a soft rounding function. Since the standard rounding operation is not differentiable, this embodiment adopts an approximation strategy.
[0081] Furthermore, S7 specifically includes the following steps:
[0082] S71: Construction of softening function
[0083] We employ a soft quantization (DSQ) strategy to construct a smooth step function based on hyperbolic tangent tanh. To simulate the rounding process:
[0084]
[0085] in, The center of the quantization interval, The hardness parameter controls the steepness of the function. This is a scalar parameter used to control the magnitude of the approximate function.
[0086] S72: Annealing strategy execution
[0087] Implement an annealing strategy during training: Set a small initial training level. This smooths the function to facilitate global gradient search; as the number of iterations increases, it gradually increases... The value ( ),make Ultimately, it approximates the standard hard rounding function, thereby eliminating the accuracy mismatch between training and inference.
[0088] S8: Parameter Adaptive Update and N2UQ Implementation Based on Dynamic Gradient Feedback
[0089] S8 specifically includes the following sub-steps:
[0090] S81: Gradient backpropagation, using the chain rule, combines the loss function. The gradient is softened by the gradient function. Feedback to non-uniform input threshold .
[0091] S82: Use an optimizer (such as Adam or SGD) based on the calculated non-uniform input threshold. The parameters are iteratively updated based on their location. Physically, this means that the input threshold will automatically cluster towards areas with higher data probability density (such as the daytime peak area of photovoltaic data), thereby maximizing the retention of information.
[0092] S83: Non-uniform to uniform mapping (N2UQ), during quantization, performs deterministic mapping: all data falling within the physical range are mapped. Data points within the range are forcibly mapped to a fixed, evenly spaced integer index, such as an 8-bit integer. .
[0093] This invention achieves a dynamic balance between statistical fidelity and noise robustness in non-stationary energy data. Addressing the characteristic of photovoltaic power and other data distributions that fluctuate dramatically with environmental changes, this invention abandons the traditional static loss function. Instead, it dynamically adjusts the control parameters of the Beta divergence by sensing the real-time volatility of the data stream online. This mechanism enables the quantization process to capture distribution details as sensitively as KL divergence when the data is stable, ensuring quantization accuracy. Conversely, when the data fluctuates drastically, it automatically reduces sensitivity to outliers, preventing the quantizer from being misled by noise, thereby significantly improving the system's robustness under complex operating conditions.
[0094] The design of N2UQ in this invention achieves a perfect decoupling of algorithm accuracy and hardware efficiency: at the algorithm level, high signal-to-noise ratio is obtained by using non-uniform partitioning, while at the hardware level, the output uniform integer stream can be directly processed by a general-purpose CPU / MCU without the need for dedicated decoding hardware. This achieves a unity of high accuracy of non-uniform quantization and high efficiency of general-purpose hardware. This means that edge devices that deploy this algorithm do not need to be equipped with dedicated non-uniform decoding hardware, and can be efficiently processed directly using the general instruction set of DSP or microcontroller, which greatly reduces the difficulty of engineering implementation.
[0095] This invention innovatively preserves the key temporal dynamics of time-series data. Existing quantization methods often focus only on restoring numerical values, neglecting the trend information of the time series. This invention, by explicitly introducing a time structure preservation term into the loss function, enforces the constraint that the quantized data must maintain the same first-order difference characteristics (i.e., ramp rate) as the original data. This effectively avoids erroneous quantization results of "numerical similarities but opposite trends," and can significantly maintain the prediction accuracy for downstream tasks that rely on gradient information, such as photovoltaic power prediction and grid fault detection.
[0096] As shown in Table 1 below, this invention, by introducing a dynamic volatility sensing mechanism and a learnable non-uniform quantization strategy, outperforms traditional methods in all key technical indicators, especially in addressing the non-stationarity of energy data and the dynamic characteristics of retention time, and has irreplaceable technical advantages.
[0097] Table 1
[0098]
[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A non-stationary data quantification method based on dynamic volatility perception, characterized in that, Includes the following steps: Step 1, online dynamic feature perception, specifically includes: S1: Continuously track and update photovoltaic data stream based on Welford algorithm Real-time volatility statistics ; S2: Time dynamic feature calculation, which calculates the first-order difference sequence of the data stream in parallel; Step 2: Learnable non-uniform quantizer geometry definition, specifically including: S3: Quantizer parameter definition and initialization. Addressing the significant non-Gaussian distribution of photovoltaic power data, a quantizer parameter is defined using learnable parameters. The non-uniform quantizer is constructed; Step 3: Dynamic composite loss function, specifically including: S4: Construct a dynamic, time-aware composite loss function : , in, For the dynamically robust distribution loss term, To preserve the loss term for the time structure, This is a balance coefficient used to weigh the relative importance between the fidelity of the statistical distribution and the preservation of its time dynamic characteristics; S5: Calculate the dynamic robust distribution loss term ; S6: Calculate the time structure preservation loss term ; Step 4: End-to-end differentiable engine steps, specifically including: S7: Uses a soft rounding function to approximate the discrete operation; S8: Parameter adaptive update based on dynamic gradient feedback and N2UQ implementation.
2. The non-stationary data quantification method based on dynamic volatility perception according to claim 1, characterized in that, Step S1 specifically includes the following steps: S11: State variable initialization. Before the processing flow begins, three scalar state variables are initialized in memory: time step counter. running average and the sum of aggregated squared differences ; S12: Incremental recursive update for each newly arrived data point To perform a single-pass update operation, first update the running mean using the following formula: , Subsequently, the aggregated squared difference is updated using the difference between the running means before and after the update, as shown in the following formula: ; S13: Real-time volatility estimation, based on current updates and Real-time calculation of volatility metrics: , This volatility measure Dynamically, it reflects the dispersion of the photovoltaic power signal. When the value is small, it indicates that the data distribution is stable; when A larger value indicates a violent fluctuation.
3. The non-stationary data quantization method based on dynamic volatility perception according to claim 2, characterized in that, Step S2 specifically includes the following steps: S21: Differential feature extraction, calculating the data point at the current time. Compared with the data points of the previous time step The difference: , This feature Physically, it represents the instantaneous rate of change of photovoltaic power data.
4. The non-stationary data quantization method based on dynamic volatility perception according to claim 1, characterized in that, The specific steps S3 are as follows Includes the following: S31: The parameters Includes a set of dynamically adjustable non-uniform input thresholds And an asymmetric zero-point parameter for correcting data center offset. These two types of parameters, together with a fixed uniform output level, constitute a deterministic mapping relationship from non-uniform to uniform; the non-uniform input threshold Physical quantization intervals of varying widths are defined in the real number domain, and their intervals automatically scale with the data distribution density; while the zero-point parameters This serves as an anchor point to align the physical zeros of the data to a specific integer index; during quantization, it will fall into the range determined by adjacent non-uniform thresholds. All input data within the defined physical interval are forcibly mapped to the corresponding, evenly spaced standard integer indices in the output set; S32: Quantile initialization. To avoid getting stuck in local optima in the early stages of training, a quantile initialization strategy is adopted.
5. The non-stationary data quantization method based on dynamic volatility perception according to claim 3, characterized in that, Step S5 specifically includes the following steps: S51: Beta divergence calculation is performed on the original data according to the generalized definition. And quantitative reconstruction of data Differences between them: , in, It means Quantized reconstruction of data at each moment, representing the original data. The value obtained after mapping and dequantizing using a non-uniform quantizer is Discretized approximation, For dynamic robustness parameters; S52: High-fidelity response during stable periods, assessing real-time volatility. The signal is determined to be stable, at which point... When set to approach 1, the Beta divergence converges to the KL divergence. The loss function is very sensitive to subtle differences in the distribution, forcing the quantizer to fit the details of the data distribution to the extreme. S53: Robust response during periods of volatility, assessing real-time volatility. If the signal is determined to have drastic fluctuations or outliers, then... When set to a value greater than 2, the gradient penalty of the loss function on large error samples is significantly blunted in this mode, so that the optimization process automatically ignores occasional spike noise and prevents the quantization threshold from being skewed by individual abnormal data.
6. The non-stationary data quantization method based on dynamic volatility perception according to claim 5, characterized in that, Step S6 specifically includes the following steps: S61: Quantization difference calculation, calculating the first-order difference sequence of the quantized reconstructed data: , in, for Quantized reconstruction of data at each moment, representing the original data. The value obtained after mapping and dequantizing by a non-uniform quantizer; S62: Trend consistency constraint, calculate the original difference. First-order difference of quantized reconstructed data Mean squared error (MSE) between: , By minimizing this factor, it is enforced that the quantized data trajectory must maintain the same upward and downward trend as the original data.
7. The non-stationary data quantization method based on dynamic volatility perception according to claim 1, characterized in that, Step S7 specifically includes the following steps: S71: Construction of the softening function: A soft quantization strategy is employed to construct a smooth step function based on the hyperbolic tangent tanh. To simulate the rounding process: , in, The center of the quantization interval, The hardness parameter controls the steepness of the function. This is a scalar parameter used to control the magnitude of the approximate function; S72: Annealing strategy execution Implement an annealing strategy during training: Set a small initial training level. This smooths the function to facilitate global gradient search; as the number of iterations increases, it gradually increases... The value of makes Ultimately, it approximates the standard hard rounding function, thereby eliminating the accuracy mismatch between training and inference.
8. The non-stationary data quantization method based on dynamic volatility perception according to claim 1, characterized in that, Step S8 specifically includes the following steps: S81: Gradient backpropagation, using the chain rule, combines the composite loss function. The gradient is softened by the gradient function. Feedback to non-uniform input threshold ; S82: Use the optimizer based on the calculated non-uniform input threshold. The parameters are iteratively updated at the position; S83: Non-uniform to uniform mapping; during quantization, a deterministic mapping is performed: all data falling within the physical region are included. The data points within are forcibly mapped to a fixed, evenly spaced integer index.
Citation Information
Cited By
Large model quantification conditional backdoor defense method and system based on micro-rounding optimization
CN122053260A