CN109067775B - Communication data compression and decompression method, device and system - Google Patents

Communication data compression and decompression method, device and system Download PDF

Info

Publication number
CN109067775B
CN109067775B CN201811057233.XA CN201811057233A CN109067775B CN 109067775 B CN109067775 B CN 109067775B CN 201811057233 A CN201811057233 A CN 201811057233A CN 109067775 B CN109067775 B CN 109067775B
Authority
CN
China
Prior art keywords
data
data frame
current
frame
compression
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
CN201811057233.XA
Other languages
Chinese (zh)
Other versions
CN109067775A (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.)
Hefei University of Technology
State Grid Shanghai Electric Power Co Ltd
Original Assignee
Hefei University of Technology
State Grid Shanghai Electric Power Co Ltd
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 Hefei University of Technology, State Grid Shanghai Electric Power Co Ltd filed Critical Hefei University of Technology
Priority to CN201811057233.XA priority Critical patent/CN109067775B/en
Publication of CN109067775A publication Critical patent/CN109067775A/en
Application granted granted Critical
Publication of CN109067775B publication Critical patent/CN109067775B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • H04L67/5651Reducing the amount or size of exchanged application data

Landscapes

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

Abstract

The invention discloses a method, a device and a system for compressing and decompressing communication data, wherein the method comprises the following steps: receiving a configuration frame and a data frame; dividing the data frame into a data frame set, and judging whether the data frame set is the first frame data of the current compression; if so, changing the value of the SYNC field of the current frame into a preset field, and taking the next frame of the current frame as the current frame; if not, performing variable compression on the current Frame to obtain a variable section delta DATA _ Frame; judging whether the compressed data frame reaches the upper compression limit or not according to the compressed Count number Count _ byte; judging whether the compression time is greater than or equal to a preset time limit T or not; and sending the combination of the DATA _ Frame1, the compressed Count number Count _ byte and the variable segment delta DATA _ Frame as compressed DATA to a master station in the WAMS system for receiving the DATA sent by the DATA sending device. By applying the embodiment of the invention, the sending efficiency of the information can be improved.

Description

Communication data compression and decompression method, device and system
Technical Field
The invention relates to a communication data compression and decompression method, in particular to a communication data compression and decompression method, device and system.
Background
The power distribution network WAMS (Wide Area Measurement system) is a Wide Area monitoring system applied to a power distribution network, and adopts a synchronous Phasor Measurement technology, and by arranging a PDC (phase Data Concentrator) at the outgoing line head end of each distribution line and a PMU (phase Measurement Unit) at each section of the distribution line, real-time high-speed acquisition of the synchronous Phasor of the distribution line and the main Data of the power distribution network is realized. The power distribution Network WAMS system comprises PMU equipment for data acquisition, PDC equipment or NIC (Network Interface Controller) equipment for data compression and transmission; and then the PMU sends the acquired data to the PDC or NIC, or the PDC or NIC, compresses the data acquired by the PMU and sends the compressed data to a WAMS master station in the WAMS system of the power distribution network. In general, the WAMS of a power distribution network uses communication specifications of about: part 2 of the GBT26865.2-2011 power system real-time dynamic monitoring system: a data transmission protocol. The communication system of the power distribution network WAMS has the following characteristics: the communication network structure is complex, and the number of communication terminal nodes is large; the communication distance is short; the amount of communication data is large. In order to meet the requirements of the power distribution network WAMS on a communication system in the construction, a plurality of power system communication modes need to be matched for use.
However, since the PDC or NIC is connected to the PMU through the optical fiber, the communication frequency may reach 100 frames per second, but the transmission rate of the wireless network system that the PDC or NIC transmits data to the WAMS master station is lower than 100 frames per second, which may result in an excessively small amount of information contained in the unit volume of data transmitted by the PDC or NIC, and thus, the information transmission efficiency is low.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a communication data compression and decompression method, device and system to improve the information transmission efficiency.
The invention solves the technical problems through the following technical scheme:
in a first aspect, an embodiment of the present invention provides a communication data compression method, which is applied to a data sending device that sends data to a master station in a power distribution network WAMS system, where the method includes:
a: receiving a configuration frame sent by a WAMS main station in a WAMS system, and receiving data frames sent by each PMU unit; dividing the data frame into at least two sets of data frames;
b: for each data frame set, taking a first data frame in the data frame set as a current data frame, and judging whether the current data frame is the first frame data of the current round of compression;
c: if yes, changing the value of the SYNC field of the current data frame into a preset field, and setting the value of the compressed counter Count _ byte to be 0; storing the current DATA Frame to a DATA _ Frame1 section at the head end of the buffer array TEMP, and judging whether the compression time consumption of the current compression is greater than or equal to a preset time limit T or not; if the time consumed by the compression of the round is more than or equal to the preset time limit T, executing the step F, if the time consumed by the compression of the round is less than the preset time limit T, taking the next frame of the current data frame as the current data frame, and returning to execute the step B;
d: if not, taking the sum of the current value of the compressed Count number Count _ byte and a preset step length as the current value of the compressed Count number; performing variable compression on the current DATA Frame according to the difference between the phasor of the current DATA Frame and the phasor corresponding to the previous DATA Frame of the current DATA Frame to obtain a variable section delta DATA _ Frame;
e: judging whether the data frame compressed in the current compression reaches the upper compression limit or not according to the compressed Count number Count _ byte; if the data frame compressed by the compression reaches the upper limit of the compression, executing the step F; if the data frame compressed by the compression of the current round does not reach the compression upper limit, judging whether the compression time consumption of the compression of the current round is greater than or equal to a preset time limit T or not; if the time consumption of the compression of the round is more than or equal to the preset time limit T, executing the step F, if the time consumption of the compression of the round is less than the preset time limit T, taking the next frame of the current data frame as the current data frame, and returning to execute the step B;
f: when the current DATA Frame is the first Frame of the current round of compression and the compression time consumption of the current round of compression is greater than or equal to a preset time limit T, the combination of the DATA _ Frame1 and the compressed Count number Count _ byte is used as compressed DATA and is sent to a master station in the WAMS system for receiving the DATA sent by the DATA sending equipment; and under the condition that the current DATA Frame is the first Frame of the current round of compression and the compression time consumption of the current round of compression is greater than or equal to a preset time limit T, sending the combination of the DATA _ Frame1, the compressed Count number Count _ byte and the variable segment delta DATA _ Frame as compressed DATA to a master station in the WAMS system for receiving the DATA sent by the DATA sending device.
Optionally, the data sending device at least includes: one of a PDC element and a NIC element.
Optionally, step a includes:
and receiving a data frame which is sent by each PMU unit and is generated by the line data acquired by the PMU unit according to the configuration frame.
Optionally, the performing variable compression on the current DATA Frame according to the difference between the phasor of the current DATA Frame and the phasor corresponding to the previous DATA Frame of the current DATA Frame to obtain a variable section Δ DATA _ Frame includes:
d1: dividing the phasor number n contained in the current data frame by j to obtain a group of phasors a and a remainder b phasors, wherein b is less than j;
d2: starting from a first group of phasors in a group of phasors, taking the first group of vectors as a current group of vectors, and comparing the amplitude of each phasor in the current group of phasors with the amplitude of the corresponding phasor of a previous data frame of the current data frame to obtain a first amplitude variation; comparing the angle of each phasor of the current data frame with the angle of each corresponding phasor of a previous data frame of the current data frame to obtain a first angle variable quantity, and generating a first variable identifier according to the first amplitude variable quantity and the first angle variable quantity; synthesizing the first amplitude variation and the first angle variation into a first variable;
d3: storing a first variable identifier corresponding to the current group phasor into an identifier group flag; storing the first variable into a variable array data; then taking the next group of phasors of the current group of phasors as the current group of phasors, and returning to execute the step D2 until the a groups of phasors are processed;
d4: for each phasor in the b phasors, comparing the amplitude of the phasor with the amplitude of the corresponding phasor of the previous data frame of the current data frame to obtain a second amplitude variable quantity; comparing the angle of the phasor with the angle of the corresponding phasor of the previous data frame of the current data frame to obtain a second angle variation; generating a second variable identifier according to the second amplitude variation and the second angle variation, and storing the second variable identifier into an identifier array flag; synthesizing the second amplitude variation and the second angle variation into a second variable; storing the second variable into a variable array data;
d5 makes the flag array flag and the variable array DATA constitute a variable segment delta DATA _ Frame.
Optionally, the amplitude of the phasor is compared with the amplitude of the corresponding phasor of the previous data frame of the current data frame to obtain a first amplitude variation; comparing the angle of each phasor of the current data frame with the angle of each corresponding phasor of a previous data frame of the current data frame to obtain a first angle variation, and generating a first variable identifier according to the first amplitude variation and the first angle variation, including:
1) and setting k as a count and an initial value as 0, judging whether k is smaller than j:
2) if so, taking the difference H1 between the amplitude r1 of each phasor of the current data frame and the amplitude p1 of each corresponding phasor of the previous data frame of the current data frame as a first amplitude variation; taking a difference value H2 of the angle r2 of each phasor of a current data frame and the angle p2 of each corresponding phasor of a previous data frame of the current data frame as a first angle variation amount; judging whether the absolute values of H1 and H2 are both less than 8;
3) if the absolute values of H1 and H2 are both less than 8, allocating 0.5 byte storage space for H1 and H2 respectively, and updating the first variable identifier sign [ k ] to be 0x 00; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 8, and judging whether the value of H2 is negative; if the value of H1 is positive, judging whether the value of H2 is negative, if the value of H2 is negative, updating the value of H2 to the sum of H2 and H8; storing H1 and H2 into a cache array one;
4) if the absolute values of H1 and H2 are not both less than 8, judging whether the absolute values of H1 and H2 are both less than 128;
5) if the absolute values of H1 and H2 are both less than 128, 1 byte of storage space is allocated for H1 and H2 respectively, and the first variable identifier sign [ k ] is updated to be 0x 01; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 128, and judging whether the value of H2 is negative; if the value of H1 is positive, performing the step of determining whether the value of H2 is negative, and if the value of H2 is negative, updating the value of H2 to the sum of H2 and 128; storing H1 and H2 in cache array two;
6) if the absolute values of H1 and H2 are not both less than 128, judging whether the absolute values of H1 and H2 are both less than 2048;
7) if the absolute values of H1 and H2 are both smaller than 2048, 1.5 bytes of storage space is allocated to H1 and H2 respectively, and the first variable identification sign [ k ] is updated to be 0x 02; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 2048, and judging whether the value of H2 is negative; if the value of H1 is positive, performing the step of determining whether the value of H2 is negative; if the value of H2 is negative, updating the value of H2 to be the sum of H2 and 2048; storing H1 and H2 into a cache array three;
8) if the absolute values of H1 and H2 are not both less than 2048, updating the first variable identifier sign [ k ] to 0x03, and then storing r1 and r2 in the cache array four;
9) updating the value of k to k +1, and returning to execute the step 1); until each vector in the current set of vectors is processed;
10) and when the value of k is larger than or equal to j, executing the step D3.
Optionally, the storing the first variable identifier corresponding to the current group phasor in an identifier group flag includes:
and storing the first variable identifications corresponding to each phasor in the current group of phasors into a temporary identification array sign, and then storing the set of the first variable identifications corresponding to each phasor in the current group into an identification array flag.
Optionally, the preset step length is 1.
Optionally, the preset field is: 0xAA 63.
The embodiment of the invention also provides a communication data decompression method, which is applied to a master station for receiving data sent by data sending equipment in a WAMS system, and the method comprises the following steps:
g: receiving a compressed data frame which is sent by the data sending equipment and corresponds to the data frame set;
h: judging whether the SYNC field of the data frame is a preset field, if not, returning to execute the step G; if yes, executing step I;
i: sequentially putting L bytes of data after the Count _ byte into an identification array flag, and putting the L bytes of data into a variable array data;
j: sequentially taking j marks out of the mark array flag and putting the j marks into an array sign, sequentially reading data with corresponding lengths in the variable array data according to sign content, restoring original phasors corresponding to the data read according to the sign content according to the phasors of a previous data frame of a data frame corresponding to the variable array data, and sequentially storing the original phasors into an array Full _ data;
k: b marks are sequentially taken out from the mark array flag and are placed into an array sign, then data with corresponding lengths in the variable array data are sequentially read according to sign content, original phasors corresponding to the data read according to the sign content are restored according to phasors of a previous data frame of a data frame corresponding to the variable array data, and the original phasors are sequentially stored into an array Full _ data;
l: and generating other fields except phasor according to the configuration frame and the first frame data frame, and combining the generated other fields with data in the array Full _ data to generate a complete data frame.
Optionally, the method further includes:
and judging whether the obtained decompressed data frame has errors or missed transmission, if so, sending a reissue command to the data sending equipment so that the data sending equipment can call the corresponding error or missed transmission data frame.
The embodiment of the invention also provides a communication data compression device, which is applied to data sending equipment for sending data to a main station in the WAMS system of a power distribution network, and the device comprises:
the first receiving module is used for receiving a configuration frame sent by a WAMS master station in the WAMS system and receiving data frames sent by each PMU unit; dividing the data frame into at least two data frame sets, wherein the configuration frame comprises data a and b;
the first judgment module is used for taking a first data frame in the data frame sets as a current data frame and judging whether the current data frame is the first frame data of the current round of compression aiming at each data frame set;
a first setting module, configured to change a value of the SYNC field of the current data frame to a preset field and set a value of the compressed Count number Count _ byte to 0 if the determination result of the first determining module is yes; storing the current DATA Frame to a DATA _ Frame1 section at the head end of the buffer array TEMP, and judging whether the compression time consumption of the current compression is greater than or equal to a preset time limit T or not; if the compression time consumption of the current round of compression is greater than or equal to the preset time limit T, triggering a second setting module, and if the compression time consumption of the current round of compression is less than the preset time limit T, taking the next frame of the current data frame as the current data frame and triggering a first judgment module;
the compression module is used for taking the sum of the current value of the compressed Count number Count _ byte and a preset step length as the current value of the compressed Count number under the condition that the judgment result of the first judgment module is negative; performing variable compression on the current DATA Frame according to the difference between the phasor of the current DATA Frame and the phasor corresponding to the previous DATA Frame of the current DATA Frame to obtain a variable section delta DATA _ Frame;
the second judgment module is used for judging whether the data frame compressed by the current compression reaches the upper compression limit or not according to the Count of compression Count number _ byte; if the data frame compressed by the compression reaches the upper limit of the compression, executing the step F; if the data frame compressed by the compression of the current round does not reach the compression upper limit, judging whether the compression time consumption of the compression of the current round is greater than or equal to a preset time limit T or not; if the compression time consumption of the current round of compression is greater than or equal to the preset time limit T, triggering a second setting module, and if the compression time consumption of the current round of compression is less than the preset time limit T, taking the next frame of the current data frame as the current data frame, and triggering the first judging module;
a second setting module, configured to send a combination of the DATA _ Frame1 and the compressed Count number Count _ byte as compressed DATA to a master station in the WAMS system for receiving DATA sent by a DATA sending device when the current DATA Frame is a first Frame of the current round of compression and the compression time consumption of the current round of compression is greater than or equal to a preset time limit T; and under the condition that the current DATA Frame is the first Frame of the current round of compression and the compression time consumption of the current round of compression is greater than or equal to a preset time limit T, sending the combination of the DATA _ Frame1, the compressed Count number Count _ byte and the variable segment delta DATA _ Frame as compressed DATA to a master station in the WAMS system for receiving the DATA sent by the DATA sending device.
Optionally, the data sending device at least includes: one of a PDC element and a NIC element.
Optionally, the first receiving module is further configured to:
and receiving a data frame which is sent by each PMU unit and is generated by the line data acquired by the PMU unit according to the configuration frame.
Optionally, the compression module is further configured to:
d1: dividing the phasor number n contained in the current data frame by j to obtain a group of phasors a and a remainder b phasors, wherein b is less than j;
d2: starting from a first group of phasors in a group of phasors, taking the first group of vectors as a current group of vectors, and comparing the amplitude of each phasor in the current group of phasors with the amplitude of the corresponding phasor of a previous data frame of the current data frame to obtain a first amplitude variation; comparing the angle of each phasor of the current data frame with the angle of each corresponding phasor of a previous data frame of the current data frame to obtain a first angle variable quantity, and generating a first variable identifier according to the first amplitude variable quantity and the first angle variable quantity; synthesizing the first amplitude variation and the first angle variation into a first variable;
d3: storing a first variable identifier corresponding to the current group phasor into an identifier group flag; storing the first variable into a variable array data; then taking the next group of phasors of the current group of phasors as the current group of phasors, and returning to execute the step D2 until the a groups of phasors are processed;
d4: for each phasor in the b phasors, comparing the amplitude of the phasor with the amplitude of the corresponding phasor of the previous data frame of the current data frame to obtain a second amplitude variable quantity; comparing the angle of the phasor with the angle of the corresponding phasor of the previous data frame of the current data frame to obtain a second angle variation; generating a second variable identifier according to the second amplitude variation and the second angle variation, and storing the second variable identifier into an identifier array flag; synthesizing the second amplitude variation and the second angle variation into a second variable; storing the second variable into a variable array data;
d5: and forming the identification array flag and the variable array DATA into a variable segment delta DATA _ Frame.
Optionally, the compression module is further configured to:
1) and setting k as a count and an initial value as 0, judging whether k is smaller than j:
2) if so, taking the difference H1 between the amplitude r1 of each phasor of the current data frame and the amplitude p1 of each corresponding phasor of the previous data frame of the current data frame as a first amplitude variation; taking a difference value H2 of the angle r2 of each phasor of a current data frame and the angle p2 of each corresponding phasor of a previous data frame of the current data frame as a first angle variation amount; judging whether the absolute values of H1 and H2 are both less than 8;
3) if the absolute values of H1 and H2 are both less than 8, allocating 0.5 byte storage space for H1 and H2 respectively, and updating the first variable identifier sign [ k ] to be 0x 00; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 8, and judging whether the value of H2 is negative; if the value of H1 is positive, judging whether the value of H2 is negative, if the value of H2 is negative, updating the value of H2 to the sum of H2 and H8; storing H1 and H2 into a cache array one;
4) if the absolute values of H1 and H2 are not both less than 8, judging whether the absolute values of H1 and H2 are both less than 128;
5) if the absolute values of H1 and H2 are both less than 128, 1 byte of storage space is allocated for H1 and H2 respectively, and the first variable identifier sign [ k ] is updated to be 0x 01; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 128, and judging whether the value of H2 is negative; if the value of H1 is positive, performing the step of determining whether the value of H2 is negative, and if the value of H2 is negative, updating the value of H2 to the sum of H2 and 128; storing H1 and H2 in cache array two;
6) if the absolute values of H1 and H2 are not both less than 128, judging whether the absolute values of H1 and H2 are both less than 2048;
7) if the absolute values of H1 and H2 are both smaller than 2048, 1.5 bytes of storage space is allocated to H1 and H2 respectively, and the first variable identification sign [ k ] is updated to be 0x 02; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 2048, and judging whether the value of H2 is negative; if the value of H1 is positive, performing the step of determining whether the value of H2 is negative; if the value of H2 is negative, updating the value of H2 to be the sum of H2 and 2048; storing H1 and H2 into a cache array three;
8) if the absolute values of H1 and H2 are not both less than 2048, updating the first variable identifier sign [ k ] to 0x03, and then storing r1 and r2 in the cache array four;
9) updating the value of k to k +1, and returning to execute the step 1); until each vector in the current set of vectors is processed;
10) and when the value of k is larger than or equal to j, executing the step D3.
Optionally, the compression module is further configured to:
and storing the first variable identifications corresponding to each phasor in the current group of phasors into a temporary identification array sign, and then storing the set of the first variable identifications corresponding to each phasor in the current group into an identification array flag.
Optionally, the preset step length is 1.
Optionally, the preset field is: 0xAA 63.
The embodiment of the invention also provides a communication data decompression device, which is applied to a master station for receiving data sent by data sending equipment in a WAMS system, and the device comprises:
a second receiving module, configured to receive a compressed data frame corresponding to the data frame set and sent by the data sending device;
the third judging module is used for judging whether the SYNC field of the data frame is a preset field or not, and if not, the second receiving module is triggered; if yes, triggering the storage module;
the storage module is used for sequentially putting L bytes of data after the Count of the compressed digital Count _ byte into an identification array flag, and putting the data after the L bytes into a variable array data;
sequentially taking j marks out of the mark array flag and putting the j marks into an array sign, sequentially reading data with corresponding lengths in the variable array data according to sign content, restoring original phasors corresponding to the data read according to the sign content according to the phasors of a previous data frame of a data frame corresponding to the variable array data, and sequentially storing the original phasors into an array Full _ data;
the decompression module is used for sequentially taking out b identifications from the identification array flag and putting the b identifications into an array sign, sequentially reading data with corresponding lengths in the variable array data according to sign content, restoring original phasors corresponding to the data read according to the sign content according to phasors of a previous data frame of a data frame corresponding to the variable array data, and sequentially storing the original phasors into an array Full _ data;
and the combination module is used for generating other fields except phasor according to the configuration frame and the first frame data frame, and combining the generated other fields with the data in the array Full _ data to generate a complete data frame.
Optionally, the apparatus further comprises: a fourth determining module, configured to:
and judging whether the obtained decompressed data frame has errors or missed transmission, if so, sending a reissue command to the data sending equipment so that the data sending equipment can call the corresponding error or missed transmission data frame.
The embodiment of the invention also provides a communication data compression and decompression system, which comprises:
a communication data compression apparatus according to any one of the above claims, and a communication data decompression apparatus according to any one of the above claims.
Compared with the prior art, the invention has the following advantages:
by applying the embodiment of the invention, the current data frame is subjected to variable compression according to the difference between the phasor of the current data frame and the phasor corresponding to the previous data frame of the current data frame, only the first frame data frame in each compression is reserved, then data compression is performed according to the difference between the phasors in the data frames after the first frame data frame, and the storage space occupied by the difference between the phasors is smaller than the storage space occupied by the phasors, so that the data volume corresponding to the data frame can be reduced, the information content contained in the data of unit capacity is improved, and the information sending efficiency is improved.
Drawings
Fig. 1 is a schematic flow chart of a communication data compression method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a power distribution network WAMS system according to an embodiment of the present invention;
fig. 3 is a schematic data exchange diagram of a power distribution network WAMS system according to an embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating a communication data compression method according to an embodiment of the present invention;
fig. 5 is a schematic diagram illustrating a principle of generating a variable identifier in a communication data compression method according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of data compressed by a communication data compression method according to an embodiment of the present invention;
fig. 7 is a schematic flowchart of a communication data decompression method according to an embodiment of the present invention;
fig. 8 is a schematic diagram illustrating a communication data decompression method according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a communication data compression apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a communication data decompression device according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a communication data compression and decompression system according to an embodiment of the present invention.
Detailed Description
The following examples are given for the detailed implementation and specific operation of the present invention, but the scope of the present invention is not limited to the following examples.
In order to solve the problems in the prior art, embodiments of the present invention provide a method, an apparatus, and a system for compressing and decompressing communication data.
In the first aspect, a method for compressing communication data according to an embodiment of the present invention is first described below.
First, it is explained that a communication data compression method provided in an embodiment of the present invention is preferably applied to a data transmission device for transmitting data to a master station in a power distribution network WAMS system, and the data transmission device at least includes: one of a PDC element and a NIC element.
Fig. 1 is a schematic flowchart of a communication data compression method according to an embodiment of the present invention, and as shown in fig. 1, the method includes:
s101: receiving a configuration frame sent by a WAMS main station in a WAMS system, and receiving data frames sent by each PMU unit; and dividing the data frame into at least two data frame sets, wherein the configuration frame comprises data a and b.
Specifically, a data frame, which is sent by each PMU and generates line data acquired by the PMU according to the configuration frame, may be received.
Fig. 2 is a schematic structural diagram of a power distribution network WAMS system according to an embodiment of the present invention; fig. 3 is a schematic data exchange diagram of a power distribution network WAMS system according to an embodiment of the present invention; as shown in fig. 2-3, the PDC device obtains the data frame from the PMU device through the ethernet, compresses the data frame, and sends the compressed data frame to the WAMS system master station through the private VPN in the wireless network. In another application scenario, the NIC device obtains the data frame from the PMU device, compresses the data frame, and sends the compressed data frame to the WAMS system master station through the dedicated VPN in the wireless network. As shown in fig. 3, the PMU device sends a DATA frame DATA to the PDC device or the NIC device once every Jms, and the PDC device or the NIC device compresses N DATA frames received in N × Jms every N × Jms and sends the compressed N DATA frames to the WAMS system master station.
Illustratively, the WAMS master station in the WAMS system may send a preset configuration frame to each data sending device, where the configuration frame includes the number a of phasors included in each phasor packet in each data frame, and the number b of phasors not grouped in the data frame. For example, a data frame contains 18 phasors, and a has a value of 4, i.e., every four phasors are grouped into one group, and then four groups of phasors are obtained. There are two remaining phasors, which are the b phasors that are not grouped.
If 3 data frame sets are obtained in the step, the data frames contained in the data frame set-1 are frame-1-1, frame-1-2, frame-1-3, frame-1-4, frame-1-5 and frame-1-6; the data frames contained in the data frame set-2 are frame-2-1, frame-2-2, frame-2-3, frame-2-4, frame-2-5 and frame-2-6; the data frames contained in the data frame set-3 are frame-3-1, frame-3-2, frame-3-3, frame-3-4, frame-3-5 and frame-3-6.
S102: for each data frame set, taking a first data frame in the data frame set as a current data frame, and judging whether the current data frame is the first frame data of the current round of compression; if yes, executing step S103; if not, executing the step S104;
step S101 shows that the PDC device or the NIC compresses N data frames received within N × Jms every N × Jms and then sends the compressed N data frames to the WAMS system master station, so that it needs to determine whether a current frame, frame-1-1, received by the PDC device or the NIC device is the first frame data of the current round of compression, if the current frame is the first frame data, the current round of compression is started, and step S103 is executed; if the first frame data is not the first frame data of the current round of compression, the step S104 is executed.
S103: changing the value of the SYNC field of the current data frame into a preset field, and setting the value of the compressed Count number Count _ byte to 0; storing the current DATA Frame to a DATA _ Frame1 section at the head end of the buffer array TEMP, and judging whether the compression time consumption of the current compression is greater than or equal to a preset time limit T or not; and if the compression time consumption of the current round of compression is greater than or equal to the preset time limit T, executing the step S106, and if the compression time consumption of the current round of compression is less than the preset time limit T, taking the next frame of the current data frame as the current data frame, and returning to execute the step S102.
Specifically, the preset field may be: 0xAA 63.
Illustratively, the compression for the data frame set-1 is taken as the first round of compression. In the existing WAMS system, the field value of the data frame is executed according to the specification of GBT26865.2-2011, the SYNC field value of the data frame is 0xAA03, and in the embodiment of the present invention, the SYNC of the first frame data frame of each round of compressed communication is changed to 0xAA63 for distinction; meanwhile, the value of the compressed Count number Count _ byte compressed in the current round is set to 0, and then the content of the current Frame, Frame-1-1, is stored in the DATA _ Frame1 section at the head end of the buffer array TEMP. Then, the time length from the moment when the data frame set-1 starts to be received to the current moment of the data compression unit price is taken as the compression time consumption of the current compression, and then whether the compression time consumption of the current compression is larger than or equal to the preset time limit T is judged; if the time consumed for the compression of the current round is greater than or equal to the preset time limit T, step S106 is executed, and if the time consumed for the compression of the current round is less than the preset time limit T, 0, which is the next frame of the current data frame, frame-1-2, is taken as the current data frame, and the step S102 is executed again.
Note that the SYNC field may also be referred to as a synchronization field.
S104: taking the sum of the current value of the compressed Count number Count _ byte and a preset step length as the current value of the compressed Count number; performing variable compression on the current DATA Frame according to the difference between the phasor of the current DATA Frame and the phasor corresponding to the previous DATA Frame of the current DATA Frame to obtain a variable section delta DATA _ Frame;
specifically, according to a difference between the phasor of the current DATA Frame and the phasor corresponding to the previous DATA Frame of the current DATA Frame, performing variable compression on the current DATA Frame to obtain a variable segment Δ DATA _ Frame may include: d1: dividing the phasor number n contained in the current data frame by j to obtain a group of phasors a and a remainder b phasors, wherein b is less than j; d2: starting from a first group of phasors in the a group of phasors, comparing the amplitude of each phasor in the current group of phasors with the amplitude of the corresponding phasor in the previous data frame of the current data frame to obtain a first amplitude variation; comparing the angle of each phasor of the current data frame with the angle of each corresponding phasor of a previous data frame of the current data frame to obtain a first angle variation; d3: storing a first variable identifier corresponding to the current group phasor into an identifier group flag; storing the first variable into a variable array data; then taking the next group of phasors of the current group of phasors as the current group of phasors, and returning to execute the step D2 until the a groups of phasors are processed; d4: for each phasor in the b phasors, comparing the amplitude of the phasor with the amplitude of the corresponding phasor of the previous data frame of the current data frame to obtain a second amplitude variable quantity; comparing the angle of the phasor with the angle of the corresponding phasor of the previous data frame of the current data frame to obtain a second angle variation; generating a second variable identifier according to the second amplitude variation and the second angle variation, and storing the second variable identifier into an identifier array flag; synthesizing the second amplitude variation and the second angle variation into a second variable; storing the second variable into a variable array data; d5 makes the flag array flag and the variable array DATA constitute a variable segment delta DATA _ Frame.
Specifically, the amplitude of the phasor is compared with the amplitude of the corresponding phasor of the previous data frame of the current data frame to obtain a first amplitude variation; comparing the angle of each phasor of the current data frame with the angle of each corresponding phasor of a previous data frame of the current data frame to obtain a first angle variation, and generating a first variable identifier according to the first amplitude variation and the first angle variation, which may include: 1) and setting k as a count and an initial value as 0, judging whether k is smaller than j: 2) if so, taking the difference H1 between the amplitude r1 of each phasor of the current data frame and the amplitude p1 of each corresponding phasor of the previous data frame of the current data frame as a first amplitude variation; taking a difference value H2 of the angle r2 of each phasor of a current data frame and the angle p2 of each corresponding phasor of a previous data frame of the current data frame as a first angle variation amount; judging whether the absolute values of H1 and H2 are both less than 8; 3) if the absolute values of H1 and H2 are both less than 8, allocating 0.5 byte storage space for H1 and H2 respectively, and updating the first variable identifier sign [ k ] to be 0x 00; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 8, and judging whether the value of H2 is negative; if the value of H1 is positive, judging whether the value of H2 is negative, if the value of H2 is negative, updating the value of H2 to the sum of H2 and H8; storing H1 and H2 into a cache array one; 4) if the absolute values of H1 and H2 are not both less than 8, judging whether the absolute values of H1 and H2 are both less than 128; 5) if the absolute values of H1 and H2 are both less than 128, 1 byte of storage space is allocated for H1 and H2 respectively, and the first variable identifier sign [ k ] is updated to be 0x 01; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 128, and judging whether the value of H2 is negative; if the value of H1 is positive, performing the step of determining whether the value of H2 is negative, and if the value of H2 is negative, updating the value of H2 to the sum of H2 and 128; storing H1 and H2 in cache array two; 6) if the absolute values of H1 and H2 are not both less than 128, judging whether the absolute values of H1 and H2 are both less than 2048; 7) if the absolute values of H1 and H2 are both smaller than 2048, 1.5 bytes of storage space is allocated to H1 and H2 respectively, and the first variable identification sign [ k ] is updated to be 0x 02; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 2048, and judging whether the value of H2 is negative; if the value of H1 is positive, performing the step of determining whether the value of H2 is negative; if the value of H2 is negative, updating the value of H2 to be the sum of H2 and 2048; storing H1 and H2 into a cache array three; 8) if the absolute values of H1 and H2 are not both less than 2048, updating the first variable identifier sign [ k ] to 0x03, and then storing r1 and r2 in the cache array four; 9) updating the value of k to k +1, and returning to execute the step 1); until each vector in the current set of vectors is processed; 10) and when the value of k is larger than or equal to j, executing the step D3.
Specifically, the storing the first variable identifier corresponding to the current group phasor in the identifier array flag may include: and storing the first variable identifications corresponding to each phasor in the current group of phasors into a temporary identification array sign, and then storing the set of the first variable identifications corresponding to each phasor in the current group into an identification array flag.
Fig. 4 is a schematic diagram illustrating a principle of a communication data compression method according to an embodiment of the present invention, and as shown in fig. 4, if the number of phasors included in a current data frame is 18, a is 4, and b is 2, the 18 phasors included in the current data frame are sequentially divided into 4 groups. Let i be the count number, representing how many sets of phasors have been processed, e.g. when i is 0, variable compression of four phasors in the first set of phasors is started, and then when compression of each set of phasors is performed, let j be the count number, j representing how many phasors in the current set of phasors have been processed.
The numbers of each phasor in the first group are phasor-1-1, phasor-1-2, phasor-1-3 and phasor-1-4; similarly, each phasor in the second set is numbered phasor-2-1, phasor-2-2, phasor-2-3, phasor-2-4; the numbers of each phasor in the third group are phasor-3-1, phasor-3-2, phasor-3-3 and phasor-3-4; the numbers of each phasor in the fourth group are phasor-4-1, phasor-4-2, phasor-4-3 and phasor-4-4; the remaining two phasors may be phasor-b-1, phasor-b-2.
Firstly, performing variable compression on a first phasor in the first set of phasors, comparing the amplitude of the phasor-1-1 with the amplitude of a corresponding position of the frame-1-1, for example, calculating the difference to obtain the difference between the amplitude of the phasor-1-1 in the first set of phasors of the frame-1-2 and the amplitude of the phasor-1-1 in the first set of phasors of the frame-1-1, and taking the difference as a first amplitude variation; then, the angle of the phasor-1-1 is compared with the angle of the corresponding position of the frame-1-1, and for example, the difference can be found to be the difference of the angle between the phasor-1-1 in the first set of phasors of the frame-1-2 and the phasor-1-1 in the first set of phasors of the frame-1-1, and the difference is taken as the first angle change amount.
And then taking the vector-1-1 in the first group of vectors of the data frame-1-2 as a current phasor, and generating a first variable identifier according to a first angle variation and a first amplitude variation of the current phasor.
Fig. 5 is a schematic diagram of a principle of generating a variable identifier in a communication data compression method according to an embodiment of the present invention, and as shown in fig. 5, a process may be: let k be the count number, the value of k being less than j, i.e., less than 4. Firstly, judging whether k is smaller than 4, if not, indicating that the generation process of the first variable identification for each vector of the first group is finished, and combining the first variable identifications of each phasor in the first group for storage. When the value of k is larger than or equal to j, generating a first variable identifier according to a first amplitude variation and the first angle variation, and storing the first variable identifier into an identifier array flag; synthesizing the first amplitude variation and the first angle variation into a first variable; storing a first variable into a variable array data; and forming a variable segment delta DATA _ Frame by the identification array flag and the variable array DATA.
When k is less than 4, a first variable identification is indicated that is needed to generate phasors in the first set. For example, the difference H1 between the amplitude r1 of the phasor-1-1 of the data frame-1-2 and the corresponding phasor, the amplitude p1 of the phasor-1-1, of the data frame-1-2 is taken as the amplitude variation; taking the difference H2 of the angle r2 of the phasor-1-1 of the data frame-1-2 and the corresponding phasor of the data frame-1-1 of the data frame-1-2 and the angle p2 of the phasor-1-1 as the angle variation; and judges whether the absolute values of H1 and H2 are both less than 8.
If the absolute values of H1 and H2 are both less than 8, allocating 0.5 byte storage space for H1 and H2 respectively, and updating the first variable identifier sign [ k ] to be 0x 00; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 8, and judging whether the value of H2 is negative; if the value of H1 is positive, judging whether the value of H2 is negative, if the value of H2 is negative, updating the value of H2 to the sum of H2 and H8; h1 and H2 are stored in cache array one.
If the absolute values of H1 and H2 are not both less than 8, judging whether the absolute values of H1 and H2 are both less than 128; if the absolute values of H1 and H2 are both less than 128, 1 byte of storage space is allocated for H1 and H2 respectively, and the first variable identifier sign [ k ] is updated to be 0x 01; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 128, and judging whether the value of H2 is negative; if the value of H1 is positive, performing the step of determining whether the value of H2 is negative, and if the value of H2 is negative, updating the value of H2 to the sum of H2 and 128; h1 and H2 are stored into cache array two.
If the absolute values of H1 and H2 are not both less than 128, judging whether the absolute values of H1 and H2 are both less than 2048; if the absolute values of H1 and H2 are both smaller than 2048, 1.5 bytes of storage space is allocated to H1 and H2 respectively, and the first variable identifier sign [ k ] is updated to be 0x 02; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 2048, and judging whether the value of H2 is negative; if the value of H1 is positive, performing the step of determining whether the value of H2 is negative; if the value of H2 is negative, updating the value of H2 to be the sum of H2 and 2048; h1 and H2 are stored in cache array three.
If the absolute values of H1 and H2 are not both less than 2048, updating the first variable identifier sign [ k ] to 0x03, and then storing r1 and r2 in the cache array four; and updating the value of k to k +1, and taking the vector-1-2 in the first group of vectors of the data frame-1-2 as the current phasor, thereby generating a first identifier corresponding to the current phasor. Meanwhile, sequentially storing data in the cache array one, the cache array two or the cache array three of the vector-1-1 into the variable array data; sign [ k ] is stored into flag array flag. For the current data frame, each vector in the first set of vectors in the data frame-1-2 is processed as described above, and then each set of vectors in the data frame-1-2 is processed as described above, thereby completing the processing of the a set of phasors. And finally, sequentially storing the obtained identification array flag, namely, first variable identifications of four vectors in a first set of phasors of the data frame-1-2, first variable identifications of four vectors in a second set of phasors, first variable identifications of four vectors in a third set of phasors, and first variable identifications of four vectors in a fourth set of phasors. The storage sequence of the variables in the variable data is the same as the storage sequence of the first variable identifier in the identifier array flag, and is not described herein again.
After the group a vectors are processed, the remaining 2 vectors need to be processed, and the process of generating the second variable identifiers in the processing process is the same as the process of generating the first variable identifiers in the group a vectors; the process of generating the second variable in the processing process is the same as the process of generating the first variable in the a-group vector, and is not described herein again.
And then combining the variable array DATA corresponding to the DATA Frame-1-2 and the identification array flag into a variable segment delta DATA _ Frame2 of the DATA Frame-1-2.
It should be noted that, when the first variable identifier is stored, taking the cache array one as an example, in an actual storage process, there is no content of a half byte, and in order to save space, it is necessary to splice the data of the cache array one with other data to fill up one byte, so in the embodiment of the present invention, there is 0.5 byte data of one byte cache array one, and similarly, three bytes are allocated to the cache array three for storing 1.5 bytes of data of the cache array, and the corresponding storage spaces are three [0], three [1], and three [2 ].
S105: judging whether the data frame compressed in the current compression reaches the upper compression limit or not according to the compressed Count number Count _ byte; if the compressed data frame reaches the upper limit of the compression, executing step S106; if the data frame compressed by the compression of the current round does not reach the compression upper limit, judging whether the compression time consumption of the compression of the current round is greater than or equal to a preset time limit T or not; if the time consumed for the compression of the current round is greater than or equal to the preset time limit T, executing step S106, and if the time consumed for the compression of the current round is less than the preset time limit T, taking the next frame of the current data frame as the current data frame, and returning to execute step S102.
Illustratively, after the data frame-1-2 is subjected to variable compression, it is determined whether the number of compressed data frames in the compression process of the data frame set-1 reaches an upper limit of the number of data frames that can be compressed, and if the upper limit is reached, the compression process is stopped, and then step S106 is performed.
If the time does not reach the upper limit, judging whether the time consumed for compressing the data frame set-1 reaches a preset time limit T or not, and if the time reaches the preset time limit T, executing the step S106; if the preset time limit T is not reached, taking the next data frame of the data frame-1-2 in the data frame set-1 and the data frame-1-30 as the current frame, and then returning to execute the step S102 until all the data frames in the data frame set are compressed.
S106: when the current DATA Frame is the first Frame of the current round of compression and the compression time consumption of the current round of compression is greater than or equal to a preset time limit T, the combination of the DATA _ Frame1 and the compressed Count number Count _ byte is used as compressed DATA and is sent to a master station in the WAMS system for receiving the DATA sent by the DATA sending equipment; and under the condition that the current DATA Frame is the first Frame of the current round of compression and the compression time consumption of the current round of compression is greater than or equal to a preset time limit T, sending the combination of the DATA _ Frame1, the compressed Count number Count _ byte and the variable segment delta DATA _ Frame as compressed DATA to a master station in the WAMS system for receiving the DATA sent by the DATA sending device.
Fig. 6 is a schematic structural diagram of data compressed by a communication data compression method according to an embodiment of the present invention; as shown in FIG. 6, for the current round of compression, DATA _ Frame1 is used to store the first Frame of DATA for the current round of compression, namely DATA Frame-1-1;
a compressed Count number Count _ byte for storing the number of data frames included in each compression round; Δ DATA _ Frame2, used to store the compressed DATA of DATA Frame-1-2 in the current round of compression, i.e. the corresponding first variable and the first variable identifier; and so on.
It should be noted that, taking Δ DATA _ Frame2 as an example, when performing variable segment combination of the DATA Frame-1-2, the first variable identification array flag of the DATA Frame-1-2 may be stored in the first half of Δ DATA _ Frame2, and then the first variables of the respective phasors are sequentially stored: PHASORS1, PHASORS2, PHASORS3, and so on.
By applying the embodiment shown in fig. 1 of the present invention, according to the difference between the phasor of the current data frame and the phasor corresponding to the previous data frame of the current data frame, the variable compression is performed on the current data frame, only the first frame data frame in each compression is reserved, then the data compression is performed according to the difference between the phasors in the data frames after the first frame data frame, the storage space occupied by the difference between the phasors is smaller than the storage space occupied by the phasors, the information content in the data of unit capacity is increased, and the information transmission efficiency is increased
In addition, by applying the embodiment shown in fig. 1 of the present invention, data can be sent out in time, and data backlog is avoided.
In a second aspect, corresponding to the embodiment shown in fig. 1 of the present invention, an embodiment of the present invention further provides a communication data decompression method.
It should be noted that the communication data decompression method provided by the embodiment of the present invention is preferably applied to a master station that receives data transmitted by a data transmitting device in a WAMS system.
Fig. 7 is a schematic flowchart of a communication data decompression method according to an embodiment of the present invention, and fig. 8 is a schematic diagram of a principle of the communication data decompression method according to an embodiment of the present invention; as shown in fig. 7 and 8, the method includes:
s701: and receiving the compressed data frame which is sent by the data sending equipment and corresponds to the data frame set.
Illustratively, the received compressed data is shown in FIG. 6.
S702: judging whether the SYNC field of the data frame is a preset field, if not, returning to execute the step S701; if yes, go to step S703.
Judging whether the SYNC field of the received data is 0xAA63, if so, indicating that the received data is the data compressed according to the method of the embodiment of the present invention, and executing step S703; if not, the received data is not the data compressed according to the method of the embodiment of the invention, and the loop is skipped to receive the data of the next round.
S703: sequentially putting L bytes of data after the Count _ byte into an identification array flag, and putting the L bytes of data into a variable array data;
illustratively, the data of L bytes after the Count _ byte of the received data frame is stored as a variable flag in the flag array flag. Subsequent data of the data frame is stored as variable data in the variable array data.
It will be appreciated that the size of L is preset by the system and may be a + 1.
S704: sequentially taking out j marks from the mark array flag and putting the j marks into an array sign, sequentially reading data with corresponding lengths in the variable array data according to sign content, restoring original phasors corresponding to the data read according to the sign content according to the phasors of a previous data frame of the data frame corresponding to the variable array data, and sequentially storing the original phasors into an array Full _ data.
Illustratively, 4 identifiers are sequentially taken out from the identifier array flag and put into the array sign, and then data with corresponding lengths in the variable array data are sequentially read.
And restoring original phasors corresponding to the data read according to sign content according to the phasors of the previous data frame of the data frame corresponding to the variable array data, and sequentially storing the original phasors into an array Full _ data. It can be understood that the process of restoring the original phasor and the variable compression process of the step S104 in the embodiment of the present invention are dual processes, and details thereof are not described in the embodiment of the present invention.
S705: b marks are sequentially taken out from the mark array flag and are placed into an array sign, then data with corresponding lengths in the variable array data are sequentially read according to sign content, original phasors corresponding to the data read according to the sign content are restored according to phasors of a previous data frame of a data frame corresponding to the variable array data, and the original phasors are sequentially stored into an array Full _ data.
Illustratively, 2 markers are sequentially taken out from the marker array flag and placed into an array sign, then data with corresponding lengths in the variable array data are sequentially read according to sign content, original phasors corresponding to the data read according to the sign content are restored according to phasors of a previous data frame of a data frame corresponding to the variable array data, and the original phasors are sequentially stored into an array Full _ data, namely are stored behind the original phasors restored in the step S704. In addition, it can be understood that the sizes of a and b are both data contained in the configuration frame transmitted by the master station to the data transmission device in the WAMS system.
S706: and generating other fields except phasor according to the configuration frame and the first frame data frame, and combining the generated other fields with data in the array Full _ data to generate a complete data frame.
It should be emphasized that the process corresponding to this step is the prior art, and the embodiment of the present invention is not described in detail herein.
By applying the embodiment of the invention shown in fig. 7, the compressed data can be decompressed.
In a specific implementation manner of the embodiment of the present invention, the method further includes:
s707 (not shown in the figure): and judging whether the obtained decompressed data frame has errors or missed transmission, if so, sending a reissue command to the data sending equipment so that the data sending equipment can call the corresponding error or missed transmission data frame.
For example, the WAMS master station determines whether the decompressed data frame has an error, for example, may determine whether a value corresponding to the data frame significantly exceeds a reasonable range, or an undetected data item obviously appears, or data between data items is inverted, etc.; or judging whether the received data of the data frame is matched with the preset identification information according to the identification information of the preset data frame, if so, indicating that the data frame has a transmission missing phenomenon, and then sending a transmission supplementing command to the data sending equipment, for example, sending the transmission supplementing command to the corresponding data sending equipment according to the identification information of the data frame which has an error or has been transmitted missing.
By applying the embodiment of the invention, the data error caused by data error or missing transmission can be avoided.
In a third aspect, corresponding to the first aspect of the embodiment of the present invention, an embodiment of the present invention further provides a communication data compression apparatus, which is applied to a data sending device that sends data to a master station in a power distribution network WAMS system.
Fig. 9 is a schematic structural diagram of a communication data compression apparatus according to an embodiment of the present invention, and as shown in fig. 9, the apparatus includes:
a first receiving module 901, configured to receive a configuration frame sent by a WAMS master station in the WAMS system, and receive a data frame sent by each PMU unit; dividing the data frame into at least two sets of data frames;
a first determining module 902, configured to, for each data frame set, use a first data frame in the data frame set as a current data frame, and determine whether the current data frame is first frame data of the current round of compression;
a first setting module 903, configured to, if the determination result of the first determining module 902 is yes, change the value of the SYNC field of the current data frame to a preset field, and set the value of the compressed Count number Count _ byte to 0; storing the current DATA Frame to a DATA _ Frame1 section at the head end of the buffer array TEMP, and judging whether the compression time consumption of the current compression is greater than or equal to a preset time limit T or not; if the compression time consumption of the current round of compression is greater than or equal to the preset time limit T, triggering a second setting module 905, and if the compression time consumption of the current round of compression is less than the preset time limit T, taking the next frame of the current data frame as the current data frame, and triggering a first judging module 902;
a compressing module 904, configured to, if the determination result of the first determining module 902 is negative, take a sum of a current value of the compressed Count number Count _ byte and a preset step size as the current value of the compressed Count number; performing variable compression on the current DATA Frame according to the difference between the phasor of the current DATA Frame and the phasor corresponding to the previous DATA Frame of the current DATA Frame to obtain a variable section delta DATA _ Frame;
a second judging module 905, configured to judge whether a data frame compressed in the current compression reaches an upper compression limit according to the Count _ byte; if the data frame compressed by the compression reaches the upper limit of the compression, executing the step F; if the data frame compressed by the compression of the current round does not reach the compression upper limit, judging whether the compression time consumption of the compression of the current round is greater than or equal to a preset time limit T or not; if the compression time consumption of the current round of compression is greater than or equal to the preset time limit T, triggering a second setting module, and if the compression time consumption of the current round of compression is less than the preset time limit T, taking the next frame of the current data frame as the current data frame, triggering the first judging module 902;
a second setting module 906, configured to send a combination of the DATA _ Frame1 and the compressed Count number Count _ byte as compressed DATA to a master station in the WAMS system for receiving DATA sent by a DATA sending device when the current DATA Frame is a first Frame of the current round of compression and the compression time consumption of the current round of compression is greater than or equal to a preset time limit T; and under the condition that the current DATA Frame is the first Frame of the current round of compression and the compression time consumption of the current round of compression is greater than or equal to a preset time limit T, sending the combination of the DATA _ Frame1, the compressed Count number Count _ byte and the variable segment delta DATA _ Frame as compressed DATA to a master station in the WAMS system for receiving the DATA sent by the DATA sending device.
By applying the embodiment shown in fig. 9 of the present invention, variable compression is performed on the current data frame according to the difference between the phasor of the current data frame and the phasor corresponding to the previous data frame of the current data frame, only the first frame data frame in each compression is reserved, then data compression is performed according to the difference between the phasors in the data frames after the first frame data frame, the storage space occupied by the difference between the phasors is smaller than the storage space occupied by the phasors, the information content contained in the data of unit capacity is increased, and the information transmission efficiency is increased.
In a specific implementation manner of the embodiment of the present invention, the data sending device at least includes: one of a PDC element and a NIC element.
In a specific implementation manner of the embodiment of the present invention, the first receiving module 901 is further configured to:
and receiving a data frame which is sent by each PMU unit and is generated by the line data acquired by the PMU unit according to the configuration frame.
In a specific implementation manner of the embodiment of the present invention, the compression module 904 is further configured to:
d1: dividing the phasor number n contained in the current data frame by j to obtain a group of phasors a and a remainder b phasors, wherein b is less than j;
d2: starting from a first group of phasors in a group of phasors, taking the first group of vectors as a current group of vectors, and comparing the amplitude of each phasor in the current group of phasors with the amplitude of the corresponding phasor of a previous data frame of the current data frame to obtain a first amplitude variation; comparing the angle of each phasor of the current data frame with the angle of each corresponding phasor of a previous data frame of the current data frame to obtain a first angle variation;
d3: storing a first variable identifier corresponding to the current group phasor into an identifier group flag; storing the first variable into a variable array data; then taking the next group of phasors of the current group of phasors as the current group of phasors, and returning to execute the step D2 until the a groups of phasors are processed;
d4: for each phasor in the b phasors, comparing the amplitude of the phasor with the amplitude of the corresponding phasor of the previous data frame of the current data frame to obtain a second amplitude variable quantity; comparing the angle of the phasor with the angle of the corresponding phasor of the previous data frame of the current data frame to obtain a second angle variation; generating a second variable identifier according to the second amplitude variation and the second angle variation, and storing the second variable identifier into an identifier array flag; synthesizing the second amplitude variation and the second angle variation into a second variable; storing the second variable into a variable array data;
d5 makes the flag array flag and the variable array DATA constitute a variable segment delta DATA _ Frame.
In a specific implementation manner of the embodiment of the present invention, the compression module 904 is further configured to:
1) and setting k as a count and an initial value as 0, judging whether k is smaller than j:
2) if so, taking the difference H1 between the amplitude r1 of each phasor of the current data frame and the amplitude p1 of each corresponding phasor of the previous data frame of the current data frame as a first amplitude variation; taking a difference value H2 of the angle r2 of each phasor of a current data frame and the angle p2 of each corresponding phasor of a previous data frame of the current data frame as a first angle variation amount; judging whether the absolute values of H1 and H2 are both less than 8;
3) if the absolute values of H1 and H2 are both less than 8, allocating 0.5 byte storage space for H1 and H2 respectively, and updating the first variable identifier sign [ k ] to be 0x 00; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 8, and judging whether the value of H2 is negative; if the value of H1 is positive, judging whether the value of H2 is negative, if the value of H2 is negative, updating the value of H2 to the sum of H2 and H8; storing H1 and H2 into a cache array one;
4) if the absolute values of H1 and H2 are not both less than 8, judging whether the absolute values of H1 and H2 are both less than 128;
5) if the absolute values of H1 and H2 are both less than 128, 1 byte of storage space is allocated for H1 and H2 respectively, and the first variable identifier sign [ k ] is updated to be 0x 01; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 128, and judging whether the value of H2 is negative; if the value of H1 is positive, performing the step of determining whether the value of H2 is negative, and if the value of H2 is negative, updating the value of H2 to the sum of H2 and 128; storing H1 and H2 in cache array two;
6) if the absolute values of H1 and H2 are not both less than 128, judging whether the absolute values of H1 and H2 are both less than 2048;
7) if the absolute values of H1 and H2 are both smaller than 2048, 1.5 bytes of storage space is allocated to H1 and H2 respectively, and the first variable identification sign [ k ] is updated to be 0x 02; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 2048, and judging whether the value of H2 is negative; if the value of H1 is positive, performing the step of determining whether the value of H2 is negative; if the value of H2 is negative, updating the value of H2 to be the sum of H2 and 2048; storing H1 and H2 into a cache array three;
8) if the absolute values of H1 and H2 are not both less than 2048, updating the first variable identifier sign [ k ] to 0x03, and then storing r1 and r2 in the cache array four;
9) updating the value of k to k +1, and returning to execute the step 1); until each vector in the current set of vectors is processed;
10) and when the value of k is larger than or equal to j, executing the step D3.
In a specific implementation manner of the embodiment of the present invention, the compression module 904 is further configured to:
and storing the first variable identifications corresponding to each phasor in the current group of phasors into a temporary identification array sign, and then storing the set of the first variable identifications corresponding to each phasor in the current group into an identification array flag.
In a specific implementation manner of the embodiment of the present invention, the preset step size is 1.
In a specific implementation manner of the embodiment of the present invention, the preset field is: 0xAA 63.
In a fourth aspect, corresponding to the second aspect of the embodiment of the present invention, the embodiment of the present invention further provides a communication data decompression apparatus.
It should be noted that, the communication data decompression apparatus provided in the embodiment of the present invention is preferably applied to a master station that receives data transmitted by a data transmitting device in a WAMS system.
Fig. 10 is a schematic structural diagram of a communication data decompression apparatus according to an embodiment of the present invention, and as shown in fig. 10, the apparatus includes:
a second receiving module 1001, configured to receive a compressed data frame corresponding to the data frame set and sent by the data sending device;
a third determining module 1002, configured to determine whether a SYNC field of the data frame is a preset field, and if not, trigger the second receiving module 1001; if yes, triggering the storage module 1003;
the storage module 1003 is configured to sequentially put L bytes of data after the Count _ byte is compressed into the flag array flag, and put L bytes of data into the variable array data;
sequentially taking j marks out of the mark array flag and putting the j marks into an array sign, sequentially reading data with corresponding lengths in the variable array data according to sign content, restoring original phasors corresponding to the data read according to the sign content according to the phasors of a previous data frame of a data frame corresponding to the variable array data, and sequentially storing the original phasors into an array Full _ data;
a decompression module 1004, configured to sequentially take out b flags from the flag array flag and place the b flags into an array sign, sequentially read data of corresponding lengths in the variable array data according to sign content, restore an original phasor corresponding to the data read according to the sign content according to a phasor of a previous data frame of a data frame corresponding to the variable array data, and sequentially store the original phasor into an array Full _ data;
and a combining module 1005 for generating other fields except phasor according to the configuration frame and the first frame data frame, and combining the generated other fields with the data in the array Full _ data to generate a complete data frame.
By applying the embodiment of the invention shown in fig. 10, the compressed data can be decompressed.
In a specific implementation manner of the embodiment of the present invention, on the basis of the embodiment shown in fig. 10 of the present invention, the embodiment of the present invention further adds: a fourth determining module 1006 (not shown in the figure), configured to:
and judging whether the obtained decompressed data frame has errors or missed transmission, if so, sending a reissue command to the data sending equipment so that the data sending equipment can call the corresponding error or missed transmission data frame.
In a specific implementation manner of the embodiment of the present invention, the system includes:
the communication data compression apparatus provided based on the third aspect of the embodiment of the present invention and the communication data decompression apparatus provided based on the fourth aspect of the present invention.
By applying the embodiment of the invention, the data error caused by data error or missing transmission can be avoided.
In a fifth aspect, to solve the problem in the prior art, an embodiment of the present invention further provides a communication data compression and decompression system.
Fig. 11 is a schematic structural diagram of a communication data compression and decompression system according to an embodiment of the present invention. As shown in fig. 11, the system includes:
a communication data compression apparatus 1101 according to the third aspect of the embodiment of the present invention, and a communication data decompression apparatus 1102 according to the fourth aspect of the embodiment of the present invention.
By applying the embodiment of the invention shown in fig. 11, the communication data can be compressed and decompressed.
In a sixth aspect, to solve the problem in the prior art, corresponding to the communication data compression and decompression system provided in the fifth aspect of the embodiment of the present invention, an embodiment of the present invention further provides a communication method applied to a WAMS system, where the method includes:
the data compression method of the first aspect of the embodiment of the invention is applied to compress data and send out the compressed data; and receiving the compressed data, and decompressing the data by applying the data decompression method according to the second aspect of the embodiment of the invention.
By applying the embodiment of the invention, the compression and decompression of data can be realized.
It will be appreciated that compression and decompression together comprise the overall communication process.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (21)

1. A communication data compression method is applied to a data sending device for sending data to a main station in a power distribution network WAMS system, and comprises the following steps:
a: receiving a configuration frame sent by a WAMS main station in a WAMS system, and receiving data frames sent by each PMU unit; dividing the data frame into at least two sets of data frames;
b: for each data frame set, taking a first data frame in the data frame set as a current data frame, and judging whether the current data frame is the first frame data of the current round of compression;
c: if yes, changing the value of the SYNC field of the current data frame into a preset field, and setting the value of the compressed counter Count _ byte to be 0; storing the current DATA Frame to a DATA _ Frame1 section at the head end of the buffer array TEMP, and judging whether the compression time consumption of the current compression is greater than or equal to a preset time limit T or not; if the time consumed by the compression of the current round is greater than or equal to the preset time limit T, executing the step F, if the time consumed by the compression of the current round is less than the preset time limit T, taking the next frame of the current data frame as the current data frame, and returning to the step B for judging whether the current data frame is the first frame data of the compression of the current round;
d: if not, taking the sum of the current value of the compressed Count number Count _ byte and a preset step length as the current value of the compressed Count number; performing variable compression on the current DATA Frame according to the difference between the phasor of the current DATA Frame and the phasor corresponding to the previous DATA Frame of the current DATA Frame to obtain a variable section delta DATA _ Frame;
e: judging whether the data frame compressed in the current compression reaches the upper compression limit or not according to the compressed Count number Count _ byte; if the data frame compressed by the compression reaches the upper limit of the compression, executing the step F; if the data frame compressed by the compression of the current round does not reach the compression upper limit, judging whether the compression time consumption of the compression of the current round is greater than or equal to a preset time limit T or not; if the compression time consumption of the current round of compression is greater than or equal to the preset time limit T, executing the step F, if the compression time consumption of the current round of compression is less than the preset time limit T, taking the next frame of the current data frame as the current data frame, and returning to execute the step B to judge whether the current data frame is the first frame data of the current round of compression;
f: when the current DATA Frame is the first Frame of the current round of compression and the compression time consumption of the current round of compression is greater than or equal to a preset time limit T, the combination of the DATA _ Frame1 and the compressed Count number Count _ byte is used as compressed DATA and is sent to a master station in the WAMS system for receiving the DATA sent by the DATA sending equipment; and under the condition that the current DATA Frame is the first Frame of the current round of compression and the compression time consumption of the current round of compression is greater than or equal to a preset time limit T, sending the combination of the DATA _ Frame1, the compressed Count number Count _ byte and the variable segment delta DATA _ Frame as compressed DATA to a master station in the WAMS system for receiving the DATA sent by the DATA sending device.
2. The communication data compression method according to claim 1, wherein the data transmission device comprises at least: one of a PDC element and a NIC element.
3. The communication data compression method according to claim 1, wherein the step a comprises:
and receiving a data frame which is sent by each PMU unit and is generated by the line data acquired by the PMU unit according to the configuration frame.
4. The method of claim 1, wherein the performing variable compression on the current DATA Frame according to the difference between the phasor of the current DATA Frame and the phasor corresponding to the previous DATA Frame of the current DATA Frame to obtain a variable segment Δ DATA _ Frame comprises:
d1: dividing the phasor number n contained in the current data frame by j to obtain a group of phasors a and a remainder b phasors, wherein b is less than j;
d2: starting from a first group of phasors in a group of phasors, taking the first group of vectors as a current group of vectors, and comparing the amplitude of each phasor in the current group of phasors with the amplitude of the corresponding phasor of a previous data frame of the current data frame to obtain a first amplitude variation; comparing the angle of each phasor of the current data frame with the angle of each corresponding phasor of a previous data frame of the current data frame to obtain a first angle variable quantity, and generating a first variable identifier according to the first amplitude variable quantity and the first angle variable quantity; synthesizing the first amplitude variation and the first angle variation into a first variable;
d3: storing a first variable identifier corresponding to the current group phasor into an identifier group flag; storing the first variable into a variable array data; then taking the next group of phasors of the current group of phasors as the current group of phasors, and returning to execute the step D2 until the a groups of phasors are processed;
d4: for each phasor in the b phasors, comparing the amplitude of the phasor with the amplitude of the corresponding phasor of the previous data frame of the current data frame to obtain a second amplitude variable quantity; comparing the angle of the phasor with the angle of the corresponding phasor of the previous data frame of the current data frame to obtain a second angle variation; generating a second variable identifier according to the second amplitude variation and the second angle variation, and storing the second variable identifier into an identifier array flag; synthesizing the second amplitude variation and the second angle variation into a second variable; storing the second variable into a variable array data;
d5: and forming the identification array flag and the variable array DATA into a variable segment delta DATA _ Frame.
5. The method according to claim 4, wherein the comparing the amplitude of the phasor with the amplitude of the corresponding phasor in the previous data frame of the current data frame results in a first amplitude variation; comparing the angle of each phasor of the current data frame with the angle of each corresponding phasor of a previous data frame of the current data frame to obtain a first angle variation, and generating a first variable identifier according to the first amplitude variation and the first angle variation, including:
1) and setting k as a count and an initial value as 0, judging whether k is smaller than j:
2) if so, taking the difference H1 between the amplitude r1 of each phasor of the current data frame and the amplitude p1 of each corresponding phasor of the previous data frame of the current data frame as a first amplitude variation; taking a difference value H2 of the angle r2 of each phasor of a current data frame and the angle p2 of each corresponding phasor of a previous data frame of the current data frame as a first angle variation amount; judging whether the absolute values of H1 and H2 are both less than 8;
3) if the absolute values of H1 and H2 are both less than 8, allocating 0.5 byte storage space for H1 and H2 respectively, and updating the first variable identifier sign [ k ] to be 0x 00; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 8, and judging whether the value of H2 is negative; if the value of H1 is positive, judging whether the value of H2 is negative, if the value of H2 is negative, updating the value of H2 to the sum of H2 and H8; storing H1 and H2 into a cache array one;
4) if the absolute values of H1 and H2 are not both less than 8, judging whether the absolute values of H1 and H2 are both less than 128;
5) if the absolute values of H1 and H2 are both less than 128, 1 byte of storage space is allocated for H1 and H2 respectively, and the first variable identifier sign [ k ] is updated to be 0x 01; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 128, and judging whether the value of H2 is negative; if the value of H1 is positive, performing the step of determining whether the value of H2 is negative, and if the value of H2 is negative, updating the value of H2 to the sum of H2 and 128; storing H1 and H2 in cache array two;
6) if the absolute values of H1 and H2 are not both less than 128, judging whether the absolute values of H1 and H2 are both less than 2048;
7) if the absolute values of H1 and H2 are both smaller than 2048, 1.5 bytes of storage space is allocated to H1 and H2 respectively, and the first variable identification sign [ k ] is updated to be 0x 02; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 2048, and judging whether the value of H2 is negative; if the value of H1 is positive, performing the step of determining whether the value of H2 is negative; if the value of H2 is negative, updating the value of H2 to be the sum of H2 and 2048; storing H1 and H2 into a cache array three;
8) if the absolute values of H1 and H2 are not both less than 2048, updating the first variable identifier sign [ k ] to 0x03, and then storing r1 and r2 in the cache array four;
9) updating the value of k to k +1, and returning to execute the step 1); until each vector in the current set of vectors is processed;
10) and when the value of k is larger than or equal to j, executing the step D3.
6. The method of claim 4, wherein storing the first variable flag corresponding to the current set of phasors in flag array flag comprises:
and storing the first variable identifications corresponding to each phasor in the current group of phasors into a temporary identification array sign, and then storing the set of the first variable identifications corresponding to each phasor in the current group into an identification array flag.
7. The method of claim 1, wherein the predetermined step size is 1.
8. The method of claim 1, wherein the predetermined field is: 0xAA 63.
9. A communication data decompression method is applied to a master station which receives data transmitted by a data transmitting device in a WAMS system, and comprises the following steps:
g: receiving a compressed data frame which is sent by the data sending equipment and corresponds to the data frame set;
h: judging whether the SYNC field of the data frame is a preset field, if not, returning to execute the step G; if yes, executing step I;
i: sequentially putting L bytes of data after the Count _ byte into an identification array flag, and putting the L bytes of data into a variable array data;
j: sequentially taking j marks out of the mark array flag and putting the j marks into an array sign, sequentially reading data with corresponding lengths in the variable array data according to sign content, restoring original phasors corresponding to the data read according to the sign content according to the phasors of a previous data frame of a data frame corresponding to the variable array data, and sequentially storing the original phasors into an array Full _ data;
k: b marks are sequentially taken out from the mark array flag and are placed into an array sign, then data with corresponding lengths in the variable array data are sequentially read according to sign content, original phasors corresponding to the data read according to the sign content are restored according to phasors of a previous data frame of a data frame corresponding to the variable array data, and the original phasors are sequentially stored into an array Full _ data;
l: and generating other fields except phasor according to the configuration frame and the first frame data frame, and combining the generated other fields with data in the array Full _ data to generate a complete data frame.
10. The method of claim 9, wherein the method further comprises:
and judging whether the obtained decompressed data frame has errors or missed transmission, if so, sending a reissue command to the data sending equipment so that the data sending equipment can call the corresponding error or missed transmission data frame.
11. A communication data compression device is applied to a data sending device for sending data to a main station in a power distribution network WAMS system, and the device comprises:
the first receiving module is used for receiving a configuration frame sent by a WAMS master station in the WAMS system and receiving data frames sent by each PMU unit; dividing the data frame into at least two sets of data frames;
the first judgment module is used for taking a first data frame in the data frame sets as a current data frame and judging whether the current data frame is the first frame data of the current round of compression aiming at each data frame set;
a first setting module, configured to change a value of the SYNC field of the current data frame to a preset field and set a value of the compressed Count number Count _ byte to 0 if the determination result of the first determining module is yes; storing the current DATA Frame to a DATA _ Frame1 section at the head end of the buffer array TEMP, and judging whether the compression time consumption of the current compression is greater than or equal to a preset time limit T or not; if the compression time consumption of the current round of compression is greater than or equal to the preset time limit T, triggering a second setting module, if the compression time consumption of the current round of compression is less than the preset time limit T, taking the next frame of the current data frame as the current data frame, and triggering a first judging module to judge whether the current data frame is the first frame data of the current round of compression;
the compression module is used for taking the sum of the current value of the compressed Count number Count _ byte and a preset step length as the current value of the compressed Count number under the condition that the judgment result of the first judgment module is negative; performing variable compression on the current DATA Frame according to the difference between the phasor of the current DATA Frame and the phasor corresponding to the previous DATA Frame of the current DATA Frame to obtain a variable section delta DATA _ Frame;
the second judgment module is used for judging whether the data frame compressed by the current compression reaches the upper compression limit or not according to the Count of compression Count number _ byte; if the data frame compressed by the compression reaches the upper limit of the compression, executing the step F; if the data frame compressed by the compression of the current round does not reach the compression upper limit, judging whether the compression time consumption of the compression of the current round is greater than or equal to a preset time limit T or not; if the compression time consumption of the current round of compression is greater than or equal to the preset time limit T, triggering a second setting module, and if the compression time consumption of the current round of compression is less than the preset time limit T, taking the next frame of the current data frame as the current data frame, and triggering a first judgment module to judge whether the current data frame is the first frame data of the current round of compression;
a second setting module, configured to send a combination of the DATA _ Frame1 and the compressed Count number Count _ byte as compressed DATA to a master station in the WAMS system for receiving DATA sent by a DATA sending device when the current DATA Frame is a first Frame of the current round of compression and the compression time consumption of the current round of compression is greater than or equal to a preset time limit T; and under the condition that the current DATA Frame is the first Frame of the current round of compression and the compression time consumption of the current round of compression is greater than or equal to a preset time limit T, sending the combination of the DATA _ Frame1, the compressed Count number Count _ byte and the variable segment delta DATA _ Frame as compressed DATA to a master station in the WAMS system for receiving the DATA sent by the DATA sending device.
12. The communication data compression apparatus according to claim 11, wherein the data transmission device comprises at least: one of a PDC element and a NIC element.
13. The apparatus as claimed in claim 11, wherein said first receiving module is further configured to:
and receiving a data frame which is sent by each PMU unit and is generated by the line data acquired by the PMU unit according to the configuration frame.
14. The apparatus as claimed in claim 11, wherein said compression module is further configured to:
d1: dividing the phasor number n contained in the current data frame by j to obtain a group of phasors a and a remainder b phasors, wherein b is less than j;
d2: starting from a first group of phasors in a group of phasors, taking the first group of vectors as a current group of vectors, and comparing the amplitude of each phasor in the current group of phasors with the amplitude of the corresponding phasor of a previous data frame of the current data frame to obtain a first amplitude variation; comparing the angle of each phasor of the current data frame with the angle of each corresponding phasor of a previous data frame of the current data frame to obtain a first angle variable quantity, and generating a first variable identifier according to the first amplitude variable quantity and the first angle variable quantity; synthesizing the first amplitude variation and the first angle variation into a first variable;
d3: storing a first variable identifier corresponding to the current group phasor into an identifier group flag; storing the first variable into a variable array data; then taking the next group of phasors of the current group of phasors as the current group of phasors, and returning to execute the step D2 until the a groups of phasors are processed;
d4: for each phasor in the b phasors, comparing the amplitude of the phasor with the amplitude of the corresponding phasor of the previous data frame of the current data frame to obtain a second amplitude variable quantity; comparing the angle of the phasor with the angle of the corresponding phasor of the previous data frame of the current data frame to obtain a second angle variation; generating a second variable identifier according to the second amplitude variation and the second angle variation, and storing the second variable identifier into an identifier array flag; synthesizing the second amplitude variation and the second angle variation into a second variable; storing the second variable into a variable array data;
d5: and forming the identification array flag and the variable array DATA into a variable segment delta DATA _ Frame.
15. The communication data compression apparatus of claim 14, wherein the compression module is further configured to:
1) and setting k as a count and an initial value as 0, judging whether k is smaller than j:
2) if so, taking the difference H1 between the amplitude r1 of each phasor of the current data frame and the amplitude p1 of each corresponding phasor of the previous data frame of the current data frame as a first amplitude variation; taking a difference value H2 of the angle r2 of each phasor of a current data frame and the angle p2 of each corresponding phasor of a previous data frame of the current data frame as a first angle variation amount; judging whether the absolute values of H1 and H2 are both less than 8;
3) if the absolute values of H1 and H2 are both less than 8, allocating 0.5 byte storage space for H1 and H2 respectively, and updating the first variable identifier sign [ k ] to be 0x 00; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 8, and judging whether the value of H2 is negative; if the value of H1 is positive, judging whether the value of H2 is negative, if the value of H2 is negative, updating the value of H2 to the sum of H2 and H8; storing H1 and H2 into a cache array one;
4) if the absolute values of H1 and H2 are not both less than 8, judging whether the absolute values of H1 and H2 are both less than 128;
5) if the absolute values of H1 and H2 are both less than 128, 1 byte of storage space is allocated for H1 and H2 respectively, and the first variable identifier sign [ k ] is updated to be 0x 01; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 128, and judging whether the value of H2 is negative; if the value of H1 is positive, performing the step of determining whether the value of H2 is negative, and if the value of H2 is negative, updating the value of H2 to the sum of H2 and 128; storing H1 and H2 in cache array two;
6) if the absolute values of H1 and H2 are not both less than 128, judging whether the absolute values of H1 and H2 are both less than 2048;
7) if the absolute values of H1 and H2 are both smaller than 2048, 1.5 bytes of storage space is allocated to H1 and H2 respectively, and the first variable identification sign [ k ] is updated to be 0x 02; judging whether the value of H1 is negative, if the value of H1 is negative, updating the value of H1 to be the sum of H1 and 2048, and judging whether the value of H2 is negative; if the value of H1 is positive, performing the step of determining whether the value of H2 is negative; if the value of H2 is negative, updating the value of H2 to be the sum of H2 and 2048; storing H1 and H2 into a cache array three;
8) if the absolute values of H1 and H2 are not both less than 2048, updating the first variable identifier sign [ k ] to 0x03, and then storing r1 and r2 in the cache array four;
9) updating the value of k to k +1, and returning to execute the step 1); until each vector in the current set of vectors is processed;
10) and when the value of k is larger than or equal to j, executing the step D3.
16. The communication data compression apparatus of claim 14, wherein the compression module is further configured to:
and storing the first variable identifications corresponding to each phasor in the current group of phasors into a temporary identification array sign, and then storing the set of the first variable identifications corresponding to each phasor in the current group into an identification array flag.
17. The apparatus as claimed in claim 11, wherein the predetermined step size is 1.
18. The apparatus as claimed in claim 11, wherein the predetermined field is: 0xAA 63.
19. A communication data decompression apparatus, applied to a master station in a WAMS system that receives data transmitted by a data transmission device, the apparatus comprising:
a second receiving module, configured to receive a compressed data frame corresponding to the data frame set and sent by the data sending device;
the third judging module is used for judging whether the SYNC field of the data frame is a preset field or not, and if not, the second receiving module is triggered; if yes, triggering the storage module;
the storage module is used for sequentially putting L bytes of data after the Count of the compressed digital Count _ byte into an identification array flag, and putting the data after the L bytes into a variable array data;
sequentially taking j marks out of the mark array flag and putting the j marks into an array sign, sequentially reading data with corresponding lengths in the variable array data according to sign content, restoring original phasors corresponding to the data read according to the sign content according to the phasors of a previous data frame of a data frame corresponding to the variable array data, and sequentially storing the original phasors into an array Full _ data;
the decompression module is used for sequentially taking out b identifications from the identification array flag and putting the b identifications into an array sign, sequentially reading data with corresponding lengths in the variable array data according to sign content, restoring original phasors corresponding to the data read according to the sign content according to phasors of a previous data frame of a data frame corresponding to the variable array data, and sequentially storing the original phasors into an array Full _ data;
and the combination module is used for generating other fields except phasor according to the configuration frame and the first frame data frame, and combining the generated other fields with the data in the array Full _ data to generate a complete data frame.
20. The apparatus for decompressing communication data according to claim 19, further comprising: a fourth determining module, configured to:
and judging whether the obtained decompressed data frame has errors or missed transmission, if so, sending a reissue command to the data sending equipment so that the data sending equipment can call the corresponding error or missed transmission data frame.
21. A communication data compression and decompression system, the system comprising:
communication data compression apparatus according to any one of claims 11 to 18 and communication data decompression apparatus according to claim 19.
CN201811057233.XA 2018-09-11 2018-09-11 Communication data compression and decompression method, device and system Active CN109067775B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811057233.XA CN109067775B (en) 2018-09-11 2018-09-11 Communication data compression and decompression method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811057233.XA CN109067775B (en) 2018-09-11 2018-09-11 Communication data compression and decompression method, device and system

Publications (2)

Publication Number Publication Date
CN109067775A CN109067775A (en) 2018-12-21
CN109067775B true CN109067775B (en) 2020-12-08

Family

ID=64760111

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811057233.XA Active CN109067775B (en) 2018-09-11 2018-09-11 Communication data compression and decompression method, device and system

Country Status (1)

Country Link
CN (1) CN109067775B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109936373B (en) * 2019-02-28 2023-05-02 北京交通大学 Real-time data compression method for synchronous phasor data measurement

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101178424A (en) * 2007-12-12 2008-05-14 北京四方继保自动化股份有限公司 Dynamic data compression storage method in electric network wide-area measuring systems (WAMS)
CN102811062A (en) * 2010-01-19 2012-12-05 北京四方继保自动化股份有限公司 Curve sparse processing method for high-density time sequence data in power system wide-area measurement system (WAMS)
CN102970340A (en) * 2012-10-30 2013-03-13 清华大学 Real-time data compression communication method applicable to wide area measurement system
WO2017070087A1 (en) * 2015-10-21 2017-04-27 GE Lighting Solutions, LLC System and method for data compression over a communication network
CN108233344A (en) * 2018-01-29 2018-06-29 合肥工业大学 Power distribution network WAMS communications protections and feeder automation method based on multicast

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101178424A (en) * 2007-12-12 2008-05-14 北京四方继保自动化股份有限公司 Dynamic data compression storage method in electric network wide-area measuring systems (WAMS)
CN102811062A (en) * 2010-01-19 2012-12-05 北京四方继保自动化股份有限公司 Curve sparse processing method for high-density time sequence data in power system wide-area measurement system (WAMS)
CN102970340A (en) * 2012-10-30 2013-03-13 清华大学 Real-time data compression communication method applicable to wide area measurement system
WO2017070087A1 (en) * 2015-10-21 2017-04-27 GE Lighting Solutions, LLC System and method for data compression over a communication network
CN108141244A (en) * 2015-10-21 2018-06-08 通用电气照明解决方案有限责任公司 For passing through the system and method for the data compression of communication network
CN108233344A (en) * 2018-01-29 2018-06-29 合肥工业大学 Power distribution network WAMS communications protections and feeder automation method based on multicast

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Application of a Real-Time Data Compression and Adapted Protocol Technique for WAMS;Fang Zhang等;《IEEE Transactions on Power Systems》;20140701;第30卷(第2期);全文 *
广域测量系统数据在线无损压缩算法;齐文斌;《电网技术》;20080420;全文 *

Also Published As

Publication number Publication date
CN109067775A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
CN108833058B (en) Dynamic data compression and decompression method in communication process of wide area measurement system
CN104380832A (en) Compression devices, decompression devices, compression methods, and decompression methods
CN104660308A (en) File transfer method and file transfer system based on Bluetooth low power consumption technology
CN109067775B (en) Communication data compression and decompression method, device and system
CN105530013A (en) Waveform data compression method and system
CN103823807A (en) Data de-duplication method, device and system
CN109525370A (en) Data packet sending method based on zigbee
CN111130690A (en) Processing method and device for multiple communication protocols of IR46 smart electric meter
CN112335203A (en) Processing local area network diagnostic data
CN111447229B (en) Large-scale data acquisition method and device based on compressed sensing theory
CN106534259B (en) Web data acquisition method, Web server and web data acquisition system based on Docker
CN103634877A (en) Management method for AP (access point) in AC (access controller)-free network and AP equipment
CN104853447A (en) Method and device for processing data information
CN107659629A (en) A kind of efficient electrical power archives synchronous method suitable for power information acquisition system
CN109981694B (en) Synchronization method, server and terminal
CN114827287B (en) Data compression method and system
CN112820092B (en) Method for collecting electricity consumption data, terminal equipment and storage medium
CN102769512A (en) Implementation method and device for GFP frame delimitation
CN108958756A (en) A kind of method for upgrading software and system
CN112622687A (en) Battery replacement control method and device for charging cabinet
CN101521910A (en) MAC address-based terminal initial access frequency point selection method
CN102437991B (en) Method and device for synchronizing GFP (Generic Framing Procedure) bit streams
CN107689893B (en) Method and system for data stream switching multiplexing
CN104266772A (en) Data collection method of multi-point temperature monitoring system of switch cabinet
JP5641923B2 (en) Expansion module

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