Curve data compression method and device based on envelope line
Through the envelope-based curve data compression method, local maximum points, difference thresholds, difference algorithms and regional maximum methods are used to automatically extract and connect feature points, solving the problem of complicated and low-efficiency data compression in the existing technology. Achieve simple and efficient data compression effect.
Patent Information
- Application Number
- CN202410665657.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-08-30
AI Technical Summary
Existing data compression methods such as the Douglas-Peucker algorithm require manual adjustment of the threshold during the compression process, resulting in complexity and low efficiency, making it impossible to achieve simple and efficient data compression.
Adopt a curve data compression method based on envelope lines, perform spline interpolation by obtaining local maximum points, identify curve feature points and non-curve feature points, and use the difference algorithm and regional maximum method to extract feature segments and optimal feature points, automatically Join the dots for data compression.
It realizes an automated data compression process without human participation, improves data transmission and storage efficiency, and reduces hardware and processing costs.
Smart Images

Figure CN118573203A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data compression, and in particular to a curve data compression method and device based on an envelope. Background Art
[0002] In the field of wireless real-time monitoring, high-frequency sampling data will lead to increased data redundancy, increased data storage space, and increased data processing and analysis costs. Therefore, under the premise of meeting application requirements and ensuring that the basic trend of the data remains unchanged, compressing the data can effectively increase the data transmission cost, while also reducing the cost of the data display hardware system and improving the effect and efficiency of data display.
[0003] The commonly used data compression method is the Douglas-Peucker compression algorithm. The DP algorithm requires manual selection of a threshold when performing simplification, and the setting of the threshold is directly related to the data compression result. Therefore, when using the DP algorithm, it is usually necessary to manually adjust the threshold continuously, which makes the data compression process complicated and inefficient. Summary of the invention
[0004] The present invention provides a curve data compression method and device based on an envelope, which are used to solve the defects of complicated data compression process and low efficiency in the prior art and realize simple and efficient data compression.
[0005] The present invention provides a curve data compression method based on an envelope, comprising: Obtaining the local maximum point in the curve data to be compressed; Performing spline interpolation based on the local maximum point to obtain an upper peak envelope and a lower peak envelope; Based on a preset difference threshold, respectively identifying curve feature points and non-curve feature points in the upper peak envelope and the lower peak envelope to obtain an upper envelope feature curve and a lower envelope feature curve; Based on the difference algorithm, the characteristic segment of the upper envelope characteristic curve and the characteristic segment of the lower envelope characteristic curve are obtained respectively; the characteristic segment is composed of continuous characteristic points of the curve; Based on the regional extremum method, optimal feature points are extracted from data points of the curve data to be compressed corresponding to the feature segment of the upper envelope feature curve and data points of the curve data to be compressed corresponding to the feature segment of the lower envelope feature curve; the optimal feature points and the first and last endpoints of the curve data to be compressed are connected in position order to obtain compressed data corresponding to the curve data to be compressed.
[0006] In some embodiments, obtaining the local maximum point in the curve data to be compressed includes: For each data point in the curve data to be compressed, the following steps are performed: The current data point is taken as the center point of the current window, and the size of the current window is 2k+1, where k is the number of preset data points; The maximum value point in the current window is taken as the current local maximum value point.
[0007] In some embodiments, based on a preset difference threshold, respectively identifying curve feature points and non-curve feature points in the upper peak envelope and the lower peak envelope to obtain an upper envelope feature curve and a lower envelope feature curve, comprises: respectively determining the difference corresponding to each data point in the upper peak envelope and the lower peak envelope; the difference is the difference between each data point and the corresponding data point in the curve data to be compressed; The difference corresponding to each data point in the upper peak envelope and the lower peak envelope is compared with the preset difference threshold to obtain the curve feature point and the non-curve feature point; the curve feature point is a data point whose corresponding difference is less than the preset difference threshold, and the non-curve feature point is a data point whose corresponding difference is greater than or equal to the preset difference threshold; the curve feature points in the upper peak envelope and the lower peak envelope are set to 1 and the non-curve feature points are set to 0 respectively to obtain the upper envelope feature curve and the lower envelope feature curve.
[0008] In some embodiments, the obtaining of the characteristic segments of the upper envelope characteristic curve and the characteristic segments of the lower envelope characteristic curve based on a differential algorithm respectively includes: Based on the differential algorithm, respectively calculating the difference between a later data point and a previous data point in the upper envelope characteristic curve and the lower envelope characteristic curve; When the difference value is 1, the next data point is used as the starting point of the feature segment; When the difference value is -1, the previous data point is used as the end point of the feature segment; The characteristic segment of the upper envelope characteristic curve and the characteristic segment of the lower envelope characteristic curve are obtained according to the end point of the characteristic segment and the starting point of the characteristic segment in the upper envelope characteristic curve and the lower envelope characteristic curve respectively.
[0009] In some embodiments, the method of extracting the optimal feature points from the data points of the curve data to be compressed corresponding to the feature segment of the upper envelope feature curve and the data points of the curve data to be compressed corresponding to the feature segment of the lower envelope feature curve based on the regional maximum value method includes: Based on the regional maximum value method, determine the maximum value data point among the data points of the curve data to be compressed corresponding to the characteristic segment of the upper envelope characteristic curve, and the minimum value data point among the data points of the curve data to be compressed corresponding to the characteristic segment of the lower envelope characteristic curve; The maximum value data point and the minimum value data point are extracted as optimal feature points.
[0010] In some embodiments, the preset difference threshold is 10 -5 .
[0011] The present invention also provides a curve data compression device based on an envelope, comprising: An acquisition module, used for acquiring a local maximum point in the curve data to be compressed; An interpolation module, used for performing spline interpolation based on the local maximum point to obtain an upper peak envelope and a lower peak envelope; an identification module, used for identifying curve feature points and non-curve feature points in the upper peak envelope and the lower peak envelope respectively based on a preset difference threshold, to obtain an upper envelope feature curve and a lower envelope feature curve; An obtaining module, used for obtaining the characteristic segment of the upper envelope characteristic curve and the characteristic segment of the lower envelope characteristic curve respectively based on a differential algorithm; the characteristic segment is composed of continuous characteristic points of the curve; An extraction module, used for extracting optimal feature points from data points of the curve data to be compressed corresponding to the feature segment of the upper envelope feature curve and data points of the curve data to be compressed corresponding to the feature segment of the lower envelope feature curve respectively based on a regional maximum value method; The connection module is used to connect the optimal feature point and the first and last endpoints of the curve data to be compressed in order of position to obtain compressed data corresponding to the curve data to be compressed.
[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the envelope-based curve data compression method described above is implemented.
[0013] 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, the envelope-based curve data compression method described above is implemented.
[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the envelope-based curve data compression methods described above.
[0015] The curve data compression method and device based on envelope provided by the present invention firstly obtains the upper peak envelope and the lower peak envelope by performing spline interpolation on the local maximum point in the curve data to be compressed; secondly, based on the preset difference threshold, the curve feature points and non-curve feature points in the upper and lower peak envelopes are respectively identified to obtain the upper envelope feature curve and the lower envelope feature curve; then, based on the difference algorithm, the feature segments of the upper envelope feature curve and the feature segments of the lower envelope feature curve are respectively obtained; then, based on the regional maximum method, the optimal feature points are respectively extracted from the data points of the curve data to be compressed corresponding to the feature segments of the upper and lower envelope feature curves; finally, the optimal feature points and the first and last endpoints of the curve data to be compressed are connected to obtain the compressed data corresponding to the curve data to be compressed. The curve data compression method based on envelope provided by the present invention does not require human participation or multiple debugging, and the whole process is automatically completed at one time, thereby realizing simple and efficient data compression. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 It is a schematic flow chart of the curve data compression method based on the envelope provided by the present invention; Figure 2 This is one of the effect display diagrams of the curve data compression method based on the envelope provided by the present invention; Figure 3 This is the second effect display diagram of the curve data compression method based on the envelope provided by the present invention; Figure 4 It is a structural schematic diagram of a curve data compression device based on an envelope provided by the present invention; Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other in the absence of conflict. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0019] Curve data compression, also known as curve feature point extraction or curve thinning, is to extract a subset a from the data set A that makes up the curve, and use this subset a as a new information source. Under the condition of satisfied accuracy, the subset a can ensure that the shape of the original curve remains unchanged as much as possible, and reflect the original set A as closely as possible in terms of content, while compressing the data volume as much as possible.
[0020] Figure 1 FIG. 1 is a flow chart of the curve data compression method based on the envelope provided by the present invention, such as Figure 1 As shown, the present invention provides a curve data compression method based on an envelope, comprising the following steps: Step 110: Obtain the local maximum point in the curve data to be compressed.
[0021] Specifically, the local maximum point is extracted from the curve data to be compressed. For example, the curve data to be compressed is split into several parts (the splitting method can be equal splitting and / or unequal splitting), and the maximum point in each part of the curve data is used as the local maximum point.
[0022] Step 120 , performing spline interpolation based on the local maximum point to obtain an upper peak envelope and a lower peak envelope.
[0023] Specifically, by performing spline interpolation based on the coordinates of the local maximum point, the upper peak envelope can be obtained. The expression of the upper peak envelope is as follows: Upper Envelope(x)=CubicSpline(x max ,y max )(x) Where, Upper Envelope(x) represents the upper peak envelope, CubicSpline() represents the cubic spline interpolation algorithm, and x max Represents the horizontal coordinate of the local maximum point, y max represents the ordinate of the local maximum point, and x represents the data point in the curve data to be compressed.
[0024] After performing spline interpolation based on the coordinates of the local maximum point, the interpolation result is subtracted from the smoothing function to obtain the lower peak envelope. The expression of the lower peak envelope is as follows: Lower Envelope(x)=CubicSpline(x max ,y max )(x)-ε(x) Where, Lower Envelope() represents the lower peak envelope, CubicSpline() represents the cubic spline interpolation algorithm, and x maxRepresents the horizontal coordinate of the local maximum point, y max represents the ordinate of the local maximum point, x represents the data point in the curve data to be compressed, and ε() represents a smooth function, such as linear interpolation or polynomial fitting.
[0025] Step 130 , based on a preset difference threshold, respectively identify curve feature points and non-curve feature points in the upper peak envelope and the lower peak envelope to obtain an upper envelope feature curve and a lower envelope feature curve.
[0026] Specifically, in order to ensure the shape of the compressed curve and reduce the amount of data calculation, a preset difference threshold is set between each data point in the upper and lower peak envelopes and the corresponding data point in the curve data to be compressed to eliminate a large number of invalid data points.
[0027] According to the relationship between the difference between each data point in the upper and lower peak envelopes and the corresponding data point in the curve data to be compressed and the preset difference threshold, the curve feature points and non-curve feature points are determined. According to the curve feature points and non-curve feature points, the upper envelope feature curve and the lower envelope feature curve are obtained.
[0028] Step 140, based on the difference algorithm, obtain the characteristic segment of the upper envelope characteristic curve and the characteristic segment of the lower envelope characteristic curve respectively; the characteristic segment is composed of continuous curve characteristic points.
[0029] Specifically, due to the existence of non-curve feature points, the curve feature points in the upper and lower envelope feature curves are discontinuous, and a section of continuous curve feature points is taken as a feature segment. The feature segments in the upper and lower envelope feature curves are extracted using a differential algorithm.
[0030] Step 150 , based on the regional maximum method, extract the optimal feature points from the data points of the curve data to be compressed corresponding to the feature segment of the upper envelope feature curve and the data points of the curve data to be compressed corresponding to the feature segment of the lower envelope feature curve.
[0031] Specifically, based on the regional extremum method, the extremum data points among the data points of the curve data to be compressed corresponding to the characteristic segments of the upper and lower envelope characteristic curves are respectively determined, and the extremum data points are extracted as the optimal characteristic points.
[0032] Step 160 , connecting the optimal feature point and the first and last endpoints of the curve data to be compressed in order of position to obtain compressed data corresponding to the curve data to be compressed.
[0033] Specifically, the optimal feature point and the first and last endpoints of the curve data to be compressed are connected in order of position, so as to obtain the compressed data corresponding to the compressed curve data.
[0034] The curve data compression method based on envelope provided by the present invention firstly performs spline interpolation through the local maximum point in the curve data to be compressed to obtain the upper peak envelope and the lower peak envelope; secondly, based on the preset difference threshold, the curve feature points and non-curve feature points in the upper and lower peak envelopes are respectively identified to obtain the upper envelope feature curve and the lower envelope feature curve; then, based on the difference algorithm, the feature segments of the upper envelope feature curve and the feature segments of the lower envelope feature curve are respectively obtained; then, based on the regional maximum method, the optimal feature points are respectively extracted from the data points of the curve data to be compressed corresponding to the feature segments of the upper and lower envelope feature curves; finally, the optimal feature points and the first and last endpoints of the curve data to be compressed are connected to obtain the compressed data corresponding to the curve data to be compressed. The curve data compression method based on envelope provided by the present invention does not require human participation or multiple debugging, and the whole process is automatically completed at one time, thereby realizing simple and efficient data compression.
[0035] In some embodiments, obtaining the local maximum point in the curve data to be compressed includes: For each data point in the curve data to be compressed, the following steps are performed: The current data point is taken as the center point of the current window, and the size of the current window is 2k+1, where k is the number of preset data points; The maximum point in the current window is taken as the current local maximum point.
[0036] Specifically, the preset number k of data points spaced apart is variable. For example, when the amount of data is small, k can be set to 2; when the amount of data is large, the value of k can be appropriately increased, for example, k can be set to 25.
[0037] Traverse each data point in the curve data to be compressed, and determine the maximum value in the window corresponding to each data point.
[0038] For example, the current data point is y i , data point y i is the center point of the current window, then the data points contained in the current window are (y i-k …, y i , …, y i+k ). The maximum point in the current window is taken as the current local maximum point, that is, y max =max(y i-k …, y i , …, y i+k ) In the formula, y max Indicates the maximum value in the current window, y i-k …, y i , …, y i+k are the data points contained in the current window.
[0039] The envelope-based curve data compression method provided by the present invention, for each data point in the curve data to be compressed, uses the current data point as the center point of the current window and the maximum value point in the current window as the current local maximum value point, thereby accurately obtaining the local maximum value in the curve data to be compressed.
[0040] In some embodiments, the preset difference threshold is 10 -5 .
[0041] Specifically, in theory, the smaller the preset difference threshold, the better. However, if the preset difference threshold is set too small, the data compression result will be less than ideal. After many experiments, the preset difference threshold is set to 10. -5 It is a better choice.
[0042] In some embodiments, based on a preset difference threshold, curve feature points and non-curve feature points in the upper peak envelope and the lower peak envelope are respectively identified to obtain an upper envelope feature curve and a lower envelope feature curve, including: Determine the difference corresponding to each data point in the upper peak envelope and the lower peak envelope respectively; the difference is the difference between each data point and the corresponding data point in the curve data to be compressed; Compare the difference corresponding to each data point in the upper peak envelope and the lower peak envelope with the preset difference threshold to obtain curve feature points and non-curve feature points; the curve feature points are data points whose corresponding difference is less than the preset difference threshold, and the non-curve feature points are data points whose corresponding difference is greater than or equal to the preset difference threshold; The curve feature points in the upper peak envelope and the lower peak envelope are set to 1 and the non-curve feature points are set to 0, respectively, to obtain the upper envelope feature curve and the lower envelope feature curve.
[0043] Specifically, the difference between each data point in the upper peak envelope and the lower peak envelope and the corresponding data point in the curve data to be compressed is calculated to obtain the difference corresponding to each data point in the upper peak envelope and the lower peak envelope.
[0044] The difference value corresponding to each data point in the upper peak envelope and the lower peak envelope is compared with the preset difference threshold. If the difference value corresponding to a data point is less than the preset difference threshold, the data point is a curve feature point; if the difference value corresponding to a data point is greater than or equal to the preset difference threshold, the data point is a non-curve feature point.
[0045] The curve feature points in the upper peak envelope are set to 1 and the non-curve feature points are set to 0 to obtain the upper envelope feature curve; the curve feature points in the lower peak envelope are set to 1 and the non-curve feature points are set to 0 to obtain the lower envelope feature curve.
[0046] The envelope-based curve data compression method provided by the present invention identifies curve feature points and non-curve feature points by presetting a difference threshold, and sets the curve feature points to 1 and the non-curve feature points to 0, which is useful for subsequent accurate extraction of feature segments.
[0047] In some embodiments, based on a differential algorithm, characteristic segments of an upper envelope characteristic curve and characteristic segments of a lower envelope characteristic curve are obtained respectively, including: Based on the difference algorithm, the difference value between the latter data point and the former data point in the upper envelope characteristic curve and the lower envelope characteristic curve is calculated respectively; When the difference value is 1, the next data point is used as the starting point of the feature segment; When the difference value is -1, the previous data point is taken as the end point of the feature segment; The characteristic segment of the upper envelope characteristic curve and the characteristic segment of the lower envelope characteristic curve are obtained according to the end point of the characteristic segment and the starting point of the characteristic segment in the upper envelope characteristic curve and the lower envelope characteristic curve respectively.
[0048] Specifically, based on the difference algorithm, the difference between the latter data point and the former data point in the upper envelope characteristic curve and the lower envelope characteristic curve is calculated respectively, and the expression is as follows: diff(Y″)=Y′ i+1 -Y′ i In the formula, diff(Y″) represents the difference value, Y′ i+1 represents the i+1th data point in the upper envelope characteristic curve or the lower envelope characteristic curve, Y′ i Represents the i-th data point in the upper envelope characteristic curve or the lower envelope characteristic curve.
[0049] When diff(Y″)=1, that is, the next data point is 1 and the previous data point is 0, the next data point is used as the starting point of the feature segment; when diff(Y″)=-1, that is, the next data point is 0 and the previous data point is 1, the previous data point is used as the ending point of the feature segment.
[0050] According to the end points of all feature segments in the upper envelope feature curve and the starting points of all feature segments, all feature segments of the upper envelope feature curve are obtained. According to the end points of all feature segments in the lower envelope feature curve and the starting points of all feature segments, all feature segments of the lower envelope feature curve are obtained.
[0051] The envelope-based curve data compression method provided by the present invention determines the end point and the starting point of the feature segment through the difference value between the latter data point and the previous data point in the upper envelope characteristic curve and the lower envelope characteristic curve, thereby accurately obtaining the feature segments in the upper envelope characteristic curve and the lower envelope characteristic curve.
[0052] In one embodiment, based on the regional maximum method, the optimal feature points are extracted from the data points of the curve data to be compressed corresponding to the feature segment of the upper envelope feature curve and the data points of the curve data to be compressed corresponding to the feature segment of the lower envelope feature curve, respectively, including: Based on the regional maximum value method, determine the maximum value data point among the data points of the curve data to be compressed corresponding to the characteristic segment of the upper envelope characteristic curve, and the minimum value data point among the data points of the curve data to be compressed corresponding to the characteristic segment of the lower envelope characteristic curve; The maximum value data point and the minimum value data point are extracted as the optimal feature points.
[0053] Specifically, based on the regional maximum value method, the maximum value data point is determined from the data points of the curve data to be compressed corresponding to the characteristic segment of the upper envelope characteristic curve, and the minimum value data point is determined from the data points of the curve data to be compressed corresponding to the characteristic segment of the lower envelope characteristic curve. The maximum value data point and the minimum value data point are extracted as the optimal feature points.
[0054] The envelope-based curve data compression method provided by the present invention uses the regional maximum value method to extract the maximum value data point among the data points of the curve data to be compressed corresponding to the characteristic segment of the upper envelope characteristic curve, and the minimum value data point among the data points of the curve data to be compressed corresponding to the characteristic segment of the lower envelope characteristic curve as the optimal feature points, which is conducive to achieving accurate data compression.
[0055] Figure 2 This is one of the effect display diagrams of the curve data compression method based on the envelope provided by the present invention. Figure 3 This is the second effect display diagram of the curve data compression method based on the envelope provided by the present invention. Figure 2 and Figure 3 As shown, the envelope-based curve data compression method provided by the present invention achieves good compression of curve data.
[0056] By adopting the curve data compression method based on envelope technology, effective compression of various types of high-frequency sampling data can be achieved, while ensuring the shape characteristics of the curve data. This method is a brand-new curve data compression method, which can achieve data compression without any prior knowledge, and is an effective supplement to the existing compression method. The method provided by the present invention has good adaptability, can adapt to various types of curve monitoring data, has a wide range of applicable environments, and has broad development space and application prospects.
[0057] The following is a description of the curve data compression device based on the envelope provided by the present invention. The curve data compression device based on the envelope described below and the curve data compression method based on the envelope described above can be referred to each other.
[0058] Figure 4 is a schematic diagram of the structure of the curve data compression device based on the envelope provided by the present invention, such as Figure 4 As shown, the present invention provides a curve data compression device based on an envelope, comprising: An acquisition module 410 is used to acquire a local maximum point in the curve data to be compressed; An interpolation module 420, configured to perform spline interpolation based on the local maximum point to obtain an upper peak envelope and a lower peak envelope; An identification module 430 is used to identify curve feature points and non-curve feature points in the upper peak envelope and the lower peak envelope respectively based on a preset difference threshold, so as to obtain an upper envelope feature curve and a lower envelope feature curve; An obtaining module 440 is used to obtain the characteristic segment of the upper envelope characteristic curve and the characteristic segment of the lower envelope characteristic curve based on a difference algorithm; the characteristic segment is composed of continuous characteristic points of the curve; An extraction module 450 is used to extract optimal feature points from data points of the curve data to be compressed corresponding to the feature segment of the upper envelope feature curve and data points of the curve data to be compressed corresponding to the feature segment of the lower envelope feature curve based on a regional maximum value method; The connection module 460 is used to connect the optimal feature point and the first and last endpoints of the curve data to be compressed in order of position to obtain compressed data corresponding to the curve data to be compressed.
[0059] In some embodiments, the acquisition module 410 is specifically used to: For each data point in the curve data to be compressed, the following steps are performed: The current data point is taken as the center point of the current window, and the size of the current window is 2k+1, where k is the number of preset data points; The maximum value point in the current window is taken as the current local maximum value point.
[0060] In some embodiments, the identification module 430 is specifically used to: Determine the difference corresponding to each data point in the upper peak envelope and the lower peak envelope respectively; the difference is the difference between each data point and the corresponding data point in the curve data to be compressed; The difference corresponding to each data point in the upper peak envelope and the lower peak envelope is compared with the preset difference threshold to obtain the curve feature point and the non-curve feature point; the curve feature point is a data point whose corresponding difference is less than the preset difference threshold, and the non-curve feature point is a data point whose corresponding difference is greater than or equal to the preset difference threshold; the curve feature points in the upper peak envelope and the lower peak envelope are set to 1 and the non-curve feature points are set to 0 respectively to obtain the upper envelope feature curve and the lower envelope feature curve.
[0061] In some embodiments, the obtaining module 440 is specifically used to: Based on the differential algorithm, respectively calculating the difference between a later data point and a previous data point in the upper envelope characteristic curve and the lower envelope characteristic curve; When the difference value is 1, the next data point is used as the starting point of the feature segment; When the difference value is -1, the previous data point is used as the end point of the feature segment; The characteristic segment of the upper envelope characteristic curve and the characteristic segment of the lower envelope characteristic curve are obtained according to the end point of the characteristic segment and the starting point of the characteristic segment in the upper envelope characteristic curve and the lower envelope characteristic curve respectively.
[0062] In some embodiments, the extraction module 450 is specifically used to: Based on the regional maximum value method, determine the maximum value data point among the data points of the curve data to be compressed corresponding to the characteristic segment of the upper envelope characteristic curve, and the minimum value data point among the data points of the curve data to be compressed corresponding to the characteristic segment of the lower envelope characteristic curve; The maximum value data point and the minimum value data point are extracted as optimal feature points.
[0063] In some embodiments, the preset difference threshold is 10 -5 .
[0064] It should be noted here that the above-mentioned envelope-based curve data compression device provided by the present invention can implement all the method steps implemented by the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be described in detail here.
[0065] Figure 5 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 5As shown, the electronic device may include: a processor (processor) 510, a communication interface (Communications Interface) 520, a memory (memory) 530 and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 can call the logic instructions in the memory 530 to execute the envelope-based curve data compression method, which includes: obtaining the local maximum point in the curve data to be compressed; performing spline interpolation based on the local maximum point to obtain the upper peak envelope and the lower peak envelope; based on a preset difference threshold, respectively identifying the curve feature points and non-curve feature points in the upper peak envelope and the lower peak envelope to obtain the upper envelope feature curve and the lower envelope feature curve; based on the difference algorithm, respectively obtaining the feature segment of the upper envelope feature curve and the feature segment of the lower envelope feature curve; the feature segment is composed of continuous curve feature points; based on the regional maximum method, respectively extracting the optimal feature point from the data points of the curve data to be compressed corresponding to the feature segment of the upper envelope feature curve and the data points of the curve data to be compressed corresponding to the feature segment of the lower envelope feature curve; connecting the optimal feature point and the first and last endpoints of the curve data to be compressed in position order to obtain the compressed data corresponding to the curve data to be compressed.
[0066] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0067] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program 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 envelope-based curve data compression method provided by the above methods, the method comprising: obtaining a local maximum point in the curve data to be compressed; performing spline interpolation based on the local maximum point to obtain an upper peak envelope and a lower peak envelope; based on a preset difference threshold, respectively identifying curve feature points and non-curve feature points in the upper peak envelope and the lower peak envelope points to obtain an upper envelope characteristic curve and a lower envelope characteristic curve; based on a differential algorithm, a characteristic segment of the upper envelope characteristic curve and a characteristic segment of the lower envelope characteristic curve are obtained respectively; the characteristic segment is composed of continuous characteristic points of the curve; based on a regional maximum method, optimal characteristic points are extracted from data points of the curve data to be compressed corresponding to the characteristic segment of the upper envelope characteristic curve and data points of the curve data to be compressed corresponding to the characteristic segment of the lower envelope characteristic curve; the optimal characteristic points and the first and last endpoints of the curve data to be compressed are connected in position order to obtain compressed data corresponding to the curve data to be compressed.
[0068] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the processor executes the envelope-based curve data compression method provided by the above methods, the method comprising: obtaining a local maximum point in the curve data to be compressed; performing spline interpolation based on the local maximum point to obtain an upper peak envelope and a lower peak envelope; based on a preset difference threshold, respectively identifying curve feature points and non-curve feature points in the upper peak envelope and the lower peak envelope to obtain an upper envelope feature curve and a lower envelope feature curve; based on a differential algorithm, respectively obtaining a feature segment of the upper envelope feature curve and a feature segment of the lower envelope feature curve; the feature segment is composed of continuous curve feature points; based on a regional maximum method, respectively extracting the optimal feature point from the data points of the curve data to be compressed corresponding to the feature segment of the upper envelope feature curve and the data points of the curve data to be compressed corresponding to the feature segment of the lower envelope feature curve; connecting the optimal feature point and the first and last endpoints of the curve data to be compressed in position order to obtain compressed data corresponding to the curve data to be compressed.
[0069] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0070] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method 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 this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for 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.
[0071] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0072] It should be further noted that, in this article, the terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0073] In the present invention, "at least one" means one or more, and "more than one" means two or more than two. The terms "first", "second", "third", "fourth", etc. (if any) in the present invention are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0074] In the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0075] 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 it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A curve data compression method based on envelope, characterized in that: include: Obtaining the local maximum point in the curve data to be compressed; Performing spline interpolation based on the local maximum point to obtain an upper peak envelope and a lower peak envelope; Based on a preset difference threshold, respectively identifying curve feature points and non-curve feature points in the upper peak envelope and the lower peak envelope to obtain an upper envelope feature curve and a lower envelope feature curve; Based on the difference algorithm, the characteristic segment of the upper envelope characteristic curve and the characteristic segment of the lower envelope characteristic curve are obtained respectively; the characteristic segment is composed of continuous characteristic points of the curve; Based on the regional extremum method, optimal feature points are extracted from data points of the curve data to be compressed corresponding to the feature segment of the upper envelope feature curve and data points of the curve data to be compressed corresponding to the feature segment of the lower envelope feature curve; the optimal feature points and the first and last endpoints of the curve data to be compressed are connected in position order to obtain compressed data corresponding to the curve data to be compressed.
2. The curve data compression method based on envelope according to claim 1, characterized in that: The step of obtaining the local maximum point in the curve data to be compressed includes: For each data point in the curve data to be compressed, the following steps are performed: The current data point is taken as the center point of the current window, and the size of the current window is 2k+1, where k is the number of preset data points; The maximum value point in the current window is taken as the current local maximum value point.
3. The curve data compression method based on envelope according to claim 1, characterized in that: The method of identifying curve feature points and non-curve feature points in the upper peak envelope and the lower peak envelope based on a preset difference threshold, and obtaining an upper envelope feature curve and a lower envelope feature curve, comprises: Determine the difference corresponding to each data point in the upper peak envelope and the lower peak envelope respectively; the difference is the difference between each data point and the corresponding data point in the curve data to be compressed; The difference corresponding to each data point in the upper peak envelope and the lower peak envelope is compared with the preset difference threshold to obtain the curve feature point and the non-curve feature point; the curve feature point is a data point whose corresponding difference is less than the preset difference threshold, and the non-curve feature point is a data point whose corresponding difference is greater than or equal to the preset difference threshold; the curve feature points in the upper peak envelope and the lower peak envelope are set to 1 and the non-curve feature points are set to 0 respectively to obtain the upper envelope feature curve and the lower envelope feature curve.
4. The curve data compression method based on envelope according to claim 3, characterized in that: The method of obtaining the characteristic segment of the upper envelope characteristic curve and the characteristic segment of the lower envelope characteristic curve based on the differential algorithm comprises: calculating the difference value between the latter data point and the former data point in the upper envelope characteristic curve and the lower envelope characteristic curve based on the differential algorithm; When the difference value is 1, the next data point is used as the starting point of the feature segment; When the difference value is -1, the previous data point is used as the end point of the feature segment; The characteristic segment of the upper envelope characteristic curve and the characteristic segment of the lower envelope characteristic curve are obtained according to the end point of the characteristic segment and the starting point of the characteristic segment in the upper envelope characteristic curve and the lower envelope characteristic curve respectively.
5. The curve data compression method based on envelope according to claim 1, characterized in that: The method based on the regional maximum value method, respectively extracting the optimal feature points from the data points of the curve data to be compressed corresponding to the feature segment of the upper envelope feature curve and the data points of the curve data to be compressed corresponding to the feature segment of the lower envelope feature curve, comprises: Based on the regional maximum value method, determine the maximum value data point among the data points of the curve data to be compressed corresponding to the characteristic segment of the upper envelope characteristic curve, and the minimum value data point among the data points of the curve data to be compressed corresponding to the characteristic segment of the lower envelope characteristic curve; The maximum value data point and the minimum value data point are extracted as optimal feature points.
6. The curve data compression method based on envelope according to claim 1, characterized in that: The preset difference threshold is 10 -5 .
7. A curve data compression device based on envelope, characterized in that: include: An acquisition module, used for acquiring a local maximum point in the curve data to be compressed; An interpolation module, used for performing spline interpolation based on the local maximum point to obtain an upper peak envelope and a lower peak envelope; an identification module, used for identifying curve feature points and non-curve feature points in the upper peak envelope and the lower peak envelope respectively based on a preset difference threshold, to obtain an upper envelope feature curve and a lower envelope feature curve; An obtaining module, used for obtaining the characteristic segment of the upper envelope characteristic curve and the characteristic segment of the lower envelope characteristic curve respectively based on a differential algorithm; the characteristic segment is composed of continuous characteristic points of the curve; An extraction module, used for extracting optimal feature points from data points of the curve data to be compressed corresponding to the feature segment of the upper envelope feature curve and data points of the curve data to be compressed corresponding to the feature segment of the lower envelope feature curve respectively based on a regional maximum value method; The connection module is used to connect the optimal feature point and the first and last endpoints of the curve data to be compressed in order of position to obtain compressed data corresponding to the curve data to be compressed.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the envelope-based curve data compression method according to any one of claims 1 to 6 is implemented.
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, the envelope-based curve data compression method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the envelope-based curve data compression method according to any one of claims 1 to 6 is implemented.
