A data compression method for concentrator communication module
By arranging, combining and screening the parameter variable data collected in the power efficiency monitoring system, and replacing the encoding with a longer encoding length, the problem of limited compression effect of Hoffmann encoding is solved and the communication data transmission efficiency is improved.
Patent Information
- Application Number
- CN202510186552.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-02-20
AI Technical Summary
The effect of using Hoffman encoding to encode and compress the collected parameter variable data is limited, which affects the communication data transmission efficiency of the power efficiency monitoring system.
By arranging and combining all basic data, the target combination that does not appear in the updated parameter variable data sequence and has corresponding target data, the basic data whose encoding length is smaller than the encoding length of the data combination is used as the target data, and the corresponding data in the updated parameter variable data sequence is replaced, so that encoding with a shorter encoding length is used in subsequent compression encoding.
The encoding length of the compression result of the parameter variable data sequence is shortened, the effect of encoding and compression of the collected parameter variable data is improved, and the communication data transmission efficiency of the power efficiency monitoring system is improved.
Smart Images

Figure CN119653262B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of communication data transmission, and more particularly to a data compression method for a concentrator communication module. Background Art
[0002] The electric power energy efficiency monitoring system adopts advanced monitoring, collection equipment and communication means to assist industrial and mining enterprises, buildings, government agencies, etc. to solve comprehensive management problems such as electricity data collection and monitoring, energy consumption comparison and analysis, energy saving evaluation, fault alarm, etc., which involves the communication transmission of the collected parameter data.
[0003] In the related technology, for example, the Chinese patent document with the authorization announcement number CN117459188B discloses a Beidou power communication system and communication method based on Beidou communication technology. The patent document can efficiently detect errors in data transmission through cyclic redundancy check CRC, and use Beidou positioning data to determine the calibration position of the Beidou power communication system equipment. Then, the future position Pfuture of the Beidou power communication system equipment is predicted by the machine learning model, and the predicted network quality Q is obtained by the network quality prediction model. The predicted future position Pfuture of the Beidou power communication system equipment and the predicted network quality Q are substituted into the adjustment function to increase or decrease the current transmission rate, which can reduce the loss and retransmission of data packets caused by network congestion. At the same time, the decision tree algorithm can effectively process a large amount of data, identify key information, reduce irrelevant data transmission, and use Huffman coding to reduce the data size, thereby reducing the amount of data transmission and improving transmission efficiency.
[0004] In the related art, Huffman coding is a conventional compression method, and its compression rate is limited by the frequency of the coding object. Therefore, the effect of encoding and compressing the collected parameter data using Huffman coding is limited, which affects the communication data transmission efficiency of the power energy efficiency monitoring system. Summary of the invention
[0005] In order to solve the technical problem that the effect of encoding and compressing the collected parameter data by using Huffman coding is limited, which affects the communication data transmission efficiency of the power energy efficiency monitoring system, the present invention provides a data compression method for a concentrator communication module, comprising: collecting a parameter data sequence through a collection device of the power energy efficiency monitoring system; in the parameter data sequence, the same data belongs to the same basic data; according to the frequency of each basic data in the parameter data sequence, a Huffman tree is constructed, and the coding of each basic data is obtained through the Huffman tree; all the basic data are arranged and combined to obtain all data combinations; the data combinations are sorted in the order of code length from small to large; and each data combination is judged in order whether it is in the updated parameter data sequence. The target data that has appeared in the column and whether each data combination has corresponding target data, so as to obtain all target combinations; the target combination has not appeared in the updated parameter data sequence and has corresponding target data, and the target data refers to one of all basic data with a coding length greater than the coding length of the data combination; wherein, after obtaining each target combination, all data in the updated parameter data sequence that is identical to the target data corresponding to the target combination and is not marked are replaced with the target combination and marked, so as to realize the re-update of the updated parameter data sequence; the parameter data sequence after the last update is compressed and encoded by encoding all basic data, and the compressed encoding result is used as the compression result of the parameter data sequence, and is transmitted.
[0006] The present invention arranges and combines all basic data, selects target combinations that have not appeared in the updated parameter data sequence and have corresponding target data from all the obtained data combinations, and uses one of all basic data with a coding length greater than the coding length of the data combination as the target data corresponding to the target combination, and replaces all data in the parameter data sequence that are identical to the target data corresponding to the target combination with the target combination, so that when the parameter data sequence after the last update is compressed and encoded by the encoding of all basic data, the coding of the target data of the target combination with a shorter coding length is replaced by the coding of the target combination with a longer coding length, so as to shorten the coding length of the compression result of the parameter data sequence, improve the effect of coding and compressing the collected parameter data, and further improve the communication data transmission efficiency of the electric power energy efficiency monitoring system.
[0007] Preferably, the arranging and combining all basic data to obtain all data combinations includes: arranging and combining every two basic data among all basic data as a data combination to obtain all data combinations; for any data combination, concatenating the codes of the two basic data constituting the data combination as the code of the data combination, the code length of the data combination is equal to the sum of the code lengths of the two basic data constituting the data combination.
[0008] Preferably, the step of sorting the data combinations in ascending order of code length includes: deleting the data combinations whose code length is greater than or equal to All data combinations with a code length less than All data combinations are sorted in ascending order of encoding length. Indicates the maximum value among the encoding lengths of all basic data.
[0009] Before sorting, remove the codes with length greater than or equal to All data combinations can be combined to reduce the number of data combinations that need to be judged later, thereby reducing the amount of calculation.
[0010] Preferably, the obtaining of all target combinations includes: obtaining the first In the process of combining the goals, , determine in turn whether each data combination after sorting has appeared in the parameter data sequence, and delete the data combination that has appeared in the parameter data sequence, until a data combination that has not appeared in the parameter data sequence appears, and record the data combination as ;when , determine in turn whether each data combination after sorting is in the first The updated parameter data sequence It has appeared in Delete the data combinations that have appeared in the When a data combination has appeared in ;judge Is there corresponding target data? When the corresponding target data exists, stop judging and directly As the A combination of targets.
[0011] The present invention ensures the accuracy of subsequent decoding of the compression result of the parameter data sequence by requiring that the obtained target combination has never appeared in the updated parameter data sequence.
[0012] Preferably, the method for acquiring the target data comprises: Among all the basic data, randomly select one basic data as the data combination The corresponding target data will be deleted, and the selected basic data will be deleted. Combine data The encoding length.
[0013] Preferably, the method for acquiring the target data comprises: when the data combination When the corresponding target data exists, the encoding length is greater than Any basic data among all basic data of The corresponding candidate data, based on the frequency of the candidate data and the combination of the candidate data and data The difference in the encoding length of the data to be selected is calculated as the data combination The preferred degree of the target data; the candidate data with the largest preferred degree is used as the data combination The corresponding target data is obtained, and the candidate data with the highest preference is deleted, where: Combine data The encoding length.
[0014] The present invention calculates the code length greater than Each basic data as a data combination The priority of the corresponding target data, and the data combination is obtained according to the priority The corresponding target data is used to maximize the compression effect of the parameter data.
[0015] Preferably, the selected data is a data combination The calculation formula for the preference of target data is: ; In the formula, The data to be selected is used as a data combination The priority of the target data, is the encoding length of the data to be selected, Combine data The encoding length, is the frequency of the data to be selected.
[0016] The present invention is based on the frequency of the selected data and the combination of the selected data and the data The difference in the encoding length is calculated using the data combination That is When the encoding of the target combination replaces the encoding of the candidate data, the shortening amount of the compression result of the parameter data sequence is shortened, so that the data combination obtained according to the preference degree The corresponding target data can maximize the improvement effect of the compression effect of the parameter data.
[0017] Preferably, the method for acquiring the frequency of each basic data is: counting the number of times each basic data appears in the parameter data sequence, then the frequency of each basic data is equal to the ratio of the number of times each basic data appears in the parameter data sequence to the length of the parameter data sequence, wherein the length of the parameter data sequence is equal to the total number of all data in the parameter data sequence.
[0018] Preferably, the encoding of each basic data is obtained through the Huffman tree, including: the encoding result of each basic data is the label of all paths between the root node in the Huffman tree to the corresponding node of each basic data, and the encoding length of each basic data is equal to the number of labels of all paths between the root node to the corresponding node of each basic data.
[0019] Preferably, the collecting of parameter data sequence by the collecting device of the electric power energy efficiency monitoring system includes: in the electric power energy efficiency monitoring system, collecting parameter data by the collecting device according to the sampling frequency, and forming a parameter data sequence with all parameter data collected within a preset period; wherein the parameter data include voltage, current, active power, reactive power, apparent power, power factor, electricity, demand, and rate electricity.
[0020] The beneficial effects of the present invention are:
[0021] The present invention arranges and combines all basic data, selects target combinations that have not appeared in the updated parameter data sequence and have corresponding target data from all the obtained data combinations, and uses one of all basic data with a coding length less than the coding length of the data combination as the target data corresponding to the target combination, and replaces all data in the parameter data sequence that are identical to the target data corresponding to the target combination with the target combination, so that when the parameter data sequence after the last update is compressed and encoded by the encoding of all basic data, the coding of the target data of the target combination with a shorter coding length is replaced by the coding of the target combination with a longer coding length, so as to shorten the coding length of the compression result of the parameter data sequence, improve the effect of coding and compressing the collected parameter data, and further improve the communication data transmission efficiency of the electric power energy efficiency monitoring system. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The above and other purposes, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below through the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0023] Figure 1 is a flow chart schematically illustrating a data compression method for a concentrator communication module in the present invention;
[0024] Figure 2 is a schematic diagram schematically showing the overall architecture of a power energy efficiency monitoring system;
[0025] Figure 3 is a diagram schematically showing a Huffman tree. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0027] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0028] The embodiment of the present invention discloses a data compression method for a concentrator communication module, referring to Figure 1 , including steps S1 to S5:
[0029] S1. Collect parameter data sequence through the collection equipment of the power energy efficiency monitoring system.
[0030] The power energy efficiency monitoring system adopts advanced monitoring, collection equipment and communication means to assist industrial and mining enterprises, buildings, government agencies, etc. to solve comprehensive management problems such as electricity data collection and monitoring, energy consumption comparison and analysis, energy saving evaluation, fault alarm, etc.; the system can not only automatically complete the collection of energy consumption data and real-time parameter monitoring, but also flexibly generate energy consumption reports, charts and systematic energy consumption audit reports for various customer needs, and can scientifically monitor abnormal conditions of energy consumption equipment and issue early warning signals in time, so as to provide decision-making basis for formulating reasonable comprehensive energy consumption management plans, realize interaction with energy-saving experts, and achieve the goal of sustainable energy saving.
[0031] The overall architecture of the power energy efficiency monitoring system includes: the main station system, the database server, the information collection and interaction terminal, the power energy efficiency monitoring terminal, the metering terminal and the energy consumption equipment; and the schematic diagram of the overall architecture of the power energy efficiency monitoring system is as follows Figure 2 shown.
[0032] The power energy efficiency monitoring system has data collection function, monitoring function, basic power management function and alarm function, specifically:
[0033] 1. The data acquisition function refers to obtaining various electric energy data through the entire system, and can realize real-time monitoring, alarm, analysis, calculation, statistics and other functions of enterprise operation data. The collected data include voltage, current, active power, reactive power, apparent power, power factor, power, demand, rate power, 2-31 harmonics, harmonic distortion rate and voltage flicker and other parameter data; wherein, the voltage refers to the voltage level of each node, the current refers to the current size of each branch, the active power refers to the actual power consumed, the unit is kilowatt (kW), the reactive power refers to the power used to establish a magnetic field or electric field, the unit is kilovar (kVAR), the apparent power refers to the product of voltage and current, the unit is kilovolt-ampere (kVA), the power The factor is equal to the ratio of active power to apparent power, and is used to evaluate the efficiency of electric energy utilization. The power refers to the total amount of electric energy consumed in a period of time, and the unit is kilowatt-hour (kWh). The demand refers to the average power in a certain time interval, and the unit is kilowatt (kW). The rate power refers to the electric energy consumption calculated according to different electricity price periods or electricity price types. The 2-31 harmonics refer to the higher-order sinusoidal wave components of voltage or current in the power system, which appear as integer multiples of the fundamental frequency. The harmonic distortion rate refers to the ratio of the sum of all harmonic components to the fundamental component. The voltage flicker includes short-time flicker Pst and long-time flicker Plt. Short-time flicker reflects flicker within 10 minutes, and long-time flicker reflects flicker within 2 hours.
[0034] 2. Monitoring functions include: (1) monitoring, alarming and real-time adjustment of each subsystem to realize power flow monitoring, system fault alarm and analysis, and system optimization scheduling; (2) automatic analysis and alarm of power quality problems such as excessive harmonics, three-phase imbalance, power factor, etc.; (3) implementation of power emergency dispatch strategies during emergencies to ensure safe and stable power supply and achieve energy saving and efficiency improvement.
[0035] 3. Basic power management function refers to summarizing, analyzing and organizing the collected data, combining it with the planned data, to carry out basic power management work, including power performance analysis management, power quality management, power balance management, power forecast analysis, power system operation support management, etc. It provides users with powerful reporting functions, from various energy consumption data and cost comparisons, power peak and valley reports to energy consumption budgets, etc., to meet user needs.
[0036] 4. The alarm function is to track the operating data of high-energy-consuming equipment and accumulate the equipment operating law curve. Once the equipment is found to be operating abnormally, an alarm message will be sent in real time via the WEB or mobile phone text message. On the premise of accumulating a large amount of equipment operating data, the operating status and service life of the equipment will be analyzed to provide a basis for the planned maintenance of the equipment.
[0037] Specifically, in the electric power energy efficiency monitoring system, parameter data are collected by collecting equipment according to the sampling frequency, and all parameter data collected within a preset period are composed into a parameter data sequence; wherein, the parameter data include but are not limited to voltage, current, active power, reactive power, apparent power, power factor, electricity, demand, rate electricity, therefore, it should be specially noted that one type of parameter data collected within a preset period constitutes a parameter data sequence.
[0038] Among them, the sampling frequency for voltage, current, active power, reactive power, apparent power and power factor is 100Hz; the sampling frequency for electricity, demand and rate electricity is 1Hz; Hz is the unit of sampling frequency.
[0039] The size of the preset period can be set according to actual application scenarios and requirements. The present invention sets the size of the preset period to 5 minutes.
[0040] S2. Construct a Huffman tree according to the frequency of each basic data in the parameter data sequence, and obtain the encoding of each basic data through the Huffman tree.
[0041] Specifically, in the parameter data sequence, the same data belongs to the same basic data; the number of times each basic data appears in the parameter data sequence is counted, then the frequency of each basic data is equal to the ratio of the number of times each basic data appears in the parameter data sequence to the length of the parameter data sequence, and the length of the parameter data sequence is equal to the total number of all data in the parameter data sequence.
[0042] For example, when the parameter data sequence is {11,11,12,10,13,11,12,17,13,10,15,13,17,12,17,13,16,12,10,13,17,17,12,16,13,10,10,12,16,16,13,14,12,15,10,12,15,17,12,15,13,17,12,15}, the total number of There are 8 basic data, namely 10, 11, 12, 13, 14, 15, 16, and 17. The number of times these 8 basic data appear in the parameter data sequence is 6, 3, 10, 8, 1, 5, 4, and 7 respectively. The length of the parameter data sequence is 44. The frequencies of these 8 basic data are 0.136, 0.068, 0.227, 0.182, 0.023, 0.114, 0.091, and 0.159 respectively.
[0043] Furthermore, a Huffman tree is constructed according to the frequency of each basic data in the parameter data sequence, and the Huffman tree is a binary tree; starting from the root node of the Huffman tree, the left path is marked as 1, and the right path is marked as 0. In other embodiments, the left path can also be marked as 0, and the right path can also be marked as 1; and constructing a Huffman tree is a well-known technology and will not be described in detail here.
[0044] Exemplarily, when the parameter data sequence is {11,11,12,10,13,11,12,17,13,10,15,13,17,12,17,13,16,12,10,13,17,17,12,16,13,10,10,12,16,16,13,14,12,15,10,12,15,17,12,15,13,17,12,15}, the frequencies of the eight basic data of 10, 11, 12, 13, 14, 15, 16, 17 are 0.136, 0.068, 0.227, 0.182, 0.023, 0.114, 0.091, 0.159 respectively. According to the frequencies of the basic data in the parameter data sequence, the schematic diagram of the Huffman tree constructed is as follows: Figure 3 shown.
[0045] Furthermore, the encoding of each basic data is obtained through the Huffman tree. The encoding result of each basic data is the label of all paths between the root node in the Huffman tree and the corresponding nodes of each basic data. Then the encoding length of each basic data is equal to the number of labels of all paths between the root node and the corresponding nodes of each basic data.
[0046] For example, in Figure 3 In the Huffman tree shown, the encodings of the eight basic data 10, 11, 12, 13, 14, 15, 16, and 17 are 011, 11101, 10, 00, 11100, 010, 1111, and 110, respectively, and the encoding lengths of these eight basic data are 3, 5, 2, 2, 5, 3, 4, and 3, respectively.
[0047] It should be noted that Huffman coding, as a conventional compression method, has a compression rate limited by the frequency of the encoding object. Therefore, the effect of using Huffman coding to encode and compress the collected parameter data is limited, which affects the communication data transmission efficiency of the power energy efficiency monitoring system.
[0048] S3. Arrange and combine all basic data to obtain all data combinations; sort all data combinations in order of code length from small to large.
[0049] Specifically, every two basic data in all basic data are arranged and combined as a data combination to obtain all data combinations. It should be noted that the two basic data constituting each data combination are different; therefore, when the number of types of all basic data is equal to When , the number of all data combinations obtained is equal to .
[0050] Exemplarily, for the eight basic data of 10, 11, 12, 13, 14, 15, 16, and 17, every two basic data in all the basic data are arranged and combined, and the two basic data constituting each data combination are different, then a total of 8×(8-1)=56 different data combinations are obtained, for example: data combination (12,13), data combination (13,12), data combination (10,13), and data combination (13,10).
[0051] Furthermore, for any data combination, the codes of the two basic data constituting the data combination are concatenated as the code of the data combination. Then the code length of the data combination is equal to the sum of the code lengths of the two basic data constituting the data combination. The code length of the target combination is recorded as ,but ,in, The encoding length of the first basic data constituting the target combination, The encoding length of the second basic data that constitutes the target combination.
[0052] Exemplarily, the code of the data combination (12, 13) is 1000, and the code length is 4; the code of the data combination (13, 12) is 0010, and the code length is 4; the code of the data combination (10, 13) is 01100, and the code length is 5; the code of the data combination (13, 10) is 00011, and the code length is 5.
[0053] Furthermore, the data combinations are sorted in order of code length from small to large.
[0054] In one embodiment, sorting the data combinations in ascending order of code length includes: sorting all data combinations in ascending order of code length.
[0055] Exemplarily, when the parameter data sequence is {11,11,12,10,13,11,12,17,13,10,15,13,17,12,17,13,16,12,10,13,17,17,12,16,13,10,10,12,16,16,13,14,12,15,10,12,15,17,12,15,13,17,12,15}, since there are 56 data combinations obtained, in the subsequent process, 56 judgments are required to screen out all target combinations from the sorted data combinations.
[0056] In another embodiment, the step of sorting the data combinations in ascending order of code length includes: deleting the data combinations whose code length is greater than or equal to All data combinations with a code length less than All data combinations are sorted in ascending order of encoding length, where Indicates the maximum value among the encoding lengths of all basic data.
[0057] Exemplarily, when the parameter data sequence is {11,11,12,10,13,11,12,17,13,10,15,13,17,12,17,13,16,12,10,13,17,17,12,16,13,10,10,12,16,16,13,14,12,15,10,12,15,17,12,15,13,17,12,15}, the encoding lengths of the eight basic data 10, 11, 12, 13, 14, 15, 16, 17 are 3, 5, 2, 2, 5, 3, 4, 3 respectively, then the maximum value of the encoding lengths of all basic data is , delete all data combinations with a code length greater than or equal to 5, and retain all data combinations with a code length less than 5. The only data combinations retained are the data combination (12,13) with a code length of 4 and the data combination (13,12). In the subsequent process, only two judgments are needed to filter out all target combinations from the sorted data combinations.
[0058] It should be noted that, in the subsequent process, by judging whether there is corresponding target data in the sorted data combination, the target combination with corresponding target data will be screened out from the sorted data combination; and judging whether there is corresponding target data is mainly through finding target data with longer coding length than the data combination. In the subsequent compression coding process, the coding of the data combination with shorter coding length is used to replace the coding of the target data with longer coding length, so as to improve the compression efficiency; therefore, if the coding length of the data combination is greater than or equal to the maximum value of the coding lengths of all basic data If the target data is longer than the encoding length of the data combination, it is impossible to find the target data, that is, the encoding length is greater than or equal to the maximum value of the encoding lengths of all basic data. The data combination cannot have corresponding target data, and it is impossible to be the target combination with corresponding target data that is screened out. Therefore, before sorting, delete the data with code length greater than or equal to All data combinations can be combined to reduce the number of data combinations that need to be judged later, thereby reducing the amount of calculation.
[0059] S4. Filter out target combinations that have not appeared in the updated parameter data sequence and have corresponding target data from all the obtained data combinations, and update the updated parameter data sequence again using the target data corresponding to the target combinations.
[0060] Specifically, it is determined in sequence whether each data combination has appeared in the updated parameter data sequence and whether each data combination has corresponding target data, and target combinations that have not appeared in the updated parameter data sequence and have corresponding target data are screened out from all the obtained data combinations until all the data combinations are determined; and after each target combination is obtained, the updated parameter data sequence is updated again by the target data corresponding to the target combination, including: replacing all data in the updated parameter data sequence that are identical to the target data corresponding to the target combination and are not marked with the target combination and marking them, thereby updating the updated parameter data sequence again.
[0061] Among them, the number of all target combinations obtained is recorded as , for the target combination and The target data corresponding to the target combination, is the sequence number of the target combination, , obtain the The process of combining the goals is:
[0062] (1) When , determine in turn whether each data combination after sorting has appeared in the parameter data sequence, and delete the data combination that has appeared in the parameter data sequence, until a data combination that has not appeared in the parameter data sequence appears, and record the data combination as ;when , determine in turn whether each data combination after sorting is in the first The updated parameter data sequence It has appeared in Delete the data combinations that have appeared in the When a data combination has appeared in .
[0063] (2) Determine data combination Is there corresponding target data: When the data combination When the corresponding target data exists, stop judging and directly combine the data As the A combination of targets.
[0064] Among them, the judgment data combination The process of whether there is corresponding target data is as follows: determine whether there is a code length greater than The basic data, Combine data Code length: When there is no code length greater than When the basic data is There is no corresponding target data. When there is a code length greater than When the basic data is The corresponding target data exists.
[0065] For example, when the parameter data sequence is {11,11,12,10,13,11,12,17,13,10,15,13,17,12,17,13,16,12,10,13,17,17,12,16,13,10,10,12,16,16,13,14,12,15,10,12,15,17,12,15,13,17,12,15}, The target combination is , we determine whether each data combination after sorting has appeared in the parameter data sequence. For the data combination (12,13), since this data combination has not appeared in the parameter data sequence, we record this data combination as ; Determine data combination Whether there is corresponding target data, that is, whether there is a code length greater than The basic data, Combine data The encoding length and Since there are basic data 11 and 14 whose encoding length is greater than 4, the data combination If there is corresponding target data, stop judging and directly combine the data As the target combination, then The target combination is (12,13).
[0066] Among them, in judging the data combination Whether there is corresponding target data, when the data combination When there is no corresponding target data, combine the data Delete; continue to get the next one that is not in New data series The data combinations that appeared in , determine the data combination Check whether there is corresponding target data.
[0067] It should be noted that the present invention ensures the accuracy of subsequent decoding of the compression result of the parameter data sequence by requiring that the target combination obtained has not appeared in the updated parameter data sequence.
[0068] (3) Obtain the The target data corresponding to the target combination is obtained. The process of target data corresponding to target combinations is: When there is corresponding target data, the data combination That is target combination, obtain data combination The corresponding target data is to obtain the The target data corresponding to the target combination, where the data combination is obtained The corresponding target data process is: from the encoding length greater than From all the basic data, select one basic data as the data combination The corresponding target data will be deleted to avoid multiple selections of the same basic data.
[0069] In one embodiment, the slave code length is greater than From all the basic data, select one basic data as the data combination The corresponding target data includes: Among all the basic data, randomly select one basic data as the data combination The corresponding target data.
[0070] For example, for data combination =(12,13), data combination The encoding length Therefore, from the basic data 11 and 14 whose encoding length is greater than 4, a basic data 14 is randomly selected as the data combination The corresponding target data is The target data corresponding to the target combination (12,13) is 14.
[0071] In another embodiment, the slave code length is greater than From all the basic data, select one basic data as the data combination The corresponding target data includes: Any basic data among all basic data of The corresponding candidate data, based on the frequency of the candidate data and the combination of the candidate data and data The difference in the encoding length of the data to be selected is calculated as the data combination The preferred degree of the target data; the candidate data with the largest preferred degree is used as the data combination The corresponding target data.
[0072] It should be noted that the present invention calculates the code length greater than Each basic data as a data combination The priority of the corresponding target data, and the data combination is obtained according to the priority The corresponding target data is used to maximize the compression effect of the parameter data.
[0073] The selected data is used as a data combination The calculation formula for the preference of target data is:
[0074] ;
[0075] In the formula, The data to be selected is used as a data combination The priority of the target data, is the encoding length of the data to be selected, Combine data The encoding length, is the frequency of the data to be selected.
[0076] It should be noted that Indicates that when the last updated parameter data sequence is compressed and encoded, the data combination is used to obtain the compression result of the parameter data sequence. That is The amount of shortening of the compression result when the encoding of the target combination replaces the encoding of the candidate data. The larger the value, the more the candidate data should be used as the data combination. The target data, accordingly, the selected data is used as a data combination The greater the preference of the target data.
[0077] For example, for data combination =(12,13), data combination The encoding length Therefore, when the basic data 11 with a coding length greater than 4 is used as the data combination The corresponding candidate data, the preference ; When the basic data 14 with a coding length greater than 4 is used as the data combination The corresponding candidate data, the preference At this time, the candidate data with the highest preference, i.e., basic data 11, is used as the data combination. The corresponding target data is The target data corresponding to the target combination (12,13) is 11.
[0078] It should be noted that the present invention is based on the frequency of the selected data and the combination of the selected data and the data. The difference in the encoding length is calculated using the data combination That is When the encoding of the target combination replaces the encoding of the candidate data, the shortening amount of the compression result of the parameter data sequence is shortened, so that the data combination obtained according to the preference degree The corresponding target data can maximize the improvement effect of the compression effect of the parameter data.
[0079] (4) After obtaining After the target combination, through the The target data corresponding to the target combination is The updated parameter data sequence Update again to get the The updated parameter data sequence The specific process is: When All the data that have the same target data and are not labeled as the target combination are replaced by Combine and mark the targets to obtain the The updated parameter data sequence ;when When The updated parameter data sequence Middle and All the data that have the same target data and are not labeled as the target combination are replaced by Combine and mark the targets to obtain the The updated parameter data sequence .
[0080] It should be noted that the present invention arranges and combines all basic data, screens out target combinations that have not appeared in the updated parameter data sequence and have corresponding target data from all the obtained data combinations, and uses one of all basic data whose coding length is greater than the coding length of the data combination as the target data corresponding to the target combination, and replaces all data in the parameter data sequence that are identical to the target data corresponding to the target combination with the target combination, so that when the parameter data sequence after the last update is compressed and encoded subsequently by encoding all basic data, the code of the target combination with a shorter coding length replaces the code of the target data of the target combination with a longer coding length, thereby shortening the coding length of the compression result of the parameter data sequence and improving the effect of encoding and compressing the collected parameter data.
[0081] For example, when When the target data corresponding to the target combination (12,13) is 14, the parameter data sequence corresponding to the first All the data that are the same as the target data 14 and are not marked corresponding to the target combination (12,13) are replaced by The target combination (12,13) is marked to obtain the The updated parameter data sequence , then The updated parameter data sequence is {11,11,12,10,13,11,12,17,13,10,15,13,17,12,17,13,16,12,10,13,17,17,12,16,13,10,10,12,16,16,13,12,13,12,15,10,12,15,17,12,15,13,17,12,15}; When the target data corresponding to the first target combination (12,13) is 11, All the data that are the same as the target data 11 and are not marked corresponding to the target combination (12,13) are replaced by The target combination (12,13) is marked to obtain the The updated parameter data sequence , then The updated parameter data sequence is {12,13,12,13,12,10,13,12,13,12,17,13,10,15,13,17,12,17,13,16,12,10,13,17,17,12,16,13,10,10,12,16,13,14,12,15,10,12,15,17,12,15,13,17,12,15}.
[0082] For example, after obtaining The target combination is , determine in turn whether each data combination after sorting is in the first The updated parameter data sequence For the data combination (13,12), since this data combination appears in The updated parameter data sequence Delete the data combination (13,12) if it has appeared before.
[0083] S5. Compress and encode the parameter data sequence after the last update by encoding all basic data, obtain the compression result of the parameter data sequence and transmit it.
[0084] Specifically, the parameter data sequence after the last update is compressed and encoded by encoding all basic data, the obtained compression encoding result is used as the compression result of the parameter data sequence, and the compression result of the parameter data sequence is communicated and transmitted.
[0085] Exemplarily, when the parameter data sequence is {11,11,12,10,13,11,12,17,13,10,15,13,17,12,17,13,16,12,10,13,17,17,12,16,13,10,10,12,16,16,13,14,12,15,10,12,15,17,12,15,13,17,12,15}, the parameter data sequence is compressed and encoded by Huffman coding, and the length of the compressed result of the obtained parameter data sequence is equal to 126; when the parameter data sequence is compressed and encoded by the compression coding method of the present invention, when the first When the target data corresponding to the first target combination (12,13) is 14, the length of the compressed result of the parameter data sequence is equal to 125. When the target data corresponding to the target combination (12, 13) is 11, the length of the compression result of the parameter data sequence obtained is equal to 123. Compared with compressing the parameter data sequence through Huffman coding, the length of the obtained encoding compression result is shortened; therefore, the compression coding method of the present invention can improve the effect of encoding and compressing the collected parameter data.
[0086] It should be noted that the present invention improves the communication data transmission efficiency of the power energy efficiency monitoring system by improving the effect of encoding and compressing the collected parameter data.
[0087] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0088] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A data compression method for a concentrator communication module, characterized in that: include: Collect parameter data sequence through electric power energy efficiency monitoring system acquisition equipment; In the parameter data sequence, the same data belongs to the same basic data; According to the frequency of each basic data in the parameter data sequence, a Huffman tree is constructed, and the encoding of each basic data is obtained through the Huffman tree; Arrange and combine all basic data to obtain all data combinations; delete the code length greater than or equal to All data combinations with a code length less than All data combinations are sorted in ascending order of encoding length. Indicates the maximum value of all basic data encoding lengths; Determine in order whether each data combination has appeared in the updated parameter data sequence and whether each data combination has corresponding target data, so as to obtain all target combinations; the target combination has not appeared in the updated parameter data sequence and has corresponding target data, and the target data refers to one of all basic data whose coding length is greater than the coding length of the data combination; after obtaining each target combination, replace all data in the updated parameter data sequence that are the same as the target data corresponding to the target combination and are not marked with the target combination and mark them, so as to realize the re-update of the updated parameter data sequence; The parameter data sequence after the last update is compressed and encoded by encoding all basic data, and the compression encoding result is used as the compression result of the parameter data sequence and transmitted.
2. A data compression method for a concentrator communication module according to claim 1, characterized in that: The method of arranging and combining all basic data to obtain all data combinations includes: Arrange and combine every two basic data among all basic data as a data combination, so as to obtain all data combinations; For any data combination, the codes of the two basic data constituting the data combination are concatenated as the code of the data combination, and the code length of the data combination is equal to the sum of the code lengths of the two basic data constituting the data combination.
3. A data compression method for a concentrator communication module according to claim 1, characterized in that: The method of obtaining all target combinations includes: Get the In the process of combining the goals, , determine in turn whether each data combination after sorting has appeared in the parameter data sequence, and delete the data combination that has appeared in the parameter data sequence, until a data combination that has not appeared in the parameter data sequence appears, and record the data combination as ;when , determine in turn whether each data combination after sorting is in the first The updated parameter data sequence It has appeared in Delete the data combinations that have appeared in the When a data combination has appeared in ;judge Is there corresponding target data? When the corresponding target data exists, stop judging and directly As the A combination of targets.
4. A data compression method for a concentrator communication module according to claim 1, characterized in that: The method for acquiring the target data includes: From a code length greater than Among all the basic data, randomly select one basic data as the data combination The corresponding target data will be deleted, and the selected basic data will be deleted. Combine data The encoding length.
5. The data compression method for a concentrator communication module according to claim 1, characterized in that: The method for acquiring the target data includes: When data combination When the corresponding target data exists, the encoding length is greater than Any basic data among all basic data of The corresponding candidate data, based on the frequency of the candidate data and the combination of the candidate data and data The difference in the encoding length of the data to be selected is calculated as the data combination The preferred degree of the target data; the candidate data with the largest preferred degree is used as the data combination The corresponding target data is obtained, and the candidate data with the highest preference is deleted, where: Combine data The encoding length.
6. A data compression method for a concentrator communication module according to claim 5, characterized in that: The selected data is used as a data combination The calculation formula for the preference of target data is: ; In the formula, The data to be selected is used as a data combination The priority of the target data, is the encoding length of the data to be selected, Combine data The encoding length, is the frequency of the data to be selected.
7. A data compression method for a concentrator communication module according to claim 1, characterized in that: The method for obtaining the frequency of each basic data is: The number of times each basic data appears in the parameter data sequence is counted, and the frequency of each basic data is equal to the ratio of the number of times each basic data appears in the parameter data sequence to the length of the parameter data sequence, where the length of the parameter data sequence is equal to the total number of all data in the parameter data sequence.
8. The data compression method for a concentrator communication module according to claim 1, characterized in that: The encoding of each basic data is obtained by using the Huffman tree, including: The encoding result of each basic data is the label of all paths between the root node and the corresponding node of each basic data in the Huffman tree, and the encoding length of each basic data is equal to the number of labels of all paths between the root node and the corresponding node of each basic data.
9. The data compression method for a concentrator communication module according to claim 1, characterized in that: The collecting of parameter data sequence by the collecting device of the electric power energy efficiency monitoring system includes: In the electric power energy efficiency monitoring system, parameter data are collected by collecting equipment according to the sampling frequency, and all parameter data collected within a preset period are organized into a parameter data sequence; wherein the parameter data include voltage, current, active power, reactive power, apparent power, power factor, electricity, demand, and rate electricity.
Citation Information
Patent Citations
Power Beidou communication system and communication method based on Beidou communication technology
CN117459188B
Transportation energy data compression and transmission method based on Huffman coding
CN115987296A
Router data processing method for cloud server connection
CN116055008A