A method, device and storage medium for compressing numerical data
By comparing the difference between the predicted data of numerical data and the actual numerical values and making predictions and storage decisions based on the trend change algorithm, the redundancy problem in numerical data storage is solved, and efficient data compression storage and data integrity maintenance is achieved.
Patent Information
- Application Number
- CN202411942610.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-27
AI Technical Summary
In the application fields of the Internet of Things, monitoring, sensors, finance, etc., numerical data is streamed in the time dimension, with large data throughput, resulting in a large amount of data being written continuously and rapidly, occupying a large amount of space. How to effectively reduce data redundancy has become a technical problem that needs to be solved urgently.
By comparing the difference between the prediction data of the numerical record item of the data source and the actual value, if the difference is less than or equal to the threshold, the actual value will be discarded; otherwise, the actual value will be recorded and subsequent predictions will be updated. This method is based on a trend change algorithm for prediction, including moving average algorithm, linear regression algorithm, polynomial regression algorithm or neural network algorithm.
It effectively reduces the amount of data that needs to be stored, reduces data redundancy, and can efficiently compress and store numerical data, while maintaining the accuracy and completeness of the data.
Smart Images

Figure CN119377228B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of database technology, and more specifically, relates to a method, device and storage medium for compressing and storing numerical data. Background Art
[0002] In the application fields of Internet of Things, monitoring, sensors, finance, etc., numerical data is generated in a streaming manner in the time dimension: the data flux is large, a large amount of data is continuously and rapidly written, and it takes up a lot of space. How to effectively reduce data redundancy in the storage process of numerical data is a technical problem that needs to be solved in this field. Summary of the invention
[0003] In view of the defects of the prior art, the purpose of the present application is to effectively reduce data redundancy in the storage process of numerical data.
[0004] To achieve the above objectives, in a first aspect, the present application provides a method for compressing and storing numerical data, comprising:
[0005] For the numerical record items of the data source, compare the difference between the predicted data of the numerical record items at the current t-th time point and the actual value of the numerical record items at the current t-th time point. The predicted data is based on the actual value of the numerical record items in the continuous time before the t-1-th time point, and is predicted by the trend change algorithm. t represents the number of the time point;
[0006] If it is determined that the difference between the predicted data and the actual value is less than or equal to the threshold, the actual value of the value record item at the current tth time point is discarded; otherwise, the actual value of the value record item at the current tth time point is recorded, and based on the actual value of the value record item in the continuous time before the current tth time point, the value of the value record item after the tth time point is predicted through the trend change algorithm.
[0007] In a possible implementation, the prediction data includes prediction values corresponding to multiple dimensions, and the durations of continuous time used by the prediction values of different dimensions are different;
[0008] Accordingly, determining whether the difference between the predicted data and the actual value is less than or equal to a threshold value includes:
[0009] Determine whether the difference between the predicted and actual values of at least one dimension is less than or equal to a threshold value.
[0010] In a possible implementation, based on the actual values of the value record items in the continuous time before the current t-th time point, the value of the value record item after the t-th time point is predicted by a trend change algorithm, including:
[0011] By querying the actual values of the value record items in the continuous time before the current t-th time point, a value set is constructed;
[0012] Based on the values in the value set, the predicted data of the value record item after the tth time point is predicted through the trend change algorithm.
[0013] In a possible implementation, the value set is constructed by querying the actual value of the value record item in the continuous time before the current t-th time point, including:
[0014] For the continuous time before the current t-th time point, search for the actual value of the value record item at each time point from the current t-th time point forward to see if it exists;
[0015] If the actual value of the value record item at the time point exists, the corresponding actual value is added to the value set.
[0016] In a possible implementation, the method further includes:
[0017] receiving a data query request, where the data query request is used to indicate a query range of a data source;
[0018] Check whether the value of the value record item exists at each time point in the query range;
[0019] If the value of the numerical record item at the first time point does not exist, then trace back to the second time point where the value exists, and based on the actual value of the numerical record item in the continuous time before the second time point, predict through the trend change algorithm to restore the value of the numerical record item between the second time point and the first time point.
[0020] In a possible implementation, the trend change algorithm is a moving average algorithm, a linear regression algorithm, a polynomial regression algorithm, or a neural network algorithm.
[0021] In a second aspect, the present application provides a numerical data compression storage device, comprising:
[0022] A comparison module is used to compare the difference between the predicted data of the numerical record item at the current t-th time point and the actual value of the numerical record item at the current t-th time point for the numerical record item of the data source, the predicted data is based on the actual value of the numerical record item in the continuous time before the t-1-th time point, and is predicted by a trend change algorithm, where t represents the number of the time point;
[0023] A compression storage module is used to discard the actual value of the numerical record item at the current t-th time point if it is determined that the difference between the predicted data and the actual value is less than or equal to a threshold; otherwise, the actual value of the numerical record item at the current t-th time point is recorded, and based on the actual value of the numerical record item in the continuous time before the current t-th time point, the value of the numerical record item after the t-th time point is predicted through a trend change algorithm.
[0024] In a third aspect, the present application provides an electronic device comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in the first aspect or any possible implementation of the first aspect.
[0025] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect.
[0026] In a fifth aspect, the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect.
[0027] In general, the above technical solutions conceived by this application have the following beneficial effects compared with the prior art:
[0028] By predicting the numerical record items and comparing the predicted value with the actual value, the difference between the two is determined. If the difference is less than or equal to the preset threshold, the actual value at the current time point can be discarded to avoid storing redundant data; when the difference is large, the actual value is recorded and the subsequent prediction is updated. This dynamic storage strategy based on difference comparison effectively reduces the amount of data that needs to be stored, reduces data redundancy, and can efficiently compress and store numerical data while maintaining data accuracy and integrity. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a flowchart of a method for compressing and storing numerical data provided in an embodiment of the present application;
[0030] Figure 2 It is a schematic diagram of the data writing process provided by the embodiment of the present application;
[0031] Figure 3 It is a schematic diagram of the data query process provided by the embodiment of the present application;
[0032] Figure 4is a structural schematic diagram of a numerical data compression storage device provided in an embodiment of the present application;
[0033] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0035] The terms "first" and "second" in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of objects. For example, the first time point and the second time point are used to distinguish different time points rather than to describe a specific order of time points.
[0036] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application 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.
[0037] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two. For example, multiple processing units refer to two or more processing units, etc.; multiple elements refer to two or more elements, etc.
[0038] First, the technical terms involved in the embodiments of the present application are introduced.
[0039] (1) Dimension (tag): describes the spatial or business characteristics of the data, such as geographic location, device ID, product type, etc. This dimensional information can be used as filtering or aggregation conditions in subsequent analysis.
[0040] (2) Data source: A data source is a unique representation consisting of a series of tags (also called dimensions). For example, a data source can be the geographic location of a sensor, device ID, device model, etc.
[0041] (3) Metric: A numerical record of data. For example, a data metric can be a temperature record or humidity record of a sensor.
[0042] (4) Dimensional historical trend: The predicted value of numerical data from the same data source over a continuous time (a time range) is calculated based on a trend change algorithm.
[0043] (5) Dimensional historical trend three-dimensional attributes: According to the three defined time ranges such as 30s, 60s, and 90s, the numerical data is predicted based on the trend change algorithm to obtain three predicted values.
[0044] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application.
[0045] Figure 1 is a flow chart of a method for compressing and storing numerical data provided by an embodiment of the present application, such as Figure 1 As shown, the method includes the following steps S101 and S102.
[0046] Step S101, for the numerical record items of the data source, compare the difference between the predicted data of the numerical record items at the current t-th time point (the current time point is the t-th time point) and the actual value of the numerical record items at the current t-th time point, the predicted data is based on the actual value of the numerical record items in the continuous time before the t-1-th time point, and is predicted by a trend change algorithm, and t represents the number of the time point;
[0047] Step S102, if it is determined that the difference between the predicted data and the actual value is less than or equal to the threshold, the actual value of the value record item at the current t-th time point is discarded (ignored); otherwise, the actual value of the value record item at the current t-th time point is recorded, and based on the actual value of the value record item in the continuous time before the current t-th time point, the value of the value record item after the t-th time point is predicted through the trend change algorithm.
[0048] Specifically, the above method involves the following steps: (1) data prediction, (2) difference comparison, and (3) data storage decision.
[0049] (1) Data prediction;
[0050] A trend change algorithm is a mathematical model or calculation method used to analyze and predict the trend of numerical changes in time series data. The algorithm models historical data and identifies patterns and regularities in the data in order to predict numerical values in the future.
[0051] The method first uses a trend change algorithm to predict the numerical record items. The prediction is based on the actual value before the t-1 time point, which means that the method relies on historical data to infer future values. This prediction can be based on a variety of algorithms, such as linear regression, time series analysis, moving average, etc. The specific choice depends on the characteristics and change trends of the data.
[0052] Exemplarily, in order to obtain the actual value of the numerical record item in the continuous time before the t-1th time point, it is possible to trace back from the t-1th time point to the t-1-nth time point where the value exists, and extract the actual value of the numerical record item between the t-1-nmth time point and the t-1-nth time point, where m represents the duration of the continuous time, n is an integer greater than or equal to 0, and m, t-1-nm, t-1-n, and t-1 are all positive integers.
[0053] (2) Comparison of differences;
[0054] At each time point, the above method compares the predicted data with the actual value. By calculating the difference between the two, the accuracy of the prediction can be judged. If the difference is less than or equal to the preset threshold, it means that the prediction is relatively accurate, and the actual value at the current time point can be discarded. This process effectively reduces the amount of data that needs to be stored, because in many cases, the actual value is very close to the predicted value, and the need to store the actual value is reduced.
[0055] (3) Data storage decisions;
[0056] Discarding actual values: When the difference between the predicted and actual values is within an acceptable range, discarding the actual values can significantly reduce storage requirements.
[0057] Recording actual values: When the difference exceeds the threshold, it means that the prediction is not accurate enough. At this time, it is necessary to record the actual values to ensure the integrity and accuracy of the data. After recording the actual values, the method will update subsequent predictions based on the new actual values, which can improve the accuracy of future predictions.
[0058] It can be understood that by predicting the numerical record items and comparing the predicted value with the actual value, the difference between the two is determined. If the difference is less than or equal to the preset threshold, the actual value at the current time point can be discarded to avoid storing redundant data; when the difference is large, the actual value is recorded and the subsequent prediction is updated. This dynamic storage strategy based on difference comparison effectively reduces the amount of data that needs to be stored, reduces data redundancy, and can efficiently compress and store numerical data while maintaining the accuracy and integrity of the data.
[0059] In a possible implementation, the prediction data includes prediction values corresponding to multiple dimensions, and the durations of continuous time used by the prediction values of different dimensions are different;
[0060] Accordingly, the above determination that the difference between the predicted data and the actual value is less than or equal to the threshold value includes:
[0061] Determine whether the difference between the predicted and actual values of at least one dimension is less than or equal to a threshold value.
[0062] It can be understood that when determining the difference between the predicted data and the actual value, the above method allows the difference between the predicted value and the actual value of at least one dimension to be less than or equal to the threshold. Even if the prediction of some dimensions is not accurate enough, as long as the prediction of other dimensions meets the conditions, it is still possible to choose to discard redundant data. This fault tolerance makes the system more robust in the face of data fluctuations.
[0063] In a possible implementation, the above-mentioned prediction of the value of the value record item after the tth time point by using a trend change algorithm based on the actual value of the value record item in the continuous time before the current tth time point includes:
[0064] By querying the actual values of the value record items in the continuous time before the current t-th time point, a value set is constructed;
[0065] Based on the values in the value set, the predicted data of the value record item after the tth time point is predicted through the trend change algorithm.
[0066] In a possible implementation, the above-mentioned constructing a value set by querying the actual value of the value record item in the continuous time before the current t-th time point includes:
[0067] For the continuous time before the current t-th time point, search for the actual value of the value record item at each time point from the current t-th time point forward to see whether it exists (if the actual value of the value record item at a certain time point is stored, it means that the actual value of the value record item at that time point exists);
[0068] If the actual value of the value record item at the time point exists, the corresponding actual value is added to the value set.
[0069] In a possible implementation, the method further includes:
[0070] receiving a data query request, where the data query request is used to indicate a query range of a data source;
[0071] Check whether the value of the value record item exists at each time point in the query range;
[0072] If the value of the numerical record item at the first time point does not exist, then trace back to the second time point where the value exists, and based on the actual value of the numerical record item in the continuous time before the second time point, predict (the value of the numerical record item between the second time point and the first time point) through the trend change algorithm to restore the value of the numerical record item between the second time point and the first time point.
[0073] Specifically, after receiving a query request, the system retrieves the value records for each time point within the query range and checks whether the values of these records exist. Due to the use of a compressed storage method, the actual values of some time points may have been discarded, so the following processing is required: (1) tracing the missing values; (2) restoring the missing values.
[0074] (1) Tracing missing values;
[0075] (1-1) Missing judgment: If the value of a numerical record item does not exist at the first time point within the query range, the system will automatically trace back to the second time point where the value exists.
[0076] (1-2) Trend prediction: Once the actual value at the second time point is found, the system will predict the value at the first time point through the trend change algorithm based on the actual value of the value record item in the continuous time before the second time point. This process can use the same prediction algorithm as before to ensure the consistency and accuracy of the prediction.
[0077] (2) Restore missing values;
[0078] Through the above tracing and prediction, the system can restore the value record items at the first point in time. This recovery mechanism ensures that when querying data, even if some values are discarded due to compression strategies, the system can still provide a complete data view.
[0079] Exemplarily, if the prediction data includes prediction values corresponding to multiple dimensions, the prediction values corresponding to the multiple dimensions can be weighted and summed, and the weighted sum value can be used as the restored value of the numerical record item at the corresponding time point.
[0080] It is understandable that users can query data within a specific time range as needed, and the system can intelligently handle missing data, provide complete query results, and ensure the data integrity of data queries.
[0081] Therefore, the numerical data compression storage method provided by the present application can realize the efficient writing and query analysis of large-scale high-path time series data in relational databases, and high-fidelity and low-cost storage of data. Large batch refers to the situation where a large number of data records are generated or processed in a short period of time, usually involving high-frequency data generation and storage requirements. High path: refers to the ability of the system to process multiple data streams or requests at the same time, ensuring that the fast writing and query efficiency of data can be maintained under high concurrency.
[0082] In a possible implementation, the trend change algorithm is a moving average algorithm, a linear regression algorithm, a polynomial regression algorithm, or a neural network algorithm.
[0083] The moving average algorithm predicts by calculating the average value of the value recorded in a certain time window (the continuous time before a certain time point). Specifically, a fixed time window is selected, and the (weighted) average value of the actual values at all times in the time window is calculated. The calculated value is used as the predicted value of the value record item at the subsequent time point. This algorithm is suitable for situations where the data fluctuation is small and the change trend is stable.
[0084] The linear regression algorithm makes predictions by establishing a linear relationship model between the independent variable (time) and the dependent variable (value record item). By performing regression analysis on historical data (the actual values of the value record items in the continuous time before a certain time point), a linear equation is obtained, which can be used to predict the predicted values of the value record items at subsequent time points. This algorithm is suitable for situations where the data has a linear trend.
[0085] The polynomial regression algorithm captures the nonlinear relationship of data by fitting a polynomial function. By performing polynomial regression analysis on historical data (the actual values of numerical record items in continuous time before a certain time point), a polynomial equation is obtained, which can be used to predict the predicted values of numerical record items at subsequent time points. This algorithm is suitable for situations where data changes are more complex and show nonlinear trends.
[0086] Neural network algorithms learn complex patterns and relationships in data by building multi-layer neural network models. By inputting historical numerical data (the actual values of numerical records in continuous time before a certain point in time), the neural network can automatically extract features and train, and finally output the predicted values of numerical records at subsequent time points. This algorithm is suitable for situations where the amount of data is large and has complex nonlinear relationships.
[0087] The numerical data compression storage method provided by the present application is exemplified below with reference to several examples.
[0088] The present application provides a method for compressing and storing numerical data, which specifically includes the following steps: (1) defining data dimensions, where a series of data dimensions constitute a data source definition; (2) calculating and loading three-dimensional attributes of historical trends of data sources; (3) writing process; and (4) query process.
[0089] Figure 2 is a schematic diagram of the data writing process provided by the embodiment of the present application, such as Figure 2 As shown, the writing process includes: querying the three-dimensional attributes of the historical trend corresponding to the data source; calculating the variance coefficient (degree of difference) between the three-dimensional attributes of the trend (the predicted values corresponding to the three time ranges respectively) and the value; and recording the current data if the variance coefficient is greater than a threshold, otherwise ignoring it.
[0090] Figure 3 is a flow chart of data query provided by the embodiment of the present application, such as Figure 3 As shown, the query process includes: calculating and obtaining the query range of the data source (for example, specifying the time range of the query, specifying which data indicators to query); calculating and obtaining all points (time points) within the query range of the data source; retrieving whether the point data exists, and returning the point data if it exists; if it does not exist, tracing back to the existing point data in sequence.
[0091] It is understandable that when storing data, historical trend calculation is performed based on the dimension. If the change coefficient is less than the threshold, it is ignored, and if the change coefficient is greater than the threshold, it is stored. When querying data, the query range of the data source is used to check whether the data of each point exists. If not, the data of the existing points is traced back in sequence. This achieves low-cost storage and efficient query analysis.
[0092] The numerical data compression storage device provided in the present application is described below. The numerical data compression storage device described below and the numerical data compression storage method described above can be referenced to each other.
[0093] Figure 4 is a schematic diagram of the structure of a numerical data compression storage device provided in an embodiment of the present application, such as Figure 4 As shown, the device comprises: a comparison module 10 and a compression storage module 20. Wherein:
[0094] A comparison module 10 is used to compare the difference between the predicted data of the numerical record item at the current t-th time point and the actual value of the numerical record item at the current t-th time point for the numerical record item of the data source, wherein the predicted data is obtained by predicting the actual value of the numerical record item in the continuous time before the t-1-th time point through a trend change algorithm, and t represents the number of the time point;
[0095] The compression storage module 20 is used to discard the actual value of the numerical record item at the current t-th time point if it is determined that the difference between the predicted data and the actual value is less than or equal to a threshold value; otherwise, the actual value of the numerical record item at the current t-th time point is recorded, and based on the actual value of the numerical record item in the continuous time before the current t-th time point, the value of the numerical record item after the t-th time point is predicted through a trend change algorithm.
[0096] It can be understood that the detailed functional implementation of each of the above-mentioned units / modules can be found in the introduction of the aforementioned method embodiment, and will not be repeated here.
[0097] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method, which will not be repeated here.
[0098] Based on the method in the above embodiment, an embodiment of the present application provides an electronic device, Figure 5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 5 As shown, the electronic device may include: a processor (Processor) 810, a communication interface (Communications Interface) 820, a memory (Memory) 830 and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call the logic instructions in the memory 830 to execute the method in the above embodiment.
[0099] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, 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, which is stored in a storage medium and includes 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 application.
[0100] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0101] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.
[0102] It is understandable that the processor in the embodiment of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0103] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0104] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0105] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0106] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for compressing and storing numerical data, characterized in that: include: For the numerical record items of the data source, compare the difference between the predicted data of the numerical record items at the current t-th time point and the actual value of the numerical record items at the current t-th time point. The predicted data is based on the actual value of the numerical record items in the continuous time before the t-1-th time point, and is predicted by the trend change algorithm. t represents the number of the time point; If it is determined that the difference between the predicted data and the actual value is less than or equal to the threshold, the actual value of the value record item at the current t-th time point is discarded; otherwise, the actual value of the value record item at the current t-th time point is recorded, and based on the actual values of the value record items in the continuous time before the current t-th time point, the value of the value record item after the t-th time point is predicted by the trend change algorithm; Also includes: receiving a data query request, where the data query request is used to indicate a query range of a data source; Check whether the value of the value record item exists at each time point in the query range; If the value of the numerical record item at the first time point does not exist, then trace back to the second time point where the value exists, and based on the actual value of the numerical record item in the continuous time before the second time point, predict through the trend change algorithm to restore the value of the numerical record item between the second time point and the first time point.
2. The method for compressing and storing numerical data according to claim 1, characterized in that: The prediction data includes prediction values corresponding to multiple dimensions respectively, and the duration of continuous time used by the prediction values of different dimensions is different; Accordingly, determining that the difference between the predicted data and the actual value is less than or equal to a threshold value includes: Determine whether the difference between the predicted and actual values of at least one dimension is less than or equal to a threshold value.
3. The method for compressing and storing numerical data according to claim 1, characterized in that: The method predicts the value of the value record item after the tth time point based on the actual value of the value record item in the continuous time before the current tth time point by using a trend change algorithm, including: Construct a value set by querying the actual value of the value record item in the continuous time before the current t-th time point; Based on the values in the value set, the predicted data of the value record item after the tth time point is predicted through the trend change algorithm.
4. The method for compressing and storing numerical data according to claim 3, characterized in that: The step of constructing a value set by querying the actual value of the value record item in the continuous time before the current t-th time point includes: For the continuous time before the current t-th time point, search from the current t-th time point forward to see whether the actual value of the value record item exists at each time point; If the actual value of the value record item at the time point exists, the corresponding actual value is added to the value set.
5. The method for compressing and storing numerical data according to any one of claims 1 to 4, characterized in that: The trend change algorithm is a moving average algorithm, a linear regression algorithm, a polynomial regression algorithm or a neural network algorithm.
6. A numerical data compression storage device, characterized in that: include: A comparison module is used to compare the difference between the predicted data of the numerical record item at the current t-th time point and the actual value of the numerical record item at the current t-th time point for the numerical record item of the data source, the predicted data is based on the actual value of the numerical record item in the continuous time before the t-1-th time point, and is predicted by a trend change algorithm, where t represents the number of the time point; A compression storage module, for discarding the actual value of the value record item at the current t-th time point if it is determined that the difference between the predicted data and the actual value is less than or equal to a threshold value; otherwise, recording the actual value of the value record item at the current t-th time point, and predicting the value of the value record item after the t-th time point based on the actual value of the value record item in the continuous time before the current t-th time point through a trend change algorithm; Also includes: receiving a data query request, where the data query request is used to indicate a query range of a data source; Check whether the value of the value record item exists at each time point in the query range; If the value of the numerical record item at the first time point does not exist, then trace back to the second time point where the value exists, and based on the actual value of the numerical record item in the continuous time before the second time point, predict through the trend change algorithm to restore the value of the numerical record item between the second time point and the first time point.
7. An electronic device, characterized in that: include: at least one memory for storing a computer program; At least one processor is used to execute the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program runs on a processor, the processor is caused to execute the method according to any one of claims 1 to 5.
9. A computer program product, characterized in that When the computer program product runs on a processor, the processor is caused to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Short-term power prediction method and system for renewable energy sources
CN118199061A