A weighing equipment remote data transmission method and system based on the Internet of Things
By combining the Analytic Hierarchy Process (AHP) and BWT encoding, the problem of low efficiency in remote data transmission for weighing equipment was solved, achieving efficient data compression and timely transmission, and ensuring data integrity and time correlation.
Patent Information
- Application Number
- CN202511758352.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2045-11-27
AI Technical Summary
Existing general compression algorithms are inefficient in remote data transmission of weighing equipment in continuous production, resulting in high network bandwidth consumption and an inability to achieve real-time sensing and rapid response, especially when there are small fluctuations in the weight data of bulk materials.
The hierarchical tree of the weighing equipment is obtained by using the analytic hierarchy process (AHP). By dividing the data into optimal layers and utilizing all the clusters in each layer of the hierarchical tree, the target layer is determined. The data points are divided into data blocks, and secondary encoding compression is performed by BWT encoding and merging similar encoded blocks.
This improves the compression efficiency of weighing data, thereby enhancing the timeliness and reliability of data transmission and ensuring the temporal correlation and integrity of the data.
Smart Images

Figure CN121217831B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data transmission technology, and specifically to a remote data transmission method and system for weighing equipment based on the Internet of Things. Background Technology
[0002] General compression algorithms are widely used in data transmission. These algorithms scan the data stream using a sliding window, searching for the longest repeating pattern in the processed data that perfectly matches the current data segment. A pointer pair (<distance, length>) to that historical pattern is then used to replace the current data segment. If no match is found, the original characters are stored directly.
[0003] In continuous factory production, batches of finished products require precise weighing for quality monitoring, output statistics, and cost accounting. For bulk materials such as finished steel and non-ferrous metal ingots, weight data generally needs to be accurate to at least three decimal places, i.e., in units of 0.001 tons (1 kilogram). Due to the large number of decimal places and the slight fluctuations in the weight of continuously produced finished products around the target value, the data sequence exhibits the characteristic of "locally highly correlated but not completely identical". At the same time, due to changes in production rhythm or specifications, many data points often show the same value at intervals. This data structure of "high-order identical, low-order slightly variable" results in high information entropy. When transmitting data remotely, traditional general compression algorithms struggle to find long, precisely matching repetitive patterns, leading to low compression efficiency. This not only consumes valuable network bandwidth but also affects the timeliness of data transmission, preventing the backend management system from real-time sensing and rapid response to production dynamics. Summary of the Invention
[0004] This invention provides a method and system for remote data transmission of weighing equipment based on the Internet of Things (IoT) to solve existing problems.
[0005] The present invention provides a remote data transmission method and system for weighing equipment based on the Internet of Things, which adopts the following technical solution:
[0006] One embodiment of the present invention provides a remote data transmission method for weighing equipment based on the Internet of Things, the method comprising the following steps:
[0007] Acquire multiple data points collected by the weighing equipment; where each data point includes a timestamp and a weight value;
[0008] Obtain a hierarchical tree based on multiple data points;
[0009] By utilizing all the class clusters in each level of the hierarchical tree, the target level in the hierarchical tree can be determined.
[0010] Each cluster in the target layer is treated as a data block, and multiple data points are divided into multiple data blocks;
[0011] Each data block is BWT encoded to obtain multiple encoded blocks;
[0012] By using the frequency of each numeric type in each coding block, adjacent and similar coding blocks are merged to obtain multiple update blocks;
[0013] Perform BWT encoding on each update block to obtain the encoding result of each update block;
[0014] Based on the encoding result of each updated block, obtain the final encoding result;
[0015] The final encoded result is compressed, and the compressed data is then transmitted.
[0016] Furthermore, the specific steps for obtaining the hierarchical tree based on multiple data points are as follows:
[0017] For multiple data points, calculate the absolute value c of the difference between the timestamps of any two data points, and then... As a measure of temporal similarity; where e is the natural constant;
[0018] Calculate the absolute value s of the difference between the weight values of any two data points, and then... As weight similarity; where e is the natural constant;
[0019] The product of time similarity and weight similarity is determined as the comprehensive similarity between any two data points among multiple data points;
[0020] Based on comprehensive similarity, hierarchical clustering is performed on multiple data points to obtain a hierarchical tree.
[0021] Furthermore, the specific steps for determining the target layer in the hierarchical tree by utilizing all clusters at each layer are as follows:
[0022] By utilizing all the clusters at each level of the hierarchical tree, we can obtain the intra-class variance and inter-class symbolic similarity at each level of the hierarchical tree.
[0023] The weights of intra-class variance and inter-class symbol similarity are determined based on the weight values of multiple data points.
[0024] Based on the intra-class variance and inter-class symbolic similarity of each layer in the hierarchical tree, as well as the weights of intra-class variance and inter-class symbolic similarity, the evaluation value of the clustering of each layer in the hierarchical tree is obtained.
[0025] The layer in the hierarchy tree corresponding to the maximum evaluation value is determined as the target layer in the hierarchy tree.
[0026] Furthermore, the specific steps for obtaining the intra-class variance and inter-class symbolic similarity of each layer in the hierarchical tree by utilizing all clusters in each layer are as follows:
[0027] For all clusters at each level of the hierarchical tree, calculate the intra-class variance of each cluster, and determine the mean of the intra-class variances of all clusters as the intra-class variance of each level of the hierarchical tree.
[0028] For all clusters at each level of the hierarchical tree, obtain the number of numeric types in each cluster, and determine the minimum number of numeric types as the number of numeric types at each level of the hierarchical tree;
[0029] Get the number of numeric values for the weight values of multiple data points;
[0030] The ratio of the number of numeric types in each level of the hierarchical tree to the number of numeric types in the weight values of multiple data points is determined as the inter-class symbol similarity of each level of the hierarchical tree.
[0031] Furthermore, the specific steps for determining the weights of intra-class variance and inter-class symbol similarity based on the weight values of multiple data points are as follows:
[0032] The weight values of multiple data points are sorted according to their timestamps to obtain a weight value sequence.
[0033] The period of the weight value sequence is obtained by Fourier transform;
[0034] Based on the period of the weight value sequence, the weight value sequence is divided into multiple segments;
[0035] For multiple segments, calculate the cosine similarity between any two adjacent segments, and determine the mean of the cosine similarities between all two adjacent segments as the similarity of the weight value sequence.
[0036] For multiple segments, calculate the variance of each segment, and take the mean of the variances of all segments as the variance of the weight value sequence.
[0037] The product of the similarity of the weight value sequences and the variance of the weight value sequences is determined as the weight of the inter-class symbol similarity.
[0038] The difference between 1 and the weight of inter-class symbol similarity is determined as the weight of intra-class variance.
[0039] Furthermore, the specific steps for obtaining the evaluation value of the clustering situation at each layer of the hierarchical tree based on the intra-class variance and inter-class symbolic similarity of each layer, as well as the weights of the intra-class variance and inter-class symbolic similarity, are as follows:
[0040] The first product is determined by multiplying the inter-class symbol similarity of each level in the hierarchical tree by the weight of the inter-class symbol similarity.
[0041] The second product is determined by multiplying the intra-class variance of each level in the hierarchical tree by the weight of the intra-class variance.
[0042] The sum of the first and second products is used as the evaluation value for the clustering of each level in the hierarchical tree.
[0043] Furthermore, the specific steps for merging adjacent and similar coding blocks to obtain multiple update blocks by utilizing the frequency of each numerical type in each coding block are as follows:
[0044] Calculate the number of times each numeric type appears in each coded block; where the numeric type is an integer from 0 to 9.
[0045] Sort the number of occurrences of each numeric type in ascending order to obtain the numeric type count sequence for each coded block.
[0046] For any two adjacent coded blocks, calculate the Euclidean distance d between the sequences of number of numeric types in the two coded blocks, and then... The similarity between any two adjacent coded blocks is defined as e, where e is a natural constant.
[0047] Multiple update blocks are obtained based on the similarity between any two adjacent coded blocks.
[0048] Furthermore, the specific steps for obtaining multiple update blocks based on the similarity between any two adjacent coding blocks are as follows:
[0049] When the similarity between any two adjacent coded blocks is greater than a preset similarity threshold, the two adjacent coded blocks are merged to obtain an updated block.
[0050] Furthermore, the specific steps for obtaining the final encoding result based on the encoding result of each updated block are as follows:
[0051] The encoding results of each updated block are combined with the encoding results of the unmerged encoded blocks in sequence to obtain the final encoding result.
[0052] One embodiment of the present invention provides a remote data transmission system for weighing equipment based on the Internet of Things, the system comprising the following modules:
[0053] The acquisition module is used to acquire multiple data points collected by the weighing equipment; the data points include timestamps and weight values.
[0054] The encoding module is used to obtain a hierarchical tree based on multiple data points; determine the target layer in the hierarchical tree using all clusters in each layer; divide the multiple data points into multiple data blocks by treating each cluster in the target layer as a data block; perform BWT encoding on each data block to obtain multiple encoded blocks; merge adjacent and similar encoded blocks using the frequency of each value type in each encoded block to obtain multiple updated blocks; perform BWT encoding on each updated block to obtain the encoding result of each updated block; and obtain the final encoding result based on the encoding result of each updated block.
[0055] The transmission module is used to compress the final encoded result and transmit the compressed data.
[0056] The beneficial effects of the technical solution of this invention are as follows: This invention proposes a remote data transmission method and system for weighing equipment based on the Internet of Things (IoT). It obtains a hierarchical tree of weighing data through the analytic hierarchy process (AHP); obtains the optimal layer of the hierarchical tree; divides the data of the optimal layer into data blocks; performs BWT encoding on the data of each data block to obtain an encoded block; merges the encoded blocks according to merging requirements to obtain an updated block; and performs secondary BWT encoding on the updated block data to obtain the final encoding result. This invention can improve the compression efficiency of weighing data, thereby improving the timeliness of data transmission. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 This is a flowchart illustrating the steps of a remote data transmission method for weighing equipment based on the Internet of Things according to the present invention.
[0059] Figure 2 This is a block diagram of a remote data transmission system for weighing equipment based on the Internet of Things (IoT) according to the present invention. Detailed Implementation
[0060] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a remote data transmission method and system for weighing equipment based on the Internet of Things (IoT) proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0062] The following description, in conjunction with the accompanying drawings, details a specific solution for a remote data transmission method and system for weighing equipment based on the Internet of Things (IoT) provided by this invention.
[0063] Please see Figure 1 The diagram illustrates a flowchart of a remote data transmission method for weighing equipment based on the Internet of Things (IoT) according to an embodiment of the present invention. The method includes steps S001-S009:
[0064] Step S001: Acquire multiple data points collected by the weighing equipment; wherein, the data points include timestamps and weight values.
[0065] It should be noted that each data point includes the weight of the finished product and the timestamp corresponding to that weight.
[0066] Specifically, at fixed times every few hours or each day, data points collected by the locally stored weighing equipment are remotely transmitted. The data collection process is as follows: The finished product (such as a steel ingot) passes through the weighing platform, and a piezoelectric sensor converts its weight into a weak electrical signal. The weighing transmitter amplifies the signal and converts it into a digital signal, which is then used by the weighing instrument to calculate a precise weight value (e.g., 12.735 tons). This data is recorded locally, segmented, compressed, and then remotely transmitted to a cloud platform or server via an IoT network. A timestamp can be generated by the real-time clock within the weighing transmitter when the weight value stabilizes.
[0067] Step S002: Obtain the hierarchical tree based on multiple data points.
[0068] It should be noted that, in response to the problem of low compression efficiency of weighing equipment data in factory production using traditional methods, this embodiment first obtains data with high local correlation or even complete similarity through the BWT encoding method, and then compresses it according to the entropy encoding method, thereby greatly improving the compression efficiency.
[0069] Traditional BWT encoding divides the data into even blocks and then performs BWT transformation on each data block. This embodiment improves compression efficiency by using a two-stage BWT compression method.
[0070] To prevent secondary BWT encoding from corrupting the results of primary BWT compression encoding, this embodiment uses hierarchical clustering to divide the data into blocks. The effectiveness of secondary encoding is considered during the clustering process, thus ensuring that the block data can guarantee that the secondary BWT encoding result will only optimize the encoding result based on the primary BWT encoding result, without causing any negative impact.
[0071] For weighing equipment data that needs to be transmitted remotely, hierarchical clustering is first performed. To ensure that the block data obtained from the hierarchical clustering results can guarantee that the secondary BWT encoding result will only optimize the encoding result based on the primary BWT encoding result without causing negative impacts, the data points in this embodiment need to meet the following two requirements when clustering:
[0072] When determining whether a data point should be assigned to a specific cluster, for two data points with the same membership degree, the data points whose temporal order is closer to the cluster should be merged first. This ensures good temporal correlation of the data. Even if the encoded data is attacked or partially lost due to network instability, the retained data has a high temporal correlation, which helps with later data recovery. Furthermore, when performing data analysis after data retention, the data validity will not be rendered completely useless due to discontinuity.
[0073] When selecting a layer in the hierarchical tree to divide the data into blocks based on the data of the same data, the layer with the highest degree of repetition of numerical values between different clusters is more likely to be selected as the target layer. This allows for the division of the data into blocks based on the same data, and in the subsequent secondary BWT encoding, the data from different blocks can participate in the secondary encoding to the greatest extent possible, thus achieving a better compression effect on the basis of the first BWT encoding.
[0074] Step S002 further includes steps S021-S024:
[0075] Step S021: For multiple data points, calculate the absolute value c of the difference between the timestamps of any two data points, and then... As a measure of time similarity, where e is the natural constant.
[0076] Step S022: Calculate the absolute value s of the difference between the weight values of any two data points, and then... As a weight similarity metric, where e is the natural constant.
[0077] Step S023: The product of time similarity and weight similarity is determined as the comprehensive similarity between any two data points among multiple data points.
[0078] Step S024: Based on the comprehensive similarity, perform hierarchical clustering on multiple data points to obtain a hierarchical tree.
[0079] It's important to note that hierarchical clustering is a bottom-up merging clustering algorithm. It gradually merges the most similar data points or clusters to ultimately form a tree-like structure (hierarchical tree) that represents the hierarchical grouping relationships of all data. The specific steps are as follows: Initialize each data point as an independent cluster; calculate and store the pairwise distances between all clusters, where distance = 1 - overall similarity; iteratively execute the following steps until all data points are merged into one cluster: find the two clusters with the smallest current distance; merge these two clusters into a new cluster; update the distance matrix and calculate the distances between the new cluster and all other remaining clusters; throughout the iteration process, record the merging history of all clusters, thus generating the hierarchical tree. Hierarchical clustering is a well-known technique and will not be elaborated upon further here.
[0080] Step S003: Determine the target layer in the hierarchical tree by utilizing all the class clusters in each layer of the hierarchical tree.
[0081] It should be noted that: the greater the intra-class similarity of different clusters in a layer, the higher the repetition of data within each basic block, resulting in better compression. At the same time, data that is closer together is merged first, which can ensure a better time order of data. Even if data is lost, the temporal correlation of the retained data is greater, which helps to resist attacks. The greater the similarity of numerical types between classes, the better the clustering effect of the same characters can be achieved when performing secondary BWT encoding, based on the first BWT.
[0082] Step S003 further includes steps S031-S034:
[0083] Step S031: Using all the clusters in each layer of the hierarchical tree, obtain the intra-class variance and inter-class symbol similarity of each layer in the hierarchical tree.
[0084] Step S031 further includes steps S0311-S0314:
[0085] Step S0311: For all clusters at each level in the hierarchical tree, calculate the intra-class variance of each cluster, and determine the mean of the intra-class variances of all clusters as the intra-class variance of each level in the hierarchical tree.
[0086] It's important to note that intra-class variance measures how similar members are to each other within a cluster. Let k1 denote the intra-class variance at each level of the hierarchical tree. The smaller k1 is, the more similar the data within each cluster at that level, and the greater the clustering of identical characters when the data in each cluster is encoded using BWT.
[0087] Step S0312: For all clusters at each level in the hierarchical tree, obtain the number of numeric types in each cluster, and determine the minimum number of numeric types as the number of numeric types at each level in the hierarchical tree.
[0088] It should be noted that the numeric types are 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Let n denote the number of numeric types at each level of the hierarchical tree.
[0089] Step S0313: Obtain the number of numeric types for the weight values of multiple data points.
[0090] Specifically, n0 is denoted as the number of numeric types for the weight values of multiple data points. The character types in the weighing data to be transmitted must be a subset of these ten numeric types. For example, a weight value of 12.735 has numeric types 1, 2, 7, 3, and 5, with a total of 5 numeric types.
[0091] Step S0314: The ratio of the number of numeric types in each layer of the hierarchical tree to the number of numeric types of the weight values of multiple data points is determined as the inter-class symbol similarity of each layer in the hierarchical tree.
[0092] Specifically, the ratio b of n to n0 is denoted as the inter-class symbol similarity of each level in the hierarchical tree. The larger the ratio b, the more complete the numerical types in the different clusters of that level, which helps to improve the effect of subsequent secondary BWT encoding.
[0093] Step S032: Determine the weights of intra-class variance and inter-class symbol similarity based on the weight values of multiple data points.
[0094] Step S032 further includes steps S0321-S0327:
[0095] Step S0321: Sort the weight values of multiple data points according to the timestamp order to obtain a weight value sequence.
[0096] Step S0322: Obtain the period of the weight value sequence through Fourier transform.
[0097] It should be noted that the Fourier transform is a mathematical tool that decomposes complex signals into the sum of simple sinusoidal components with different frequencies, amplitudes, and phases. Its core idea is to transform time-domain analysis into frequency-domain analysis to reveal the signal's structural composition. Specifically, it involves performing a Fast Fourier Transform on the weight value sequence to obtain its frequency domain representation; identifying the frequency component with the largest amplitude in the frequency domain and determining its frequency value as the dominant frequency; and using the reciprocal of the dominant frequency as the period of the weight value sequence. The Fourier transform is a well-known technique and will not be elaborated upon further here.
[0098] Step S0323: Divide the weight value sequence into multiple segments based on the period of the weight value sequence.
[0099] Specifically, if the period is T, the weight value sequence is divided into multiple consecutive segments of length T. Starting from the beginning of the sequence, every T consecutive weight values constitute a segment, until the end of the sequence. If the total length of the sequence is not an integer multiple of T, the remaining portion with fewer than T weight values at the end can be discarded.
[0100] Step S0324: For multiple segments, calculate the cosine similarity between any two adjacent segments, and determine the mean of the cosine similarities between all two adjacent segments as the similarity of the weight value sequence.
[0101] It should be noted that cosine similarity is a well-known technique, and will not be elaborated upon here. Let j denote the similarity of the weight value sequences.
[0102] Step S0325: For multiple segments, calculate the variance of each segment, and determine the mean of the variances of all segments as the variance of the weight value sequence.
[0103] Specifically, segment variance measures the degree to which the weight data within a segment fluctuates around its own average. Small segment variance means the weight values within this segment are very stable, fluctuating almost horizontally. Large segment variance means the weight values within this segment fluctuate wildly, like a rollercoaster. Variance is a well-known technique and will not be elaborated upon here. Let g denote the variance of the weight value sequence.
[0104] Step S0326: The product of the similarity of the weight value sequence and the variance of the weight value sequence is determined as the weight of the inter-class symbol similarity.
[0105] Specifically, the greater the variance of data within the same period segment, the greater the similarity between different period segments, and the greater the similarity of the interval data. The product of j and g is used as the weight p of the inter-class symbol similarity b.
[0106] Step S0327: Determine the weight of the intra-class variance as the difference between 1 and the weight of inter-class symbol similarity.
[0107] Specifically, (1-p) is used as the weight of k1.
[0108] Step S033: Based on the intra-class variance and inter-class symbolic similarity of each layer in the hierarchical tree, and the weights of intra-class variance and inter-class symbolic similarity, obtain the evaluation value of the clustering of each layer in the hierarchical tree.
[0109] Step S033 further includes steps S0331-S0333:
[0110] Step S0331: The first product is determined by multiplying the inter-class symbol similarity of each layer in the hierarchical tree with the weight of the inter-class symbol similarity.
[0111] Specifically, p × b is denoted as the first product.
[0112] Step S0332: Determine the second product by multiplying the intra-class variance of each level in the hierarchical tree by the weight of the intra-class variance.
[0113] Specifically, (1-p)×k1 is denoted as the second product.
[0114] Step S0333: The sum of the first product and the second product is determined as the evaluation value of the cluster division of each level in the hierarchical tree.
[0115] Specifically, by using a weighted summation method, the evaluation value o of the cluster division of each level of the hierarchical tree is obtained: o = p × b + (1 - p) × k1.
[0116] Step S034: Determine the layer in the hierarchy tree corresponding to the maximum evaluation value as the target layer in the hierarchy tree.
[0117] Step S004: Divide each cluster in the target layer into a data block, and divide multiple data points into multiple data blocks.
[0118] It should be noted that the cluster division of the target layer of the hierarchical tree corresponding to the maximum evaluation value is used as the basis for data block division. That is, the clusters of this layer are used as the division of the data of the weighing device, and each cluster is recorded as a data block.
[0119] This partitioning method ensures that the internal data of each cluster in the optimal layer (target layer) has high similarity, while the numerical type similarity of data in different clusters within the same layer is maximized. This guarantees that during subsequent BWT encoding, scattered characters can be aggregated with maximum efficiency, thereby improving the local correlation of data in the BWT encoding result of each data block.
[0120] Step S005: Perform BWT encoding on each data block to obtain multiple encoded blocks.
[0121] It should be noted that BWT (Burrows-Wheeler Transform) encoding is a reversible block sorting transformation. It groups similar characters together through cyclic shifting and alphabetical sorting, thus greatly improving the efficiency of subsequent compression algorithms. Specifically:
[0122] Data block stringification: Each data block is treated as an independent string and processed accordingly. A data block contains multiple weight values, which need to be converted into a character sequence to form a string to be encoded. For example, the weight value 12.735 will be converted into the character sequence ['1','2','.','7','3','5'].
[0123] Add a terminator: Add a unique terminator (such as $) that does not exist in the original data to the end of the string to mark the end of the string.
[0124] Generate cyclic shift matrices: Generate all possible cyclic shift versions of a string with a terminator added. For a string of length L, this will generate L cyclic shift strings, each of length L.
[0125] Sort lexicographically: Sort all the obtained cyclic shift strings in lexicographical order to form an L×L matrix.
[0126] Extract the last column: Take all characters from the last column of the sorted matrix and arrange them sequentially to form a new string. This new string is the BWT encoding result of this data block. Output the resulting BWT encoding string as a single encoded block.
[0127] For the data in each data block, BWT encoding is used to obtain the encoding result of each data block, which is denoted as the encoded block.
[0128] Step S006: Using the number of occurrences of each value type in each coding block, merge adjacent and similar coding blocks to obtain multiple update blocks.
[0129] Step S006 further includes steps S061-S064:
[0130] Step S061: Calculate the number of times each numeric type appears in each coded block; where the numeric type is an integer from 0 to 9.
[0131] Specifically, the frequency of occurrence of each numerical type can be determined by obtaining a histogram of the distribution of numerical types.
[0132] Step S062: Sort the number of occurrences of each numeric type in ascending order to obtain the numeric type count sequence for each coded block.
[0133] Specifically, if the numerical types in a certain coded block are 1, 2, 7, 3, 5, and the number of occurrences of numerical type 1 is 8, numerical type 2 is 7, numerical type 7 is 10, numerical type 3 is 5, and numerical type 5 is 4, then the numerical type number sequence [8, 7, 5, 4, 10] is obtained by following the numerical type order from smallest to largest.
[0134] Step S063: For any two adjacent coded blocks, calculate the Euclidean distance d between the numerical type quantity sequences of the two coded blocks, and then... The similarity is defined as the similarity between any two adjacent coded blocks. Here, e is a natural constant.
[0135] It should be noted that Euclidean distance calculation is a well-known technique, and will not be elaborated upon here. The smaller d is, the more similar the numerical distributions are in two adjacent coded blocks.
[0136] Step S064: Based on the similarity between any two adjacent coded blocks, obtain multiple update blocks.
[0137] Specifically, when the similarity between any two adjacent coding blocks is greater than a preset similarity threshold, the two adjacent coding blocks are merged to obtain an updated block.
[0138] It should be noted that the preset similarity threshold is set according to the specific situation, and in this embodiment, it is preferably 0.9.
[0139] If the value is less than or equal to 0.9, no merging will be performed.
[0140] Step S007: Perform BWT encoding on each update block to obtain the encoding result of each update block.
[0141] Step S008: Obtain the final encoding result based on the encoding result of each updated block.
[0142] Specifically, this includes: combining the encoding results of each updated block with the encoding results of the unmerged encoded blocks in sequence to obtain the final encoding result.
[0143] For example, according to the target layer, multiple data points are divided into data blocks Q1, Q2, Q3, Q4, and Q5 in sequence.
[0144] After the data block is first BWT encoded, the corresponding encoded blocks F1, F2, F3, F4, and F5 are obtained.
[0145] Through calculation, F1 and F2 are merged, and F4 and F5 are merged to obtain F12, F3, and F45 in the corresponding order. Among them, F12 and F45 are updated blocks, and F3 is the unmerged encoded block.
[0146] Next, F12 and F45 are subjected to secondary BWT encoding to obtain the encoding results f12 and f45. The final encoding result is f12+F3+f45.
[0147] Step S009: Compress the final encoding result and transmit the compressed data.
[0148] Specifically, the final encoding result is compressed using entropy coding to obtain compressed data of the remote weighing equipment. Entropy coding is a well-known technique and will not be elaborated upon here.
[0149] Once the updated block is obtained, a sequence of data amounts in each block along the time sequence can be obtained. For example, the sequence of data amounts in each block of F12, F3, and F45.
[0150] At the same time, the breakpoint sequence of each update block is obtained. For example, if update block F12 is obtained by merging coded blocks F1 and F2, then the breakpoint is the order value of the last element of the previous coded block (F1) in the weighing data.
[0151] Transmit compressed data and its corresponding data volume sequence and breakpoint sequence.
[0152] After receiving the compressed data, the receiver first performs entropy encoding and decoding to obtain decoded data. The decoded data is then segmented according to the data volume sequence to obtain update blocks. The update blocks are then decoded using BWT to obtain block decoded data. For the block decoded data corresponding to the update block, it is segmented according to the breakpoint sequence of the update block to obtain multiple data blocks (basic blocks). The content of each data block is then decoded using BWT to obtain the original content of each data block, thus obtaining the plaintext data.
[0153] Please see Figure 2 The diagram illustrates a block diagram of a remote data transmission system for weighing equipment based on the Internet of Things (IoT) according to an embodiment of the present invention. The system includes the following modules:
[0154] The acquisition module 100 is used to acquire multiple data points collected by the weighing equipment; the data points include timestamps and weight values.
[0155] The encoding module 200 is used to obtain a hierarchical tree based on multiple data points; determine the target layer in the hierarchical tree using all clusters in each layer; divide the multiple data points into multiple data blocks by treating each cluster in the target layer as a data block; perform BWT encoding on each data block to obtain multiple encoded blocks; merge adjacent and similar encoded blocks using the frequency of each value type in each encoded block to obtain multiple updated blocks; perform BWT encoding on each updated block to obtain the encoding result of each updated block; and obtain the final encoding result based on the encoding result of each updated block.
[0156] The transmission module 300 is used to compress the final encoded result and transmit the compressed data.
[0157] In summary, BWT encoding was updated using first-order and second-order optimization methods. The updated encoding method, taking into account the characteristic of uniform intervals in the weighing data, yielded encoding results that are more conducive to compression, thus achieving better compression performance. First-order optimization: Clustering is used to make each data block similar, thereby optimizing the data blocks. Second-order optimization: By controlling the symbol distribution between blocks, the block sequence itself is made highly compressible, thus optimizing the block sequence.
[0158] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A remote data transmission method for weighing equipment based on the Internet of Things, characterized in that, The method includes the following steps: Acquire multiple data points collected by the weighing equipment; where each data point includes a timestamp and a weight value; A hierarchical tree is obtained based on multiple data points. The hierarchical tree is obtained based on the inter-cluster distance calculated from the comprehensive similarity between any two data points. The comprehensive similarity is calculated based on the difference between the timestamps and the difference between the weight values of the two data points. By utilizing all the class clusters in each level of the hierarchical tree, the target level in the hierarchical tree can be determined. The specific steps involved in determining the target layer in the hierarchical tree by utilizing all the clusters in each layer are as follows: Using all clusters at each level of the hierarchical tree, obtain the intra-class variance and inter-class symbolic similarity of each level of the hierarchical tree; the intra-class variance of each level of the hierarchical tree is the mean of the intra-class variances of all clusters at each level of the hierarchical tree, and the inter-class symbolic similarity of each level of the hierarchical tree is the ratio of the number of numeric types at each level of the hierarchical tree to the number of numeric types of the weight values of multiple data points, where the numeric types are integers from 0 to 9. The weights of intra-class variance and inter-class symbol similarity are determined based on the weight values of multiple data points. The specific steps for determining the weights of intra-class variance and inter-class symbol similarity based on the weight values of multiple data points are as follows: The weight values of multiple data points are sorted according to their timestamps to obtain a weight value sequence. The period of the weight value sequence is obtained by Fourier transform; Based on the period of the weight value sequence, the weight value sequence is divided into multiple segments; For multiple segments, calculate the cosine similarity between any two adjacent segments, and determine the mean of the cosine similarities between all two adjacent segments as the similarity of the weight value sequence. For multiple segments, calculate the variance of each segment, and take the mean of the variances of all segments as the variance of the weight value sequence. The product of the similarity of the weight value sequences and the variance of the weight value sequences is determined as the weight of the inter-class symbol similarity. The difference between 1 and the weight of inter-class symbol similarity is determined as the weight of intra-class variance; Based on the intra-class variance and inter-class symbolic similarity of each layer in the hierarchical tree, as well as the weights of intra-class variance and inter-class symbolic similarity, the evaluation value of the clustering of each layer in the hierarchical tree is obtained. The layer in the hierarchy tree corresponding to the maximum evaluation value is determined as the target layer in the hierarchy tree; Each cluster in the target layer is treated as a data block, and multiple data points are divided into multiple data blocks; Each data block is BWT encoded to obtain multiple encoded blocks; By utilizing the frequency of each numeric type in each coding block, adjacent and similar coding blocks are merged to obtain multiple update blocks; among them, the similarity calculated based on the Euclidean distance of the numeric type frequency sequence of two adjacent coding blocks is used to merge adjacent and similar coding blocks; the numeric type frequency sequence is obtained by sorting the frequency of each numeric type in the coding block, and each numeric type in the coding block is an integer from 0 to 9; Perform BWT encoding on each update block to obtain the encoding result of each update block; Based on the encoding result of each updated block, obtain the final encoding result; The final encoded result is compressed, and the compressed data is then transmitted.
2. The remote data transmission method for weighing equipment based on the Internet of Things according to claim 1, characterized in that, The specific steps for obtaining the hierarchical tree based on multiple data points are as follows: For multiple data points, calculate the absolute value c of the difference between the timestamps of any two data points, and then... As a measure of temporal similarity; Calculate the absolute value s of the difference between the weight values of any two data points, and then... As a measure of weight similarity; The product of time similarity and weight similarity is determined as the comprehensive similarity between any two data points among multiple data points; Based on comprehensive similarity, hierarchical clustering is performed on multiple data points to obtain a hierarchical tree.
3. The remote data transmission method for weighing equipment based on the Internet of Things according to claim 1, characterized in that, The specific steps for obtaining the intra-class variance and inter-class symbolic similarity of each layer of the hierarchical tree by utilizing all clusters in each layer are as follows: For all clusters at each level of the hierarchical tree, calculate the intra-class variance of each cluster, and determine the mean of the intra-class variances of all clusters as the intra-class variance of each level of the hierarchical tree. For each level of the hierarchical tree, obtain the number of numeric types in each cluster, and determine the minimum number of numeric types as the number of numeric types in each level of the hierarchical tree; the numeric types are integers from 0 to 9. The total number of numeric types for all data points within each cluster is used to determine the number of numeric types within each cluster. Get the number of numeric values for the weight values of multiple data points; The total number of numeric types for the weight values of multiple data points is defined as the number of numeric types for the weight values of multiple data points. The ratio of the number of numeric types in each level of the hierarchical tree to the number of numeric types in the weight values of multiple data points is determined as the inter-class symbol similarity of each level of the hierarchical tree.
4. The remote data transmission method for weighing equipment based on the Internet of Things according to claim 1, characterized in that, The specific steps for obtaining the evaluation value of the clustering situation at each layer of the hierarchical tree based on the intra-class variance and inter-class symbolic similarity of each layer, as well as the weights of the intra-class variance and inter-class symbolic similarity, are as follows: The first product is determined by multiplying the inter-class symbol similarity of each level in the hierarchical tree by the weight of the inter-class symbol similarity. The second product is determined by multiplying the intra-class variance of each level in the hierarchical tree by the weight of the intra-class variance. The sum of the first and second products is used as the evaluation value for the clustering of each level in the hierarchical tree.
5. The remote data transmission method for weighing equipment based on the Internet of Things according to claim 1, characterized in that, The specific steps involved in merging adjacent and similar coding blocks to obtain multiple update blocks by utilizing the frequency of each value type in each coding block are as follows: Calculate the number of times each numeric type appears in each coded block; where the numeric type is an integer from 0 to 9. Sort the number of occurrences of each numeric type in ascending order to obtain the numeric type count sequence for each coded block. For any two adjacent coded blocks, calculate the Euclidean distance d between the sequences of number of numeric types in the two coded blocks, and then... The similarity between any two adjacent coded blocks; Multiple update blocks are obtained based on the similarity between any two adjacent coded blocks.
6. The remote data transmission method for weighing equipment based on the Internet of Things according to claim 5, characterized in that, The specific steps for obtaining multiple update blocks based on the similarity between any two adjacent coding blocks are as follows: When the similarity between any two adjacent coded blocks is greater than a preset similarity threshold, the two adjacent coded blocks are merged to obtain an updated block.
7. The remote data transmission method for weighing equipment based on the Internet of Things according to claim 1, characterized in that, The specific steps for obtaining the final encoding result based on the encoding result of each updated block are as follows: The encoding results of each updated block are combined with the encoding results of the unmerged encoded blocks in sequence to obtain the final encoding result.
8. A remote data transmission system for weighing equipment based on the Internet of Things, characterized in that, The system includes the following modules: The acquisition module is used to acquire multiple data points collected by the weighing equipment; the data points include timestamps and weight values. The encoding module is used to obtain a hierarchical tree based on multiple data points. The hierarchical tree is obtained by calculating the inter-cluster distance based on the comprehensive similarity between any two data points. The comprehensive similarity is calculated based on the difference between the timestamps and the difference between the weight values of the two data points. The target layer in the hierarchical tree is determined using all the clusters in each layer. The specific steps for determining the target layer in the hierarchical tree using all the clusters in each layer are as follows: Using all clusters at each level of the hierarchical tree, obtain the intra-class variance and inter-class symbolic similarity of each level of the hierarchical tree; the intra-class variance of each level of the hierarchical tree is the mean of the intra-class variances of all clusters at each level of the hierarchical tree, and the inter-class symbolic similarity of each level of the hierarchical tree is the ratio of the number of numeric types at each level of the hierarchical tree to the number of numeric types of the weight values of multiple data points, where the numeric types are integers from 0 to 9. The weights of intra-class variance and inter-class symbol similarity are determined based on the weight values of multiple data points. The specific steps for determining the weights of intra-class variance and inter-class symbol similarity based on the weight values of multiple data points are as follows: The weight values of multiple data points are sorted according to their timestamps to obtain a weight value sequence. The period of the weight value sequence is obtained by Fourier transform; Based on the period of the weight value sequence, the weight value sequence is divided into multiple segments; For multiple segments, calculate the cosine similarity between any two adjacent segments, and determine the mean of the cosine similarities between all two adjacent segments as the similarity of the weight value sequence. For multiple segments, calculate the variance of each segment, and take the mean of the variances of all segments as the variance of the weight value sequence. The product of the similarity of the weight value sequences and the variance of the weight value sequences is determined as the weight of the inter-class symbol similarity. The difference between 1 and the weight of inter-class symbol similarity is determined as the weight of intra-class variance; Based on the intra-class variance and inter-class symbolic similarity of each layer in the hierarchical tree, as well as the weights of intra-class variance and inter-class symbolic similarity, the evaluation value of the clustering of each layer in the hierarchical tree is obtained. The layer in the hierarchy tree corresponding to the maximum evaluation value is determined as the target layer in the hierarchy tree; Each cluster in the target layer is treated as a data block, and multiple data points are divided into multiple data blocks. Each data block is BWT encoded to obtain multiple encoded blocks. Adjacent and similar encoded blocks are merged based on the frequency of each numeric type in each encoded block to obtain multiple updated blocks. The similarity is calculated based on the Euclidean distance between the numeric type frequency sequences of two adjacent encoded blocks. The numeric type frequency sequence is obtained by sorting the frequency of each numeric type in the encoded block, where each numeric type in the encoded block is an integer from 0 to 9. Perform BWT encoding on each update block to obtain the encoding result of each update block; based on the encoding result of each update block, obtain the final encoding result; The transmission module is used to compress the final encoded result and transmit the compressed data.
Citation Information
Patent Citations
Methods and systems for data analysis and compression
CN106687966A
Block-wise adaptive statistical data compressor
WO1999044292A1