Data compression method, device and equipment for power grid cloud platform, medium and product

By converting the operational data of the power grid cloud platform into long integer data, performing logarithmic iterative compression, and combining parameters to generate a compressed bitstream, the problem of low efficiency in traditional compression methods is solved, achieving efficient data compression and lossless restoration.

CN121508548APending Publication Date: 2026-02-10SHENZHEN POWER SUPPLY BUREAU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511712969.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-20
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Traditional compression methods based on repetitive pattern recognition are inefficient in compressing current, voltage, and other data on power grid cloud platforms, resulting in poor compression rates.

Method used

By converting the operational data of the power grid cloud platform into long integer data, performing logarithmic iterative compression, and combining it with preset scaling factors and computational precision parameters, a compressed bitstream is generated through secondary encoding.

Benefits of technology

It significantly improves the data compression rate, eliminates the structural redundancy of floating-point numbers, and achieves efficient data compression and lossless restoration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121508548A_ABST
    Figure CN121508548A_ABST
Patent Text Reader

Abstract

The invention relates to a data compression method and device for a power grid cloud platform, equipment, a medium and a product. The method comprises the following steps: performing data conversion processing on acquired operation data of a power grid cloud platform to obtain long integer data; performing logarithmic iteration compression processing on the long integer data, and obtaining iteration data when the iteration process is ended; performing parameter combination processing on the basis of the iteration data, a preset scale factor and a preset operation precision parameter to obtain metadata; the metadata is used for losslessly restoring the operation data; and performing secondary coding processing on the metadata to obtain a compressed code stream. By adopting the method, the compression rate can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of big data technology, and in particular to a data compression method, apparatus, equipment, medium and product for a power grid cloud platform. Background Technology

[0002] As power systems evolve towards intelligence and cloudification, power grid cloud platforms have become critical infrastructure supporting core functions such as distribution network planning, operation and maintenance, and dispatch. These platforms heavily rely on the real-time collection, transmission, and storage of massive amounts of operational data.

[0003] However, power grid operation data are mostly real-time collected numerical sequences (such as current, voltage, load values, etc.), and their data patterns have low repeatability, which leads to the problem that traditional compression methods based on repeating pattern recognition (such as LZW, Huffman, GZIP, etc.) have low compression rates in such scenarios. Summary of the Invention

[0004] Therefore, it is necessary to provide a data compression method, apparatus, equipment, medium, and product for power grid cloud platforms that can improve the compression ratio, addressing the aforementioned technical problems.

[0005] Firstly, this application provides a data compression method for a power grid cloud platform, including:

[0006] The acquired operational data from the power grid cloud platform is processed to obtain long integer data;

[0007] Perform logarithmic iterative compression on long integer data and obtain the iterative data when the iteration process terminates;

[0008] Metadata is obtained by combining parameters based on iterative data, preset scaling factors, and preset computational precision parameters; the metadata is used to losslessly restore the running data.

[0009] The metadata is subjected to two-level encoding to obtain a compressed bitstream.

[0010] Secondly, this application also provides a data compression device for a power grid cloud platform, comprising:

[0011] The conversion module is used to convert the acquired operational data from the power grid cloud platform into long integer data.

[0012] The compression module is used to perform logarithmic iterative compression on long integer data and obtain the iterative data when the iteration process terminates.

[0013] The combination module is used to process parameters based on iterative data, preset scaling factors, and preset computational precision parameters to obtain metadata; the metadata is used to restore the running data without loss.

[0014] The encoding module is used to perform secondary encoding processing on the metadata to obtain a compressed bitstream.

[0015] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0016] The acquired operational data from the power grid cloud platform is processed to obtain long integer data;

[0017] Perform logarithmic iterative compression on long integer data and obtain the iterative data when the iteration process terminates;

[0018] Metadata is obtained by combining parameters based on iterative data, preset scaling factors, and preset computational precision parameters; the metadata is used to losslessly restore the running data.

[0019] The metadata is subjected to two-level encoding to obtain a compressed bitstream.

[0020] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0021] The acquired operational data from the power grid cloud platform is processed to obtain long integer data;

[0022] Perform logarithmic iterative compression on long integer data and obtain the iterative data when the iteration process terminates;

[0023] Metadata is obtained by combining parameters based on iterative data, preset scaling factors, and preset computational precision parameters; the metadata is used to losslessly restore the running data.

[0024] The metadata is subjected to two-level encoding to obtain a compressed bitstream.

[0025] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0026] The acquired operational data from the power grid cloud platform is processed to obtain long integer data;

[0027] Perform logarithmic iterative compression on long integer data and obtain the iterative data when the iteration process terminates;

[0028] Metadata is obtained by combining parameters based on iterative data, preset scaling factors, and preset computational precision parameters; the metadata is used to losslessly restore the running data.

[0029] The metadata is subjected to two-level encoding to obtain a compressed bitstream.

[0030] The aforementioned data compression method, device, equipment, medium, and product for power grid cloud platforms first convert operational data into integers and concatenate them using a preset scaling factor to obtain long integer data. This effectively eliminates the structural redundancy of floating-point numbers and transforms the compression problem of multiple data items into the compression problem of a single data entity, laying a structural foundation for improving the compression ratio. Next, by performing logarithmic iterative operations on the long integer data with a preset base, the order-of-magnitude information of the original data is transformed into iterative data consisting of iteration depth and termination value. This process achieves data dimensionality reduction through mathematical transformation, mapping large-scale numerical information into a compact representation, completing the initial efficient data compression. Subsequently, by combining the depth and fractional part of the termination value in the iterative data with the scaling factor and operational precision parameters, highly concise metadata is generated, further reducing information redundancy. Finally, by implementing two-level encoding on the metadata to generate a compressed bitstream, statistical redundancy is further eliminated, bringing the data volume close to the lower limit of information entropy, thereby systematically achieving a significant improvement in the compression ratio. Attached Figure Description

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

[0032] Figure 1 This is an internal structural diagram of a computer device in one embodiment;

[0033] Figure 2 This is a flowchart illustrating a data compression method for a power grid cloud platform in one embodiment;

[0034] Figure 3 This is a flowchart illustrating a data compression method for a power grid cloud platform in another embodiment;

[0035] Figure 4 This is a flowchart illustrating a data compression method for a power grid cloud platform in another embodiment;

[0036] Figure 5 This is a flowchart illustrating a data compression method for a power grid cloud platform in another embodiment;

[0037] Figure 6 This is a flowchart illustrating a data compression method for a power grid cloud platform in another embodiment;

[0038] Figure 7 This is a flowchart illustrating a data compression method for a power grid cloud platform in another embodiment;

[0039] Figure 8 This is a flowchart illustrating a data compression method for a power grid cloud platform in another embodiment;

[0040] Figure 9 This is a flowchart illustrating a data compression method for a power grid cloud platform in another embodiment;

[0041] Figure 10 This is a structural block diagram of a data compression device for a power grid cloud platform in one embodiment. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0043] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 1 As shown, the computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores relevant data for the data compression process for the power grid cloud platform. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a data compression method for the power grid cloud platform.

[0044] Those skilled in the art will understand that Figure 1 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0045] In one exemplary embodiment, such as Figure 2As shown, a data compression method for a power grid cloud platform is provided, which can be applied to... Figure 1 Taking the server in the example, the explanation includes the following steps 201 to 204. Wherein:

[0046] Step 201: Perform data conversion processing on the obtained power grid cloud platform operation data to obtain long integer data.

[0047] Among them, operational data refers to the monitoring data such as current, voltage, and load values ​​collected in real time in the power grid cloud platform, which are usually floating-point numbers or numerical sequences with decimal places.

[0048] Data conversion processing refers to converting floating-point numbers in the running data into integers using a preset scaling factor, and then concatenating multiple integers in sequence to form a very long integer, i.e., long integer data. This aims to eliminate floating-point storage redundancy and prepare for subsequent compression.

[0049] Long integer data refers to high-precision values ​​composed of multiple integerized data, and their range usually exceeds the representation capability of conventional computer word length.

[0050] In this embodiment, the server performs data conversion processing on the acquired power grid cloud platform operation data to obtain long integer data. For example, the server acquires a sequence of switch status change events uploaded by the distribution network terminal. Each event contains a timestamp accurate to milliseconds and a status code. First, the timestamp is normalized and converted into a millisecond offset relative to the start time of the acquisition period. Then, the millisecond offset of each event and the status code are numerically fused according to a preset rule: the millisecond offset is used as the high-order bit, and the status code is used as the low-order bit, combined into a composite integer value through bitwise operations. For example, combining the offset of 123 milliseconds with the status code 1 yields the composite value 123001. Finally, all composite integer values ​​in the event sequence are concatenated in chronological order to generate long integer data containing complete timing information.

[0051] Step 202: Perform logarithmic iterative compression on the long integer data and obtain the iterative data when the iteration process terminates.

[0052] The iterative data refers to the result of logarithmic iterative compression, which typically includes the iteration depth (the number of times the logarithmic operation is performed) and the termination value (the result of the last operation). These two small values ​​are used to represent the information of the original long integer data.

[0053] In this embodiment, the server obtains a long integer data composed of multiple power distribution equipment identification codes, which contains complete topological connection information within the region. First, a logarithmic operation is performed on the long integer with the number of equipment types as the base. For example, if the power distribution network contains 8 main equipment types, the first iteration is performed with the base 8 to obtain the hierarchical feature value of the topology. When the iteration value is less than the number of equipment types, a second iteration is performed with the number of node connectivity as the base. For example, if the maximum node connectivity is 4, the iteration is performed with the base 4. The iteration termination condition is set to the difference between two consecutive iteration results being less than a preset threshold. At this point, the final iteration depth and termination value are recorded as iteration data.

[0054] Step 203: Based on the iterative data, the preset scaling factor and the preset calculation precision parameters, the parameter combination processing is performed to obtain metadata; the metadata is used to restore the running data without loss.

[0055] The scaling factor refers to the multiplier coefficient used to amplify floating-point numbers into integers during data conversion and processing. It is a parameter that ensures lossless scaling of data during compression and restoration.

[0056] The computational precision parameter refers to the number of significant digits that are pre-set for high-precision numerical calculations to ensure that errors do not occur during logarithmic iteration and its inverse operation due to insufficient significant digits.

[0057] Metadata refers to a set of data generated by parameter combination processing that contains all the information needed to losslessly restore the original running data from compressed data.

[0058] In this embodiment, the server obtains metadata by combining iterative data, a preset scaling factor, and preset computational precision parameters. For example, when the iterative data contains a depth value of 3 and a termination value of 2.174, the server first automatically selects a scaling factor based on the power grid data security level: a scaling factor of 1000 is used for protection-type data to ensure measurement accuracy, and a scaling factor of 100 is used for monitoring-type data to balance storage efficiency. The computational precision parameters are dynamically adjusted according to the power grid sampling rate; 128-bit precision is set for 4000Hz high-frequency sampling data, and 64-bit precision is set for 800Hz conventional sampling data.

[0059] The parameter combination employs a hierarchical encoding structure: the first layer contains the iteration depth (3) and the integer part of the termination value (2), encoded using a fixed 4-byte encoding; the second layer contains the decimal part of the termination value (0.174), converted to binary scientific notation according to the preset precision parameter; the third layer contains the scale factor identifier and the precision level identifier, encoded using a 2-byte combination. The final generated metadata structure includes a data check bit, a version identifier, and a parameter combination body, where the parameter combination body is bit-aligned and encapsulated in the order of "depth-termination value-scale factor-precision parameter".

[0060] In one embodiment, the server performs parameter combination processing based on iterative data, a preset scaling factor, and a preset computational precision parameter to obtain metadata; the metadata is used to losslessly reconstruct the running data. For example, combining the iteration depth of 2, the integer part of the termination value (1) and the fractional part (0.156), the scaling factor (100), and the computational precision parameter (64 bits) generates structured metadata {2,1,0.156,100,64}.

[0061] Step 204: Perform secondary encoding on the metadata to obtain a compressed bitstream.

[0062] The compressed bitstream refers to the final binary data stream generated after a complete compression process, which is used for storage or transmission.

[0063] In one embodiment, the server performs two-level encoding on the metadata to obtain a compressed bitstream. First, the integer fields (such as iteration depth 2, integer part 1, and scaling factor 10) in the metadata {2,1,0.0556,10,50} are encoded, converting them into compact binary prefixes and suffixes. Then, the entire bitstream generated after encoding all fields is arithmetically encoded to further compress its statistical redundancy, ultimately generating a compressed binary bitstream.

[0064] In the aforementioned data compression method for power grid cloud platforms, firstly, the operational data is converted into integers and concatenated using a preset scaling factor to obtain long integer data. This effectively eliminates the structural redundancy of floating-point numbers and transforms the compression problem of multiple data items into the compression problem of a single data entity, laying a structural foundation for improving the compression ratio. Next, by performing logarithmic iterative operations with a preset base on the long integer data, the order-of-magnitude information of the original data is transformed into iterative data consisting of the iteration depth and the termination value. This process achieves data dimensionality reduction through mathematical transformation, mapping large-scale numerical information into a compact representation, completing the initial efficient data compression. Subsequently, by combining the depth and the fractional part of the termination value in the iterative data with the scaling factor and operational precision parameters, highly concise metadata is generated, further reducing information redundancy. Finally, by implementing two-level encoding on the metadata to generate a compressed bitstream, statistical redundancy is further eliminated, bringing the data volume close to the lower limit of information entropy, thereby systematically achieving a significant improvement in the compression ratio.

[0065] In one exemplary embodiment, such as Figure 3 As shown, the above-mentioned "performing logarithmic iterative compression on long integer data and obtaining iterative data upon termination of the iteration process" includes steps 301 to 302. Wherein:

[0066] Step 301: Perform logarithmic iterative operations on the long integer data with a preset number as the base using a preset logarithmic iterative relation until the number of iterations is less than a preset value; wherein, the logarithmic iterative relation includes the recursive relationship between the long integer data of the current iteration and the long integer data of the next iteration.

[0067] In this context, the iteration round refers to the number of times the logarithmic operation is repeated. Each complete calculation (deriving the next value from the current value through a relational expression) is counted as one round. The first calculation is round 1, and subsequent calculations increment sequentially.

[0068] A recursive relation refers to the inherent logic established by a logarithmic iterative formula, connecting the data of two consecutive iterations. That is, the input data of the next iteration is completely determined by the output result of the previous iteration, thus forming a complete computational sequence.

[0069] The iteration termination round refers to the last iteration round being executed when a preset termination condition (such as "the value is less than a preset value") is met. The result calculated in this round is the final output.

[0070] In this embodiment of the application, the server uses a preset logarithmic iterative relation to perform logarithmic iterative operations on long integer data with a preset number as the base, until the number of iterations is less than a preset value.

[0071] In another embodiment, the server performs logarithmic iterative compression on the long integer data and obtains the iterative data when the iteration process terminates. The long integer data "230523112298" is iteratively calculated using a base-10 matrix. First iteration: log10(230523112298) ≈ 11.3627; Second iteration: log10(11.3627) ≈ 1.0556.

[0072] Step 302: Extract and process the long integer data of the iteration termination round, and generate iteration data.

[0073] In this embodiment of the application, the server extracts and processes the long integer data of the iteration termination round and generates iteration data.

[0074] In one specific embodiment, the iteration terminates because 1.0556 < 10 in step 301. The iteration depth is recorded as 2, and the termination value is 1.0556. The iteration data consists of this depth and the termination value.

[0075] In one exemplary embodiment, such as Figure 3 As shown, the aforementioned iterative data includes the iteration depth and the termination value. Based on this, the above-mentioned "obtaining metadata by combining parameters based on the iterative data, a preset scaling factor, and preset computational precision parameters" includes steps 401 to 402. Wherein:

[0076] Step 401: Determine the integer and fractional parts of the termination value.

[0077] The integer part refers to the integer components of a number, that is, the digits to the left of the decimal point. It represents the magnitude of the number. For example, for the terminal value 1.197, its integer part is 1.

[0078] The fractional part refers to the decimal portion of a number, that is, the digits to the right of the decimal point. It represents the precise details of the number based on its integer part. For example, for the terminal value 1.197, its fractional part is 0.197. Preserving the fractional part is one of the keys to achieving lossless reconstruction.

[0079] In the embodiments of this application, the integer part and the fractional part of the termination value are determined.

[0080] In one embodiment, assume the iterative process yields a termination value of 2.854. Its integer part is determined to be 2, and its fractional part to be 0.854.

[0081] Step 402 involves combining the iteration depth, integer part, fractional part, scaling factor, and computational precision parameters to obtain metadata.

[0082] Parameter combination processing refers to the process of integrating multiple independent parameters into a single, structured metadata according to a predetermined structure and format. This process ensures that all the information necessary to reconstruct the original data is completely and orderly encapsulated together.

[0083] In this embodiment of the application, the iteration depth, integer part, fractional part, scaling factor and operation precision parameters are combined to obtain metadata.

[0084] In one embodiment, the integer part 2 and the fractional part 0.854 are combined with the iteration depth 3, the scaling factor 100, and the precision parameter 64 for parameter combination processing. This processing arranges and encapsulates these parameters in a predefined order (e.g., [iteration depth]|[integer part]|[fractional part]|[scaling factor]|[precision]) to generate a well-structured metadata package, for example, represented as {3,2,0.854,100,64}. This metadata package contains all the information needed to reconstruct the original running data from the compressed data.

[0085] In one exemplary embodiment, such as Figure 5 As shown, the above-mentioned "performing secondary encoding of metadata to obtain a compressed bitstream" includes steps 501 to 502. Wherein:

[0086] Step 501: Perform first-level encoding on the integer field in the metadata to obtain a bit stream; the first-level encoding is used to map the positive integers in the integer field into a format in which a variable-length unary code is concatenated with a fixed-length binary code.

[0087] Integer fields refer to those data items in the various components of metadata that take integer values. Examples include iteration depth, the integer part of the termination value, and scaling factors.

[0088] A unary code is a variable-length prefix code. To encode a non-negative integer q, it is represented as q consecutive "1"s followed by a "0". For example, the unary code for the number 3 is 1110.

[0089] Fixed-length binary code refers to representing a number directly using a binary sequence of a fixed number of bits. For example, the number 5 is represented by 101 using 3 binary bits.

[0090] A bitstream is a sequence of binary bits (0s and 1s) arranged in order. Here, the output of the first-level encoding is used as the input for the second-level encoding.

[0091] In one embodiment, the integer field in the metadata is first-level encoded to obtain a bit stream; the first-level encoding is used to map the positive integers in the integer field into a format in which a variable-length unary code is concatenated with a fixed-length binary code.

[0092] In another embodiment, the first-level encoding is specifically Columbus-Rice encoding. Let parameter k=2, then the modulus M=4. The integer field n=9 in the metadata is encoded as follows:

[0093] The quotient q = floor(9 / 4) = 2, and its unary code is 110. The remainder r = 9%4 = 1, and its fixed-length binary code (fixed to 2 bits since k = 2) is 01. The unary code and the binary code are concatenated to obtain 11001 as the codeword for this integer. After encoding all integer fields, they are concatenated sequentially to form a bitstream.

[0094] Step 502: Perform a second-level encoding on the bitstream to obtain a compressed bitstream; the second-level encoding maps the bitstream to a single arithmetic codeword.

[0095] The second-level encoding refers to the stage that follows the first-level encoding, where the intermediate results are further compressed.

[0096] Arithmetic codewords refer to the output of arithmetic coding. Arithmetic coding is an efficient entropy coding technique that does not encode each input symbol independently, but instead maps the entire input message (bit stream) to a single short decimal between 0 and 1, which is ultimately represented by a fixed-length binary codeword.

[0097] In one embodiment, the bitstream is subjected to a second-level encoding to obtain a compressed bitstream; the second-level encoding maps the bitstream to a single arithmetic codeword.

[0098] In another embodiment, the second-level encoding specifically employs arithmetic encoding. The bitstream output from step 501 (e.g., 110011010...) is taken as input. The encoder calculates the probability of '0' and '1' appearing in the bitstream and, based on these probabilities, maps the entire bitstream to a short decimal interval between 0 and 1. This interval is ultimately represented by a fixed-length binary fraction (i.e., a single arithmetic codeword), which is the final compressed bitstream. This method can approximate the Shannon entropy limit of data, achieving efficient compression.

[0099] In one exemplary embodiment, such as Figure 6 As shown, the above-mentioned "data conversion processing of the acquired power grid cloud platform operation data to obtain long integer data" includes steps 601 to 602. Wherein:

[0100] Step 601: Convert the running data into integer data using a scaling factor.

[0101] Step 602: Concatenate multiple converted integer data in sequence to obtain long integer data.

[0102] In this embodiment, the server uses a scaling factor to convert operational data into integer data, and then concatenates multiple converted integer data in sequence to obtain long integer data. For example, the server performs data conversion processing on the acquired operational data from the power grid cloud platform to obtain long integer data. For instance, the server collects three voltage values: 230.5V, 231.1V, and 229.8V. Setting the scaling factor to 10, these three floating-point numbers are converted into integers: 2305, 2311, and 2298. Subsequently, these three integers are concatenated in the order of acquisition to obtain the long integer data "230523112298".

[0103] In another embodiment, for high-frequency acquired current data, a larger scaling factor (such as 1000) can be used to retain more effective bits. Simultaneously, integers can be padded with a fixed bit width before splicing, for example, each integer can be uniformly 6 bits, with zeros added if necessary. This eliminates the need to store additional data boundary information during reconstruction; the data can be segmented solely based on the fixed bit width.

[0104] In one exemplary embodiment, such as Figure 7 As shown, the process of determining the above-mentioned computational precision parameters includes steps 701 to 702. Wherein:

[0105] Step 701: Determine the number of binary bits corresponding to the long integer data based on the number of decimal bits of the long integer data.

[0106] The decimal number of digits refers to the total number of digits contained in a long integer when represented in decimal. For example, the long integer 123456 has 6 decimal digits.

[0107] The number of bits in a binary number refers to the minimum number of bits required to unambiguously represent a long integer. For example, an 8-bit binary number can represent a maximum of 255 (i.e., 2^8-1).

[0108] In one embodiment, the number of binary bits corresponding to the long integer data is determined based on the number of decimal bits of the long integer data.

[0109] In another embodiment, the calculation is performed using the formula "binary number of bits = ceil(decimal number of bits × log2(10))". For example, when the long integer data is 123456789 (decimal number of bits = 9), the calculation is: ceil(9 × 3.321928) = ceil(29.897) = 30, which means that the corresponding binary number of bits is 30.

[0110] Step 702: Add a preset safety margin to the binary number of bits to obtain the operation precision parameter.

[0111] The safety margin is a preset positive integer, designed to add extra bits beyond the theoretically minimum number of binary bits required for calculation. This provides a buffer to ensure that accumulated rounding errors remain within a controllable range throughout the compression and decompression process.

[0112] In one embodiment, a preset safety margin is added to the binary number of bits to obtain the operation precision parameter.

[0113] In another embodiment, different safety margin levels are set according to the accuracy requirements of the power grid data: a high safety margin of 10 bits is used for metering data, and a standard safety margin of 5 bits is used for monitoring data. For example, when the binary number is 30 bits, a 10-bit safety margin is added to the metering data to obtain a 40-bit operational accuracy parameter; a 5-bit safety margin is added to the monitoring data to obtain a 35-bit operational accuracy parameter.

[0114] In one exemplary embodiment, such as Figure 8 As shown, the above method further includes steps 801 to 804. Wherein:

[0115] Step 801: Perform a second-level decoding on the compressed bitstream to obtain the bitstream.

[0116] In one embodiment, the compressed bitstream is decoded in a second stage to obtain the bitstream.

[0117] In another embodiment, the second-level decoding is specifically arithmetic decoding. The decoder reads the compressed bitstream (i.e., a binary codeword representing a certain numerical range) and decodes the codeword back to the original binary bit sequence, i.e., the bitstream, according to the same probability model as the encoder.

[0118] Step 802: Perform the first-level decoding on the bitstream to restore the metadata.

[0119] In one embodiment, the bitstream is first-level decoded to restore the metadata.

[0120] In another embodiment, the first-level decoding is specifically Columbus-Rice decoding. The decoder reads the bitstream, parses the quotient q from the unary code prefix (consecutive '1's to '0's), then parses the remainder r from the subsequent k bits of binary code, and then reconstructs each integer field by calculating the original integer = q * M + r (where M = 2^k). Finally, all fields are reassembled into complete metadata.

[0121] Step 803: Based on the iteration depth and termination value in the metadata, perform exponential operation to restore the long integer data.

[0122] In one embodiment, an exponential operation is performed based on the iteration depth and termination value in the metadata to reconstruct long integer data.

[0123] In another embodiment, the exponentiation operation is specifically performed as follows: starting from the termination value of 1.155 and using 10 as the base, nested exponentiation operations are performed, with the number of nesting operations equal to the iteration depth of 2. That is, to calculate 10^(10^1.155), first the inner layer 10^1.155≈14.288 is calculated, and then the outer layer 10^14.288≈1.94e14 is calculated, thus restoring the long integer data 1940000000000000.

[0124] Step 804: Based on the scaling factor in the metadata, perform inverse transformation on the long integer data to obtain the running data.

[0125] In one embodiment, long integer data is inversely transformed based on a scaling factor in the metadata to obtain runtime data.

[0126] In another embodiment, the inverse transformation process includes: first, splitting the restored long integer data 194000000000000 according to its known number of original data items (e.g., 3) to obtain [194,000,000] (this is only for illustrative purposes). Then, scaling (i.e., dividing by 100) each integer using a scaling factor of 100 from the metadata to obtain the final running data [1.94,0.00,0.00].

[0127] In one exemplary embodiment, such as Figure 9 As shown, the above method also includes:

[0128] The logarithmic iterative compression method for power grid cloud platforms proposed in this application begins with data preprocessing. In this primary step, the server performs a normalization transformation on the raw operating data collected from the power grid cloud platform: first, floating-point data (such as current and voltage values) are converted into integers using a preset scaling factor to eliminate floating-point representation errors; then, multiple integerized data are concatenated in a fixed order into a high-precision long integer, which serves as the single input to the compression algorithm; finally, the computational precision is dynamically set according to the decimal digits of the long integer to ensure the accuracy of subsequent calculations.

[0129] After preprocessing, the process enters the core compression stage—logarithmic iteration. This stage achieves substantial data compression through innovative mathematical transformations: a base-10 logarithmic iterative operation is performed on the high-precision long integers obtained from preprocessing; the process terminates when the iteration result is less than 10. Upon termination, the server records the iteration depth and extracts the integer and finite decimal parts of the termination value as the mantissa. These three elements together constitute a compact representation of the original data, typically requiring no more than five iterations to complete the compressed representation of large-scale data.

[0130] In the metadata generation stage, the server integrates the compression results with the restoration parameters. By combining iteration depth, the integer part of the termination value, the mantissa, and scaling factors and computational precision parameters used in the preprocessing stage, a structured metadata data package is generated. This metadata design fully considers the requirements of lossless restoration, recording all necessary numerical characteristics and recovery conditions with minimal information, ensuring accurate data restoration in subsequent stages.

[0131] To further improve compression efficiency, the process enters the compression and storage stage. This stage employs a two-stage compression mechanism: first, the integer fields in the metadata are encoded using Golomb-Rice encoding to generate a bitstream concatenated from unary codes and fixed-length binary codes; then, entropy encoding is applied to the bitstream to eliminate statistical redundancy, making the final output compressed bitstream approach the theoretical compression limit of information.

[0132] Finally, in the decoding and restoration stage, the server performs the reverse operation of the compression process: first, it performs entropy decoding and Golomb-Rice decoding on the compressed bitstream to restore the complete metadata; then, it performs exponential operations based on the parameters in the metadata to reconstruct the high-precision long integer through the inverse operation corresponding to the compression stage; finally, it performs inverse conversion processing on the long integer according to parameters such as the scaling factor to accurately restore the original power grid operation data bit by bit.

[0133] In one embodiment, the method further includes:

[0134] The operational data (such as current, voltage, and load values) collected by the power grid cloud platform are usually floating-point or decimal data. To ensure good computability and reversibility of the power grid operational data during logarithmic iteration, the raw data first needs to be converted into integers or high-precision values ​​suitable for calculation. To avoid floating-point errors and facilitate the concatenation of large numbers, the following method is adopted:

[0135] Integerization: By setting a scaling factor (like This converts decimal data to integers. For example, voltage values. In the scaling factor The downmap is .

[0136] Numerical concatenation: This involves sequentially concatenating multiple integerized data sets into a single long integer, which serves as the input to the compression algorithm. For example, three sets of integerized data... It can be concatenated into a long integer. The splicing method is strictly fixed to ensure the correspondence between compression and decompression processes.

[0137] High-precision numerical representation: The concatenated long integer typically exceeds the representation range of a conventional 64-bit integer or double-precision floating-point number. A high-precision numerical library is used for storage and computation, and the calculation precision is dynamically set before computation to ensure that information is not lost due to floating-point rounding errors or insufficient significant bits when performing multiple logarithmic iterations and exponentiation restorations on the long integer. The calculation precision is calculated as follows:

[0138]

[0139] in, This indicates the required computational precision. Represents integers The number of decimal places, Its function is to convert decimal digits into their corresponding binary digits. Indicates rounding up. Indicates the safety margin.

[0140] Logarithmic iteration is used to map high-precision long integers into compact compressed tuples, achieving effective compression of power grid operation data. First, the preprocessed high-precision values... Input is sent to the logarithmic iteration module. During the calculation, a base-10 logarithmic recurrence formula is used:

[0141]

[0142] When the iteration result meets the termination condition The iteration process ends at that time. Because exist The time constant holds, therefore the process must converge within a finite number of steps, typically with an iteration depth of... No more than 5.

[0143] When the iteration terminates, extract the integer part of the termination value. And, as needed, append a limited number of decimal places (e.g., 3-6 digits) as a mantissa to ensure the accuracy of the inverse operation. Finally, the parameter set for logarithmic iteration is generated:

[0144]

[0145] in, The integer part of the terminating value. To supplement the last digits, The iteration depth.

[0146] When the iteration terminates, only the integer part of the final value is retained, with a limited number of decimal places appended as needed. This is because the logarithmic transformation can convert the order-of-magnitude information of the original large number into the iteration depth, while the final value carries the precise position of the number in the logarithmic field. By only keeping the integer part and supplementing it with a small number of decimal places, not only can storage redundancy be significantly reduced and compression efficiency improved, but also, after combining the iteration depth, scaling factor, and precision parameters, the original data can still be accurately recovered bit by bit in the reverse operation. Thus, while achieving a high compression ratio, the lossless reversibility and numerical stability of the data are maintained.

[0147] After completing the logarithmic iteration, the compression results and related parameters need to be organized into metadata to support subsequent storage, transmission, and decoding. The design goal of the metadata is to record the necessary numerical features and recovery conditions with the minimum amount of information while ensuring lossless reversibility. The generated metadata mainly includes the following elements:

[0148]

[0149] in, The integer part of the terminating value, To supplement the last digit, For iteration depth, Where n is the scaling factor, and n is the number of decimal places in the original number. This ensures computational precision. Through this structured metadata, it is guaranteed that compressed data can be losslessly restored bit by bit to its original high-precision integer during the decoding process.

[0150] To further reduce the overhead of storage and transmission of this tuple, a two-stage compression mechanism of Golomb-Rice encoding and entropy encoding is adopted.

[0151] First, for integer fields in the tuple Set parameters and define the modulus For any integer to be compressed... Its quotient and remainder can be given by the following formula:

[0152]

[0153]

[0154] in, express Divide by modulus Integer quotient, This indicates the floor function. express Divide by modulus The remainder obtained later, sign This represents the modulo operation. According to the Golomb-Rice encoding rules, this integer can be... Mapped to the following codewords:

[0155]

[0156] The prefix part is composed of A single consecutive "1" followed by a separator "0" forms a unary code; the suffix part... remainder The binary representation of , with a fixed length of . The resulting codeword length is: (bits).

[0157]

[0158] in, This represents the total number of bits in the codeword. To achieve the average code length... To get as close as possible to the optimal value, this invention calculates the mean of the current field in block-level data. And select appropriate parameters based on empirical formulas. :

[0159]

[0160] in, This indicates that the operation takes the larger value. This ensures that the Golomb-Rice encoding is close to the entropy limit overall. After normalizing the above fields once using GR, a set of bit sequences (including...) is obtained. as well as sequence).

[0161] Even after Golomb-Rice encoding, the resulting bitstream still suffers from uneven symbol distribution. To further improve compression efficiency, this invention implements entropy encoding on the bitstream. Let the set of encoded symbols be... Its empirical probability distribution is According to the principles of information theory, the theoretical average code length of entropy coding satisfies:

[0162]

[0163] in, This represents the average bit length of the symbol after entropy encoding. Represents a set of symbols Shannon entropy, Symbols The probability of occurrence This represents the summation operation over all possible symbols. Therefore, entropy coding can bring the code length close to the theoretical limit.

[0164] An entropy encoder is used to directly apply the symbol stream of the bit sequence after GR, and it is encapsulated into the final compressed output bit stream in bit-level concatenation order:

[0165]

[0166] in For entropy encoding operators, This represents a bit-level concatenation. Thus, tuples can be mapped to compressed bitstreams that are close to the lower bound of information theory, significantly reducing resource consumption in data storage and transmission for the power grid cloud platform while ensuring complete reversibility.

[0167] The decoding and restoration process is performed in reverse order of encoding. First, the bitstream is... Execution entropy decoding:

[0168]

[0169] in This represents the entropy decoding operator. This is a bit stream obtained by concatenating a sequence of symbols.

[0170] Subsequently, based on the Golomb-Rice parameters given by the block head. ,right Expand segment by segment to obtain each field. Let GR be the modulus. For any codeword encoded by GR The quotient is determined by the number of prefix "1". The remainder is determined by parsing the suffix binary number. This restores the original value:

[0171]

[0172] This formula can be used to decode the results sequentially. ,and The entropy decoder outputs the result directly, which is then reassembled into a tuple:

[0173]

[0174] After obtaining the tuples, the inverse logarithmic operation phase begins. Let the iteration termination value be:

[0175]

[0176] in Indicates the number of bits in the mantissa. (Based on iteration depth) Perform exponential operations sequentially:

[0177]

[0178] The exponent is nested and repeated. Next, we obtain the intermediate results of the reverse reconstruction. .

[0179] Finally, using the scaling factor Bit parameters and accuracy parameters Completed numerical restoration:

[0180]

[0181] in, Indicates the number of digits in the original decimal system. Perform a bounding and rounding operation to ensure that the result is consistent with the original number in the specified number of digits; This limits the number of significant digits during high-precision numerical calculations to avoid the accumulation of rounding errors.

[0182] In one exemplary embodiment, the method further includes:

[0183] Step 1: Convert the running data into integer data using a scaling factor.

[0184] Step 2: Concatenate multiple converted integer data in sequence to obtain long integer data.

[0185] Step 3: Determine the corresponding binary number of the long integer data based on the number of decimal bits.

[0186] Step 4: Add a preset safety margin to the binary number of bits to obtain the operation precision parameter.

[0187] Step 5: Perform logarithmic iterative operations on the long integer data with a preset base of a preset logarithmic iterative formula until the number of iterations is less than a preset value. The logarithmic iterative formula includes the recursive relationship between the long integer data of the current iteration and the long integer data of the next iteration.

[0188] Step 6: Extract and process the long integer data of the iteration termination round, and generate iteration data.

[0189] Step 7: Determine the integer and fractional parts of the termination value.

[0190] Step 8: Combine the iteration depth, integer part, fractional part, scaling factor, and computational precision parameters to obtain metadata.

[0191] Step 9: Perform first-level encoding on the integer field in the metadata to obtain a bitstream. First-level encoding is used to map positive integers in the integer field into a format that concatenates variable-length unary codes with fixed-length binary codes.

[0192] Step 10: Perform a second-level encoding on the bitstream to obtain a compressed bitstream. The second-level encoding maps the bitstream to a single arithmetic codeword.

[0193] Step 11: Perform a second-level decoding on the compressed bitstream to obtain the bitstream.

[0194] Step 12: Perform the first-level decoding on the bitstream to restore the metadata.

[0195] Step 13: Based on the iteration depth and termination value in the metadata, perform exponential operation to restore the long integer data.

[0196] Step 14: Based on the scaling factor in the metadata, perform inverse transformation on the long integer data to obtain the running data.

[0197] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0198] Based on the same inventive concept, this application also provides a data compression device for a power grid cloud platform to implement the aforementioned data compression method for a power grid cloud platform. The solution provided by this device is similar to the implementation described in the above method. Therefore, the specific limitations of one or more embodiments of the data compression device for a power grid cloud platform provided below can be found in the limitations of the data compression method for a power grid cloud platform described above, and will not be repeated here.

[0199] In one exemplary embodiment, such as Figure 10 As shown, a data compression device for a power grid cloud platform is provided, comprising: a conversion module 1001, a compression module 1002, a combination module 1003, and an encoding module 1004, wherein:

[0200] The conversion module 1001 is used to perform data conversion processing on the acquired power grid cloud platform operation data to obtain long integer data;

[0201] Compression module 1002 is used to perform logarithmic iterative compression on long integer data and to obtain iterative data when the iteration process terminates.

[0202] The combination module 1003 is used to perform parameter combination processing based on iterative data, preset scaling factors, and preset calculation precision parameters to obtain metadata; the metadata is used to restore the running data without loss.

[0203] Encoding module 1004 is used to perform secondary encoding processing on metadata to obtain a compressed bitstream.

[0204] In an exemplary embodiment, the compression module 1002 is specifically used to perform logarithmic iterative operations on long integer data with a preset number as the base, using a preset logarithmic iterative relation, until the iteration round is less than a preset value; wherein, the logarithmic iterative relation includes the recursive relationship between the long integer data of the current iteration round and the long integer data of the next iteration round; the long integer data of the iteration termination round is extracted and processed to generate iterative data.

[0205] In an exemplary embodiment, the iteration data includes the iteration depth and the termination value. The aforementioned combination module 1003 is specifically used to determine the integer part and the fractional part of the termination value; and to perform parameter combination processing on the iteration depth, the integer part, the fractional part, the scaling factor, and the calculation precision parameter to obtain metadata.

[0206] In an exemplary embodiment, the above-mentioned encoding module 1004 is specifically used to perform a first-level encoding on the integer field in the metadata to obtain a bit stream; the first-level encoding is used to map the positive integers in the integer field into a format of concatenating variable-length unary codes and fixed-length binary codes; the bit stream is then subjected to a second-level encoding to obtain a compressed bit stream; the second-level encoding is used to map the bit stream into a single arithmetic codeword.

[0207] In an exemplary embodiment, the conversion module 1001 is specifically used to convert the running data into integer data using a scaling factor; and to concatenate multiple converted integer data in sequence to obtain long integer data.

[0208] In an exemplary embodiment, the data compression device for the power grid cloud platform described above is further used to determine the number of binary bits corresponding to the long integer data based on the decimal number of the long integer data; and to obtain the calculation accuracy parameter by adding a preset safety margin to the number of binary bits.

[0209] In an exemplary embodiment, the data compression device for the power grid cloud platform described above is further configured to perform a second-level decoding on the compressed bitstream to obtain a bitstream; perform a first-level decoding on the bitstream to restore metadata; perform exponential operations based on the iteration depth and termination value in the metadata to restore long integer data; and perform inverse conversion processing on the long integer data according to the scaling factor in the metadata to obtain running data.

[0210] The modules in the aforementioned data compression device for the power grid cloud platform can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0211] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0212] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0213] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0214] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0215] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0216] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A data compression method for a power grid cloud platform, characterized in that, The method includes: The acquired operational data from the power grid cloud platform is processed to obtain long integer data; The long integer data is subjected to logarithmic iterative compression, and the iterative data is obtained when the iteration process terminates; Metadata is obtained by combining parameters based on the iterative data, a preset scaling factor, and preset computational precision parameters; the metadata is used to losslessly reconstruct the running data. The metadata is subjected to two-level encoding to obtain a compressed bitstream.

2. The method according to claim 1, characterized in that, The step of performing logarithmic iterative compression on the long integer data and obtaining the iterative data when the iteration process terminates includes: The long integer data is subjected to a logarithmic iterative operation with a preset base of a preset number using a preset logarithmic iterative formula until the number of iterations is less than a preset value; wherein, the logarithmic iterative formula includes the recursive relationship between the long integer data of the current iteration and the long integer data of the next iteration. The long integer data of the iteration termination round is extracted and processed to generate the iteration data.

3. The method according to claim 2, characterized in that, The iterative data includes the iteration depth and the termination value. The metadata obtained by combining the iterative data, a preset scaling factor, and preset computational precision parameters includes: Determine the integer and fractional parts of the termination value; The metadata is obtained by combining the iteration depth, the integer part, the fractional part, the scaling factor, and the operation precision parameter.

4. The method according to claim 1, characterized in that, The step of performing secondary encoding on the metadata to obtain a compressed bitstream includes: The integer field in the metadata is first-level encoded to obtain a bit stream; the first-level encoding is used to map the positive integers in the integer field into a format in which a variable-length unary code is concatenated with a fixed-length binary code; The bitstream is subjected to a second-level encoding to obtain the compressed bitstream; the second-level encoding maps the bitstream to a single arithmetic codeword.

5. The method according to claim 1, characterized in that, The process of converting the acquired power grid cloud platform operation data into long integer data includes: The operating data is converted into integer data using the scaling factor. Multiple converted integer data are concatenated in sequence to obtain the long integer data.

6. The method according to claim 5, characterized in that, The process of determining the computational precision parameter includes: Based on the decimal number of the long integer data, determine the corresponding binary number of the long integer data; The calculation precision parameter is obtained by adding a preset safety margin to the binary number of bits.

7. The method according to claim 3, characterized in that, The method further includes: The compressed bitstream is then decoded in a second stage to obtain a bitstream; The bitstream is decoded at the first stage to restore the metadata; Based on the iteration depth and the termination value in the metadata, perform exponential operation to reconstruct the long integer data; Based on the scaling factor in the metadata, the long integer data is inversely transformed to obtain the running data.

8. A data compression device for a power grid cloud platform, characterized in that, The device includes: The conversion module is used to convert the acquired operational data from the power grid cloud platform into long integer data. The compression module is used to perform logarithmic iterative compression on the long integer data and obtain the iterative data when the iteration process terminates. The combination module is used to perform parameter combination processing based on the iterative data, a preset scaling factor, and preset computational precision parameters to obtain metadata; the metadata is used to losslessly restore the running data; The encoding module is used to perform secondary encoding processing on the metadata to obtain a compressed bitstream.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

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