Compression and decompression method suitable for mechanical energy storage monitoring data, storage medium and equipment
By adopting real-time data compression and decompression methods in mechanical energy storage systems, the problems of storage space occupation and processing efficiency caused by large data volume are solved, and efficient data storage and rapid query are realized, which is suitable for high-traffic environments.
Patent Information
- Application Number
- CN202410995598.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-11-15
AI Technical Summary
The amount of data generated in mechanical energy storage systems is huge, and the existing technology is difficult to achieve real-time data compression and decompression, resulting in large storage space and low data processing efficiency.
Using a compression and decompression method suitable for mechanical energy storage monitoring data, by storing data in memory and performing real-time compression algorithm calculations according to time sequence, we judge whether to compress and save compressed or uncompressed data in the database; During the decompression process, decompression is performed using the timestamp boundary and the straight slope.
It significantly reduces storage space requirements, improves data processing performance, ensures data stability and reliability, simplifies compression and decompression processes, and is suitable for high traffic and high concurrency environments.
Smart Images

Figure CN118964313A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a compression and decompression method, storage medium and device suitable for mechanical energy storage monitoring data. Background Art
[0002] As global carbon emissions continue to increase, environmental problems are becoming more and more prominent. Therefore, research and development of new energy and advanced methods to improve energy efficiency have become urgent issues of global concern. In this context, an emerging energy storage technology, mechanical energy storage, has gradually come into people's view. Mechanical energy storage is a new type of energy storage method. Its principle is to transport mass blocks up and down by elevators to convert gravitational potential energy into kinetic energy for power generation. At present, there are only a handful of mechanical energy storage projects in China. It is particularly important to fully collect and save the data generated during the operation of the mechanical energy storage system. Since there are data generated by the operation of various devices in the mechanical energy storage system, the data collected by the sensor has time series characteristics and is huge in quantity. One of the main problems faced by the mechanical energy storage system is to compress the collected data in real time and decompress the data in real time when there is a need.
[0003] During the operation of the mechanical energy storage data acquisition system, the various sensor data with time series characteristics are compressed and stored locally or in the cloud for subsequent data feature mining, anomaly detection and recording, data visualization reporting and other operations. The mechanical energy storage system has data generated by various devices, but the similarity of the sensor data collected for the same type of equipment is relatively high. Therefore, in the prior art, a revolving door algorithm is usually used to compress the collected sensor data, which has the characteristics of high efficiency, high compression ratio, adjustable error, etc. However, there is still a lack of methods for real-time compression of data generated during the operation of the mechanical energy storage system. Since the mechanical energy storage device generates tens of thousands of data per second, if all of these data are stored, a large amount of server space will be occupied. At this time, a reasonable data compression algorithm is needed to compress the data losslessly within the interval. Generally speaking, the compression algorithm only performs overall calculation compression on a continuous period of data, and cannot compress the new data for real-time processing. Therefore, how to perform real-time data compression on the data generated during the operation of the mechanical energy storage system and decompress the data in real time when there is a query demand has become an urgent problem to be solved.
[0004] On April 2, 2024, the State Intellectual Property Office published an invention patent with publication number CN117807546A, entitled "A data efficient storage method and system for photovoltaic protocol converters". The application obtains the DC current data sequence of any photovoltaic panel collected by the photovoltaic protocol converter in a preset time period; obtains the sequence difference sum of the DC current data sequence and the specificity of each DC current data; for any DC current data in the DC current data sequence, obtains the optimization parameters of the DC current data according to the sequence difference sum of the DC current data sequence and the specificity of the DC current data, and obtains the size of the adaptive revolving door of the DC current data according to the optimization parameters of the DC current data; according to the size of the adaptive revolving door corresponding to each DC current data in the DC current data sequence, the DC current data sequence is compressed and stored using the revolving door algorithm, thereby improving the storage accuracy of the fluctuating current data in the DC current data sequence. However, the application can only compress the data generated under the operation of the same type of equipment, and cannot achieve real-time data compression.
[0005] On April 4, 2023, the State Intellectual Property Office published an invention patent with publication number CN115912429A, entitled "A data compression method based on radar algorithm". This method effectively increases the depth of the dictionary and reduces the update frequency of the dictionary through data sample compressibility analysis and processing, compression implementation and result analysis and processing, implementation method analysis and processing, detailed design processing, effect evaluation processing, and technical difficulties and risk analysis and evaluation processing. It can greatly improve the compression speed. At the same time, the LZ series compression algorithm also has template matching and dictionary generation, which will increase resource utilization and reduce working time. However, this application also has shortcomings, including very tight clock constraint margins and very large resource overhead. At the same time, due to the different compression ratios after compression of multiple signals, there will be problems with multi-channel caching and then packaging and forwarding, which requires subsequent verification and optimization. At the same time, the huge amount of data in the mechanical energy storage system cannot be compressed in real time under limited resource conditions.
[0006] Therefore, real-time data compression in the field of mechanical energy storage and real-time data decompression when there is a query demand have become urgent problems to be solved. At the same time, real-time processing of data is the difficulty and key. It is urgent to find a feasible method for compression and decompression of mechanical energy storage monitoring data. Summary of the invention
[0007] In view of the problems existing in the prior art, the present invention provides a compression and decompression method, storage medium and device suitable for mechanical energy storage monitoring data, which compresses the mechanical energy storage monitoring data in real time, thereby improving the compression and storage efficiency and decompression and query efficiency of the mechanical energy storage monitoring data.
[0008] To achieve the above technical objectives, the present invention adopts the following technical solution: a compression method suitable for mechanical energy storage monitoring data, specifically comprising the following steps:
[0009] Step A1, storing the mechanical energy storage monitoring data in a memory in chronological order, and the memory records the node where the mechanical energy storage monitoring data is located and the node compression cache parameter;
[0010] Step A2: reading the mechanical energy storage monitoring data from the memory, performing real-time compression algorithm calculation, and determining whether to perform compression;
[0011] Step A3: If compression is required, the mechanical energy storage monitoring data is compressed and saved in the database; otherwise, the mechanical energy storage monitoring data is directly saved in the database.
[0012] Furthermore, the mechanical energy storage monitoring data in step A1 includes: monitoring data of the power shaft, elevator, pulley and trolley of the mechanical energy storage system.
[0013] Furthermore, the node compression cache parameters in step 1 include: compression times, recording date and backup data.
[0014] Furthermore, step A2 includes the following sub-steps:
[0015] Step A2.1: Determine whether it is a new day according to the recording time of the read mechanical energy storage monitoring data. If so, save the queue data in the cache to the database, clear the number of compressions in the cache, modify the recording date to the current day, clear the backup data, and clear the queue data; otherwise, execute step A2.2;
[0016] Step A2.2, determine whether the current queue data in the cache is equal to 0, if so, save the current data, otherwise, execute step A2.3;
[0017] Step A2.3, determine whether the current queue data in the cache is equal to 1, if so, read the mechanical energy storage monitoring data from the memory as backup data and write it into the current value, otherwise execute step A2.4;
[0018] Step A2.4, determine whether the current queue data in the cache is greater than or equal to 2. If not, do not perform any operation. Otherwise, take out the first data of the queue data, the backup data, and the current value and write them into the newly created queue. Perform revolving door compression calculation to obtain the compression value of the newly created queue. Determine whether to perform compression based on the compression value of the newly created queue.
[0019] Furthermore, step A3 includes the following sub-steps:
[0020] Step A3.1, determine whether the compression value of the newly created queue is less than 3, if so, determine whether the number of compressions is greater than or equal to 30, if so, save the queue data to the database, clear the queue data, clear the backup data, clear the number of compressions, and write the current mechanical energy storage monitoring data to the queue data; otherwise, compress the current mechanical energy storage monitoring data in the queue data, and increase the number of compressions by one;
[0021] Step A3.2: If the compression value of the newly created queue is greater than or equal to 3, the current mechanical energy storage monitoring data is directly saved to the database, and the compression times are cleared, the backup data is cleared, and the queue data is cleared.
[0022] Furthermore, the present invention also provides a decompression method applicable to mechanical energy storage monitoring data, which specifically comprises the following steps:
[0023] Step B1, based on the mechanical energy storage monitoring data compressed by the compression method applicable to the mechanical energy storage monitoring data, determining the start time node and the end time node of the compressed mechanical energy storage monitoring data for query;
[0024] Step B2, finding the timestamp boundary according to the first mechanical energy storage monitoring data on the left side of the query start time node and the first mechanical energy storage monitoring data on the right side of the query end time node in the database;
[0025] Step B3, querying the database using the timestamp boundary to obtain the corresponding compressed data segment, decompressing the compressed data segment using a decompression algorithm to obtain decompressed mechanical energy storage monitoring data;
[0026] Step B4: Determine the range of mechanical energy storage monitoring data that needs to be decompressed according to the start time node and the end time node of the query.
[0027] Furthermore, step B3 includes the following sub-steps:
[0028] Step B3.1, query the database using the timestamp boundary to obtain the corresponding compressed data segment, where there are several compressed nodes N in the compressed data segment, and create a compressed node index i and a list List;
[0029] Step B3.2: for the compressed data segments corresponding to two adjacent compressed nodes, obtain the timestamp difference T of the two adjacent compressed nodes, create a time variable t, and assign it to the timestamp of the first compressed node among the adjacent compressed nodes;
[0030] Step B3.3, calculating the slope of the straight line where the two adjacent compression nodes are located according to the data information of the two adjacent compression nodes;
[0031] Step 3.4, the time variable t is updated by adding a collection time interval of the mechanical energy storage monitoring data, the data information corresponding to the time variable t under the slope of the straight line is calculated, and written into the time list List;
[0032] Step 3.5: If the updated time variable t < T, repeat step B3.4; otherwise, execute step B3.6;
[0033] Step 3.6, assign the compression node index i to i+1, repeat steps B3.2-B3.5 until the compression node index i≥N-1, and complete the decompression of the compressed data segment corresponding to the timestamp boundary.
[0034] Furthermore, the present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the compression method applicable to mechanical energy storage monitoring data or the decompression method applicable to mechanical energy storage monitoring data.
[0035] Furthermore, 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 compression method applicable to mechanical energy storage monitoring data or the decompression method applicable to mechanical energy storage monitoring data is implemented.
[0036] Compared with the prior art, the present invention has the following beneficial effects: the amount of mechanical energy storage monitoring data is huge. By using the compression method of the present invention applicable to mechanical energy storage monitoring data to perform real-time compression processing of the mechanical energy storage monitoring data, the required storage space can be significantly reduced, so that more mechanical energy storage monitoring data can be stored on a storage device with the same capacity, and in a high-flow and high-concurrency environment, real-time compression can quickly reduce flow pressure and ensure the stability of mechanical energy storage monitoring data compression. At the same time, the real-time compression of mechanical energy storage monitoring data has a small amount of data, which can speed up the reading and writing speed of mechanical energy storage monitoring data and improve data processing performance. In addition, a decompression method applicable to the compressed data of the present invention is also provided. The mechanical energy storage monitoring data is decompressed by the slope of the straight line where two adjacent compression nodes are located. The mechanical energy storage monitoring data can be quickly located and restored during the decompression process, thereby improving the decompression speed. The logic is relatively simple, easy to implement and maintain, and has the characteristics of stability and reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a flow chart of the compression and decompression method applicable to mechanical energy storage monitoring data of the present invention;
[0038] Figure 2 It is a specific flow chart of the compression method applicable to mechanical energy storage monitoring data in the present invention;
[0039] Figure 3 It is a specific flow chart of the decompression method applicable to mechanical energy storage monitoring data in the present invention. DETAILED DESCRIPTION
[0040] The technical solution of the present invention is further explained below in conjunction with the accompanying drawings.
[0041] Data compression is of great value to the operating data of mechanical energy storage systems, and can effectively improve the overall efficiency and economy of mechanical energy storage systems: continuous monitoring and storage of equipment data can help detect potential faults in advance and perform predictive maintenance, thereby reducing downtime and maintenance costs. Detailed operating data can help quickly locate the cause of the fault, reduce diagnosis time, and provide historical data comparison to assist in formulating better maintenance strategies. Through long-term data accumulation, trend analysis can be performed to understand the performance changes of mechanical energy storage systems under different environmental conditions, helping to improve the design and operation strategies of mechanical energy storage systems. Based on this, Figure 1-2 The present invention provides a compression method for mechanical energy storage monitoring data, which specifically includes the following steps:
[0042] Step A1: storing the mechanical energy storage monitoring data in a memory in chronological order, and the memory records the node where the mechanical energy storage monitoring data is located and the node compression cache parameters, including: compression times, recording date and backup data. The mechanical energy storage monitoring data involved in the present invention include: monitoring data corresponding to the operation of the power shaft of the mechanical energy storage system, such as monitoring data of the adjustment of the power shaft brake cylinder proportional valve 1DT, monitoring data of the adjustment of the power shaft brake cylinder proportional valve 2DT, monitoring data of the power shaft low-pressure oil pump outlet pressure SP1, monitoring data of the power shaft oil temperature sensor, etc., monitoring data corresponding to the operation of the elevator, such as monitoring data of the failure of the 24V power supply UPS in the elevator cabinet, monitoring data of the elevator pressure switch SP, monitoring data of the floor detection sensor 1, monitoring data of the elevator LFS1 magnetic ring position signal, etc., monitoring data corresponding to the operation of the pulley, such as monitoring data of the pulley pressure switch PS9, monitoring data of the pulley oil supply pump start instruction, monitoring data of the pulley main oil pressure SP1, monitoring data of the proportional valve YVH1 signal instruction, etc., monitoring data corresponding to the operation of the trolley, such as monitoring data of the trolley pressure signal, monitoring data of the trolley forward limit, monitoring data of the high pressure difference of the trolley return oil filter, monitoring data of the trolley accumulator switch instruction, etc.
[0043] Step A2, reading the mechanical energy storage monitoring data from the memory, performing real-time compression algorithm calculation, and determining whether to perform compression, specifically includes the following sub-steps:
[0044] Step A2.1: Determine whether it is a new day according to the recording time of the read mechanical energy storage monitoring data. If so, save the queue data in the cache to the database, clear the compression times in the cache, modify the recording date to the current day, clear the backup data, clear the queue data, and save the first data of each day as a minimum to avoid the problem of exponential increase in the amount of query data caused by querying the data of the previous day in order to find the left timestamp boundary when querying the data during the decompression process; otherwise, execute step A2.2;
[0045] Step A2.2, determine whether the current queue data in the cache is equal to 0. If the current queue data is 0, it means that the compression program has just started and no compression calculation is required. If so, save the current data. Otherwise, execute step A2.3;
[0046] Step A2.3, determine whether the current queue data in the cache is equal to 1. If so, read the mechanical energy storage monitoring data from the memory as backup data and write it into the current value. When the current queue data is 1, it means that the compression program has just started and there is only one data cache. At this time, there is no need to perform compression calculation, but the current value needs to be written into the backup cache for the convenience of the subsequent N-th compression calculation, N>2. At the same time, the backup cache calculation is used to ensure that the slope remains unchanged during the decompression process and is not affected by subsequent data. Otherwise, execute step A2.4;
[0047] Step A2.4, determine whether the current queue data in the cache is greater than or equal to 2. If not, do not perform any operation. Otherwise, if the revolving door compression calculation conditions are met, you can enter the compression process, take out the first data of the queue data, the backup data, and the current value and write them into the new queue, perform the revolving door compression calculation, obtain the compression value of the new queue, and determine whether to perform compression based on the compression value of the new queue.
[0048] Step A3. Generally speaking, data compression is to perform overall calculation on a complete and continuous segment of data, and put all the data to be calculated into the memory, which occupies a large amount of memory and requires many compression calculation times. The present invention determines whether to perform compression by the compression value of the newly created queue. If compression is required, the mechanical energy storage monitoring data is compressed and saved to the database; otherwise, the mechanical energy storage monitoring data is directly saved to the database, thereby achieving real-time compression of the data in the memory, alleviating memory pressure, reducing the number of compression calculation times, and simplifying the compression complexity. Specifically, the present invention comprises the following sub-steps:
[0049] Step A3.1, determine whether the compression value of the newly created queue is less than 3, if so, determine whether the number of compressions is greater than or equal to 30, if so, save the queue data to the database, clear the queue data, clear the backup data, clear the number of compressions, write the current mechanical energy storage monitoring data to the queue data, so as to record the queue data as a minimum to avoid data loss in the event of long-term compression abnormalities; otherwise, compress the current mechanical energy storage monitoring data in the queue data, and increase the number of compressions by one;
[0050] Step A3.2: If the compression value of the newly created queue is greater than or equal to 3, the current mechanical energy storage monitoring data is directly saved to the database, and the compression times are cleared, the backup data is cleared, and the queue data is cleared.
[0051] The present invention is applicable to a compression method for mechanical energy storage monitoring data to perform real-time compression processing of mechanical energy storage monitoring data, which can significantly reduce the required storage space, so that more mechanical energy storage monitoring data can be stored on a storage device with the same capacity, and in a high-flow and high-concurrency environment, real-time compression can quickly reduce flow pressure and ensure the stability of mechanical energy storage monitoring data compression. At the same time, the real-time compression of mechanical energy storage monitoring data has a small data volume, which can speed up the reading and writing speed of mechanical energy storage monitoring data and improve data processing performance.
[0052] like Figure 1 and 3 The present invention also provides a compression method for mechanical energy storage monitoring data, which specifically comprises the following steps:
[0053] Step B1, based on the mechanical energy storage monitoring data compressed by the compression method applicable to the mechanical energy storage monitoring data, determining the start time node and the end time node of the compressed mechanical energy storage monitoring data for query;
[0054] Step B2, find the timestamp boundary according to the first mechanical energy storage monitoring data on the left side of the query start time node and the first mechanical energy storage monitoring data on the right side of the query end time node in the database. Since the data recorded in the database is compressed, the data is incomplete. The value input during the query is a certain value. If it cannot be found in the database, empty data will be returned. However, there are two ends of the compressed value outside the query range. The compressed value in the middle can be obtained by decompression calculation. Therefore, it is necessary to first find the timestamp boundary in the database that is compressed and cannot be directly queried through conditions;
[0055] Step B3, querying the database using the timestamp boundary to obtain the corresponding compressed data segment, decompressing the compressed data segment using the decompression algorithm to obtain the decompressed mechanical energy storage monitoring data, decompressing the mechanical energy storage monitoring data by the slope of the straight line where two adjacent compression nodes are located, being able to quickly locate and restore the mechanical energy storage monitoring data during the decompression process, improving the decompression speed, having relatively simple logic, being easy to implement and maintain, and having the characteristics of stability and reliability; specifically comprising the following sub-steps:
[0056] Step B3.1, query the database using the timestamp boundary to obtain the corresponding compressed data segment, where there are several compressed nodes N in the compressed data segment, and create a compressed node index i and a list List;
[0057] Step B3.2: for the compressed data segments corresponding to two adjacent compressed nodes, obtain the timestamp difference T of the two adjacent compressed nodes, create a time variable t, and assign it to the timestamp of the first compressed node among the adjacent compressed nodes;
[0058] Step B3.3, calculating the slope of the straight line where the two adjacent compression nodes are located according to the data information of the two adjacent compression nodes;
[0059] Step 3.4, the time variable t is updated by adding a collection time interval of the mechanical energy storage monitoring data, the data information corresponding to the time variable t under the slope of the straight line is calculated, and written into the time list List;
[0060] Step 3.5: If the updated time variable t < T, repeat step B3.4; otherwise, execute step B3.6;
[0061] Step 3.6, assign the compression node index i to i+1, repeat steps B3.2-B3.5 until the compression node index i≥N-1, and complete the decompression of the compressed data segment corresponding to the timestamp boundary.
[0062] Step B4: Determine the range of mechanical energy storage monitoring data that needs to be decompressed according to the start time node and the end time node of the query.
[0063] By decompressing the mechanical energy storage monitoring data using the decompression method for mechanical energy storage monitoring data of the present invention, the compressed mechanical energy storage monitoring data can be restored. The mechanical energy storage monitoring data decompressed according to the query conditions are complete and accurate, and will not match the query conditions. Moreover, the time point of the decompressed data is accurate, and the data value has basically no error with the original data, which indicates that the decompression method for mechanical energy storage monitoring data of the present invention has the characteristics of stability and reliability.
[0064] In a technical solution of the present invention, a computer-readable storage medium is also provided, storing a computer program, wherein the computer program enables a computer to execute the compression method applicable to mechanical energy storage monitoring data or the decompression method applicable to mechanical energy storage monitoring data.
[0065] In one technical solution of the present invention, an electronic device is also provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the compression method applicable to mechanical energy storage monitoring data or the decompression method applicable to mechanical energy storage monitoring data is implemented.
[0066] In the embodiments disclosed in the present application, the computer storage medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. The computer storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the above. More specific examples of computer storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0067] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0068] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.
Claims
1. A compression method for mechanical energy storage monitoring data, characterized in that: The specific steps include: Step A1, storing the mechanical energy storage monitoring data in a memory in chronological order, and the memory records the node where the mechanical energy storage monitoring data is located and the node compression cache parameter; Step A2: reading the mechanical energy storage monitoring data from the memory, performing real-time compression algorithm calculation, and determining whether to perform compression; Step A3: If compression is required, the mechanical energy storage monitoring data is compressed and saved in the database; otherwise, the mechanical energy storage monitoring data is directly saved in the database.
2. A compression method for mechanical energy storage monitoring data according to claim 1, characterized in that: The mechanical energy storage monitoring data in step A1 includes: monitoring data of the power shaft, elevator, pulley and trolley of the mechanical energy storage system.
3. A compression method for mechanical energy storage monitoring data according to claim 1, characterized in that: The node compression cache parameters in step 1 include: compression times, recording date and backup data.
4. A compression method for mechanical energy storage monitoring data according to claim 3, characterized in that: Step A2 includes the following sub-steps: Step A2.1, judging whether it is a new day according to the recording time of the read mechanical energy storage monitoring data, if so, saving the queue data in the cache to the database, clearing the number of compressions in the cache, modifying the recording date to the current day, clearing the backup data, and clearing the queue data; Otherwise, proceed to step A2.2; Step A2.2, determine whether the current queue data in the cache is equal to 0, if so, save the current data, otherwise, execute step A2.3; Step A2.3, determine whether the current queue data in the cache is equal to 1, if so, read the mechanical energy storage monitoring data from the memory as backup data and write it into the current value, otherwise execute step A2.4; Step A2.4, determine whether the current queue data in the cache is greater than or equal to 2. If not, do not perform any operation. Otherwise, take out the first data of the queue data, the backup data, and the current value and write them into the newly created queue. Perform revolving door compression calculation to obtain the compression value of the newly created queue. Determine whether to perform compression based on the compression value of the newly created queue.
5. A compression method for mechanical energy storage monitoring data according to claim 4, characterized in that: Step A3 includes the following sub-steps: Step A3.1, determine whether the compression value of the newly created queue is less than 3, if so, determine whether the number of compressions is greater than or equal to 30, if so, save the queue data to the database, clear the queue data, clear the backup data, clear the number of compressions, and write the current mechanical energy storage monitoring data to the queue data; otherwise, compress the current mechanical energy storage monitoring data in the queue data, and increase the number of compressions by one; Step A3.2: If the compression value of the newly created queue is greater than or equal to 3, the current mechanical energy storage monitoring data is directly saved to the database, and the compression times are cleared, the backup data is cleared, and the queue data is cleared.
6. A decompression method suitable for mechanical energy storage monitoring data, characterized in that: The specific steps include: Step B1, based on the mechanical energy storage monitoring data compressed by the compression method applicable to mechanical energy storage monitoring data as claimed in claim 1, determining the start time node and the end time node of querying the compressed mechanical energy storage monitoring data; Step B2, finding the timestamp boundary according to the first mechanical energy storage monitoring data on the left side of the query start time node and the first mechanical energy storage monitoring data on the right side of the query end time node in the database; Step B3, querying the database using the timestamp boundary to obtain the corresponding compressed data segment, decompressing the compressed data segment using a decompression algorithm to obtain decompressed mechanical energy storage monitoring data; Step B4: Determine the range of mechanical energy storage monitoring data that needs to be decompressed according to the start time node and the end time node of the query.
7. A decompression method for mechanical energy storage monitoring data according to claim 6, characterized in that: Step B3 includes the following sub-steps: Step B3.1, query the database using the timestamp boundary to obtain the corresponding compressed data segment, where there are several compressed nodes N in the compressed data segment, and create a compressed node index i and a list List; Step B3.2: for the compressed data segments corresponding to two adjacent compressed nodes, obtain the timestamp difference T of the two adjacent compressed nodes, create a time variable t, and assign it to the timestamp of the first compressed node among the adjacent compressed nodes; Step B3.3, calculating the slope of the straight line where the two adjacent compression nodes are located according to the data information of the two adjacent compression nodes; Step 3.4, the time variable t is updated by adding a collection time interval of the mechanical energy storage monitoring data, the data information corresponding to the time variable t under the slope of the straight line is calculated, and written into the time list List; Step 3.5: If the updated time variable t < T, repeat step B3.4; Otherwise, go to step B3.6; Step 3.6, assign the compression node index i to i+1, repeat steps B3.2-B3.5 until the compression node index i≥N-1, and complete the decompression of the compressed data segment corresponding to the timestamp boundary.
8. A computer-readable storage medium storing a computer program, characterized in that: The computer program enables the computer to execute the compression method applicable to mechanical energy storage monitoring data as described in any one of claims 1-5 or the decompression method applicable to mechanical energy storage monitoring data as described in any one of claims 6-7.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the compression method applicable to mechanical energy storage monitoring data as described in any one of claims 1 to 5 or the decompression method applicable to mechanical energy storage monitoring data as described in any one of claims 6 to 7 is implemented.
Citation Information
Patent Citations
Precision-controlled self-adaptive data compression method
CN102664635A
Improved algorithm for revolving door compression algorithm
CN110995275A
Compression storage method and system and decompression method and system for industrial process data
CN114006618A
