[go: up one dir, main page]

CN114827287B - Data compression method and system - Google Patents

Data compression method and system Download PDF

Info

Publication number
CN114827287B
CN114827287B CN202111151155.1A CN202111151155A CN114827287B CN 114827287 B CN114827287 B CN 114827287B CN 202111151155 A CN202111151155 A CN 202111151155A CN 114827287 B CN114827287 B CN 114827287B
Authority
CN
China
Prior art keywords
data
compression
compressed
data0
transmitted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111151155.1A
Other languages
Chinese (zh)
Other versions
CN114827287A (en
Inventor
巫钟兴
刘宣
祝恩国
朱子旭
唐悦
郑安刚
夏桃芳
高琛
丁忠安
刘兴奇
张宇鹏
窦健
郄爽
王朝亮
叶方彬
陆春光
陈盛
李丹
吴彤
孙丽娜
韩月
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Zhejiang Electric Power Co Ltd
China Electric Power Research Institute Co Ltd CEPRI
State Grid Fujian Electric Power Co Ltd
State Grid Liaoning Electric Power Co Ltd
State Grid Corp of China SGCC
Original Assignee
State Grid Zhejiang Electric Power Co Ltd
China Electric Power Research Institute Co Ltd CEPRI
State Grid Fujian Electric Power Co Ltd
State Grid Liaoning Electric Power Co Ltd
State Grid Corp of China SGCC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Zhejiang Electric Power Co Ltd, China Electric Power Research Institute Co Ltd CEPRI, State Grid Fujian Electric Power Co Ltd, State Grid Liaoning Electric Power Co Ltd, State Grid Corp of China SGCC filed Critical State Grid Zhejiang Electric Power Co Ltd
Priority to CN202111151155.1A priority Critical patent/CN114827287B/en
Publication of CN114827287A publication Critical patent/CN114827287A/en
Application granted granted Critical
Publication of CN114827287B publication Critical patent/CN114827287B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

本发明公开了一种数据的压缩方法及系统,属于数据压缩技术领域。本发明方法,包括:获取待压缩数据的短符描述,根据待压缩数据的短描述符,确定需要压缩数据的正向有功电能量数据块,确定需要压缩数据的正向有功电能量数据块中,需要传输的数据Data0和上次传输的数据Data1,并对Data1及Data0做差,生成Data2;根据Data2生成需要传输的数据Data0的压缩头信息;根据Data0生成CRC校验数据;使用Data2、压缩头信息及CRC校验数据生成需要传输的数据Data0的压缩数据。本发明提升了数据的传输效率和带宽的利用率,并对数据进行了高效的存储。

The present invention discloses a data compression method and system, and belongs to the technical field of data compression. The method of the present invention comprises: obtaining a short character description of the data to be compressed, determining the forward active electric energy data block of the data to be compressed according to the short descriptor of the data to be compressed, determining the data Data0 to be transmitted and the data Data1 transmitted last time in the forward active electric energy data block of the data to be compressed, and performing a difference between Data1 and Data0 to generate Data2; generating compression header information of the data Data0 to be transmitted according to Data2; generating CRC check data according to Data0; and using Data2, compression header information and CRC check data to generate compressed data of the data Data0 to be transmitted. The present invention improves the data transmission efficiency and bandwidth utilization, and stores the data efficiently.

Description

一种数据的压缩方法及系统A data compression method and system

技术领域Technical Field

本发明涉及数据压缩技术领域,并且更具体地,涉及一种数据的压缩方法及系统。The present invention relates to the technical field of data compression, and more specifically, to a data compression method and system.

背景技术Background technique

能源互联网技术和业务快速发展,电网公司“新基建”战略稳步推进,客户侧量测设备的种类和数量呈爆发式增长。越来越多的设备接入客户侧能源,包括电动汽车充电设施、分布式能源、居民家庭、商业楼宇、企业及园区、区域多能等量测设备,对通信接入的覆盖范围、带宽速率、通信时延、系统稳定性等提出更高要求。Energy Internet technology and business are developing rapidly, the "new infrastructure" strategy of power grid companies is advancing steadily, and the types and number of customer-side measurement equipment are growing explosively. More and more equipment is connected to customer-side energy, including electric vehicle charging facilities, distributed energy, residential households, commercial buildings, enterprises and parks, regional multi-energy measurement equipment, etc., which puts forward higher requirements for communication access coverage, bandwidth rate, communication delay, system stability, etc.

发明内容Summary of the invention

本发明为了提升数据的传输效率和带宽的利用率,并对数据进行高效存储,提出了一种数据的压缩方法,包括:In order to improve data transmission efficiency and bandwidth utilization and to efficiently store data, the present invention proposes a data compression method, comprising:

获取待压缩数据的短描述符,根据待压缩数据的短描述符,确定需要压缩数据的正向有功电能量数据块,确定需要压缩数据的正向有功电能量数据块中,需要传输的数据Data0和上次传输的数据Data1,并对Data1及Data0做差,生成Data2;Obtain a short descriptor of the data to be compressed, determine the forward active electric energy data block of the data to be compressed according to the short descriptor of the data to be compressed, determine the data Data0 to be transmitted and the data Data1 transmitted last time in the forward active electric energy data block of the data to be compressed, and perform a difference between Data1 and Data0 to generate Data2;

根据Data2生成需要传输的数据Data0的压缩头信息;Generate compression header information of the data Data0 to be transmitted according to Data2;

根据Data0生成CRC校验数据;Generate CRC check data according to Data0;

使用Data2、压缩头信息及CRC校验数据生成需要传输的数据Data0的压缩数据。The compressed data of the data Data0 to be transmitted is generated using Data2, the compressed header information and the CRC check data.

所述压缩数据生成后,对外传输使用的传输协议,包括:请求压缩传输或响应压缩传输的方式进行传输;After the compressed data is generated, the transmission protocol used for external transmission includes: transmission by requesting compressed transmission or responding to compressed transmission;

所述传输的方式若为请求压缩传输,生成的压缩数据携带压缩算法、压缩模式信息和压缩数据的处理结果后进行传输。If the transmission method is to request compressed transmission, the generated compressed data is transmitted after carrying the compression algorithm, compression mode information and the processing result of the compressed data.

可选的,压缩数据的压缩方式为无损差值数据压缩;Optionally, the compression method of the compressed data is lossless difference data compression;

若压缩数据的压缩方式不能使用无损差值数据压缩时,压缩数据的压缩方式使用无损数据压缩,所述无损数据压缩是将CRC校验数据及Data0进行压缩,生成压缩数据。If the compression method of the compressed data cannot use lossless difference data compression, the compression method of the compressed data uses lossless data compression, and the lossless data compression compresses CRC check data and Data0 to generate compressed data.

可选的,压缩头信息,包括:压缩头字节长度和字段压缩bit位;Optional, compression header information, including: compression header byte length and field compression bit;

字段压缩bit位用两位数字表示数据块压缩方式,0表示无损数据压缩,1表示无损差值数据压缩,2表示不压缩。The field compression bit uses two digits to indicate the data block compression method. 0 indicates lossless data compression, 1 indicates lossless differential data compression, and 2 indicates no compression.

可选的,短描述符,包括:对象标识、对象特征、对象属性标识及属性内元素索引。Optional, short descriptor, including: object identifier, object characteristics, object attribute identifier and element index within the attribute.

可选的,方法还包括:使用Data0数据生成的CRC校验数据后,根据CRC校验数据生成CRC16校验数据作为附加校验数据。Optionally, the method further includes: after using the CRC check data generated by the Data0 data, generating CRC16 check data as additional check data based on the CRC check data.

本发明还提出了一种数据的压缩系统,包括:The present invention also proposes a data compression system, comprising:

生成数据差值单元,获取待压缩数据的短描述符,根据待压缩数据的短描述符,确定需要压缩数据的正向有功电能量数据块,确定需要压缩数据的正向有功电能量数据块中,需要传输的数据Data0和上次传输的数据Data1,并对Data1及Data0做差,生成Data2;Generate a data difference unit, obtain a short descriptor of the data to be compressed, determine the forward active electric energy data block that needs to be compressed according to the short descriptor of the data to be compressed, determine the data Data0 that needs to be transmitted and the data Data1 that was transmitted last time in the forward active electric energy data block that needs to be compressed, and make a difference between Data1 and Data0 to generate Data2;

压缩头信息生成单元,根据Data2生成需要传输的数据Data0的压缩头信息;A compression header information generating unit generates compression header information of the data Data0 to be transmitted according to Data2;

校验数据生成单元,根据Data0生成CRC校验数据;A check data generating unit generates CRC check data according to Data0;

压缩数据生成单元,使用Data2、压缩头信息及CRC校验数据生成需要传输的数据Data0的压缩数据。The compressed data generating unit generates compressed data of the data Data0 to be transmitted using Data2, the compressed header information and the CRC check data.

可选的,所述压缩数据生成后,对外传输使用的传输协议,包括:请求压缩传输或响应压缩传输的方式进行传输;Optionally, after the compressed data is generated, the transmission protocol used for external transmission includes: transmitting in a manner of requesting compressed transmission or responding to compressed transmission;

所述传输的方式若为请求压缩传输,生成的压缩数据携带压缩算法、压缩模式信息和压缩数据的处理结果后进行传输。If the transmission method is to request compressed transmission, the generated compressed data is transmitted after carrying the compression algorithm, compression mode information and the processing result of the compressed data.

可选的,压缩数据的压缩方式为无损差值数据压缩;Optionally, the compression method of the compressed data is lossless difference data compression;

若压缩数据的压缩方式不能使用无损差值数据压缩时,压缩数据的压缩方式使用无损数据压缩,所述无损数据压缩是将CRC校验数据及Data0进行压缩,生成压缩数据。If the compression method of the compressed data cannot use lossless difference data compression, the compression method of the compressed data uses lossless data compression, and the lossless data compression compresses CRC check data and Data0 to generate compressed data.

可选的,压缩头信息,包括:压缩头字节长度和字段压缩bit位;Optional, compression header information, including: compression header byte length and field compression bit;

字段压缩bit位用两位数字表示数据块压缩方式,0表示无损数据压缩,1表示无损差值数据压缩,2表示不压缩。The field compression bit uses two digits to indicate the data block compression method. 0 indicates lossless data compression, 1 indicates lossless differential data compression, and 2 indicates no compression.

可选的,短描述符,包括:对象标识、对象特征、对象属性标识及属性内元素索引。Optional, short descriptor, including: object identifier, object characteristics, object attribute identifier and element index within the attribute.

可选的,校验数据生成单元还用于:在使用Data0数据生成的CRC校验数据后,根据CRC校验数据生成CRC16校验数据作为附加校验数据。Optionally, the verification data generation unit is further used to: after using the CRC verification data generated by the Data0 data, generate CRC16 verification data as additional verification data according to the CRC verification data.

本发明通过对Data2、压缩头信息及CRC校验数据进行压缩,生成压缩数据,对压缩数据进行传输,提升了数据的传输效率和带宽的利用率,并对数据进行了高效的存储。The present invention compresses Data2, compression header information and CRC check data to generate compressed data, transmits the compressed data, improves data transmission efficiency and bandwidth utilization, and stores data efficiently.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本发明方法的流程图;Fig. 1 is a flow chart of the method of the present invention;

图2为本发明系统的结构图。FIG. 2 is a structural diagram of the system of the present invention.

具体实施方式Detailed ways

现在参考附图介绍本发明的示例性实施方式,然而,本发明可以用许多不同的形式来实施,并且不局限于此处描述的实施例,提供这些实施例是为了详尽地且完全地公开本发明,并且向所属技术领域的技术人员充分传达本发明的范围。对于表示在附图中的示例性实施方式中的术语并不是对本发明的限定。在附图中,相同的单元/元件使用相同的附图标记。Now, exemplary embodiments of the present invention are described with reference to the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided to disclose the present invention in detail and completely and to fully convey the scope of the present invention to those skilled in the art. The terms used in the exemplary embodiments shown in the accompanying drawings are not intended to limit the present invention. In the accompanying drawings, the same units/elements are marked with the same reference numerals.

除非另有说明,此处使用的术语(包括科技术语)对所属技术领域的技术人员具有通常的理解含义。另外,可以理解的是,以通常使用的词典限定的术语,应当被理解为与其相关领域的语境具有一致的含义,而不应该被理解为理想化的或过于正式的意义。Unless otherwise specified, the terms (including technical terms) used herein have the commonly understood meanings to those skilled in the art. In addition, it is understood that the terms defined in commonly used dictionaries should be understood to have the same meanings as those in the context of the relevant fields, and should not be understood as idealized or overly formal meanings.

本发明提出了一种数据的压缩方法,如图1所示,包括:The present invention proposes a data compression method, as shown in FIG1 , comprising:

获取待压缩数据的短描述符,根据待压缩数据的短描述符,确定需要压缩数据的正向有功电能量数据块,确定需要压缩数据的正向有功电能量数据块中,需要传输的数据Data0和上次传输的数据Data1,并对Data1及Data0做差,生成Data2;Obtain a short descriptor of the data to be compressed, determine the forward active electric energy data block of the data to be compressed according to the short descriptor of the data to be compressed, determine the data Data0 to be transmitted and the data Data1 transmitted last time in the forward active electric energy data block of the data to be compressed, and perform a difference between Data1 and Data0 to generate Data2;

其中,待压缩的数据,包括电能量,电压、电流、功率等多种电力数据;Among them, the data to be compressed include various power data such as electric energy, voltage, current, and power;

根据Data2生成需要传输的数据Data0的压缩头信息;Generate compression header information of the data Data0 to be transmitted according to Data2;

根据Data0生成CRC校验数据;Generate CRC check data according to Data0;

使用Data2、压缩头信息及CRC校验数据生成需要传输的数据Data0的压缩数据。The compressed data of the data Data0 to be transmitted is generated using Data2, the compressed header information and the CRC check data.

压缩数据生成后,使用Data0数据生成的CRC16校验数据作为附加校验数据,所述附件校验数据供压缩数据的接收方,对接收到的压缩数据进行压缩数据正确性的校验。After the compressed data is generated, the CRC16 check data generated by the Data0 data is used as additional check data. The additional check data is provided to the receiver of the compressed data to check the correctness of the received compressed data.

所述压缩数据生成后,对外传输使用的传输协议,包括:请求压缩传输或响应压缩传输的方式进行传输;After the compressed data is generated, the transmission protocol used for external transmission includes: transmission by requesting compressed transmission or responding to compressed transmission;

所述传输的方式若为请求压缩传输,生成的压缩数据携带压缩算法、压缩模式信息和压缩数据的处理结果后进行传输。If the transmission method is to request compressed transmission, the generated compressed data is transmitted after carrying the compression algorithm, compression mode information and the processing result of the compressed data.

其中,压缩头信息,包括:压缩头字节长度和字段压缩bit位;The compression header information includes: the compression header byte length and the field compression bit;

字段压缩bit位用两位数字表示数据块压缩方式,0表示无损数据压缩,1表示无损差值数据压缩,2表示不压缩。The field compression bit uses two digits to indicate the data block compression method. 0 indicates lossless data compression, 1 indicates lossless differential data compression, and 2 indicates no compression.

其中,短描述符,包括:对象标识、对象特征、对象属性标识及属性内元素索引。The short descriptor includes: object identifier, object feature, object attribute identifier and element index within the attribute.

本发明中压缩数据的传输使用的传输协议,传输协议支持压缩编码;The transmission protocol used for the transmission of compressed data in the present invention supports compression coding;

传输协议基于客户侧能源量测数据交换协议,支持请求压缩传输和响应压缩传输两种压缩传输,在请求压缩传输时,除了支持传输压缩数据以外,还支持携带压缩算法、压缩模式信息和压缩处理结果等参数字段。The transmission protocol is based on the client-side energy measurement data exchange protocol, and supports two types of compressed transmission: request compressed transmission and response compressed transmission. When requesting compressed transmission, in addition to supporting the transmission of compressed data, it also supports carrying parameter fields such as compression algorithm, compression mode information and compression processing results.

支持本地信道,包括:RS-485、M-Bus、CAN、RF、PLC、HPLC、微功率无线以及HPLC与微功率无线双模通信,远程信道支持包括:GPRS、3G、4G、5G、电力专网230M、以太网、光纤等。Supports local channels, including RS-485, M-Bus, CAN, RF, PLC, HPLC, micro-power wireless, and HPLC and micro-power wireless dual-mode communications. Supports remote channels, including GPRS, 3G, 4G, 5G, power network 230M, Ethernet, optical fiber, etc.

因为支持携带压缩算法参数,所以支持LZW、LZ77、LZ77/78、RLE、GZIP等多种通用压缩算法和自定义客户侧能源量测数据交换协议无损数据传输压缩算法。Because it supports carrying compression algorithm parameters, it supports multiple common compression algorithms such as LZW, LZ77, LZ77/78, RLE, GZIP, and customized client-side energy measurement data exchange protocol lossless data transmission compression algorithms.

针对每一个数据是否需要压缩,压缩方式是使用无损差值数据压缩还是使用无损完全压缩,取决于数据差异值的范围和传输要求,比如差异值为0,即无差异,使用无损完全压缩,差异较小,使用无损差值数据压缩,差异很大,不压缩,使用原始数据传输,压缩方式使用数据压缩头信息来表示。Whether each data needs to be compressed and whether the compression method is to use lossless differential data compression or lossless full compression depends on the range of the data difference value and the transmission requirements. For example, if the difference value is 0, that is, there is no difference, lossless full compression is used. If the difference is small, lossless differential data compression is used. If the difference is large, no compression is performed and original data transmission is used. The compression method is indicated by the data compression header information.

压缩头信息包括:压缩头字节长度,字段压缩bit位。The compression header information includes: compression header byte length and field compression bit.

字段压缩bit位用两位来表示数据块压缩方式,0表示完全压缩,1表示差值压缩,2表示不压缩。The field compression bit uses two bits to indicate the data block compression method, 0 indicates full compression, 1 indicates differential compression, and 2 indicates no compression.

下面结合实施例对本发明进行进一步的说明:The present invention will be further described below in conjunction with embodiments:

针对一个正向有功电能量数据块,本次需要传输的数据Data0为:For a forward active electric energy data block, the data Data0 that needs to be transmitted this time is:

上一次传输的数据Data1为:The last transmitted data Data1 is:

本次传输的计量数据Data0与上一次的计量数据Data1对应不同费率值字段做差生成Data2为:The metering data Data0 transmitted this time and the metering data Data1 transmitted last time are subtracted from each other in the corresponding rate value fields to generate Data2:

其中、Data2具体差值数据及压缩头如下:Among them, the specific difference data and compression header of Data2 are as follows:

Bit7:0,无压缩头,1:有压缩头;Bit7: 0, no compression header, 1: with compression header;

Bit5:压缩比0:1/2压缩,1:1/4压缩;Bit5: Compression ratio 0:1/2 compression, 1:1/4 compression;

Bit0~Bit4:N个数据,具体采用的压缩方式;Bit0~Bit4: N data, specific compression method used;

差值数据中,每个字节表示4组压缩编码方式In the difference data, each byte represents 4 groups of compression encoding methods

压缩头信息表示为:0x85,0x52,0x01。The compressed header information is represented as: 0x85, 0x52, 0x01.

其中、0x85表示有长度域,1/2压缩,长度为5个Mbit长度;这里有电能量数据做例子,电能量数据为4字节时,当前压缩后的单组数据宽度为2字节Among them, 0x85 indicates that there is a length field, 1/2 compression, and the length is 5 Mbit. Here is an example of electric energy data. When the electric energy data is 4 bytes, the width of the current compressed single group of data is 2 bytes.

0x52的bit0~bit1是0x02,表示不压缩;Bit0 to bit1 of 0x52 is 0x02, indicating no compression;

0x52的bit2~bit3是0x00,表示完全压缩;Bit 2 to bit 3 of 0x52 are 0x00, indicating full compression;

0x52的bit4~bit5是0x01,表示差值压缩;Bit 4 to bit 5 of 0x52 are 0x01, indicating differential compression;

0x52的bit6~bit7是0x01,表示差值压缩;Bit6 to bit7 of 0x52 are 0x01, indicating differential compression;

0x01的bit0~bit1是0x01,表示差值压缩。Bit0 to bit1 of 0x01 are 0x01, indicating differential compression.

再使用CRC-CCITT校验算法,对Data0数据进行校验后,完成一次完整的数据压缩过程。Then use the CRC-CCITT verification algorithm to verify the Data0 data, completing a complete data compression process.

本发明还提出了一种数据的压缩系统200,如图2所示,包括:The present invention also proposes a data compression system 200, as shown in FIG2 , comprising:

生成数据差值单元201,获取待压缩数据的短描述符,根据待压缩数据的短描述符,确定需要压缩数据的正向有功电能量数据块,确定需要压缩数据的正向有功电能量数据块中,需要传输的数据Data0和上次传输的数据Data1,并对Data1及Data0做差,生成Data2;The data difference generating unit 201 obtains the short descriptor of the data to be compressed, determines the forward active electric energy data block that needs to be compressed according to the short descriptor of the data to be compressed, determines the data Data0 to be transmitted and the data Data1 transmitted last time in the forward active electric energy data block that needs to be compressed, and performs a difference between Data1 and Data0 to generate Data2;

压缩头信息生成单元202,根据Data2生成需要传输的数据Data0的压缩头信息;A compression header information generating unit 202 generates compression header information of the data Data0 to be transmitted according to Data2;

校验数据生成单元203,根据Data0生成CRC校验数据;使用Data0数据生成的CRC16校验数据作为附加校验数据,所述附件校验数据供压缩数据的接收方,对接收到的压缩数据进行压缩数据正确性的校验。The verification data generating unit 203 generates CRC verification data according to Data0; uses the CRC16 verification data generated by Data0 data as additional verification data, and the attached verification data is provided to the receiver of the compressed data to verify the correctness of the received compressed data.

压缩数据生成单元204,使用Data2、压缩头信息及CRC校验数据生成需要传输的数据Data0的压缩数据;The compressed data generating unit 204 generates compressed data of the data Data0 to be transmitted using Data2, the compressed header information and the CRC check data;

其中,所述压缩数据生成后,对外传输使用的传输协议,包括:请求压缩传输或响应压缩传输的方式进行传输;Wherein, after the compressed data is generated, the transmission protocol used for external transmission includes: transmitting in a manner of requesting compressed transmission or responding to compressed transmission;

所述传输的方式若为请求压缩传输,生成的压缩数据携带压缩算法、压缩模式信息和压缩数据的处理结果后进行传输。If the transmission method is to request compressed transmission, the generated compressed data is transmitted after carrying the compression algorithm, compression mode information and the processing result of the compressed data.

其中,压缩数据的压缩方式为无损差值数据压缩;Wherein, the compression method of the compressed data is lossless difference data compression;

若压缩数据的压缩方式不能使用无损差值数据压缩时,压缩数据的压缩方式使用无损数据压缩,所述无损数据压缩是将CRC校验数据及Data0进行压缩,生成压缩数据。If the compression method of the compressed data cannot use lossless difference data compression, the compression method of the compressed data uses lossless data compression, and the lossless data compression compresses CRC check data and Data0 to generate compressed data.

其中,压缩头信息,包括:压缩头字节长度和字段压缩bit位;The compression header information includes: the compression header byte length and the field compression bit;

字段压缩bit位用两位数字表示数据块压缩方式,0表示无损数据压缩,1表示无损差值数据压缩,2表示不压缩。The field compression bit uses two digits to indicate the data block compression method. 0 indicates lossless data compression, 1 indicates lossless differential data compression, and 2 indicates no compression.

其中,短描述符,包括:对象标识、对象特征、对象属性标识及属性内元素索引。The short descriptor includes: object identifier, object feature, object attribute identifier and element index within the attribute.

其中,校验数据生成单元还用于:在使用Data0数据生成的CRC校验数据后,根据CRC校验数据生成CRC16校验数据作为附加校验数据。The verification data generating unit is further used for: after using the CRC verification data generated by the Data0 data, generating CRC16 verification data as additional verification data according to the CRC verification data.

本发明提升了数据的传输效率和带宽的利用率,并对数据进行了高效的存储。The present invention improves data transmission efficiency and bandwidth utilization, and stores data efficiently.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。本发明实施例中的方案可以采用各种计算机语言实现,例如,面向对象的程序设计语言Java和直译式脚本语言JavaScript等。It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The schemes in the embodiments of the present invention may be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to the flowchart and/or block diagram of the method, device (system), and computer program product according to the embodiment of the present invention. It should be understood that each process and/or box in the flowchart and/or block diagram, as well as the combination of the process and/or box in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims (8)

1.一种数据的压缩方法,所述方法包括:1. A data compression method, the method comprising: 获取待压缩数据的短描述符,根据待压缩数据的短描述符,确定需要压缩数据的正向有功电能量数据块,确定需要压缩数据的正向有功电能量数据块中,需要传输的数据Data0和上次传输的数据Data1,并对Data1及Data0做差,生成Data2;Obtain a short descriptor of the data to be compressed, determine the forward active electric energy data block of the data to be compressed according to the short descriptor of the data to be compressed, determine the data Data0 to be transmitted and the data Data1 transmitted last time in the forward active electric energy data block of the data to be compressed, and perform a difference between Data1 and Data0 to generate Data2; 所述短描述符,包括:对象标识、对象特征、对象属性标识及属性内元素索引;The short descriptor includes: object identification, object characteristics, object attribute identification and element index within the attribute; 根据Data2生成需要传输的数据Data0的压缩头信息;Generate compression header information of the data Data0 to be transmitted according to Data2; 所述压缩头信息,包括:压缩头字节长度和字段压缩bit位;The compression header information includes: compression header byte length and field compression bit; 字段压缩bit位用两位数字表示数据块压缩方式,0表示无损数据压缩,1表示无损差值数据压缩,2表示不压缩;The field compression bit uses two digits to indicate the data block compression method, 0 indicates lossless data compression, 1 indicates lossless difference data compression, and 2 indicates no compression; 根据Data0生成CRC校验数据;Generate CRC check data according to Data0; 使用Data2、压缩头信息及CRC校验数据生成需要传输的数据Data0的压缩数据。The compressed data of the data Data0 to be transmitted is generated using Data2, the compressed header information and the CRC check data. 2.根据权利要求1所述的方法,所述压缩数据生成后,对外传输使用的传输协议,包括:请求压缩传输或响应压缩传输的方式进行传输;2. According to the method of claim 1, after the compressed data is generated, the transmission protocol used for external transmission includes: transmitting in a manner of requesting compressed transmission or responding to compressed transmission; 所述传输的方式若为请求压缩传输,生成的压缩数据携带压缩算法、压缩模式信息和压缩数据的处理结果后进行传输。If the transmission method is to request compressed transmission, the generated compressed data is transmitted after carrying the compression algorithm, compression mode information and the processing result of the compressed data. 3.根据权利要求1所述的方法,所述压缩数据的压缩方式为无损差值数据压缩;3. The method according to claim 1, wherein the compression method of the compressed data is lossless difference data compression; 若压缩数据的压缩方式不能使用无损差值数据压缩时,压缩数据的压缩方式使用无损数据压缩,所述无损数据压缩是将CRC校验数据及Data0进行压缩,生成压缩数据。If the compression method of the compressed data cannot use lossless difference data compression, the compression method of the compressed data uses lossless data compression, and the lossless data compression compresses CRC check data and Data0 to generate compressed data. 4.根据权利要求1所述的方法,所述方法还包括:使用Data0数据生成CRC校验数据后,根据CRC校验数据生成CRC16校验数据作为附加校验数据。4. The method according to claim 1 further comprises: after using Data0 data to generate CRC check data, generating CRC16 check data as additional check data according to the CRC check data. 5.一种数据的压缩系统,所述系统包括:5. A data compression system, the system comprising: 生成数据差值单元,获取待压缩数据的短描述符,根据待压缩数据的短描述符,确定需要压缩数据的正向有功电能量数据块,确定需要压缩数据的正向有功电能量数据块中,需要传输的数据Data0和上次传输的数据Data1,并对Data1及Data0做差,生成Data2;Generate a data difference unit, obtain a short descriptor of the data to be compressed, determine the forward active electric energy data block that needs to be compressed according to the short descriptor of the data to be compressed, determine the data Data0 that needs to be transmitted and the data Data1 that was transmitted last time in the forward active electric energy data block that needs to be compressed, and make a difference between Data1 and Data0 to generate Data2; 所述短描述符,包括:对象标识、对象特征、对象属性标识及属性内元素索引;The short descriptor includes: object identification, object characteristics, object attribute identification and element index within the attribute; 压缩头信息生成单元,根据Data2生成需要传输的数据Data0的压缩头信息;A compression header information generating unit generates compression header information of the data Data0 to be transmitted according to Data2; 所述压缩头信息,包括:压缩头字节长度和字段压缩bit位;The compression header information includes: compression header byte length and field compression bit; 字段压缩bit位用两位数字表示数据块压缩方式,0表示无损数据压缩,1表示无损差值数据压缩,2表示不压缩;The field compression bit uses two digits to indicate the data block compression method, 0 indicates lossless data compression, 1 indicates lossless difference data compression, and 2 indicates no compression; 校验数据生成单元,根据Data0生成CRC校验数据;A check data generating unit generates CRC check data according to Data0; 压缩数据生成单元,使用Data2、压缩头信息及CRC校验数据生成需要传输的数据Data0的压缩数据。The compressed data generating unit generates compressed data of the data Data0 to be transmitted using Data2, the compressed header information and the CRC check data. 6.根据权利要求5所述的系统,所述压缩数据生成后,对外传输使用的传输协议,包括:请求压缩传输或响应压缩传输的方式进行传输;6. The system according to claim 5, after the compressed data is generated, the transmission protocol used for external transmission includes: transmitting in a manner of requesting compressed transmission or responding to compressed transmission; 所述传输的方式若为请求压缩传输,生成的压缩数据携带压缩算法、压缩模式信息和压缩数据的处理结果后进行传输。If the transmission method is to request compressed transmission, the generated compressed data is transmitted after carrying the compression algorithm, compression mode information and the processing result of the compressed data. 7.根据权利要求5所述的系统,所述压缩数据的压缩方式为无损差值数据压缩;7. The system according to claim 5, wherein the compression method of the compressed data is lossless difference data compression; 若压缩数据的压缩方式不能使用无损差值数据压缩时,压缩数据的压缩方式使用无损数据压缩,所述无损数据压缩是将CRC校验数据及Data0进行压缩,生成压缩数据。If the compression method of the compressed data cannot use lossless difference data compression, the compression method of the compressed data uses lossless data compression, and the lossless data compression compresses CRC check data and Data0 to generate compressed data. 8.根据权利要求5所述的系统,所述校验数据生成单元还用于:使用Data0数据生成CRC校验数据后,根据CRC校验数据生成CRC16校验数据作为附加校验数据。8. The system according to claim 5, wherein the verification data generating unit is further used to: after using Data0 data to generate CRC verification data, generate CRC16 verification data as additional verification data according to the CRC verification data.
CN202111151155.1A 2021-09-29 2021-09-29 Data compression method and system Active CN114827287B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111151155.1A CN114827287B (en) 2021-09-29 2021-09-29 Data compression method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111151155.1A CN114827287B (en) 2021-09-29 2021-09-29 Data compression method and system

Publications (2)

Publication Number Publication Date
CN114827287A CN114827287A (en) 2022-07-29
CN114827287B true CN114827287B (en) 2024-06-11

Family

ID=82526097

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111151155.1A Active CN114827287B (en) 2021-09-29 2021-09-29 Data compression method and system

Country Status (1)

Country Link
CN (1) CN114827287B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116600021B (en) * 2023-05-19 2025-09-12 山东省计算中心(国家超级计算济南中心) A method for implementing a PLC internal data monitoring system
CN117792568B (en) * 2023-12-04 2024-07-23 北京君盾装备技术有限公司 Reliable communication method and system based on accumulated value

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014145363A2 (en) * 2013-03-15 2014-09-18 Hughes Network Systems, Llc Data compression for priority-based data traffic, on an aggregate traffic level, in a multi-stream communications system
CN110277998A (en) * 2019-06-27 2019-09-24 中国电力科学研究院有限公司 Power grid data lossless compression method and device
CN112202623A (en) * 2020-12-03 2021-01-08 北京和利时系统工程有限公司 Data processing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8692695B2 (en) * 2000-10-03 2014-04-08 Realtime Data, Llc Methods for encoding and decoding data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014145363A2 (en) * 2013-03-15 2014-09-18 Hughes Network Systems, Llc Data compression for priority-based data traffic, on an aggregate traffic level, in a multi-stream communications system
CN110277998A (en) * 2019-06-27 2019-09-24 中国电力科学研究院有限公司 Power grid data lossless compression method and device
CN112202623A (en) * 2020-12-03 2021-01-08 北京和利时系统工程有限公司 Data processing method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于动态字典和差分编码的计量数据压缩研究;梁捷;信息技术;20201022(10);全文 *

Also Published As

Publication number Publication date
CN114827287A (en) 2022-07-29

Similar Documents

Publication Publication Date Title
CN114827287B (en) Data compression method and system
CN110719296B (en) A method for automatically parsing message data in a terminal communication protocol
KR20130126823A (en) Method and apparatus for data management of advanced metering infrastructure network
US20150117464A1 (en) Communication apparatus, communication method, and computer readable medium
CN108028841A (en) Method and apparatus for sending and receiving data in a communications system
CN110213756A (en) A kind of data transmission method, device and its relevant device
CN112133074A (en) Data acquisition method, equipment, server and system of multiple metering sensors
CN113660286A (en) Communication protocol fusion method combined with Kalman filtering data fusion and related equipment
CN107659629B (en) Efficient electric power archive synchronization method suitable for electricity consumption information acquisition system
CN109525370A (en) Data packet sending method based on zigbee
CN115484131B (en) Internet of things gateway and equipment data storage system for same
CN115173865B (en) Battery data compression processing method for energy storage power station and electronic equipment
CN113437997B (en) Power line carrier communication method, device, equipment and medium
CN101789852A (en) Method for dynamic control of data packet length in wireless sensor network
CN105931445B (en) Anti-interference wireless M-Bus short-distance meter reading control method
CN109217986A (en) A kind of data transmission method and system based on Internet of Things
CN110944065B (en) Sensor data transmission method and system based on Internet of things
CN111953451A (en) A method to improve the efficiency of parsing the frame structure of the Internet of Things
CN117596095A (en) Water and electricity collection and dip net based on edge calculation
CN105991214A (en) Data transmission method and data transmission device
US11754419B2 (en) Auto-detection of communication module protocol in utility metering systems
CN112910775B (en) Power line carrier communication method and system based on data fusion and minimum spanning tree
CN115276715A (en) Transformer area topological relation identification method based on characteristic current signals
CN105243807A (en) Data transmission system and data transmission method
CN115080644A (en) Power grid resource service middlebox and power grid information model construction method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant