A method and apparatus for lossy concurrent compression of real-time databases in the industrial Internet of Things
By collecting data from a real-time industrial IoT database to calculate the average slope and limit rate, and employing adjustment strategies to form multiple calculation modes, the problem of insufficient compression accuracy and efficiency in existing technologies is solved, achieving a highly efficient lossy compression effect.
Patent Information
- Application Number
- CN202111264619.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-28
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2041-10-28
AI Technical Summary
Existing lossy compression algorithms for real-time databases in the Industrial Internet of Things (IIoT) are insufficient in terms of compression accuracy and efficiency, and cannot simultaneously improve compression ratio and restoration accuracy.
By collecting data within a preset time period, calculating and sorting the average slope, defining the slope limit rate and its extreme value, adopting adjustment strategies to form multiple calculation modes, determining whether to store new data, and optimizing the model coefficients in combination with actual scenarios, fast and efficient lossy compression is achieved.
It significantly improves the compression ratio and restoration accuracy, meeting the high-efficiency compression requirements of real-time data in the Industrial Internet of Things and ensuring the reliable operation of the system in different scenarios.
Smart Images

Figure CN114142864B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data compression technology, specifically to a lossy concurrent compression method and apparatus for real-time databases in the industrial Internet of Things. Background Technology
[0002] The data compression quality of real-time databases in the Industrial Internet of Things (IIoT) is a crucial metric for evaluating real-time database performance. The ability to compress real-time data in industrial monitoring stems from two main reasons. First, data collected from monitoring points often contains redundant components. For example, certain characters may appear repeatedly in a file, appear more frequently than others, or always appear in predictable positions within data blocks. These redundant parts can be removed or reduced during data encoding. Second, data collected from monitoring points, especially adjacent data points, often exhibits spatiotemporal correlations. Real-time data frequently fluctuates within a certain operating range, but this fluctuation is indistinguishable to the user. Therefore, these fluctuating data points can be excluded from the real-time database, but such variations can sometimes lead to irreversible losses and errors.
[0003] Real-time database compression algorithms are categorized into lossless and lossy compression based on their compression accuracy. Lossless compression guarantees an accurate copy of the input data stream after a compression-to-decompression cycle. Typical lossless compression algorithms include Huffinan coding, arithmetic coding, the LZ series algorithms, and RLE. Lossy compression, also known as destructive compression, involves compressing less important information, sacrificing some quality to reduce data volume and improve the compression ratio. Lossy compression is commonly used for digitally stored analog data and is primarily applied to graphics and audio files, such as in industrial monitoring systems. Currently, commonly used lossy compression algorithms for real-time databases include dead-zone compression and trend compression, with the rotating door compression algorithm being the most popular. While lossy compression algorithms significantly improve the compression ratio of real-time databases, their selective retention and discarding of data can lead to a decrease in system accuracy.
[0004] A search revealed that Chinese patent CN102393855B discloses a dynamic control method for lossy compression ratio of process data, proposing a dynamic control method guided by the formula: compression ratio = 1 - number of data items after compression / number of data items before compression. It assumes a linear relationship between the compression ratio and the compression deviation. Under a given target compression ratio, it dynamically adjusts within an adjustable range based on the compression results of a previous data segment, eliminating the need for manual setting of the compression deviation and improving the timeliness of data compression. However, the compression ratio proposed in this patent before data compression is not based on the data itself, and the accuracy of data compression remains insufficient. Summary of the Invention
[0005] To overcome the shortcomings of the prior art, the present invention provides a lossy concurrent compression method and apparatus for real-time databases in the Industrial Internet of Things, which can perform fast and efficient lossy compression of real-time data, significantly improving the compression ratio and restoration accuracy, and achieving simultaneous improvement in the compression rate and accuracy of lossy compression.
[0006] This invention is achieved through the following technical solutions:
[0007] A lossy concurrent compression method for real-time databases in the Industrial Internet of Things (IIoT) includes,
[0008] Data is collected from monitoring points p and q based on a preset time period, and the two sets of collected data are preprocessed separately.
[0009] Write the data collected the first time into the database and save it as the "last written data". Calculate the average slope of the first n data points of monitoring points p and q.
[0010] Sort the initial slopes of the first n data for monitoring points p and q respectively, and find the initial slope limit rate and the corresponding initial slope limit value after sorting.
[0011] The initial slope limit rate of the two monitoring points is adjusted. According to the adjustment strategy, monitoring points p and q correspond to different slope limit rates and slope limits under different calculation modes.
[0012] Read in new data, calculate the mean slope of the new data, and compare it with the slope limit value obtained according to the adjustment strategy. If the mean slope value is less than the slope limit value, then it is determined to store the data.
[0013] Read in new data again, repeat the calculation and judgment steps, until all data compression is completed after reading in n new data.
[0014] In the above technical solution, data is first collected continuously a predetermined number of times within a preset time period to calculate the average slope; then the slopes are sorted to find the slope limit rate and its corresponding slope limit value; secondly, an adjustment strategy is defined for the slope limit rate to form multiple calculation modes; then new data is collected, and it is determined whether to store the new data according to the adjustment strategy, which improves the compression ratio and accuracy of lossy compression.
[0015] Preferably, the calculation process of the mean slope includes:
[0016] S11. Record n data points at detection point p, calculate the initial slope between every two points, calculate the average slope, and use p1 as the "last data written". n As the "last data read in".
[0017] Specifically, record n data points p1(t1,v1), p2(t2,v2), ..., p at detection point p. n (t n ,v n ), calculate the initial slope between each pair of points r1 = (v2 - v1) / (t2 - t1), ... r n-1 =(v n -v n-1 ) / (t n -t n-1 ), calculate the mean slope R p = (r1+r2+...r) n-1 ) / (n-1), record p1 as the "last written data" as p l (t l ,v l ), p n Recorded as "last read data" as p r (t r ,v r ).
[0018] S12. Record n data points for monitoring point q. Calculate the average slope of monitoring point q according to the steps above, and use q1 as the "last data written". n As the "last data read in".
[0019] Specifically, record n data points q1(t1,v1), q2(t2,v2), ...,q at monitoring point q. n (t n ,v n ), calculate the mean slope R of monitoring point q according to the above steps. q = (r1+r2+...r) n-1 ) / (n-1), record q1 as the "last written data" as q l (t l ,v l ), q n Recorded as "last read data" as q r (t r ,v r ).
[0020] Preferably, the calculation process for the initial slope limit rate includes:
[0021] S21. Sort the initial slopes of the first n data points of monitoring point p. After sorting, find the initial slope limit rate. In the sorted initial slope sequence, find the maximum slope within the range of the initial slope limit rate, and record it as the initial slope limit value corresponding to the initial slope limit rate.
[0022] Specifically, the slope of the first n data points at monitoring point p is r1 = (v2 - v1) / (t2 - t1), ... r n-1 =(v n -v n-1 ) / (t n -t n-1 Sort the data, and then find the initial slope limit rate α. p In the sorted slope sequence, find the value at α. p The maximum slope within the range is denoted as α. p The corresponding slope limit value R max .
[0023] S22. The initial slope of the first n data points of monitoring point q is calculated in the same way as above to obtain the initial slope limit rate and the corresponding slope limit value.
[0024] Preferably, the slope limit rate is defined as the percentage of data that exceeds the mean slope.
[0025] Specifically, if k out of n-1 slopes exceed the mean slope R... p , then α p = k / n-1.
[0026] Preferably, the process of adjusting the initial slope limit rate includes:
[0027] S31. Adjust the slope limit rates for the two monitoring points. The adjustment strategy is to increase or decrease the same coefficient σ based on the initial slope limit rate. The slope limit rate for monitoring point p is adjusted to α. p α p +σ、α p In the three cases of -σ, the slope limit rate of monitoring point q is adjusted to α. q α q +σ、α q -σ three cases, α p Let α be the initial slope limit rate for monitoring point p. q Let q be the initial slope limit rate for monitoring point q.
[0028] S32. Based on the six slope limit rates of the two monitoring points, find the maximum slope within the range of each slope limit rate in the sorted slope sequence, and record it as the slope limit value corresponding to each slope limit rate;
[0029] S33. When the slope limit rate of monitoring point p is α p At that time, the slope limit rate of monitoring point q is adjusted to α. q α q +σ、α q-σ, based on this strategy, will eventually generate 9 calculation modes in the adjustment strategy table. According to the adjustment strategy, under different calculation modes, monitoring point p and monitoring point q correspond to different slope limit rates and slope limits.
[0030] Preferably, the process of comparing and determining whether to store the data includes:
[0031] S41. Monitoring point p reads in new data p n+1 Calculate p n and p n+1 The mean slope between the two values is calculated. Under each calculation mode, the mean slope calculated from the new data at monitoring point p is compared with the slope limit value corresponding to that calculation mode. If the mean slope is less than the slope limit value, the new data is saved. n+1 As the "last data read in".
[0032] Specifically, monitoring point p reads in new data p n+1 (t n+1 ,v n+1 ), calculate p n and p n+1 The slope r between n =(v n+1 -v n ) / (t n+1 -t n In each calculation mode, the new data of monitoring point p are respectively compared with the slope limit value R corresponding to that calculation mode. max Compare them, if r n <R max If so, then save the new data, p n+1 (t n+1 ,v n+1 The last data read in is recorded as p. r (t r ,v r ).
[0033] S42. New data is read into monitoring point q, and the comparison process is the same as that for monitoring point p.
[0034] Preferably, if the average slope is not less than the slope limit, the calculation mode is changed; if none of the nine calculation modes can satisfy the condition that the average slope is less than the slope limit, the new data is not saved.
[0035] Specifically, if r n >R max If the calculation mode is not met, the calculation mode will be changed, and then it will be determined whether to save the data. If none of the nine calculation modes are met, the data will not be saved.
[0036] Preferably, when n new data are read in, it is determined whether to save the data according to different calculation modes, and all data compression is completed.
[0037] Specifically, when new data is read into p 2n (t 2n ,v 2n When this happens, the system determines whether to save the data based on the different calculation modes.
[0038] Specifically, within a set period, the two monitoring points update their calculation modes and record all calculation modes and data. In the next period, new model coefficients are calculated, and the working mode is optimized based on the data from the previous period. The model coefficient σ value in the adjustment strategy is then periodically tuned in reverse. The process of tuning the model coefficients needs to be tailored to the specific scenario. For example, in a certain scenario, a threshold is set based on the performance of the existing compression algorithm. If the coefficient exceeds this threshold, it is updated; otherwise, it is not updated.
[0039] A lossy concurrent compression device for real-time databases in the Industrial Internet of Things (IIoT) includes the following modules:
[0040] The data acquisition module is used to collect data from monitoring points p and q based on a preset time period, and to preprocess the two sets of data collected.
[0041] The data initialization module is used to write the first collected data into the database and save it as the "last written data", and to calculate the average slope of the first n data points of monitoring points p and q.
[0042] The data calculation module is used to sort the initial slopes of the first n data for monitoring points p and q respectively, and then find the initial slope limit rate and the corresponding initial slope limit value after sorting.
[0043] The data adjustment module is used to adjust the initial slope limit rate of two monitoring points. According to the adjustment strategy, monitoring points p and q correspond to different slope limit rates and slope limit values under different calculation modes.
[0044] The data comparison and storage module reads in new data, calculates the mean slope of the new data, and compares it with the slope limit value obtained according to the adjustment strategy. If the mean slope value is less than the slope limit value, the data is stored.
[0045] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0046] (1) The present invention first collects data a predetermined number of times within a preset time period and calculates the average slope; then sorts the slopes and finds the slope limit rate and its corresponding slope limit value; secondly, an adjustment strategy is defined for the slope limit rate to form multiple calculation modes; then new data is collected and it is determined whether to store new data according to the adjustment strategy, which can perform fast and efficient lossy compression on real-time data, greatly improving the compression ratio and restoration accuracy;
[0047] (2) After a new number of data collections, the present invention calculates new model coefficients in the next cycle, optimizes the working mode based on the data of the previous cycle, and performs reverse periodic optimization of the model coefficient values in the adjustment strategy. The optimal mode is selected using actual field data. By continuously correcting the model coefficients, the compression accuracy requirements of real-time data in the industrial Internet of Things are achieved. Attached Figure Description
[0048] Figure 1 This is a conceptual definition diagram of the slope limit rate according to an embodiment of the present invention;
[0049] Figure 2 This is a flowchart of the lossy compression method in a real-time database according to an embodiment of the present invention.
[0050] Figure 3 Flowchart of a method for periodically diagnosing and updating the working status of monitoring points according to an embodiment of the present invention;
[0051] Figure 4 This is a system framework diagram according to an embodiment of the present invention. Detailed Implementation
[0052] The technical solutions of various embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0053] This invention discloses a lossy concurrent compression method and apparatus for real-time databases in the Industrial Internet of Things (IIoT). It involves continuously collecting real-time data a predetermined number of times and calculating the average slope. By sorting the slopes, a slope limit rate and its corresponding limit value are found. An adjustment strategy is defined for the slope limit rate, forming multiple calculation modes. New data is collected, and the decision to store the new data is based on the proposed adjustment strategy. After a predetermined number of new data collections, the optimal mode is selected using actual field data. With the increasing level of industrial automation, numerous industrial devices in industrial settings require the collection of data on various indicators. The transmission and storage of real-time and heterogeneous data presents new challenges to optimizing industrial monitoring systems, thus necessitating efficient compression algorithms for real-time monitoring data. The lossy compression algorithm proposed in this invention can be effectively used for processing real-time field data and can meet the requirements for restoration accuracy.
[0054] Example
[0055] This embodiment provides a lossy concurrent compression method for real-time databases in the Industrial Internet of Things (IIoT), which can perform fast and efficient lossy compression of real-time data, significantly improving the compression ratio and restoration accuracy.
[0056] like Figure 1 As shown, α p and α q These represent the ratios of the slope limits for monitoring points P and Q, respectively; furthermore, after a period of compression, α can be adjusted in the next stage. p and α q The size is adjusted to control the compression ratio.
[0057] When two monitoring points in an Internet of Things (IoT) are continuously collecting data, such as Figure 2 As shown, the compression algorithm proposed in this invention includes the following steps:
[0058] Step 1: System initialization. Monitoring point p reads n real-time data points, monitoring point q reads n real-time data points, writes the data collected in the first time into the database and saves it as "last written data", and calculates the average slope of the first n data points based on the first n data points and the allowable error range.
[0059] The initialization process described in step 1 includes:
[0060] S11. Record n data points p1(t1,v1), p2(t2,v2), ..., p at detection point p. n (t n ,v n ), calculate the initial slope between each pair of points r1 = (v2 - v1) / (t2 - t1), ... r n-1 =(v n -v n-1 ) / (tn -t n-1 ), calculate the mean slope R p = (r1+r2+...r) n-1 ) / (n-1), record p1 as the "last written data" as p l (t l ,v l ), p n Recorded as "last read data" as p r (t r ,v r ).
[0061] S12. Record n data points q1(t1,v1), q2(t2,v2), ...,q n (t n ,v n ), calculate the mean slope R of monitoring point q according to the above steps. q = (r1+r2+...r) n-1 ) / (n-1), record q1 as the "last written data" as q l (t l ,v l ), q n Recorded as "last read data" as q r (t r ,v r ).
[0062] Step 2: Sort the slopes of the first n data points for monitoring points p and q, and then find the initial slope limit rate α. p α q And the corresponding slope limit value. The slope limit rate is defined as the percentage of data exceeding the slope mean. The slope limit value is defined as the maximum slope within the slope limit rate range. For example, if the slopes calculated from n data points are sorted by size, and the data with a slope exceeding 20 accounts for 80%, then 80% is defined as the slope limit rate α. p In the sorted slope sequence, find the value at α. p The maximum slope within the range is defined as α. p The corresponding slope limit value.
[0063] The process of calculating the slope limit rate in step 2 includes:
[0064] S21. The slope of the first n data points from monitoring point p is r1 = (v2 - v1) / (t2 - t1),...r n-1 =(v n -v n-1 ) / (t n -t n-1Sort the data, and then find the initial slope limit rate α. p If k out of n-1 slopes exceed the mean slope R... p , then α p =k / n-1, find the slope in the sorted sequence at α p The maximum slope within the range is denoted as α. p The corresponding slope limit value R max .
[0065] S22. The slope of the first n data points at monitoring point q is calculated in the same way as above to obtain the initial slope limit rate α. q and α q The corresponding slope limit value R max .
[0066] Step 3: Adjust the slope limit rates for the two monitoring points. The adjustment strategy is to add or subtract the same coefficient σ (initial value set at 0.05) from the initial slope limit rates. The adjustment coefficient for monitoring point p is σ. p The adjustment coefficient for monitoring point q is σ. q The adjustment strategy is shown in Table 1. The slope limit rate of monitoring point p can be adjusted to α. p α p +σ、α p -σ are three cases, when the slope limit rate of monitoring point p is α. p At that time, the slope limit rate of monitoring point q can be adjusted to α. q α q +σ、α q -σ represents three cases, and adjustments based on this strategy will ultimately generate nine calculation modes. Depending on the adjustment strategy, monitoring points p and q correspond to different slope limit rates and slope limits under different calculation modes.
[0067] The adjustment process described in step 3 is as follows:
[0068] S31. Adjust the slope limit rates for the two monitoring points. The adjustment strategy is to add or subtract the same coefficient σ based on the initial slope limit rate. The slope limit rate for monitoring point p can be adjusted to α. p α p +σ、α p In the three cases of -σ, the slope limit rate of monitoring point q can be adjusted to α. q α q +σ、α q -σ are three cases.
[0069] S32. As described in step 2, based on the six slope limit rates for the two monitoring points, find the maximum slope within the range of each slope limit rate in the sorted slope sequence, and record it as the slope limit value R corresponding to each slope limit rate. max .
[0070] S33. When the slope limit rate of monitoring point p is α p At that time, the slope limit rate of monitoring point q can be adjusted to α. q α q +σ、α q -σ, based on this strategy, will ultimately generate 9 calculation modes in the adjustment strategy table. According to the adjustment strategy, under different calculation modes, monitoring points p and q correspond to different slope limit rates and slope limits.
[0071] Meanwhile, in order to deploy a regular diagnostic and update scheme for the data acquisition status of each monitoring point in the industrial IoT field, based on the initially determined calculation model, the σ of the acquisition system at the monitoring points will be adjusted periodically. p and σ q The magnitude of σ is determined based on industry-standard techniques. For more monitoring points, the method for determining the magnitude of σ is similar. When adjusting the magnitude of σ at each monitoring point, the corresponding slope limit value and interval are calculated and updated. For example, monitoring point p uses actual data collection to verify the validity of the new slope limit value and interval. When the calculated new slope best matches the calculation mode 1 of the corresponding monitoring point, the adjustment of σ is determined. p Value, otherwise σ p The value remains the same as the last setting. This process continues until each monitoring point has completed its operational status diagnosis and update. This invention, by periodically updating and confirming the σ value, slope limit value, and interval, ensures that different monitoring points can operate reliably and efficiently for extended periods.
[0072] Table 1 Adjustment Strategy
[0073]
[0074]
[0075] Step 4: Read in the new data and, based on the adjustment strategy and the slope limit rate, determine whether to store the data.
[0076] The comparison process described in step 4 is as follows:
[0077] S41. Monitoring point p reads in new data p n+1 (t n+1 ,v n+1 ), calculate p n and p n+1 The slope r betweenn =(v n+1 -v n ) / (t n+1 -t n In each calculation mode, the new data of monitoring point p are respectively compared with the slope limit value R corresponding to that calculation mode. max Compare them, if r n <R max If so, then save the new data, p n+1 (t n+1 ,v n+1 The last data read in is recorded as p. r (t r ,v r If r n >R max If the calculation mode is changed according to the order in the adjustment strategy table, then it is determined whether to save the data. If none of the nine calculation modes are suitable, the data is not saved.
[0078] S42. New data q is read in at monitoring point q. n+1 (t n+1 ,v n+1 Using the same comparison process as monitoring point p, determine whether to store the newly read data.
[0079] Step 5: After reading in n new data, use the data from the actual situation to calculate the optimal pattern.
[0080] The content described in step 5 includes:
[0081] S51. When new data is read into p 2n (t 2n ,v 2n When this happens, the system determines whether to save the data based on the different calculation modes.
[0082] Finally, real-world data is used to determine which computational mode is optimal, thus finding the optimal coefficients for lossy compression. Within a set period, two monitoring points update the computational mode, recording all computational modes and data. In the next period, new model coefficients are calculated, and the working mode is optimized based on the data from the previous period. The model coefficient σ value in the adjustment strategy is then periodically tuned in reverse. The process of tuning the model coefficients needs to be tailored to the specific scenario. For example, in a certain scenario, a threshold is set based on the performance of existing compression algorithms. If the coefficients exceed this threshold, they are updated; otherwise, they are not.
[0083] Example 2
[0084] A lossy concurrent compression device for real-time databases in the Industrial Internet of Things (IIoT) includes the following modules:
[0085] The data acquisition module is used to collect data from monitoring points p and q based on a preset time period, and to preprocess the two sets of data collected.
[0086] The data initialization module is used to write the first collected data into the database and save it as the "last written data", and to calculate the average slope of the first n data points of monitoring points p and q.
[0087] The data calculation module is used to sort the initial slopes of the first n data for monitoring points p and q respectively, and then find the initial slope limit rate and the corresponding initial slope limit value after sorting.
[0088] The data adjustment module is used to adjust the initial slope limit rate of two monitoring points. According to the adjustment strategy, monitoring points p and q correspond to different slope limit rates and slope limit values under different calculation modes.
[0089] The data comparison and storage module reads in new data, calculates the mean slope of the new data, and compares it with the slope limit value obtained according to the adjustment strategy. If the mean slope value is less than the slope limit value, the data is stored.
[0090] This system consists of a terminal layer, an edge layer, and a platform layer. Data acquisition and compression processing are deployed at the edge layer, while model calculation and updating are handled closer to the terminals. This reduces latency in remote data transmission and improves system performance. During monitoring, IntAgent employs a periodic model update method; once the set update cycle is reached, the model update calculation is automatically executed. The cycle time can be configured by the platform layer's service platform, and the cycle interval can be adjusted. Each terminal is embedded with intelligent agent (IntAgent) software. IntAgent receives data compression strategies (such as IntAgent's model parameters and update cycle) from the platform layer and performs model updates and calculations based on these strategies.
[0091] Each edge node in the edge layer performs data acquisition, model calculation, and updates, and performs compression operations based on the updated model. Edge nodes are deployed in a regionalized manner (different areas within the factory or multiple factory areas), enabling distributed processing of edge data acquisition and compression. Platform layer: This includes acquisition scheme definition, compression parameter settings, and diagnostic prediction models. The acquisition scheme definition refers to the relationship between acquisition points and edge nodes (EN). Compression parameter settings are used to set the acquisition cycle, σ parameter, etc. The diagnostic prediction model identifies and analyzes abnormal data acquired on-site, and performs predictions through continuous data sampling.
[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the technical solutions of the embodiments of the present invention.
Claims
1. A lossy concurrent compression method for real-time databases in the Industrial Internet of Things (IIoT), characterized in that, include, Monitoring points are set based on a preset time period. and monitoring points Data collection, and data preprocessing of the two sets of collected data respectively; The data collected the first time was written into the database and saved as the "last written data". The monitoring points were then calculated. and monitoring points The former The mean slope of each data point; monitoring points respectively and monitoring points The former The initial slopes of the data are sorted, and then the initial slope limit rate and the corresponding initial slope limit value are found. The slope limit rate is the percentage of data exceeding the slope mean. The rate limit value is the maximum slope within the rate limit range; The initial slope limit rate for the two monitoring points is adjusted, and the monitoring points are adjusted according to the adjustment strategy under different calculation modes. and monitoring points Corresponding to different slope limit rates and slope limit values; Read in new data, calculate the mean slope of the new data, and compare it with the slope limit value obtained according to the adjustment strategy. If the mean slope value is less than the slope limit value, then it is determined to store the data. Read in new data again, repeat the calculation and judgment steps, until new data is read in. After the latest data is released, all data compression is completed.
2. The lossy concurrent compression method for real-time databases in the Industrial Internet of Things according to claim 1, characterized in that, in, The calculation process for the mean slope includes: S11. Record detection points of Given a set of data points, calculate the initial slope between each pair of points, and then calculate the mean slope of the slopes. As "last written data" As the "last data read in"; S12. Record monitoring points of Based on the data, calculate the monitoring points according to the above steps. The mean slope, As "last written data" As "last data read in".
3. The lossy concurrent compression method for real-time databases in the Industrial Internet of Things according to claim 1, characterized in that, in, The calculation process for the initial slope limit rate includes: S21. Monitoring points forward Sort the initial slopes of the data, find the initial slope limit rate after sorting, and find the maximum slope within the range of the initial slope limit rate in the sorted initial slope sequence. Record it as the initial slope limit value corresponding to the initial slope limit rate. S22. Monitoring points The former The initial slope of the next data point is calculated in the same way to obtain the initial slope limit rate and the corresponding slope limit value.
4. The lossy concurrent compression method for real-time databases in the Industrial Internet of Things according to claim 1, characterized in that, The slope limit rate is defined as the percentage of data that exceeds the mean slope.
5. The lossy concurrent compression method for real-time databases in the Industrial Internet of Things according to claim 1, characterized in that, in, The process of adjusting the initial slope limit rate includes: S31. Adjust the slope limit rates for the two monitoring points. The adjustment strategy is to increase or decrease the same coefficient based on the initial slope limit rates. Monitoring points The slope limit rate is adjusted to , , Three scenarios, monitoring points The slope limit rate is adjusted to , , Three scenarios, For monitoring points The initial slope limit rate, For monitoring points The initial slope limit rate; S32. Based on the six slope limit rates of the two monitoring points, find the maximum slope within the range of each slope limit rate in the sorted slope sequence, and record it as the slope limit value corresponding to each slope limit rate; S33. When monitoring points The slope limit rate is At that time, monitoring point The slope limit rate is adjusted to , , Based on this strategy, adjustments will ultimately generate nine calculation modes as shown in the adjustment strategy table. Depending on the adjustment strategy, monitoring points will be used under different calculation modes. and monitoring points Corresponding to different slope limit rates and slope limits.
6. The lossy concurrent compression method for real-time databases in the Industrial Internet of Things according to claim 1, characterized in that, in, The process of comparing and determining whether to store the data includes: S41. Monitoring Point Read in new data ,calculate and The average slope between the monitoring points in each calculation mode. The mean slope calculated from the new data is compared with the slope limit value corresponding to this calculation mode. If the mean slope value is less than the slope limit value, the new data is saved. As the "last data read in"; S42. Monitoring Point Read in new data and compare the results with those from the monitoring points. .
7. A lossy concurrent compression method for real-time databases in the Industrial Internet of Things according to claim 6, characterized in that, If the mean slope is not less than the slope limit, the calculation mode is changed. If none of the nine calculation modes can satisfy the condition that the mean slope is less than the slope limit, the new data is not saved.
8. A lossy concurrent compression method for real-time databases in the Industrial Internet of Things according to claim 1, characterized in that, When reading When new data is encountered, the system determines whether to save the data based on different calculation modes, and then completes the compression of all data.
9. A lossy concurrent compression device for real-time databases in the Industrial Internet of Things (IIoT), used to implement the method described in any one of claims 1-8, characterized in that, Includes the following modules: The data acquisition module is used to monitor points based on a preset time period. and monitoring points Data collection, and data preprocessing of the two sets of collected data respectively; The data initialization module is used to write the data collected the first time into the database and save it as the "last written data", and to calculate the monitoring points. and monitoring points The former The mean slope of each data point; The data calculation module is used to process the data at the monitoring points. and monitoring points The former The initial slopes of the data are sorted, and then the initial slope limit rate and the corresponding initial slope limit value are found. The slope limit rate is the proportion of data exceeding the average slope. The slope limit value is the maximum slope within the range of the slope limit rate. The data adjustment module is used to adjust the initial slope limit rate of two monitoring points. Based on the adjustment strategy, the monitoring points are adjusted under different calculation modes. and monitoring points Corresponding to different slope limit rates and slope limit values; The data comparison and storage module reads in new data, calculates the mean slope of the new data, and compares it with the slope limit value obtained according to the adjustment strategy. If the mean slope value is less than the slope limit value, the data is stored.
Citation Information
Patent Citations
Dynamic control method for loss compression ratio of process data
CN102393855B
Method for efficiently and linearly compressing and decompressing time-series data in real time
CN102098058A