Power grid waveform data lossless compression method, decompression method, equipment, medium and program product

By employing periodic sensing, differential coding, and adaptive quantization, lossless compression of power grid waveform data is achieved, solving the problems of high compression ratio and low computational overhead on resource-constrained platforms and realizing efficient lossless reconstruction and data compression.

CN121643771APending Publication Date: 2026-03-10SHANGHAI HOLYSTAR INFORMATION TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511849090.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-09
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies struggle to balance high compression ratios, low computational overhead, and lossless compression requirements on resource-constrained embedded platforms, impacting the accuracy of power quality analysis and fault location.

Method used

A combination of periodic sensing, differential coding, adaptive quantization, and entropy coding is used to segment power grid waveform data, extract differential information, dynamically determine quantization parameters, generate compressed data through entropy coding, and associate and store feature parameters to achieve lossless reconstruction.

Benefits of technology

It achieves high compression ratio and lossless reconstruction under low power conditions, reduces data redundancy, improves compression efficiency, and is suitable for resource-constrained low-power embedded platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121643771A_ABST
    Figure CN121643771A_ABST
Patent Text Reader

Abstract

The invention provides a lossless compression method and decompression method for power grid waveform data, equipment, a medium and a program product, and the method comprises the steps: carrying out the periodic feature analysis of the original sampling data of a power grid waveform, so as to determine the periodic structure of the original sampling data, and carrying out the segmentation processing of the original sampling data based on the periodic structure; for the sampling data in each segment, extracting differential information between adjacent sampling points to form a differential data sequence; dynamically determining a corresponding quantization parameter based on the statistical distribution characteristic of the differential data sequence, and performing adaptive quantization processing on the differential data sequence to generate quantized differential data; and entropy coding processing is carried out on the quantized differential data to generate compressed data used for representing the original sampling data, and characteristic parameters used for reconstructing the original sampling data are stored in the compressed data in an associated mode. Unification of high compression ratio, low power consumption and strict lossless reconstruction is realized, and the application requirements of long-term monitoring and remote transmission of the edge side can be met.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of power system data processing, and particularly relates to a power grid waveform data lossless compression method, a decompression method, equipment, a medium and a program product. BACKGROUND

[0002] With the continuous development of smart grid and edge computing technology, power quality monitoring devices are increasingly widely deployed in on-site environments such as substations and distribution rooms, and are used for real-time collection and analysis of power grid operation waveforms such as voltage and current. Such devices are usually built based on low-power microcontrollers such as ARM Cortex-M series and RISC-V, and are generally characterized by limited storage space, limited computing power, and constrained energy supply due to their hardware structure characteristics.

[0003] Power grid waveform data (for example, 50Hz or 60Hz sine signals and their harmonic components) exhibits obvious periodicity and high correlation in the time dimension, providing a theoretical basis for data compression. However, existing general compression algorithms (such as ZIP, LZW, etc.) can achieve high compression rates, but generally have high computational complexity and large memory occupancy, making it difficult to run efficiently on resource-constrained embedded platforms, which is not conducive to meeting real-time processing requirements. While some existing lightweight compression methods (such as differential encoding, run-length encoding, etc.) have the advantages of simple structure and low implementation cost, their compression efficiency for power grid waveform data is limited, and in some scenarios it is difficult to ensure complete lossless restoration of the data, which may affect the accuracy of subsequent power quality analysis, fault location, and operation evaluation.

[0004] Therefore, under the resource constraints of low-power embedded platforms, how to achieve compression processing with high compression rate and low computational overhead while ensuring strict lossless power grid waveform data remains a technical problem to be solved in the field. SUMMARY

[0005] In view of the deficiencies in the prior art, the present application provides a power grid waveform data lossless compression method, a decompression method, equipment, a medium and a program product, at least to solve the problem that the prior art cannot simultaneously consider high compression rate, low computational overhead and lossless compression requirements in a resource-constrained embedded environment.

[0006] To achieve the above-mentioned purposes and other advantages, some embodiments of the present application provide the following aspects:

[0007] In a first aspect, some embodiments of the present application provide a power grid waveform data lossless compression method applied to a low-power embedded platform, comprising:

[0008] Periodic feature analysis is performed on the raw sampled data of the power grid waveform to determine the periodic structure of the raw sampled data, and the raw sampled data is segmented based on the periodic structure.

[0009] For the sampled data within each segment, the difference information between adjacent sampling points is extracted to form a difference data sequence;

[0010] Based on the statistical distribution characteristics of the differential data sequence, the corresponding quantization parameters are dynamically determined, and the differential data sequence is subjected to adaptive quantization processing to generate quantized differential data.

[0011] The quantized differential data is entropy encoded to generate compressed data representing the original sampled data, and feature parameters for reconstructing the original sampled data are stored in association within the compressed data.

[0012] Secondly, some embodiments of this application provide a lossless decompression method for power grid waveform data, applied to a low-power embedded platform, including:

[0013] The variable-length coded sequence and the characteristic parameters associated with the variable-length coded sequence are parsed from the compressed data obtained by lossless compression of power grid waveform data. The characteristic parameters include: a period length parameter for characterizing the basic periodic structure of the power grid waveform, a statistical parameter for characterizing the data distribution characteristics of each period, and a quantization level for indicating the quantization rule used in each period.

[0014] Based on the period length parameter, the decoding boundary and the number of target decoding symbols corresponding to each period are determined, and based on the pre-stored entropy encoding lookup table, anti-entropy decoding processing is performed on the variable-length encoding sequence to obtain a quantized differential data sequence divided by period.

[0015] Based on the quantization level, the quantized differential data sequence is dequantized to obtain the corresponding differential data sequence;

[0016] The inverse difference starting position of each period is determined based on the period length parameter, and the inverse difference accumulation operation is performed on the difference data sequence of each period to recover the sampled value sequence of each period.

[0017] The amplitude correction and continuity adjustment of the sampled value sequence of each period are performed in combination with the statistical parameters, and the sampled value sequence of each period is spliced ​​and reconstructed in period order to obtain power grid waveform data that is consistent with the original sampled data corresponding to the compressed data.

[0018] Thirdly, some embodiments of this application also provide an electronic device, the electronic device comprising:

[0019] One or more processors; and a memory storing computer program instructions, which, when executed, cause the processors to perform a lossless compression method for power grid waveform data or a lossless decompression method for power grid waveform data as described above.

[0020] Fourthly, some embodiments of this application also provide a computer-readable storage medium having a computer program and / or instructions stored thereon, wherein the computer program and / or instructions, when executed by a processor, implement the lossless compression method for power grid waveform data or the lossless decompression method for power grid waveform data as described above.

[0021] Fifthly, some embodiments of this application also provide a computer program product, including a computer program and / or instructions, which, when executed by a processor, implement the lossless compression method for power grid waveform data or the lossless decompression method for power grid waveform data as described above.

[0022] Compared with existing technologies, the solution provided in this application addresses the characteristics of power grid waveform data, which are characterized by strong periodicity and high correlation. It constructs a compression processing flow centered on "period sensing, differential coding, adaptive quantization, and entropy coding," forming a novel lossless compression algorithm for power grid waveforms specifically designed for embedded low-power systems. This solution effectively reduces the redundancy of power grid waveform data while ensuring lossless data restoration, enabling data to be represented with a smaller bit width, thereby significantly improving compression efficiency. Compared with existing technologies that rely on fixed segmentation or general compression algorithms, this application fully utilizes the periodicity and differential characteristics of power grid waveforms, achieving an adaptive balance between quantization accuracy and coding efficiency. It can still operate stably under extremely low CPU load and memory usage conditions, making it particularly suitable for resource-constrained low-power embedded platforms. Simultaneously, the associated storage of feature parameters provides accurate reconstruction basis for the decompression stage, effectively avoiding waveform distortion and error accumulation, achieving a unity of high compression ratio, low power consumption, and strictly lossless reconstruction, meeting the application requirements of long-term monitoring and remote transmission at the edge. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other implementation methods can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a flowchart illustrating a lossless compression method for power grid waveform data provided in an embodiment of this application;

[0025] Figure 2This is a flowchart illustrating a lossless decompression method for power grid waveform data provided in an embodiment of this application;

[0026] Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0028] First Embodiment

[0029] The first embodiment of this application relates to a lossless compression method for power grid waveform data, applied to a low-power embedded platform. The low-power embedded platform can be a microcontroller-based processing platform, such as a control system built using ARM Cortex-M series microcontrollers, RISC-V architecture microcontrollers, MSP430 series, STM32 series, or other processing chips with low-power characteristics. Such platforms typically have lower clock speeds, limited on-chip storage resources, but strong power consumption control capabilities, making them suitable for edge-side data acquisition and preprocessing scenarios. The low-power embedded platform can also be a power monitoring terminal, power quality analyzer, smart meter, or distribution automation terminal, which uses a built-in processing unit to process the acquired voltage and current waveform data in real time and complete lossless compression calculations under limited power consumption conditions. (Refer to...) Figure 1 As shown, the method may include the following steps:

[0030] Step S1: Perform periodic feature analysis on the raw sampled data of the power grid waveform to determine the periodic structure of the raw sampled data, and segment the raw sampled data based on the periodic structure.

[0031] In this embodiment, step S1 specifically includes:

[0032] Step S101: Scan the original sampling data within a preset time window, calculate the correlation value under different time delay conditions based on the autocorrelation characteristics of the original sampling data, and construct the autocorrelation distribution curve;

[0033] Step S102: In the autocorrelation distribution curve, according to the correlation extreme value determination rule, select the time delay when the correlation value reaches its maximum and satisfies the stability constraint as the basic period of the original sampling data;

[0034] Step S103: Based on the basic period, perform periodic alignment processing on the original sampled data, and periodically segment the original sampled data according to the basic period.

[0035] Specifically, the raw sampled data is continuously written from the analog-to-digital converter interface (ADC interface) to the sampling buffer at a fixed sampling frequency. The buffer is stored using a circular queue or a linear array structure, and the buffer length corresponds to the number of sampling points within a preset time window. After the buffer is full or the preset window length is reached, a continuous data sequence is read from the buffer, denoted as X[n], where n is the sampling point number.

[0036] Before performing period detection, the raw sampled data is preprocessed. Preprocessing may include DC component removal, simple digital filtering, or outlier suppression. For example, moving averages or low-pass filtering can be used to smooth high-frequency noise in the sampled sequence, improving the stability of autocorrelation calculations and the accuracy of period detection.

[0037] Subsequently, a linear scanning method with increasing sampling point numbers is used to traverse the continuous data sequence. For different time delays τ (τ corresponds to different sampling point offsets), the autocorrelation values ​​between X[n] and X[n+τ] are calculated sequentially. The correlation results under the corresponding delay are obtained by multiplying and accumulating the data in the overlapping interval point by point.

[0038] In this correlation calculation process, each sampling point participates in only a finite number of multiplication and accumulation operations. The overall calculation process does not require the construction of high-dimensional matrices or the execution of frequency domain transformation operations. Its processing path relies solely on a linear traversal of the sampled data sequence, making the time complexity of the correlation calculation linearly related to the number of sampling points, i.e., O(n). This linear complexity characteristic allows the periodic detection process to maintain stable computational efficiency even as the number of sampling points increases, reducing the computational load of the algorithm and making it more suitable for implementation in low-power embedded platform environments.

[0039] Meanwhile, to further adapt to the computing power of MCUs (microprocessors), the correlation calculation process avoids complex floating-point operations and preferably uses fixed-point or integer operations. By traversing multiple delay points, a discrete correspondence table between delay offsets and correlation values ​​is formed, which can be regarded as a discrete autocorrelation distribution curve.

[0040] According to the preset correlation extreme value determination rules, the autocorrelation distribution curve is scanned and analyzed. Specifically, the main correlation peak with zero delay is first ignored, and then local correlation maximum points are searched within the remaining delay range. By comparing the correlation value amplitudes of adjacent delay points, delay positions that satisfy the condition that "the current correlation value is greater than the adjacent correlation values ​​and the corresponding amplitude exceeds a set threshold" are identified. Among multiple candidate delays, the stability of the candidate points is further judged, for example, whether the correlation value changes of multiple points near the delay are gradual, thereby eliminating pseudo-periods caused by noise or transient fluctuations. Finally, the delay values ​​that satisfy both correlation strength and stability conditions are converted into the form of the number of sampling points, which serves as the basic period length of the current original sampling data.

[0041] Using the number of sampling points corresponding to the basic cycle as the alignment benchmark, the starting point of the original sampling data is corrected to ensure that each cycle segment starts from the cycle start point, avoiding data breaks or edge distortions caused by cycle misalignment. After completing cycle alignment, the original sampling data is periodically segmented according to the basic cycle, dividing the continuous sampling data into multiple cycle segments. Each cycle segment corresponds to a complete power grid cycle or a preset number of integer cycles, forming a segmented data sequence with a clear structure and consistent cycle.

[0042] Through the processing in steps S101 to S103 above, this embodiment performs periodic detection and segmentation of power grid waveform data based on autocorrelation characteristics, achieving automatic identification and accurate division of the basic period. This periodic detection process only requires a single linear scan of the original sampled data to complete correlation calculation and extreme value determination, eliminating the need for complex frequency domain transformations or multiple iterative calculations. This significantly reduces the overall computational complexity of the algorithm, making it more suitable for the resource constraints of low-power embedded platforms.

[0043] Step S2: For the sampled data in each segment, extract the differential information between adjacent sampling points to form a differential data sequence.

[0044] In this embodiment, step S2 specifically includes:

[0045] Step S201: For the sampled data within each period segment, select adjacent sampling point pairs in sequence according to the sampling order, use the previous sampling point as the reference value, and perform differential calculation on the next sampling point to obtain the corresponding differential value.

[0046] Step S202: Sequentially arrange the differential values ​​to form a differential data sequence that reflects the waveform change trend within the period.

[0047] Specifically, the sampled data within each period segment is read sequentially according to the sampling time order, and let the consecutive sampling points within the period be X. i and X i-1Using the previous sampling point as a baseline, the current sampling point X is... i Perform the difference calculation to obtain the corresponding difference value Δ i =X i -X i-1 , where i is an integer index ranging from 1 to N, and N is the total number of sampling points within a single cycle. Since the power grid waveform exhibits good continuity within a cycle, the variation amplitude between adjacent sampling points is typically small. Therefore, the absolute value of the difference is much smaller than the amplitude range of the original sampling values, thus achieving effective convergence of the data's dynamic range. For example, when the original sampling sequence is [100, 101, 103, 102], after differential processing, the difference sequence [1, 2, -1] can be obtained, with a significantly reduced numerical amplitude, which is more beneficial for subsequent encoding processing.

[0048] Each difference value is serialized and arranged according to its corresponding sampling order to form a difference data sequence that reflects the waveform change trend within the period. This difference data sequence can not only completely represent the relative change relationship of the original waveform, but also, because its values ​​are usually concentrated in a small range, which is only one-tenth or even less of the variation range of the original sample values ​​(e.g., within the range of ±10 to ±100), subsequent adaptive quantization and entropy coding can use less representation bit width, thereby achieving higher compression efficiency while ensuring data reversibility.

[0049] Through the differential encoding processing in steps S201 to S202 above, this embodiment effectively utilizes the signal characteristics of small changes between adjacent points of the power grid waveform and strong overall continuity, converting the original sampled data into a differential form with a narrower numerical range and higher information density, thereby reducing data redundancy and improving subsequent compression efficiency.

[0050] Step S3: Based on the statistical distribution characteristics of the differential data sequence, dynamically determine the corresponding quantization parameters and perform adaptive quantization processing on the differential data sequence to generate quantized differential data.

[0051] In this embodiment, step S3 specifically includes:

[0052] Step S301: Perform statistical analysis on the difference data sequence to extract parameters representing the distribution range, fluctuation amplitude, and concentration degree of the difference values.

[0053] The difference values ​​in the difference data sequence are traversed and scanned to calculate their maximum and minimum values ​​to obtain the distribution range of the difference data. Simultaneously, the absolute value variation of the difference values ​​is statistically analyzed to characterize the fluctuation range. Furthermore, by calculating the frequency or concentration of each difference value within different intervals (e.g., the percentage falling into a certain central interval), a concentration parameter reflecting the distribution state of the difference values ​​is extracted. These statistical parameters can determine whether the difference data sequence exhibits characteristics of "small-amplitude concentrated fluctuations" or "wide-range dispersed distribution," thus providing a basis for subsequent quantitative-level decisions.

[0054] Step S302: Input the distribution range, fluctuation amplitude and concentration parameters into the quantization decision model that is preset and stored in the low power embedded platform. The quantization decision model adaptively selects the target quantization parameter that matches the distribution characteristics of the differential data sequence from multiple preset quantization levels according to the preset judgment rules. The target quantization parameter is used to define the effective representation range of the differential data and corresponds to different quantization interval widths.

[0055] The quantization decision model is pre-defined and stored in the non-volatile memory of the low-power embedded platform during the system initialization phase. It includes judgment rules and a set of threshold parameters describing the correspondence between the distribution characteristics of the differential data and the quantization level. This quantization decision model takes distribution interval parameters, fluctuation amplitude parameters, and concentration parameters as inputs, and generates a comprehensive evaluation result through a weighted evaluation method. This result characterizes the degree of quantization accuracy required by the current differential data sequence.

[0056] Specifically, a comprehensive evaluation function F can be defined, for example: F = α × R + β × σ - γ × C, where R is the effective range of the differential data, σ is the fluctuation amplitude, C is the concentration degree, and α, β, and γ are preset weight coefficients. Preset judgment rules are used to classify the quantization accuracy requirements based on the distribution characteristics of the differential data. This is achieved by comparing the comprehensive evaluation result calculated based on the distribution interval parameter, fluctuation amplitude parameter, and concentration degree parameter with a preset threshold interval to determine the quantization accuracy requirement level corresponding to the current differential data, and then matching the corresponding quantization level accordingly.

[0057] Multiple quantization levels are pre-set as candidate quantization schemes. Different quantization levels correspond to different encoding bit widths and the number of quantization intervals, such as 4-bit quantization (16 quantization intervals), 6-bit quantization (64 quantization intervals), and 8-bit quantization (256 quantization intervals). During the operation of the quantization decision model, the quantization effect of each quantization level is simulated sequentially, and their coverage of the effective range of differential data and quantization error are compared. The selection is based on the principle of "prioritizing the use of lower bit width quantization levels under the condition of satisfying effective coverage".

[0058] For example, if statistical results show that at least 90% of the difference values ​​in the difference data sequence are distributed within the range of ±10, and the fluctuation amplitude parameter indicates that the overall change of the difference data is small, then it is determined that the current difference data exhibits a highly concentrated distribution characteristic. The quantization decision model preferentially selects a 4-bit quantization level as the target quantization parameter, so that the difference data is encoded with a lower bit width. When the distribution range of the difference data expands or the concentration is lower than the preset threshold, a 6-bit or 8-bit quantization level is selected accordingly to improve quantization accuracy and ensure the reliability of lossless reconstruction.

[0059] Different quantization levels correspond to different numbers of quantization intervals and different quantization interval widths. Specifically, a smaller quantization bit width results in fewer quantization intervals and a larger width for each individual quantization interval; conversely, a larger quantization bit width results in more quantization intervals and a smaller width for each individual quantization interval. The target quantization parameters determined in this way define the effective representation range of the differential data and the quantization interval division rules, enabling the differential data to be expressed with the minimum necessary coding bit width while meeting reconstruction accuracy requirements, thereby achieving an adaptive balance between compression efficiency and reconstruction accuracy.

[0060] Meanwhile, the quantization level information is recorded in the form of a compressed identifier during the adaptive quantization process, requiring only 1 to 2 bits of storage space. This is used to identify the quantization level used in the current cycle, thereby providing a clear quantization basis for the subsequent decompression stage without significantly increasing the storage load, and further improving the overall compression efficiency.

[0061] Step S303: Based on the effective representation range determined by the target quantization parameters, normalize each difference value in the difference data sequence so that the difference value is mapped to the corresponding quantization value range.

[0062] Based on the target quantization parameters determined in step S302, the effective representation range of the difference data is obtained, for example... Then, each difference value in the difference data sequence is iterated and processed. When a certain difference value is less than... When, limit it to When a certain difference value is greater than When, limit it to This avoids interference from extreme outliers in the quantization process and ensures the stability of the quantization mapping. After boundary constraint processing, a normalization transformation is performed on the difference values ​​within the effective representation range. This is done by linearly mapping the difference values ​​to the effective representation range, converting them into a standardized numerical range that matches the number of quantization intervals. For example, by performing offset and translation operations on the difference values, they are mapped to a numerical interval starting from zero, or to a continuous numerical interval corresponding to the number of quantization intervals, allowing difference data at different amplitude scales to participate in quantization processing under a unified reference system.

[0063] Step S304: Divide the difference value into intervals according to the quantization interval width corresponding to the target quantization parameter, and use the encoded value of each quantization interval as the quantization representation of the corresponding difference value.

[0064] Once the target quantization parameters are determined, the corresponding quantization interval width can be obtained. This width represents the range of values ​​covered by each quantization interval. Using the quantization interval width as the step size, multiple consecutive quantization intervals are constructed sequentially within the effective representation range of the normalized difference data. Each quantization interval corresponds to a unique quantization code value. For each difference value in the difference data sequence, its quantization interval position is determined based on its magnitude, and the difference value is mapped to the quantization code value of the corresponding quantization interval. The quantization code value then replaces the original difference value for subsequent encoding processing.

[0065] For example, when the target quantization parameter is 4-bit quantization, corresponding to 16 quantization intervals, the effective range of the normalized differential data is divided into 16 consecutive intervals, each interval corresponding to a coded value from 0 to 15. When a differential value falls within the k-th quantization interval, the coded value k is used as the quantization representation of that differential value. Through this method, the differential data, originally represented by multiple bits, is converted into a fixed-length quantization code, achieving bit width compression of the differential data while maintaining its reversible descriptive ability regarding the trend of numerical changes.

[0066] Through the processing in steps S301 to S304 above, an adaptive quantization mechanism based on the distribution characteristics of differential data is constructed. This mechanism allows the quantization bit width to be dynamically adjusted according to the concentration of the differential data. Under the premise of meeting the requirements of lossless reconstruction, lower bit widths are preferentially used for encoding, thereby effectively reducing the encoding space occupied by differential data and significantly reducing data bit width redundancy. This adaptive quantization mechanism avoids the over-encoding problem caused by fixed quantization, making the data representation more closely match the actual waveform change characteristics. While improving compression efficiency, it significantly reduces the computational complexity and storage overhead on low-power embedded platforms.

[0067] Step S4: Perform entropy encoding on the quantized differential data to generate compressed data representing the original sampled data, and store the feature parameters used to reconstruct the original sampled data in the compressed data.

[0068] In this embodiment, step S4 specifically includes:

[0069] Step S401: Perform offline statistical analysis on the quantized encoded values ​​of the pre-collected typical power grid waveform sample data after differential processing and adaptive quantization processing, obtain the frequency distribution of the quantized encoded values, and construct an entropy encoding mapping relationship that matches the characteristics of the power grid waveform based on the frequency distribution. Convert the entropy encoding mapping relationship into an encoding lookup table and pre-store it in the read-only storage area of ​​the low-power embedded platform.

[0070] Before system deployment, representative typical power grid waveform sample data are collected in advance. Period segmentation, differential processing, and adaptive quantization are then performed on this sample data sequentially to obtain the corresponding quantized code value sequence. Offline statistical analysis is then performed on this quantized code value sequence to calculate the frequency of each quantized code value in the sample data and construct its probability distribution model.

[0071] Based on a probability distribution model, Huffman coding is used to generate an entropy coding mapping relationship that matches the statistical characteristics of power grid waveform data. This entropy coding mapping relationship is then converted into a coding lookup table for storage. The coding lookup table is permanently stored in the read-only memory area (such as ROM or Flash area) of the low-power embedded platform, with a storage capacity of approximately 1KB, so that it can be directly accessed during operation, avoiding the computational load caused by real-time generation of coding rules.

[0072] Each record in the encoding lookup table corresponds to a quantized encoding value and its corresponding variable-length encoding sequence, which allows high-frequency quantized encoding values ​​to be assigned shorter encoding lengths, thereby improving overall compression efficiency.

[0073] Step S402: During the operation of the low-power embedded platform, the pre-stored encoding lookup table is directly read to map the quantized encoding values ​​in the quantized differential data to the corresponding variable-length encoding sequences for generating compressed data.

[0074] During operation of the low-power embedded platform, after completing the adaptive quantization processing of the differential data and obtaining the quantized differential data sequence, the encoding rules are not recalculated. Instead, the corresponding mapping relationship is directly read from the pre-stored encoding lookup table, mapping each quantized encoding value in the quantized differential data to the corresponding variable-length encoding sequence. That is, the quantized encoding values ​​are read one by one according to the order of the quantized differential data sequence, and the corresponding variable-length encoding sequence is read from the encoding lookup table using the quantized encoding value as an index. Subsequently, the read variable-length encoding sequences are sequentially concatenated into the compressed data buffer to form a continuous bit stream, which serves as the compressed data for the current period, realizing the conversion of quantized differential data into a high-compression-rate encoding form.

[0075] Step S403: While generating compressed data, the feature parameters used to characterize the lossless reconstruction rules are associated and stored with the variable-length coding sequence, so that the decoding end can collaboratively complete the lossless reconstruction of the original sampled data based on the variable-length coding sequence and feature parameters.

[0076] In this embodiment, the feature parameters used to characterize the lossless reconstruction rules include: a period length parameter characterizing the basic periodic structure of the power grid waveform; statistical parameters characterizing the data distribution characteristics of each period, including the average value and standard deviation of the corresponding period; and a quantization level indicating the quantization rule used in each period. The feature parameters are stored in association using a compact encoding method, requiring only about 10 to 20 bits per period to describe the periodic structure, statistical characteristics, and quantization level. This ensures reconstruction accuracy while keeping the storage cost of control information extremely low.

[0077] After entropy encoding is performed on the data segments for each period, the period length parameter, average value parameter, standard deviation parameter, and quantization level parameter corresponding to that period are encapsulated as periodic feature information. This periodic feature information is then bound and stored with the corresponding variable-length coded sequence according to a preset data format. For example, the feature parameters can be written as frame header information to the front end of the compressed data stream, or stored as structured data blocks along with the compressed bit stream in a non-volatile storage medium, so that each variable-length coded sequence has a clear basis for reconstruction.

[0078] Among the feature parameters, the period length parameter is used to determine the decoding boundary and reconstruction length corresponding to each period during decompression; the mean and standard deviation are used to assist in restoring the amplitude distribution characteristics of the waveform in each period and to perform amplitude correction; the quantization level parameter is used to indicate the quantization rule used for the corresponding period, thereby guiding the decoder to accurately perform inverse quantization processing. By associating and storing the feature parameters with the variable-length coding sequence in a one-to-one correspondence, it is ensured that after the decoder obtains the compressed data, it can collaboratively complete data parsing, inverse entropy decoding, inverse quantization, and inverse differential processing based on the variable-length coding sequence and feature parameters, achieving strict lossless reconstruction of the original sampled data.

[0079] Through the processing in steps S401 to S403 above, offline statistical analysis is performed on typical power grid waveform sample data, and an entropy coding mapping relationship is pre-constructed. This ensures that the entropy coding rules fully conform to the actual probability distribution characteristics of the quantized coded values ​​in the power grid waveform. During operation, there is no need to dynamically calculate the coding model; variable-length coding mapping can be completed simply by looking up a table. This effectively reduces the computational complexity and power consumption in the online coding stage, making it particularly suitable for resource-constrained low-power embedded platforms. Simultaneously, variable-length coding of the quantized differential data based on the coding lookup table results in shorter coding lengths for high-frequency quantized coded values, further compressing the data volume, improving the overall compression ratio, and reducing storage space and communication bandwidth usage.

[0080] In summary, the solution provided in this application addresses the characteristics of power grid waveform data, which are characterized by strong periodicity and high correlation. It constructs a compression processing flow centered on "period sensing, differential coding, adaptive quantization, and entropy coding," forming a novel lossless compression algorithm for power grid waveforms specifically designed for embedded low-power systems. This solution effectively reduces the redundancy of power grid waveform data while ensuring lossless data restoration, enabling data to be represented with a smaller bit width, thereby significantly improving compression efficiency. Compared with existing technologies that rely on fixed segmentation or general compression algorithms, this application fully utilizes the periodicity and differential characteristics of power grid waveforms, achieving an adaptive balance between quantization accuracy and coding efficiency. It can still operate stably under extremely low CPU load and memory usage conditions, making it particularly suitable for resource-constrained low-power embedded platforms. Simultaneously, the associated storage of feature parameters provides accurate reconstruction basis for the decompression stage, effectively avoiding waveform distortion and error accumulation, achieving a unity of high compression ratio, low power consumption, and strictly lossless reconstruction, meeting the application requirements of long-term monitoring and remote transmission at the edge.

[0081] Second Embodiment

[0082] The second embodiment of this application relates to a lossless decompression method for power grid waveform data, applied to a low-power embedded platform, as described above. Figure 2 As shown, the method may include the following steps:

[0083] Step A1: Parse the variable-length coded sequence and the associated characteristic parameters from the compressed data obtained by lossless compression of the power grid waveform data. The characteristic parameters include: the period length parameter used to characterize the basic periodic structure of the power grid waveform, the statistical parameter used to characterize the data distribution characteristics of each period, and the quantization level used to indicate the quantization rule adopted for each period.

[0084] In the power grid monitoring equipment of the low-power embedded platform, a decompression unit for power grid waveform data is provided to receive compressed data output from the compression end. The compressed data is encapsulated according to a preset data frame structure, which includes a variable-length coded sequence and characteristic parameters associated with the variable-length coded sequence.

[0085] The decompression unit parses the frame header of the received compressed data, distinguishes between the data area and the parameter area according to the preset data format identifier, extracts the variable-length encoded sequence, and parses the characteristic parameter information corresponding to the variable-length encoded sequence. The characteristic parameters include: the period length parameter used to characterize the basic periodic structure of the power grid waveform, the statistical parameters used to characterize the data distribution characteristics of each period (such as the average value and standard deviation of the corresponding period), and the quantization level parameter used to indicate the quantization rule adopted for each period.

[0086] During the parsing process, the decompression unit determines the period boundary basis for subsequent data processing based on the period length parameter, obtains the distribution characteristic information of each period data based on the statistical parameters, and determines the corresponding dequantization rules based on the quantization level parameter, providing accurate control parameters for subsequent anti-entropy decoding, dequantization processing and inverse differential reconstruction processes.

[0087] Step A2: Determine the decoding boundary and target number of decoding symbols for each period based on the period length parameter, and perform anti-entropy decoding on the variable-length coded sequence based on the pre-stored entropy encoding lookup table to obtain the quantized differential data sequence divided by period.

[0088] Based on the cycle length parameter obtained in step A1, the number of sampling points corresponding to each cycle is determined, thereby determining the target number of decoded symbols in the quantized differential data sequence for each cycle. The cycle length parameter is given in the form of the number of sampling points or the time length. For example, if a power grid cycle contains N sampling points, then N quantized differential values ​​need to be decoded for each cycle during the decoding process. Accordingly, the decoding boundary corresponding to each cycle is determined in the continuous variable-length encoded sequence to prevent data misalignment caused by cross-cycle readings during the decoding process.

[0089] After determining the decoding boundaries and the target number of decoded symbols, the encoded data is read sequentially from the beginning of the variable-length encoded sequence according to the bitstream order, and anti-entropy decoding is performed by calling the entropy encoding lookup table pre-stored in the low-power embedded platform. This entropy encoding lookup table is a mapping table constructed during the compression stage based on the distribution characteristics of the quantized differential data, which stores the correspondence between the variable-length encoded sequence and the quantized encoded values.

[0090] During decoding, the decompression unit matches the variable-length coded sequence bit-by-bit. When the current bit sequence completely matches a valid codeword in the entropy coding lookup table, the corresponding quantized code value is output and written as quantized differential data into the quantized differential data sequence of the current period. Then, it moves to the next undecoded bit position and continues the next round of matching and decoding until all the target decoded symbols required for the current period are generated. After the quantized differential data of one period is decoded, it automatically switches to the decoding boundary of the next period based on the period length parameter, repeating the above anti-entropy decoding process until the decoding operation of the entire variable-length coded sequence is completed, thus obtaining a quantized differential data sequence divided according to a consistent periodic structure.

[0091] Step A3: Based on the quantization level, perform dequantization on the quantized differential data sequence to obtain the corresponding differential data sequence.

[0092] The quantization level indicates the quantization rule used in the compression stage, such as 4-bit, 6-bit, or 8-bit quantization. Different quantization levels correspond to different numbers of quantization intervals and different quantization interval widths. Based on the quantization level, the decompression unit determines the number and width of quantization intervals for the current cycle, and, in conjunction with the effective representation range parameters associated with the compression end, constructs the corresponding inverse quantization mapping rule.

[0093] During dequantization, the decompression unit iterates through each quantized encoded value in the quantized differential data sequence. Based on the index of the encoded value within the quantization interval, it finds the corresponding differential value mapped to that interval and uses this differential value as the restoration result of the quantized encoded value. For example, when 4-bit quantization is used and the effective range of the differential data is divided into 16 quantization intervals, each encoded value corresponds to a specific quantization interval. The decompression unit determines the interval to which the encoded value belongs based on the quantized value and restores the corresponding differential value according to the boundary range of that interval and the preset dequantization mapping rules. This achieves a one-to-one mapping relationship between the quantized encoded value and the differential data, ensuring the reversibility and determinism of the dequantization process.

[0094] Step A4: Determine the inverse difference starting position of each period based on the period length parameter, and perform inverse difference accumulation operation on the difference data sequence of each period to recover the sampled value sequence of each period.

[0095] The decompression unit determines the start and end positions of each period in the differential data sequence based on the period length parameter obtained from the analysis, thereby dividing the differential data subsequences corresponding to each period. At the same time, based on the period start position index, the inverse difference starting point of each period is determined as the initial reference point for inverse difference accumulation.

[0096] During inverse differential processing, the decompression unit uses the initial sample value of each cycle as the initial reference value. Following the sampling order, it sequentially performs inverse accumulation operations on the differential data sequence of the current cycle, adding the differential values ​​point-by-point to the previous sample value to gradually restore the actual amplitude of each sample point within the cycle, thereby generating the corresponding sample value sequence. This process is executed point-by-point according to the sampling order, ensuring the continuity of waveform changes and the accurate restoration of relative changes.

[0097] For the first sampling point within the period, its initial reference value is directly used as the reconstruction result; for each subsequent sampling point, the following inverse difference relationship is used for calculation: X i =X i-1 +Δi, where X i X is the reconstructed value of the current sampling point. i-1 The reconstructed value of the previous sampling point, Δ i This represents the difference value at the corresponding position.

[0098] By performing the inverse differential accumulation operation independently on a periodic basis, the differential data sequence in each period is completely restored to the corresponding sampled value sequence, providing an accurate data foundation for subsequent amplitude correction and period splicing.

[0099] Step A5: Combine statistical parameters to perform amplitude correction and continuity adjustment on the sampled value sequence of each period, and splice and reconstruct the sampled value sequence of each period in period order to obtain power grid waveform data consistent with the original sampled data corresponding to the compressed data.

[0100] The decompression unit performs amplitude correction processing on the sampled value sequence corresponding to each period based on the average and standard deviation of the statistical parameters. Specifically, it compares the sampled value sequence reconstructed for the current period with the average value stored at the compression end, and performs overall offset correction on the entire sampled value segment through linear shift to make its mean consistent with the average value; at the same time, it combines the standard deviation parameter to scale and adjust the amplitude distribution of the sampled value sequence so that its fluctuation range matches the target standard deviation, thereby ensuring that the amplitude distribution characteristics within each period are consistent with those before compression, effectively suppressing amplitude drift or compression distortion caused by quantization errors.

[0101] After completing the single-cycle amplitude correction, the connection between the tail sampling points and the head sampling points of two adjacent cycles is detected. When a significant abrupt change is detected at the boundary between adjacent cycles, the head sampling points of the next cycle are gradually smoothed or finely adjusted to ensure that the sampling values ​​at the end of the previous cycle are continuous in terms of numerical change trend. This avoids step or breakage at the splicing point and improves the natural transition effect of the overall waveform.

[0102] After amplitude correction and continuity adjustment for each cycle, the sampled value sequences of each cycle are sequentially spliced ​​together to reconstruct a continuous power grid waveform data sequence. After these steps, the reconstructed waveform maintains consistency with the original sampled data corresponding to the compressed data in terms of overall trend, cycle shape, and local variation characteristics, achieving high-fidelity lossless restoration of the power grid waveform.

[0103] The lossless compression and decompression methods for power grid waveform data were deployed and verified on an STM32F407 low-power embedded platform based on the ARM Cortex-M4 core. Representative power grid waveform samples were selected for the test data, including a standard 50Hz sine wave, complex waveforms containing multiple harmonics, and transient waveforms with abrupt changes. The sampling frequency was set to 1000Hz, and the length of a single data set was 10,000 sampling points. Lossless compression and decompression processes were performed on the above three types of waveforms respectively, and the test results are shown in Table 1.

[0104] Table 1 Comparison of Lossless Compression Test Results of Power Grid Waveform Data

[0105]

[0106] As shown in Table 1, with the original data size being 20KB, after processing by the method of this application, the compressed data size was reduced to 6.5KB, 7.2KB, and 7.8KB, respectively, with corresponding compression ratios of 3.08:1, 2.78:1, and 2.56:1. The compressed data size was approximately 30% to 50% of the original data. Furthermore, the restoration error calculated based on the comparison between the decompression reconstruction results and the original sampled data was less than 0.01%, with the restoration error of the standard 50Hz sine wave approaching 0. This indicates that under actual test conditions, this scheme achieves significant data compression while maintaining a high-fidelity reconstruction capability of the power grid waveform, verifying its lossless or quasi-lossless characteristics.

[0107] In terms of power consumption, due to the compression mechanism that combines differential coding, adaptive quantization, and pre-computed entropy coding tables, the computational complexity is significantly lower than traditional algorithms. Compared to the LZW algorithm (Lempel-Ziv-Welch, a lossless data compression algorithm based on dictionary coding technology), the computational power consumption is reduced by about 40%, and compared to conventional Huffman coding, it is reduced by about 20%. At the same time, the quantized differential data after differential processing and adaptive quantization, combined with the entropy coding mechanism, typically has a compressed data volume of only 30% to 50% of the original sampled data, effectively reducing the bandwidth and space overhead required for data transmission and storage, making it suitable for long-term continuous acquisition scenarios at the edge.

[0108] Further analysis of platform operation data reveals that the compression computation time for processing 10,000 data points on the STM32F407 platform is approximately 20ms, with a code space footprint of about 2KB and a dynamic data area footprint of about 200 bytes. This verifies that the proposed method maintains low computational complexity and low storage overhead while ensuring compression effectiveness. These results clearly demonstrate that this solution is suitable for resource-constrained power monitoring terminals and edge devices, and can achieve synergistic optimization of high compression ratio, low power consumption, and high restoration accuracy in long-term online operation scenarios.

[0109] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this application. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this application.

[0110] Furthermore, some embodiments of this application also provide an electronic device. The electronic device can be various forms of digital computer, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, etc. The electronic device can also be various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices.

[0111] The electronic device includes: one or more processors; and a memory storing computer program instructions, which, when executed, cause the processor to perform a lossless compression or decompression method for power grid waveform data as provided in the above embodiments. Figure 3 An exemplary structural diagram of the electronic device is disclosed. The electronic device includes one or more processors 1101, a memory 1102, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components are interconnected via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In some other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations. The components, their connections and relationships, and their functions shown herein are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.

[0112] The electronic device may further include an input device 1103 and an output device 1104. The processor 1101, memory 1102, input device 1103, and output device 1104 may be connected via a bus or other means. Figure 3 Taking the example of a connection between China and Israel via a bus.

[0113] Input device 1103 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 1104 may include a display device, auxiliary lighting device (e.g., LED), and haptic feedback device (e.g., vibration motor). The display device may include, but is not limited to, a liquid crystal display, a light-emitting diode display, and a plasma display. In some embodiments, the display device may be a touch screen.

[0114] To provide interaction with the user, the electronic device can be a computer. The computer has: a display device (e.g., a cathode ray tube or LCD monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback); and input from the user can be received in any form (e.g., voice input or tactile input).

[0115] In this embodiment, a computer-readable medium stores a computer program / instruction, which, when executed by a processor, implements the lossless compression or decompression method for power grid waveform data provided in the above embodiments. This computer-readable medium may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into that device. The computer-readable medium carries one or more computer-readable instructions.

[0116] The memory 1102 can serve as a non-transitory computer-readable storage medium, used to store non-transitory software programs, non-transitory computer-executable programs, and modules. The processor 1101 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions, and modules stored in the memory 1102, thereby implementing the program instructions / modules corresponding to the methods provided in any one or more of the embodiments described above in this application.

[0117] The memory 1102 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device. Furthermore, the memory 1102 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 1102 may optionally include memory remotely located relative to the processor 1101, and these remote memories can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0118] It should be noted that the computer-readable medium described in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. Computer-readable media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections having one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, optical fibers, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0119] Computer-readable media include permanent and non-permanent, removable and non-removable media, which can store information by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory, static random access memory, dynamic random access memory, other types of random access memory, read-only memory, electrically erasable programmable read-only memory, flash memory or other memory technologies, read-only optical discs, digital versatile optical discs or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0120] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including local area networks (LANs) or wide area networks (WANs), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0121] In the above embodiments, all or part of the implementation can be achieved through software, hardware, firmware, or any combination thereof. For example, it can be implemented using an application-specific integrated circuit (ASIC), a general-purpose computer, or any other similar hardware device. In some embodiments, the software program of this application can be executed by a processor to implement the above steps or functions. Similarly, the software program of this application (including related data structures) can be stored in a computer-readable recording medium, such as RAM memory, magnetic or optical drives, floppy disks, and similar devices. In addition, some steps or functions of this application can be implemented in hardware, for example, as circuitry that cooperates with a processor to perform the various steps or functions.

[0122] The computer program product provided in this application includes one or more computer programs / instructions. When executed by a processor, these computer programs / instructions generate, in whole or in part, the processes or functions described in this application. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.

[0123] The flowcharts or block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-specific system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0124] The scope of this application is defined by the appended claims rather than the foregoing description, and is therefore intended to encompass all variations falling within the meaning and scope of equivalents of the claims. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a device claim may also be implemented by a single unit or device in software or hardware. Terms such as "first," "second," etc., are used only for distinguishing descriptions and do not indicate any particular order, nor should they be construed as indicating or implying relative importance.

[0125] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily made by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims, and the above embodiments should be regarded as exemplary and non-limiting.

Claims

1. A lossless compression method for power grid waveform data, characterized in that, The application is applied to a low-power embedded platform, comprising: Periodic characteristic analysis is performed on original sampling data of a power grid waveform to determine a periodic structure of the original sampling data, and the original sampling data is processed in segments based on the periodic structure; For sampling data in each segment, difference information between adjacent sampling points is extracted to form a difference data sequence; Based on statistical distribution characteristics of the difference data sequence, a corresponding quantization parameter is dynamically determined, and the difference data sequence is adaptively quantized to generate quantized difference data; Entropy encoding is performed on the quantized difference data to generate compressed data for representing the original sampling data, and feature parameters for reconstructing the original sampling data are stored in the compressed data.

2. The lossless compression method of power grid waveform data according to claim 1, characterized in that, The step of performing periodic characteristic analysis on original sampling data of a power grid waveform to determine a periodic structure of the original sampling data, and processing the original sampling data in segments based on the periodic structure, comprises: The original sampling data is scanned in a preset time window, and based on autocorrelation characteristics of the original sampling data, correlation values under different time delays are calculated to construct an autocorrelation distribution curve; In the autocorrelation distribution curve, according to a correlation extreme value determination rule, a time delay with a maximum correlation value and satisfying a stability constraint is selected as a basic period of the original sampling data; Based on the basic period, the original sampling data is processed for periodic alignment, and the original sampling data is segmented periodically according to the basic period.

3. The lossless compression method of power grid waveform data according to claim 1, characterized in that, The step of extracting difference information between adjacent sampling points for sampling data in each segment to form a difference data sequence, comprises: For sampling data in each periodic segment, adjacent sampling point pairs are selected in sequence according to a sampling order, a previous sampling point is taken as a reference value, and difference calculation is performed on a subsequent sampling point to obtain a corresponding difference value; The difference values are sequentially arranged to form a difference data sequence reflecting the trend of waveform change in a period.

4. The lossless compression method of power grid waveform data according to claim 1, characterized in that, The step of dynamically determining a corresponding quantization parameter based on statistical distribution characteristics of the difference data sequence, and adaptively quantizing the difference data sequence to generate quantized difference data, comprises: Statistical analysis is performed on the difference data sequence to extract distribution interval, fluctuation amplitude and concentration degree parameters representing the distribution state of difference values; The distribution interval, fluctuation amplitude and concentration degree parameters are input into a quantization decision model pre-set and stored in a low-power embedded platform, and the target quantization parameter matching the distribution characteristics of the difference data sequence is adaptively selected from a plurality of preset quantization levels by the quantization decision model according to a preset determination rule, the target quantization parameter is used to define the effective representation range of difference data and corresponds to different quantization interval widths; According to the effective representation range determined by the target quantization parameter, each difference value in the difference data sequence is normalized to map the difference value to a corresponding quantization value interval. The difference value is divided into intervals according to a quantization interval width corresponding to the target quantization parameter, and an encoding value of each quantization interval is taken as a quantization representation of the corresponding difference value.

5. The lossless compression method of power grid waveform data according to claim 1, characterized in that, The step of performing entropy encoding processing on the quantized difference data to generate compressed data for representing the original sampling data and storing feature parameters for reconstructing the original sampling data in association with the compressed data comprises: Performing offline statistical analysis on the quantized encoding values of the pre-acquired typical power grid waveform sample data after difference processing and adaptive quantization processing, obtaining the frequency distribution of the occurrence of the quantized encoding values, and constructing an entropy encoding mapping relationship matched with the power grid waveform characteristics according to the frequency distribution of the occurrence, converting the entropy encoding mapping relationship into an encoding lookup table and pre-storing it in the read-only storage area of the low-power embedded platform; During the running of the low-power embedded platform, the pre-stored encoding lookup table is directly read to map the quantized encoding values in the quantized difference data into corresponding variable-length encoding sequences, which are used to generate the compressed data; At the same time of generating the compressed data, the feature parameters for representing the lossless reconstruction rule are stored in association with the variable-length encoding sequences, so that the lossless reconstruction of the original sampling data is completed based on the variable-length encoding sequences and the feature parameters at the decoding end.

6. The lossless compression method of power grid waveform data according to claim 5, characterized in that, The feature parameters for representing the lossless reconstruction rule comprise: a period length parameter for representing the basic period structure of the power grid waveform; statistical parameters for representing the distribution characteristics of each period, including the mean value and standard deviation of the corresponding period; a quantization level for indicating the quantization rule adopted by each period.

7. A lossless decompression method of power grid waveform data, characterized by, Applied to a low-power embedded platform, comprising: parsing the variable-length encoding sequences and the feature parameters stored in association with the variable-length encoding sequences from the compressed data obtained by lossless compression processing of the power grid waveform data, the feature parameters comprising: a period length parameter for representing the basic period structure of the power grid waveform, statistical parameters for representing the distribution characteristics of each period, and a quantization level for indicating the quantization rule adopted by each period; determining the decoding boundary and the target number of decoding symbols corresponding to each period based on the period length parameter, and performing inverse entropy decoding processing on the variable-length encoding sequences based on the pre-stored entropy encoding lookup table to obtain a quantized difference data sequence divided by period; performing inverse quantization processing on the quantized difference data sequence based on the quantization level to obtain a corresponding difference data sequence; determining the inverse difference starting position of each period based on the period length parameter, and performing inverse difference accumulation operation on the difference data sequence of each period to recover the sampling value sequence of each period; combining the statistical parameters to perform amplitude correction and continuity adjustment on the sampling value sequence of each period, and splicing and reconstructing the sampling value sequence of each period in period order to obtain power grid waveform data consistent with the original sampling data corresponding to the compressed data.

8. An electronic device, comprising: The electronic device comprises: one or more processors; and memory storing computer program instructions that, when executed, cause the processors to perform the lossless compression method of power grid waveform data as claimed in any one of claims 1-6, or the lossless decompression method of power grid waveform data as claimed in claim 7.

9. A computer readable storage medium having stored thereon a computer program and / or instructions, characterized in that, The computer program and / or instructions, when executed by the processor, implement the lossless compression method of power grid waveform data as claimed in any one of claims 1-6, or the lossless decompression method of power grid waveform data as claimed in claim 7.

10. A computer program product comprising computer programs and / or instructions, characterized in that, The computer program and / or instructions, when executed by the processor, implement the lossless compression method of power grid waveform data as claimed in any one of claims 1-6, or the lossless decompression method of power grid waveform data as claimed in claim 7.

Citation Information

Cited By

  • Data transmission compression method and device, equipment and storage medium

    CN122053512A

  • A power digital inspection monitoring method and system based on remote diagnosis

    CN122394218A