Sensor data compression method and device, electronic equipment and readable storage medium
By transforming sensor data into the transformation domain for eigenvalue retention and lossless compression, the problems of large data reconstruction errors and high resource consumption of lossy compression algorithms on edge devices are solved, and high efficiency compression and low power consumption data processing are achieved.
Patent Information
- Application Number
- CN202510335765.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-07-22
AI Technical Summary
Existing lossy compression algorithms are difficult to achieve high-efficiency compression ratio and low resource consumption on resource-constrained edge devices, and there are large data reconstruction errors.
Transform the original sensor data into the transformation domain, determine the target fixed-point integer and perform lossless compression through eigenvalue retention and lossless compression methods, including using improved DCT algorithms and Rice-Golomb encoding.
It greatly reduces data reconstruction errors, reduces device power consumption, and improves computing speed, and is suitable for resource-constrained edge devices.
Smart Images

Figure CN120357905A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data compression, and particularly to a method, device, electronic device and readable storage medium for compressing sensor data. Background Art
[0002] In the field of data processing, according to whether the decompressed data is distorted, data compression algorithms can be divided into lossless compression and lossy compression. Currently, common lossy compression algorithms mainly include transform coding, compressive sensing, and autoencoder-based methods.
[0003] Transform coding-based methods use transformation means such as Fast Fourier Transform (FFT), Discrete Wavelet Transform (DWT), and Discrete Cosine Transform (DCT) to convert data into a domain with sparse features for compression. This method relies on the sparse characteristics of data in the transform domain and achieves efficient compression by retaining the main energy coefficients. However, it requires collecting a complete data set before compression, which may not be suitable in some real-time and resource-constrained application environments.
[0004] In contrast, compressive sensing-based methods can obtain key sample points of data using random sampling far below the Nyquist sampling rate and reconstruct the data by finding the sparse solution of an underdetermined linear system. Although compressive sensing achieves simple and efficient compression during the sampling process, its decompression process is complex and the reconstruction error is large.
[0005] In recent years, autoencoder-based methods have also gradually attracted attention. Such methods use the powerful representation ability of neural networks for data compression and restoration. However, since autoencoders usually involve a large model size and the input and output data lengths are fixed, it is difficult to meet the requirements of sensor data processing on edge devices.
[0006] In addition, for edge computing scenarios, some lightweight lossy compression algorithms such as the Rotation Door algorithm and the LTC algorithm have also been proposed. They are essentially linear fitting methods that keep the error bounded and can represent data with several endpoints of multiple line segments to achieve compression. Although these methods have simple algorithms, due to the loss of deep features of the data, they result in a large reconstruction error.
[0007] In summary, the existing lossy compression algorithms have their own characteristics, but they all face certain challenges in practical applications. Transform coding methods are suitable for application scenarios that require high fidelity, but they have high requirements for computing resources; compressed sensing methods can work at low sampling rates, but the decompression complexity is high and the reconstruction error is large; autoencoder methods rely on the powerful capabilities of deep learning, but are difficult to apply to resource-constrained edge devices. Although lightweight lossy compression algorithms are easy to implement, the quality of data reconstruction is poor.
[0008] Therefore, how to develop a new generation of lossy compression algorithm that can ensure efficient compression ratio while meeting the requirements of low resource consumption and high-quality data reconstruction is an important issue that needs to be urgently addressed in the field of data compression. Summary of the invention
[0009] The present invention provides a sensor data compression method, device, electronic device and readable storage medium, which are used to overcome the defects of existing lossy compression methods, such as large data reconstruction error, large consumption of computing resources, and difficulty in applying to resource-constrained edge devices. The method can not only significantly reduce the data reconstruction error, but also can be directly applied to resource-constrained edge devices, while improving the computing speed and reducing the power consumption of the device.
[0010] On the one hand, the present invention provides a sensor data compression method, comprising: transforming the collected original sensor data into a transform domain to obtain a transform result; the transform result includes a transform value and its corresponding original position; retaining a characteristic value of the transform result to obtain retained information; the retained information includes a retained-transform value and its corresponding original position; determining a target fixed-point integer based on the retained information and the original position in the transform result; and losslessly compressing the target fixed-point integer to obtain a compressed result.
[0011] Furthermore, the feature value retention of the transformation results to obtain the retention information includes: sorting the transformation results according to absolute value, and intercepting the transformation value of the set position to obtain the retention-transformation value; and obtaining the retention information according to the retention-transformation value and its corresponding original position.
[0012] Furthermore, the determining the target fixed-point integer based on the retention information and the original position in the transformation result includes: determining a maximum retention-exchange value in the retention information; determining a numerical fixed-point integer based on the maximum retention-exchange value and other retention-exchange values in the retention information; and determining the target fixed-point integer based on the numerical fixed-point integer and a positional fixed-point integer corresponding to the original position in the transformation result.
[0013] Further, the step of transforming the collected original sensor data into a transform domain to obtain a transform result includes: using a variant algorithm of the discrete cosine transform algorithm to transform the original sensor data into the transform domain to obtain the transform result.
[0014] Further, the step of losslessly compressing the target fixed-point integer to obtain a compression result includes: performing a difference process on the target fixed-point integer to obtain a result after difference; performing a normalization process on the result after difference to obtain a result after normalization; and performing an encoding process on the result after normalization to obtain the compression result.
[0015] Further, the sensor data compression method further includes: decoding the compression result, performing inverse transforms of normalization and difference to restore the target fixed-point integer; separating the value and the original position in the target fixed-point integer by bit operations to obtain the restored frequency domain feature information; filling the frequency domain feature information into corresponding positions of a pre-constructed zero sequence according to the original position in the target fixed-point integer to obtain a frequency domain feature sequence; the data length of the zero sequence is the same as the data length of the original sensor data; and performing an inverse transform on the frequency domain feature sequence to obtain a decompression result.
[0016] In a second aspect, the present invention further provides a sensor data compression device, including: a data transformation module, configured to transform the collected original sensor data into a transform domain to obtain a transform result; the transform result includes a transform value and its corresponding original position; a feature value retention module, configured to retain feature values of the transform result to obtain retention information; the retention information includes a retained-transform value and its corresponding original position; a fixed-point integer determination module, configured to determine a target fixed-point integer based on the retention information and the original position in the transform result; and a lossless compression module, configured to perform lossless compression on the target fixed-point integer to obtain a compression result.
[0017] In a third aspect, the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the computer program, the sensor data compression method as described in any one of the above is implemented.
[0018] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the sensor data compression method as described in any one of the above is implemented.
[0019] In a fifth aspect, the present invention further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the sensor data compression method as described in any one of the above is implemented.
[0020] The sensor data compression method provided by the present invention transforms the collected original sensor data into the transform domain to obtain a transform result; the transform result includes transform values and their corresponding original positions; and eigenvalue retention is performed on the transform result to obtain retention information; the retention information includes retained-transform values and their corresponding original positions; furthermore, based on the retention information and the original positions in the transform result, target fixed-point integers are determined; thus, lossless compression is performed on the target fixed-point integers to obtain a compression result. By performing eigenvalue retention and quantization on the transform result of the original sensor data and then performing lossless compression, this method not only greatly reduces the data reconstruction error, but can also be directly applied to resource-constrained edge devices, while improving the calculation speed and reducing the device power consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0022] Figure 1 It is a schematic flowchart of the sensor data compression method provided by an embodiment of the present invention.
[0023] Figure 2 It is a schematic diagram of the process of determining the target fixed-point integer provided by an embodiment of the present invention.
[0024] Figure 3 It is a schematic diagram of Rice-Golomb coding provided by an embodiment of the present invention.
[0025] Figure 4 It is a schematic diagram of the overall process of the sensor data compression method provided by an embodiment of the present invention.
[0026] Figure 5 It is a schematic diagram of the structure of the sensor data compression device provided by an embodiment of the present invention.
[0027] Figure 6 It is a schematic diagram of the physical structure of the electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0028] To make the objectives, technical solutions, and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions in the present invention with reference to the drawings in the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments in the present invention belong to the scope of protection of the present invention.
[0029] It should be noted that existing lossy compression algorithms each have their own characteristics, but they all face certain challenges in practical applications. Among them, transform coding methods are suitable for application scenarios that require high fidelity, but have high requirements for computing resources; compressive sensing methods can work at low sampling rates, but have high decompression complexity and large reconstruction errors; autoencoder methods rely on the powerful capabilities of deep learning, but are difficult to apply to resource-constrained edge devices. Although lightweight lossy compression algorithms are easy to implement, the data reconstruction quality is poor.
[0030] Considering this, the present invention proposes a new sensor data compression method. Specifically, Figure 1 FIG. shows a schematic flowchart of the sensor data compression method provided by an embodiment of the present invention.
[0031] As Figure 1 shown, the method includes steps S110 - S140, and the following will elaborate on steps S110 - S140 and related steps in detail.
[0032] S110, transform the collected original sensor data into the transform domain to obtain a transform result; the transform result includes transform values and their corresponding original positions.
[0033] Sensor data refers to information collected by various types of sensors, which can reflect specific states or changes in the physical world. A sensor is a detection device that can sense physical, chemical, biological, and other phenomena in the surrounding environment and convert them into processable electrical signals or other forms of output. Common types of sensors include acceleration sensors, temperature sensors, humidity sensors, pressure sensors, light sensors, gyroscopes, etc.
[0034] Correspondingly, the original sensor data refers to the original information collected by various types of sensors, emphasizing that these data are original and have not been processed twice.
[0035] It can be understood that first, the original sensor data of the target object needs to be collected through pre-configured sensors. Among them, the target object can be any device with a large data storage requirement, such as rotating machinery such as engines, generators, compressors, and turbines, manufacturing and processing equipment such as numerically controlled machine tools and stamping machines, bridges, buildings, and other large structures. Correspondingly, the original sensor data can be one or a combination of acceleration data, displacement data, strain data, temperature data, and environmental data of the target object, and no specific limitation is made here.
[0036] Subsequently, a preset transformation algorithm is used to transform the original sensor data into the transform domain to obtain a transformation result with the same length as the original sensor data. In a specific embodiment, the data lengths of the original sensor data and the transformation result are both 512.
[0037] The preset transformation algorithm mainly includes improved DCT algorithms, such as variant algorithms of DCT algorithms like DCT-I, DCT-II, DCT-III, DCT-IV, MDCT, etc. Preferably, in this embodiment, the DCT-IV algorithm is used to transform the original sensor data into the transform domain to obtain the corresponding transformation result. The transformation formula corresponding to the DCT-IV algorithm is as follows in Equation (1).
[0038] (1)。
[0039] In Equation (1), is the transformation result (sequence), represents the input original sensor data, represents the number of each data point in the original sensor data, represents the input data length, that is, the length of the original sensor data.
[0040] It should be noted that before performing the transformation processing on the original sensor data, preprocessing needs to be performed on the original sensor data to ensure that the original sensor data is in a form suitable for the preset transformation algorithm. The preprocessing here includes but is not limited to normalization, outlier removal, etc.
[0041] The transformation result consists of two parts, namely the transformed value and its corresponding original position. The transformed value is the data obtained by transforming the original sensor data, and the original position is the position / order of each data point when collecting the original sensor data.
[0042] After obtaining the transformation result by transforming the collected original sensor data into the transform domain in step S110, further, step S120 is executed.
[0043] S120, retain the eigenvalues of the transformation result to obtain the retention information; the retention information includes the retained-transformed value and its corresponding original position.
[0044] It is easy to understand that first, the transformed values in the transformation result are sorted according to their absolute values, and at the same time, the original positions corresponding to these transformed values are retained. Then, by intercepting the transformed values at the set positions in the re-sorted transformation result sequence, the retained-transformed values can be obtained.
[0045] Among them, the set position is set according to the sorting method of absolute values. Specifically, when the transformed values in the transformation result are sorted in ascending order of absolute value, the transformed value of the set position is the set number of transformed values sorted later; when the transformed values in the transformation result are sorted in descending order of absolute value, the transformed value of the set position is the set number of transformed values sorted earlier. That is to say, the purpose of this step is to intercept the set number of transformed values with larger absolute values in the transformation result.
[0046] The set number can be set according to actual needs and is not specifically limited here. For example, in a specific embodiment, the set number is 51.
[0047] It should be noted that in this embodiment, by only retaining the transformed values with larger absolute values in the transformation result, the main features of the original sensor data / transformation result can be retained to the greatest extent, and at the same time, data compression is achieved by removing unimportant information.
[0048] After obtaining the retained-transformed values, combined with their corresponding original positions, the retained information can be obtained.
[0049] On the basis of performing eigenvalue retention on the transformation result in step S120 to obtain the retained information, further, step S130 is executed.
[0050] S130. Based on the retained information and the original positions in the transformation result, determine the target fixed-point integer.
[0051] It is easy to understand that first, the largest retained-exchange value is extracted from the retained information, that is, the maximum retained-exchange value , and then, the numerical fixed-point integer is determined according to the maximum retained-exchange value and the other retained-exchange values in the retained information. Among them, the other retained-exchange values refer to the retained-exchange values in the retained information except the maximum retained-exchange value.
[0052] Specifically, determine the number of bits of the fixed-point number after quantization, and perform the operation of the following formula (2) on the other retained-exchange values.
[0053] (2).
[0054] In formula (2), is the numerical fixed-point integer after transformation, is the other retained-exchange value in the retained information.
[0055] Among them, the number of bits of the fixed-point number after quantization can be set according to the actual situation. Preferably, as in the above formula (2), the number of bits of the fixed-point number after quantization is determined to be 7.
[0056] Meanwhile, represent the original position information of the transformation result as a position fixed-point integer , and the number of fixed-point digits of the position fixed-point integer can be set according to the data length of the transformation result. For example, if the data length of the transformation result is 512, the number of fixed-point digits of the position fixed-point integer is 9 bits.
[0057] Next, connect the 7-bit numerical fixed-point integer and the 9-bit position fixed-point integer to obtain a 16-bit target fixed-point integer. The connection process can be seen in the following formula (3).
[0058] (3).
[0059] In formula (3), is the target fixed-point integer.
[0060] In a specific embodiment, Figure 2 shows a schematic diagram of the process of determining the target fixed-point integer provided by the embodiment of the present invention. In Figure 2 , the numerical fixed-point integer is 0101000, the position fixed-point integer is 000101101, and the connected target fixed-point integer is 0101000000101101.
[0061] After determining the target fixed-point integer based on the reserved information and the original position in the transformation result in step S130, further, execute step S140.
[0062] S140, perform lossless compression on the target fixed-point integer to obtain a compression result.
[0063] It is easy to understand that for the obtained 16-bit target fixed-point integer , lossless compression needs to be performed to further improve the compression ratio. Specifically, the process of lossless compression includes a difference step, a normalization step, and a compression step, which jointly aim to reduce data redundancy to achieve efficient storage.
[0064] First, perform difference processing on the target fixed-point integer to obtain a difference result.
[0065] Difference processing refers to the difference value between adjacent data points in technology, and its purpose is to remove the trend component in the data or reduce the dynamic range of the data. Among them, the difference process can be seen in the following formula (4).
[0066] (4).
[0067] In formula (4), is the difference result. The difference result obtained by difference processing has a smaller numerical range, which is beneficial to the subsequent compression step.
[0068] Then, for the result after differencing perform normalization processing to obtain the result after normalization.
[0069] The purpose of normalization processing is to convert all the results after differencing into positive values for compression use. Among them, the normalization process can refer to the following formula (5).
[0070] (5).
[0071] In formula (5), is the result after normalization.
[0072] Finally, perform encoding processing on the result after normalization to obtain the final compression result.
[0073] There can be multiple specific encoding algorithms available in this step. Preferably, in this embodiment, Rice - Golomb encoding is adopted. Its encoding method is to define an adjustable parameter , and perform the following operation on the positive integer to be compressed (i.e., the result after normalization in this embodiment) according to formula (6).
[0074] (6).
[0075] In formula (6), represents the quotient, and unary encoding is adopted, represents the remainder, and binary encoding is adopted. represents the positive integer to be compressed, and is replaced with the result after normalization in this embodiment during actual compression . , can be selected according to actual needs. Preferably, is determined to be 11.
[0076] Subsequently, use and to form the encoding result, that is, the final compression result. Specifically, use bits of 0 connected to 1 bit of 1, and then connected to bits of the binary representation of .
[0077] In a specific embodiment, Figure 3 shows the schematic diagram of Rice - Golomb encoding provided by the embodiment of the present invention. As Figure 3 shown, bits (5 bits) of 0 connected to 1 bit of 1, and then connected to bits (4 bits) of the binary representation of , and finally obtain the compression result 0000010001.
[0078] It should be noted that the sensor data compression method provided by the present invention is a lossy compression method, which can be directly applied to edge devices, such as sensors for data acquisition at the edge.
[0079] In this embodiment, the collected original sensor data is transformed into the transform domain to obtain a transform result; the transform result includes transform values and their corresponding original positions; and eigenvalue retention is performed on the transform result to obtain retention information; the retention information includes retained-transform values and their corresponding original positions; furthermore, based on the retention information and the original positions in the transform result, target fixed-point integers are determined; thus, lossless compression is performed on the target fixed-point integers to obtain a compression result. This method not only greatly reduces the data reconstruction error by performing eigenvalue retention and quantization on the transform result of the original sensor data and then performing lossless compression, but also can be directly applied to resource-constrained edge devices, while improving the calculation speed and reducing the device power consumption.
[0080] On the basis of the above embodiment, further, the sensor data compression method provided by the present invention further includes: performing decoding processing on the compression result, and performing inverse transforms of normalization and difference to obtain target fixed-point integers; using bit operations to separate the values and original positions in the target fixed-point integers to obtain restored frequency-domain feature information; filling the frequency-domain feature information into the corresponding positions of a pre-constructed zero sequence according to the original positions in the target fixed-point integers to obtain a frequency-domain feature sequence; the data length of the zero sequence is the same as the data length of the original sensor data; performing an inverse transform on the frequency-domain feature sequence to obtain a decompression result.
[0081] It is easy to understand that after performing lossy compression on the original sensor data and obtaining a compression result, the compression result also needs to be decompressed when reading the data to obtain a decompression result. Decompression can be achieved through the inverse process of lossy compression.
[0082] Specifically, first, according to the principle of Rice-Golomb coding, the compression result is decoded to restore the compression result to an integer, and the restored integer is restored to a target fixed-point integer through the inverse transforms of the normalization step and the difference step .
[0083] Then, bit operations are used to separate the values and original position information in the restored target fixed-point integer to restore the frequency-domain feature information.
[0084] Immediately afterwards, a zero sequence of the same length as the original sensor data is constructed, and according to the restored original position information, the restored frequency-domain feature information is filled into the corresponding positions of the zero sequence to form a complete frequency-domain feature sequence.
[0085] Finally, use the inverse transform of a preset transform algorithm (such as the DCT-IV algorithm) to convert the frequency-domain feature sequence into time-domain data, and then the decompression can be completed to obtain the decompression result.
[0086] In some other embodiments, Figure 4 FIG. shows the overall flowchart of the sensor data compression method provided by the embodiment of the present invention. In this embodiment, the bridge structure is used as the target object, and the original vibration data of the bridge structure is used as the original sensor data, specifically including acceleration data.
[0087] First, frequency-domain transform (transform from time domain to frequency domain). Transform the collected original vibration data of the bridge structure into the transform domain to obtain frequency-domain information with the same length as the original vibration data, that is, the transform result.
[0088] Then, eigenvalue retention. Sort and intercept the frequency-domain information (by absolute value) to obtain the retention information with a length of 0.1 times the length of the original vibration data.
[0089] Immediately afterwards, quantization. Quantize the retention information and its corresponding original position information to obtain the fixed-point number information with a length of 0.1 times the length of the original vibration data, that is, the target fixed-point integer.
[0090] Finally, lossless compression. Perform lossless compression on the fixed-point number information to obtain the final result, that is, the compression result. Among them, the process of lossless compression includes three steps: differential processing, normalization processing, and coding compression.
[0091] After obtaining the compression result, package and send the data (compression result) to the requester. The requester can perform the inverse process of the compression process to achieve decompression and obtain the decompression result, thereby realizing data transmission and reading.
[0092] In still some other embodiments, multiple defined evaluation indicators are used to evaluate whether the sensor data compression method provided by the present invention is applicable. Specifically, for the vibration data of bridge structure health monitoring, the core indicator is the accuracy of the modal information extracted by modal analysis. Secondly, indicators such as reconstruction error are also used to evaluate the degree of recovery of the data waveform in the time domain.
[0093] In this embodiment, the original sensor data used is 20-bit vibration data, and the length of the finally obtained compression result data is about 750 bits.
[0094] The multiple defined evaluation indicators include compression ratio, reconstruction error, nRMSE (Normalized Root Mean Square Error), and modal confidence.
[0095] Among them, the compression ratio is defined as the ratio of the length of the compressed data to the length of the original data. The smaller the compression ratio, the better the compression effect. When the reconstruction error < 0.5, the result of data recovery is acceptable; when the reconstruction error < 0.3, the result of data recovery is very good; when the reconstruction error < 0.1, the result of data recovery is perfect.
[0096] When nRMSE < 0.03, the data recovery is very successful. After performing modal analysis on the vibration data, multi-order modal information will be obtained. The modal confidence is an evaluation index for evaluating the similarity of two pieces of modal information, presented in matrix form. Generally, it is considered that when the diagonal elements of the matrix > 0.9, it indicates that the modal information has not deviated unacceptably.
[0097] Here, the multi-order modal information refers to a set of modal parameters at multiple different frequencies extracted from the vibration data. Each frequency corresponds to a mode, and these different modes each have unique natural frequencies, modal shapes, and damping ratios, etc.
[0098] Verified, in this embodiment, the compression ratio is 750 / (20×512) = 0.073, significantly reducing the scale of data transmission. The reconstruction error is 0.43, and the result of data recovery is acceptable. The nRMSE is 0.027, less than 0.03, and the data recovery is very successful. The diagonal elements of the modal confidence matrix are all above 0.9, and the modal information has not deviated unacceptably.
[0099] Corresponding to the sensor data compression methods described in the above embodiments, the present invention also provides a sensor data compression device.
[0100] Specifically, Figure 5 shows a schematic structural diagram of the sensor data compression device provided by the embodiment of the present invention. As Figure 5 shown, the device includes: a data transformation module 510, configured to transform the collected original sensor data into the transform domain to obtain a transformation result; the transformation result includes transformation values and their corresponding original positions; an eigenvalue retention module 520, configured to retain eigenvalues of the transformation result to obtain retention information; the retention information includes retained - transformation values and their corresponding original positions; a fixed-point integer determination module 530, configured to determine a target fixed-point integer based on the retention information and the original positions in the transformation result; a lossless compression module 540, configured to perform lossless compression on the target fixed-point integer to obtain a compression result.
[0101] In this embodiment, the acquired original sensor data is transformed into the transform domain through the data transformation module 510 to obtain a transformation result; the transformation result includes transformation values and their corresponding original positions; the eigenvalue retention module 520 retains eigenvalues of the transformation result to obtain retention information; the retention information includes retained-transformation values and their corresponding original positions; furthermore, the fixed-point integer determination module 530 determines a target fixed-point integer based on the retention information and the original positions in the transformation result; thus, the lossless compression module 540 performs lossless compression on the target fixed-point integer to obtain a compression result. By retaining eigenvalues and quantifying the transformation result of the original sensor data and then performing lossless compression, this device not only greatly reduces the data reconstruction error, but can also be directly applied to resource-constrained edge devices, while improving the computing speed and reducing the device power consumption.
[0102] It should be noted that the sensor data compression device provided in the embodiments of the present invention can be correspondingly referred to the sensor data compression methods described in the above embodiments, and will not be elaborated here.
[0103] Figure 6 An entity structure diagram of an electronic device is exemplified, as Figure 6 shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630, and a communication bus 640. Among them, the processor 610, the communication interface 620, and the memory 630 complete mutual communication through the communication bus 640. The processor 610 can call the logical instructions in the memory 630 to execute the sensor data compression method, and the method includes: transforming the acquired original sensor data into the transform domain to obtain a transformation result; the transformation result includes transformation values and their corresponding original positions; retaining eigenvalues of the transformation result to obtain retention information; the retention information includes retained-transformation values and their corresponding original positions; determining a target fixed-point integer based on the retention information and the original positions in the transformation result; performing lossless compression on the target fixed-point integer to obtain a compression result.
[0104] In addition, when the logical instructions in the above-mentioned memory 630 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.
[0105] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the sensor data compression method provided by the above-mentioned various methods. The method includes: transforming the collected original sensor data into a transform domain to obtain a transform result; the transform result includes transform values and their corresponding original positions; retaining eigenvalue information for the transform result to obtain retention information; the retention information includes retained-transform values and their corresponding original positions; determining a target fixed-point integer based on the retention information and the original positions in the transform result; and performing lossless compression on the target fixed-point integer to obtain a compression result.
[0106] In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is configured to execute the sensor data compression method provided by the above-mentioned various methods. The method includes: transforming the collected original sensor data into a transform domain to obtain a transform result; the transform result includes transform values and their corresponding original positions; retaining eigenvalue information for the transform result to obtain retention information; the retention information includes retained-transform values and their corresponding original positions; determining a target fixed-point integer based on the retention information and the original positions in the transform result; and performing lossless compression on the target fixed-point integer to obtain a compression result.
[0107] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0108] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for compressing sensor data, characterized in that, Including: Transform the collected original sensor data into the transform domain to obtain a transform result; The transform result includes transform values and their corresponding original positions; Perform eigenvalue retention on the transform result to obtain retention information; the retention information includes retained-transform values and their corresponding original positions; Based on the retention information and the original positions in the transform result, determine the target fixed-point integer; Perform lossless compression on the target fixed-point integer to obtain a compression result.
2. The sensor data compression method according to claim 1, wherein The performing eigenvalue retention on the transform result to obtain retention information includes: Sort the transform result according to the absolute value size and intercept the transform values at the set positions to obtain the retained-transform values; According to the retained-transform values and their corresponding original positions, obtain the retention information.
3. The sensor data compression method according to claim 1, wherein The determining the target fixed-point integer based on the retention information and the original positions in the transform result includes: Determine the maximum retained-exchange value in the retention information; According to the maximum retained-exchange value and other retained-exchange values in the retention information, determine the numerical fixed-point integer; According to the numerical fixed-point integer and the position fixed-point integer corresponding to the original position in the transform result, determine the target fixed-point integer.
4. The sensor data compression method according to claim 1, characterized in that, The transforming the collected original sensor data into the transform domain to obtain a transform result includes: Use a variant algorithm of the discrete cosine transform algorithm to transform the original sensor data into the transform domain to obtain the transform result.
5. The sensor data compression method according to claim 1, wherein The performing lossless compression on the target fixed-point integer to obtain a compression result includes: Perform differential processing on the target fixed-point integer to obtain a result after differentiation; Perform normalization processing on the result after differentiation to obtain a result after normalization; Perform encoding processing on the result after normalization to obtain the compression result.
6. The sensor data compression method according to any one of claims 1-5, characterized in that Also including: Decode the compression result, perform inverse transformation of normalization and differentiation, and restore to obtain the target fixed-point integer; Use bit operations to separate the numerical value and the original position in the target fixed-point integer to obtain the restored frequency domain feature information; According to the original position in the target fixed-point integer, fill the frequency domain feature information into the corresponding positions of a pre-constructed zero sequence to obtain a frequency domain feature sequence; the data length of the zero sequence is the same as the data length of the original sensor data; Perform inverse transformation on the frequency domain feature sequence to obtain a decompression result.
7. A sensor data compression device, characterized in that, Including: A data transformation module for transforming the collected original sensor data into the transform domain to obtain a transform result; The transform result includes transform values and their corresponding original positions; An eigenvalue retention module for performing eigenvalue retention on the transform result to obtain retention information; the retention information includes retained-transform values and their corresponding original positions; A fixed-point integer determination module for determining the target fixed-point integer based on the retention information and the original positions in the transform result; A lossless compression module for performing lossless compression on the target fixed-point integer to obtain a compression result.
8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the sensor data compression method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the sensor data compression method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the sensor data compression method according to any one of claims 1 to 6.