A method for storing time-series data based on partitioned time-series data files

CN122570575APending Publication Date: 2026-08-14CMA METEOROLOGICAL OBSERVATION CENT +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-14
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

(1)存储空间浪费严重:对于实际长度波动显著的变长时序数据而言,每一行均需按预先评估的最大长度预留空间

Benefits of technology

[0020]综上所述,本公开实施例通过构建包括元数据区、索引区和时序数据区的分区时序数据文件,并采用时序数据动态追加与索引槽位精确记录偏移及长度的机制,从根本上解决了现有预占位定长行存储方案中因固定行预留最大空间导致的存储资源严重浪费、对乱序时序数据写入支持不足以及时序数据文件自描述能力欠缺的技术问题,实现了存储空间的高效利用、乱序时序数据的可靠写入以及文件作为独立存储单元的自解释性,显著提升了时序数据在持久化存储、离线传输和分析处理场景下的整体性能与可用性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122570575A_ABST
    Figure CN122570575A_ABST
Patent Text Reader

Abstract

This disclosure provides a time-series data storage method based on a partitioned time-series data file, relating to the field of time-series data storage technology. The method includes: constructing a partitioned time-series data file comprising a metadata area, an index area, and a time-series data area; receiving time-series data to be stored and parsing it to determine its corresponding logical time point; determining the current end offset address of the time-series data area as the starting offset address corresponding to the time-series data, appending the time-series data to the time-series data area for storage starting from the starting offset address, and calculating the data length occupied by the time-series data in the time-series data area; locating the corresponding index slot from the index area according to the logical time point corresponding to the time-series data, and writing the determined starting offset address and the calculated data length to the located index slot. This achieves efficient utilization of storage space, reliable writing of out-of-order time-series data, and the self-interpretation of the file as an independent storage unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of time-series data storage technology, and in particular to a time-series data storage method based on partitioned time-series data files. Background Technology

[0002] With the rapid development of fields such as the Internet of Things, industrial automation, and environmental monitoring, various data acquisition devices continuously generate massive amounts of time-series data at fixed intervals (such as per second or per minute). To facilitate the persistent storage, offline transmission, and subsequent analysis and processing of time-series data, it is usually necessary to write this time-series data into time-series data files in a specific format.

[0003] Currently, a common method for storing time-series data is to use a pre-placed fixed-length line storage scheme. The specific implementation process of this scheme is as follows: First, the maximum storage space that a single piece of time-series data might reach is pre-assessed; second, this maximum storage space is increased by the length of a newline character to determine the fixed length occupied by each piece of time-series data in the time-series data file; then, based on a preset total number of logical time points (for example, the time-series data collection period is one day, totaling 1440 minutes, with each minute as the time-series data collection cycle, meaning one piece of time-series data is generated per minute, and each minute is a logical time point, for a total of 1440 logical time points), a time-series data file with a fixed number of lines (e.g., 1440 lines) and each line occupying a fixed length is pre-generated. When time-series data for a certain logical time point arrives, its fixed offset address in the time-series data file is calculated directly based on the corresponding logical time point and the fixed length, and the time-series data is overwritten into the corresponding line, with any insufficient space filled with null characters.

[0004] However, the above-mentioned pre-occupied fixed-length row storage scheme has at least the following technical problems in practical applications: (1) Significant waste of storage space: For variable-length time-series data with significant fluctuations in actual length, space must be reserved for each row according to the pre-estimated maximum length. This results in a large number of invalid placeholders in the time-series data file, a low proportion of valid data, poor utilization of storage resources, and also leads to an excessively large size of the time-series data file, increasing the burden on network transmission and backup.

[0005] (2) Inability to effectively support out-of-order timing data writing: This scheme relies on the assumption that timing data arrives sequentially in time order. If, due to network delays, equipment failures, or other reasons, timing data at a certain logical time point arrives later than timing data at subsequent logical time points, it is difficult to flexibly write the later-arriving timing data to the fixed offset address of its corresponding logical time point.

[0006] (3) Insufficient self-description capability of time-series data files: The time-series data files generated by this scheme usually do not carry metadata information and need to rely on external configuration files to provide the basis for parsing, which reduces the portability and self-interpretability of time-series data files as independent storage units. Summary of the Invention

[0007] In a first aspect, embodiments of this disclosure provide a time-series data storage method based on partitioned time-series data files, the method comprising: Construct partitioned time-series data files; The partitioned time-series data file includes a metadata area, an index area, and a time-series data area; The metadata area is located at the beginning of the partition time-series data file and has a preset first fixed length. It stores metadata that describes the global attributes of the partition time-series data file. The index area is located after the metadata area and has a preset second fixed length. It is pre-divided into N consecutive index slots of equal length, where N is the total number of multiple logical time points determined based on the time range and time period of the time series data acquisition corresponding to the partition time series data file. Each index slot corresponds to one logical time point. The time-series data area is located after the index area and is used to store time-series data; Receive the time-series data to be stored, parse it, and determine its corresponding logical time point; The current end offset address of the timing data area is determined as the starting offset address of the timing data. Starting from the starting offset address, the timing data is appended to the timing data area for storage, and the data length occupied by the timing data in the timing data area is calculated. Based on the logical time point corresponding to the time series data, locate the corresponding index slot in the index area, and write the determined starting offset address and the statistical data length into the located index slot.

[0008] In some possible implementations of the first aspect, timing data is appended to the timing data area for storage, starting from the starting offset address, and the length of the timing data occupied in the timing data area is calculated, including: If a compression algorithm identifier exists in the metadata, the compression algorithm corresponding to the compression algorithm identifier is called to compress the time series data. Starting from the starting offset address, the compressed time series data is appended to the time series data area for storage, and the data length occupied by the compressed time series data in the time series data area is calculated.

[0009] In some possible implementations of the first aspect, timing data is appended to the timing data area for storage, starting from the starting offset address, and the length of the timing data occupied in the timing data area is calculated, including: If an encryption algorithm identifier exists in the metadata, the encryption algorithm corresponding to the encryption algorithm identifier is called to encrypt the time series data. Starting from the starting offset address, the encrypted time series data is appended to the time series data area for storage, and the data length occupied by the encrypted time series data in the time series data area is counted.

[0010] Among some possible implementations of the first aspect, the method also includes: Receive the latest time series data corresponding to the logical time point that needs to be updated, parse it, and determine the corresponding logical time point; The current end offset address of the timing data area is determined as the starting offset address of the latest timing data. Starting from the starting offset address, the latest timing data is appended to the timing data area for storage, and the data length occupied by the latest timing data in the timing data area is calculated. Based on the logical time point corresponding to the latest time series data, locate the corresponding index slot in the index area, and write the determined starting offset address and the statistical data length into the located index slot.

[0011] In some possible implementations of the first aspect, each index slot includes four index entries: a current starting offset address entry, a current data length entry, a historical starting offset address entry, and a historical data length entry. Write the determined starting offset address and the statistical data length into the positioning index slot, including: For the index slot being located, its current starting offset address entry and its current data length entry are checked; If it is detected that its current starting offset address entry has not been written to the starting offset address and its current data length entry has not been written to the data length, then the determined starting offset address is written to its current starting offset address entry, and the statistical data length is written to its current data length entry. If it is detected that its current starting offset address entry has been written to the starting offset address and its current data length entry has been written to the data length, then the starting offset address in its current starting offset address entry is migrated to its historical starting offset address entry, the data length in its current data length entry is migrated to its historical data length entry, and then the determined starting offset address is written to its current starting offset address entry, and the statistical data length is written to its current data length entry.

[0012] Among some possible implementations of the first aspect, the method also includes: Receive the target logical time point from which you need to view the timing data; Based on the target logical time point, locate the corresponding index slot in the index area, and read the starting offset address and data length from the located index slot; In the timing data area, starting from the starting offset address, read the data corresponding to the data length to obtain the timing data that needs to be viewed.

[0013] Among some possible implementations of the first aspect, the method also includes: Receive the target logical time point from which you need to view the timing data; Based on the target logical time point, locate the corresponding index slot in the index area, and read the starting offset address and data length from the located index slot; If a compression algorithm identifier exists in the metadata, then in the time series data area, starting from the starting offset address, data corresponding to the data length is read to obtain the compressed time series data. Then, the decompression algorithm that matches the compression algorithm corresponding to the compression algorithm identifier is called to decompress the compressed time series data to obtain the time series data that needs to be viewed.

[0014] Among some possible implementations of the first aspect, the method also includes: Receive the target logical time point from which you need to view the timing data; Based on the target logical time point, locate the corresponding index slot in the index area, and read the starting offset address and data length from the located index slot; If the metadata contains an encryption algorithm identifier, then in the time-series data area, starting from the starting offset address, the data corresponding to the data length is read to obtain the encrypted time-series data. Then, the decryption algorithm that matches the encryption algorithm corresponding to the encryption algorithm identifier is called to decrypt the encrypted time-series data to obtain the time-series data that needs to be viewed.

[0015] Among some possible implementations of the first aspect, the method also includes: Receives a specified logical time point for which historical time-series data needs to be traced; Based on the specified logical time point, locate the corresponding index slot in the index area, and read the current starting offset address, current data length, historical starting offset address, and historical data length from the current starting offset address entry, current data length entry, historical starting offset address entry, and historical data length entry in the located index slot respectively; In the timing data area, starting from the current starting offset address, read the data corresponding to the current data length to obtain the current timing data at the specified logical time point; In the time-series data area, starting from the historical starting offset address, data corresponding to the length of historical data is read to obtain the historical time-series data at the specified logical time point.

[0016] Among some possible implementations of the first aspect, the method also includes: Traverse each index slot in the index area and count the index slots that do not have a starting offset address and data length; Based on the statistical results, a list of empty index slots is generated, and the logical time points where time-series data is missing are determined accordingly.

[0017] Secondly, embodiments of this disclosure provide a time-series data storage device based on partitioned time-series data files, the device comprising: The build module is used to construct partitioned time-series data files; The partitioned time-series data file includes a metadata area, an index area, and a time-series data area; The metadata area is located at the beginning of the partition time-series data file and has a preset first fixed length. It stores metadata that describes the global attributes of the partition time-series data file. The index area is located after the metadata area and has a preset second fixed length. It is pre-divided into N consecutive index slots of equal length, where N is the total number of multiple logical time points determined based on the time range and time period of the time series data acquisition corresponding to the partition time series data file. Each index slot corresponds to one logical time point. The time-series data area is located after the index area and is used to store time-series data; The parsing module is used to receive the time-series data to be stored, parse it, and determine its corresponding logical time point; The storage module is used to determine the current end offset address of the timing data area as the start offset address of the timing data, append the timing data to the timing data area for storage starting from the start offset address, and count the data length occupied by the timing data in the timing data area. The write module is used to locate the corresponding index slot from the index area according to the logical time point corresponding to the time series data, and write the determined starting offset address and the statistical data length into the located index slot.

[0018] Thirdly, embodiments of this disclosure provide an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; the memory storing instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described above.

[0019] Fourthly, embodiments of this disclosure provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the methods described above.

[0020] In summary, the embodiments of this disclosure, by constructing a partitioned time-series data file including a metadata area, an index area, and a time-series data area, and by adopting a mechanism of dynamic appending of time-series data and precise recording of offsets and lengths in index slots, fundamentally solve the technical problems in existing pre-occupied fixed-length row storage schemes, such as severe waste of storage resources due to the fixed maximum space reserved for each row, insufficient support for writing out-of-order time-series data, and lack of self-description capabilities of time-series data files. This achieves efficient utilization of storage space, reliable writing of out-of-order time-series data, and self-interpretability of files as independent storage units, significantly improving the overall performance and availability of time-series data in persistent storage, offline transmission, and analysis and processing scenarios.

[0021] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of this disclosure, nor is it intended to restrict the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0022] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. The drawings are provided for a better understanding of the invention and are not intended to limit the scope of this disclosure. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein: Figure 1 A flowchart illustrating a time-series data storage method based on partitioned time-series data files provided in an embodiment of this disclosure is shown. Figure 2 This diagram illustrates a structural diagram of a time-series data storage device based on partitioned time-series data files, according to an embodiment of this disclosure. Figure 3 A structural diagram of an exemplary electronic device capable of implementing embodiments of the present disclosure is shown. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0024] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0025] To address the technical problems encountered in the background art, this disclosure provides a time-series data storage method based on partitioned time-series data files. By constructing a partitioned time-series data file including a metadata area, an index area, and a time-series data area, and employing a mechanism of dynamic appending of time-series data and precise recording of offsets and lengths in index slots, this method fundamentally solves the technical problems in existing pre-occupied fixed-length row storage schemes, such as severe waste of storage resources due to the fixed maximum space reserved for each row, insufficient support for writing out-of-order time-series data, and the lack of self-description capabilities of time-series data files. This method achieves efficient utilization of storage space, reliable writing of out-of-order time-series data, and the self-interpretability of files as independent storage units, significantly improving the overall performance and availability of time-series data in persistent storage, offline transmission, and analysis and processing scenarios.

[0026] The following detailed description, with reference to the accompanying drawings and specific embodiments, illustrates a time-series data storage method based on partitioned time-series data files provided in this disclosure.

[0027] Figure 1 A flowchart illustrating a time-series data storage method based on partitioned time-series data files provided in this disclosure is shown, as follows: Figure 1 As shown, method 100 may include the following steps: S110, construct partitioned time-series data files.

[0028] In some embodiments, a partitioned time-series data file can be constructed at the start of a time-series data storage task. The time-series data storage task can be a storage task for any type of time-series data, such as IoT sensor data, automatic weather station observation data, telemetry and remote sensing data, or financial transaction data; there are no restrictions on this. The partitioned time-series data file physically comprises a metadata area, an index area, and a time-series data area in sequence.

[0029] Specifically, the metadata area is located at the beginning of the partition time-series data file and has a preset first fixed length. This first fixed length is set by the user based on the actual amount of metadata information the metadata area needs to carry. For example, the first fixed length can be 128 bytes, 256 bytes, or 512 bytes, and there is no limitation here. The metadata area stores metadata describing the global attributes of the partition time-series data file. This metadata can be any combination of the following information, including but not limited to: device type, device number, data type, file version, file creation timestamp, total number of logical time points, index slot length, compression algorithm identifier, and encryption algorithm identifier. Among them, device type and device number represent the type and number of the data acquisition device; file version and file creation timestamp represent the version and creation time of the partition time-series data file, respectively; the total number of logical time points is the total number of multiple logical time points determined based on the time-series data acquisition time range and time-series data acquisition cycle corresponding to the partition time-series data file. Assuming a data acquisition device acquires data and generates one time-series data point per minute, the partition time-series data file stores the time-series data generated by this data acquisition device within a day. In this case, the time-series data acquisition time range corresponding to this partition time-series data file is one day. The data acquisition cycle is every minute. Based on this time-series data acquisition time range and cycle, multiple logical time points can be determined, namely logical time point 1 (minute 1), logical time point 2 (minute 2), logical time point 3 (minute 3), ..., logical time point 1440 (minute 1440), totaling 1440. The index slot length is the length of each index slot in the index area. The compression algorithm identifier is used to identify whether the time-series data is compressed and the compression algorithm used. The encryption algorithm identifier is used to identify whether the time-series data is encrypted and the encryption algorithm used. In this way, by centrally setting this structured metadata area at the beginning of the partition time-series data file, the viewer can quickly obtain the global attributes necessary to parse the entire content of the partition time-series data file at once, without relying on any external configuration files.

[0030] The index area follows the metadata area and has a preset second fixed length. It is pre-divided into N consecutive index slots of equal length. The second fixed length is determined by the total number of index slots and the length of each index slot. The total number of index slots N is the same as the total number of logical time points. Each index slot corresponds to a logical time point and stores the starting offset address and data length of the corresponding time-series data in the time-series data area. Its initial value is empty (i.e., 0 or null). The N index slots are arranged closely adjacent to each other according to the chronological order of the logical time points, forming a continuous index slot array structure with a fixed physical location in the partitioned time-series data file. It is worth noting that the length of each index slot must ensure that it can fully accommodate the starting offset address and data length of at least one piece of time-series data. In one example, if the starting offset address and data length of the time-series data are both represented by 4 bytes, then the length of one index slot can be set to 8 bytes. Correspondingly, when N=1440, the total length of the entire index area is 1440 × 8 = 11520 bytes. When historical version tracing functionality for time-series data is required, each index slot can be further expanded to accommodate the historical starting offset address and historical data length. In this case, the length of a single index slot can be expanded to 16 bytes, and the total length of the index area increases proportionally. Since the size of the entire index area is a fixed value pre-calculated based on N and the index slot length, it occupies a physical area in the partitioned time-series data file with a completely defined location and size. This means that for the i-th logical time point, the starting offset address of its corresponding index slot in the partitioned time-series data file can be calculated using the following formula: Index area starting offset address + (i-1) × index slot length. In this way, the viewer can directly and precisely view the data storage status of any logical time point without touching any content in the time-series data area.

[0031] The time-series data area follows the index area and extends to the end of the partitioned time-series data file. Its fundamental difference from the previous two fixed areas lies in the fact that it has no pre-allocated fixed length constraints, employing a completely dynamic, append-only data organization strategy. Logically, it resembles a sequentially written log area that only allows appending to the end, used to store all actually arriving time-series data. When a new piece of time-series data needs to be written to the partitioned time-series data file, regardless of its corresponding logical time point, its actual content is always directly appended to the end of the current time-series data area. After recording, the end pointer of the partitioned time-series data file moves forward. Therefore, the physical arrangement order of time-series data in the time-series data area reflects the time order in which the time-series data arrives and is written to the time-series data area, not the logical time point order corresponding to the time-series data itself. The mapping relationship between logical time points and physical storage locations is maintained entirely and uniquely by the two key values ​​recorded in the corresponding index slot in the index area: the starting offset address and the data length. This design, which completely decouples the orderliness of the logical layer from the disorderliness of the physical layer, is the core of what gives this time-series data storage method its high flexibility and excellent space efficiency.

[0032] S120 receives the timing data to be stored, parses it, and determines its corresponding logical time point.

[0033] In some embodiments, time-series data to be stored can be received in real time from a data acquisition device. This time-series data carries not only specific measurement values ​​but also a timestamp indicating its generation time. The time-series data is then parsed, the timestamp is extracted, and based on the start time of the time-series data acquisition time range corresponding to the partitioned time-series data file and the time-series data acquisition cycle, the extracted timestamp is mapped to a logical time point. The mapping rule can be: Logical Time Point = Floor((Timestamp - Start Time) / Acquisition Cycle) + 1. Through this explicit mapping rule, time-series data generated at any given time can be uniquely mapped to a specific index slot in the index area with sequence numbers from 1 to N.

[0034] S130: Determine the current end offset address of the timing data area as the starting offset address of the timing data, append the timing data to the timing data area for storage starting from the starting offset address, and calculate the data length occupied by the timing data in the timing data area.

[0035] In some embodiments, the current end offset address of the time-series data area is determined as the starting offset address corresponding to the time-series data. If there is no compression algorithm identifier or encryption algorithm identifier in the metadata, the time-series data is appended to the time-series data area for storage starting from the starting offset address, and the data length occupied by the time-series data in the time-series data area is calculated. In this way, by using a compact appending variable-length storage method, the storage gaps caused by placeholders in the existing pre-placed fixed-length row storage scheme are completely eliminated, significantly improving the storage space utilization.

[0036] In other embodiments, the current end offset address of the time-series data area is determined as the starting offset address of the corresponding time-series data. If a compression algorithm identifier exists in the metadata, the compression algorithm corresponding to the compression algorithm identifier is called to compress the time-series data. Starting from the starting offset address, the compressed time-series data is appended to the time-series data area for storage, and the data length occupied by the compressed time-series data in the time-series data area is calculated. In this way, by compressing and storing the time-series data, the disk occupation of the time-series data area is significantly reduced, further reducing storage space overhead and network transmission bandwidth consumption, which is especially suitable for scenarios with high redundancy of time-series data.

[0037] In some embodiments, the current end offset address of the time-series data area is determined as the starting offset address of the corresponding time-series data. If an encryption algorithm identifier exists in the metadata, the encryption algorithm corresponding to the encryption algorithm identifier is called to encrypt the time-series data. Starting from the starting offset address, the encrypted time-series data is appended to the time-series data area for storage, and the length of the encrypted time-series data occupied in the time-series data area is calculated. In this way, by encrypting the storage of time-series data, the confidentiality of time-series data in disk storage and network exchange is ensured, preventing leakage of time-series data due to disk theft or eavesdropping on the transmission link.

[0038] S140: Locate the corresponding index slot from the index area according to the logical time point corresponding to the time series data, and write the determined starting offset address and the statistical data length into the located index slot.

[0039] In some embodiments, the index slot address can be calculated using the index slot address formula in S110 based on the logical time point corresponding to the time series data, and then the corresponding index slot can be located using this formula. The determined starting offset address and the statistical data length can be written into the located index slot.

[0040] Furthermore, each index slot in the index area can include two index entries: a starting offset address entry and a data length entry.

[0041] Based on this, the determined starting offset address can be written into the starting offset address entry in the positioning index slot, and the statistical data length can be written into the data length entry in the positioning index slot.

[0042] In summary, the embodiments disclosed herein achieve at least the following technical effects compared to the prior art: In terms of storage efficiency, partitioned time-series data files abandon the model of pre-occupying fixed row space according to the maximum length. Each variable-length time-series data is only appended to the end of the time-series data area according to its actual length, without filling in any placeholders. The proportion of effective data is greatly increased, and the file size is significantly compressed, thereby greatly reducing the waste of storage resources and alleviating the burden of network transmission and offline backup.

[0043] Regarding out-of-order write support, the partitioned time-series data file pre-divides the index area into N fixed-length index slots, each corresponding to a logical time point. When any time-series data arrives, regardless of its order, the logical time point is parsed and the data is actually written to the time-series data area. Subsequently, only the starting offset address of the data and the statistically obtained data length need to be accurately filled into the corresponding index slot to complete the index mapping. This design breaks the limitation that data must arrive in sequence. Even if data at a certain logical time point arrives late due to network latency or device failure, its index information can be flexibly and accurately recorded in the correct slot, ensuring reliable storage and efficient retrieval of out-of-order data.

[0044] In terms of self-description capability, the partitioned time-series data file reserves a preset first fixed-length metadata area at the beginning position, which centrally stores metadata describing the global attributes of the file, so that the file itself constitutes an independent storage unit including the parsing basis. It can be fully interpreted without the need for external configuration files, which significantly enhances the portability, self-interpretation and seamless transfer capability of the file, and provides a solid guarantee for the long-term archiving and sharing of time-series data.

[0045] In some embodiments, when it is necessary to update time series data, method 100 further includes: Receive the latest time series data corresponding to the logical time point that needs to be updated, parse it, and determine the corresponding logical time point.

[0046] The current end offset address of the timing data area is determined as the starting offset address of the latest timing data. Starting from the starting offset address, the latest timing data is appended to the timing data area for storage, and the data length occupied by the latest timing data in the timing data area is calculated.

[0047] Based on the logical time point corresponding to the latest time series data, locate the corresponding index slot in the index area, and write the determined starting offset address and the statistical data length into the located index slot.

[0048] It is worth noting that the specific details of the above-mentioned time-series data update steps are similar to those of S120-S140, and will not be repeated here. By appending new time-series data to the end of the time-series data area and updating the index slot data, it avoids the dilemma in the existing pre-occupied fixed-length row storage scheme that cannot be overwritten in place due to the length of time-series data, and achieves lossless update of time-series data.

[0049] In some embodiments, when it is necessary to support the tracing of historical time-series data, each index slot in the index area may include four index entries, namely the current starting offset address entry, the current data length entry, the historical starting offset address entry, and the historical data length entry.

[0050] Based on this, the step of writing the determined starting offset address and the statistical data length into the positioning index slot in S140 above includes: For the index slot being located, its current starting offset address entry and its current data length entry are checked; If it is detected that its current starting offset address entry has not been written to the starting offset address and its current data length entry has not been written to the data length, then the determined starting offset address is written to its current starting offset address entry, and the statistical data length is written to its current data length entry. If it is detected that its current starting offset address entry has been written to the starting offset address and its current data length entry has been written to the data length, then the starting offset address in its current starting offset address entry is migrated to its historical starting offset address entry, the data length in its current data length entry is migrated to its historical data length entry, and then the determined starting offset address is written to its current starting offset address entry, and the statistical data length is written to its current data length entry.

[0051] It is worth noting that, through the above operations, the index slot always maintains a current pointer (current starting offset address and current data length) pointing to the latest version of the time-series data and a historical pointer (historical starting offset address and historical data length) pointing to the immediately preceding version of the time-series data. For complex scenarios that require tracing earlier historical versions of time-series data, the index slot structure can be further expanded to accommodate a linked list of historical pointers or a fixed number of historical entries. This explanation uses the retention of the most recent historical version as an example. Based on this structure, older versions of time-series data still occupy the physical space they were initially written to in the time-series data area. This method does not immediately reclaim the space occupied by this discarded data in the real-time write path, but instead leaves it in its original location. This log-like storage system design not only avoids the introduction of complex real-time space reclamation mechanisms and accompanying random write operations, ensuring the continuous efficiency of the write path, but also provides tamper-proof original physical evidence for advanced analysis functions such as data auditing, error tracking, and version comparison. If space reclamation is indeed necessary, a separate offline compression and reorganization process can be run during periods of low system load to scan and rewrite the entire data area, removing discarded version time-series data.

[0052] In some embodiments, when it is necessary to view time series data, method 100 further includes: Receive the target logical time point from which you need to view the timing data.

[0053] Based on the target logical time point, locate the corresponding index slot in the index area, and read the starting offset address and data length from the located index slot. For example, read the starting offset address and data length from the starting offset address entry and data length entry in the located index slot, respectively.

[0054] In the timing data area, starting from the starting offset address, data corresponding to the data length is read to obtain the timing data to be viewed. Further, the above process can be expanded as follows: If the compression algorithm identifier and encryption algorithm identifier are not present in the metadata, then in the time-series data area, starting from the starting offset address, data corresponding to the data length is read to obtain the time-series data to be viewed. In this way, the target data can be obtained with only one index location and one interval data read, without traversing or parsing irrelevant records. The retrieval time complexity is always O(1), which significantly improves the query response speed in scenarios with massive time-series data.

[0055] If a compression algorithm identifier exists in the metadata, then in the time-series data area, starting from the starting offset address, data corresponding to the data length is read to obtain the compressed time-series data. Then, the decompression algorithm matching the compression algorithm identifier is called to decompress the compressed time-series data, obtaining the time-series data to be viewed. In this way, the presence of a compression algorithm identifier in the metadata area automatically determines whether decompression is needed and calls the corresponding decompression algorithm for inverse transformation processing. This completely encapsulates the complex data restoration process at the underlying level, eliminating the need for upper-layer business logic to concern itself with the actual storage format of the data on disk, significantly reducing the complexity of application development.

[0056] If an encryption algorithm identifier exists in the metadata, then in the time-series data area, starting from the starting offset address, data corresponding to the data length is read to obtain the encrypted time-series data. Then, the decryption algorithm matching the encryption algorithm corresponding to the encryption algorithm identifier is called to decrypt the encrypted time-series data, obtaining the time-series data to be viewed. In this way, the presence of an encryption algorithm identifier in the metadata area automatically determines whether decryption is needed and calls the corresponding decryption algorithm for inverse transformation processing. This completely encapsulates the complex data restoration process at the underlying level, eliminating the need for upper-layer business logic to concern itself with the actual storage format of the data on disk, significantly reducing the complexity of application development.

[0057] In some embodiments, when historical time-series data tracing is required, method 100 further includes: Receives a specified logical time point for which historical time-series data needs to be traced.

[0058] Based on the specified logical time point, locate the corresponding index slot in the index area, and read the current starting offset address, current data length, historical starting offset address, and historical data length from the current starting offset address entry, current data length entry, historical starting offset address entry, and historical data length entry in the located index slot, respectively.

[0059] In the timing data area, starting from the current starting offset address, read the data corresponding to the current data length to obtain the current timing data at the specified logical time point.

[0060] In the time-series data area, starting from the historical starting offset address, data corresponding to the length of historical data is read to obtain the historical time-series data at the specified logical time point.

[0061] It is worth noting that through the aforementioned historical time-series data tracing steps, only one index slot location is needed to simultaneously obtain two sets of pointers for both the current and historical time-series data. This eliminates the need for additional traversal of the data area or maintenance of an external version chain, significantly reducing the I / O overhead of historical time-series data tracing. Furthermore, the historical pointers of the historical time-series data and the current pointer of the current time-series data share the same index slot, allowing for the reuse of identical index location logic between historical and latest time-series data queries, simplifying the software architecture of the data access layer. In addition, older versions of time-series data remain unchanged within the time-series data area; version archiving is achieved solely through pointer migration, inherently possessing tamper-proof and auditable characteristics, providing a reliable basis for handling data quality disputes and tracing fault origins.

[0062] In some embodiments, when time-series data missing detection is required, method 100 further includes: Traverse each index slot in the index area and count the index slots that do not have a starting offset address and a data length. For example, if there are 2 index entries in an index slot, count the index slots where the starting offset address entry and the data length entry are empty; if there are 4 index entries in an index slot, count the index slots where the current starting offset address entry and the current data length entry are empty.

[0063] Based on the statistical results, a list of empty index slots is generated, and the logical time points where time-series data is missing are determined accordingly.

[0064] It is worth noting that the aforementioned time-series data missing detection steps can precisely narrow the detection scope from the entire massive time-series data area to a fixed-length index area occupying only a tiny amount of storage space. This completely avoids the large amount of random I / O overhead introduced by parsing the time-series data area. This mechanism fundamentally solves the performance bottleneck caused by existing pre-placed fixed-length row storage schemes having to traverse every single time-series data entry to confirm the existence of time-series data at a specific logical time point, significantly improving the response speed of integrity verification in time-series data operation and maintenance management.

[0065] To facilitate further understanding, the method 100 provided in this disclosure will be described in detail below with reference to a specific embodiment, as shown in the following figure: Scenario Setting: An automatic weather station, WS-MTN-01, is deployed in a high-altitude area. As configured, the station collects a set of observational data (i.e., time-series data) every minute, including multiple factors such as temperature, humidity, wind speed and direction, air pressure, and rainfall, and reports this data to a data aggregation gateway at the foot of the mountain via narrowband satellite or 4G network. One of the responsibilities of the data aggregation gateway is to create a partitioned time-series data file daily to store all 1440 sets of observational data from 00:00:00 to 24:00:00. During off-peak network hours each day, the gateway will transmit this partitioned time-series data file as a whole to a remote central data server. To conserve extremely valuable satellite bandwidth and storage space, the data aggregation gateway enables data compression. To streamline the design and maximize viewing efficiency, the index slots in this example include a starting offset address entry and a data length entry, both set to 8 bytes, with each index entry occupying 4 bytes.

[0066] Example task: The date is May 10, 2026. The data aggregation gateway starts the time-series data storage task for the day at 00:00:00 on that day, and begins executing method 100.

[0067] (1) Constructing the partitioned time-series data file: The data aggregation gateway generates a partitioned time-series data file named "WS-MTN-01_20260510.dat" on the local disk through the file creation interface. The configuration is as follows: the metadata area size is set to 1024 bytes; the index slot length is set to 8 bytes, and the starting offset address entry and data length entry each occupy 4 bytes; the metadata is set as: "Device type = Automatic weather station", "Device number = WS-MTN-01", "Data type = Minute observation", "Total number of logical time points = 1440", "Index slot length = 8 bytes", "Compression algorithm identifier = LZ4". Subsequently, based on the above content, a metadata area with a total size of 1024 bytes, an index area with a total size of 1440 × 8 = 11520 bytes, 1440 index slots and index entries initialized to empty, and a time-series data area with an empty status are written.

[0068] (2) Receiving and storing time-series data: At 00:00:12 AM, the data aggregation gateway first received an observation data with a timestamp of "00:00" sent by the automatic weather station, and obtained logical time point 1 after parsing. The original data length is 300 bytes. Since the compression algorithm identifier of the metadata area declares LZ4 compression, the data aggregation gateway first compresses the 300 bytes of observation data into 85 bytes of compressed data. The current end offset address of the time-series data area is the length of the metadata area plus the length of the index area, that is, 1024 + 11520 = 12544. The data aggregation gateway uses this address as the starting offset address, appends 85 bytes of compressed data to the time-series data area for storage, and the new end offset address changes to 12544 + 85 = 12629. Subsequently, the data aggregation gateway locates the first index slot with a starting offset address of 1024 + (1-1) × 8 = 1024. Since this is the first time writing to this index slot, the data aggregation gateway directly writes the starting offset address 12544 and the data length 85 into the starting offset address entry and the data length entry of this index slot, respectively.

[0069] At 00:02:15, the data aggregation gateway received another observation data point with a timestamp of "00:02" from the automatic weather station, which, after parsing, yielded logical time point 3. This observation data, after compression, was 92 bytes long. The current end offset address of the time-series data area was 12629. The data aggregation gateway used this address as the starting offset address and appended the 92 bytes of compressed data to the time-series data area for storage, changing the new end offset address to 12629 + 92 = 12721. Subsequently, the data aggregation gateway located the 3rd index slot with a starting offset address of 1024 + (3-1) × 8 = 1040. Since this was the first time writing to this index slot, the data aggregation gateway directly wrote the starting offset address 12629 and the data length 92 into the starting offset address entry and data length entry of this index slot, respectively.

[0070] At 00:02:30, the data aggregation gateway received another observation data point with a timestamp of "00:01" from the automatic weather station, which, after parsing, yielded logical time point 2. This observation data, after compression, was 88 bytes long. The current end offset address of the time-series data area was 12721. The data aggregation gateway used this address as the starting offset address and appended the 88 bytes of compressed data to the time-series data area for storage, changing the new end offset address to 12721 + 88 = 12809. Subsequently, the data aggregation gateway located the second index slot with a starting offset address of 1024 + (2-1) × 8 = 1032. Since this was the first time writing to this index slot, the data aggregation gateway directly wrote the starting offset address 12721 and the data length 88 into the starting offset address entry and data length entry of this index slot, respectively.

[0071] The process of continuously receiving and storing data will not be elaborated upon here.

[0072] (3) Data Update: At 00:02:40, the automatic weather station detected a systematic deviation in the humidity sensor reading at 00:00 during self-check. Subsequently, it automatically generated and sent a corrected observation data with the same timestamp "00:00" to the data aggregation gateway. The data aggregation gateway parsed the data to obtain logical time point 1. The corrected observation data was compressed to a length of 88 bytes. The current end offset address of the time series data area is 12809. The data aggregation gateway used this address as the starting offset address and appended the 88 bytes of compressed data to the time series data area for storage. The new end offset address changed to 12809+88=12897. Then, the data aggregation gateway located the first index slot with a starting offset address of 1024+(1-1)×8=1024 and overwrote the starting offset address entry and data length entry written to this index slot with the starting offset address 12809 and the data length 88, respectively. After this operation is completed, the starting offset address and data length in the first index slot will point to the new data at the end of the timing data area, and the old data at address 12544 will be regarded as discarded data.

[0073] (4) Central Data Server Viewing and Integrity Verification: At 15:00, the central server maintenance personnel connected to the data aggregation gateway through the data management interface to remotely inspect the storage status of the day's observation data. After calling the missing data detection function, the data aggregation gateway traversed all 1440 index slots (a total of 11520 bytes), counted the index slots with empty start offset address entries and data length entries, and finally found that only a small number of index slots had empty start offset address entries and data length entries, such as the 700th index slot (corresponding to logical time point 700, i.e., 11:39). Then, based on the statistical results, a list of empty index slots was generated, and the logical time point of missing time series data was determined based on this, for example, "Before 15:00, WS-MTN-01 should have received 900 observation data today, actually received 897, missing 3, missing logical time point: 700 (11:39), ...", and then displayed to the maintenance personnel. The entire scanning process only read 11520 bytes of data and was completed instantly. To further view the latest corrected value at 00:00, the operations and maintenance personnel selected logical time point 1 to initiate the view. The data aggregation gateway reads the first index slot, obtaining the starting offset address 12809 and data length 88. It then reads 88 bytes of LZ4 compressed data from address 12809, decompresses it using the corresponding decompression algorithm, and displays it to the operations and maintenance personnel. If comparing older time-series data is required, this example needs to enable the historical time-series data tracing function; the specific implementation can be found in the above description and will not be repeated here.

[0074] This specific meteorological observation application example clearly demonstrates that the method 100 provided in this disclosure, with its unique three-part file structure of "metadata area - index area - time-series data area," flexible and efficient mapping mechanism of "fixed slot logical mapping and variable-length append-only physical storage," and built-in comprehensive expansion capabilities such as compression, encryption, updating, and rapid integrity detection, offers a system-level technical solution for the reliable storage and high-performance management of fixed-period time-series data. This solution boasts extremely high space utilization, excellent retrieval efficiency, complete data security, and comprehensive business adaptability. It can be seamlessly applied to any industry software and platform system with regular time-series data generation and storage needs, such as water conservancy and hydrological telemetry, smart grid data acquisition, industrial production line sensor monitoring, financial market data recording, and vehicle network trajectory recording, demonstrating extremely broad industrial application prospects and practical value.

[0075] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this disclosure is not limited to the described order of actions, because according to this disclosure, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this disclosure.

[0076] The above is an introduction to the method embodiments. The following describes the solution described in this disclosure further through device embodiments.

[0077] Figure 2 This illustration shows a structural diagram of a time-series data storage device based on partitioned time-series data files, as provided in an embodiment of this disclosure. Figure 2 As shown, the device 200 may include: Module 210 is used to build partitioned time-series data files.

[0078] The partitioned time-series data file includes a metadata area, an index area, and a time-series data area.

[0079] The metadata area is located at the beginning of the partition time-series data file and has a preset first fixed length. It stores metadata that describes the global attributes of the partition time-series data file.

[0080] The index area is located after the metadata area and has a preset second fixed length. It is pre-divided into N consecutive index slots of equal length, where N is the total number of multiple logical time points determined based on the time range and time period of the time series data acquisition corresponding to the partition time series data file. Each index slot corresponds to one logical time point.

[0081] The time-series data area is located after the index area and is used to store time-series data.

[0082] The parsing module 220 is used to receive the time-series data to be stored, parse it, and determine its corresponding logical time point.

[0083] The storage module 230 is used to determine the current end offset address of the timing data area as the starting offset address of the timing data, append the timing data to the timing data area for storage starting from the starting offset address, and count the data length occupied by the timing data in the timing data area.

[0084] The writing module 240 is used to locate the corresponding index slot from the index area according to the logical time point corresponding to the time series data, and write the determined starting offset address and the statistical data length into the located index slot.

[0085] Understandable Figure 2 Each module / unit in the illustrated device 200 has the ability to implement Figure 1 The functions of each step in method 100 shown, and their corresponding technical effects, will not be elaborated here for the sake of brevity.

[0086] Figure 3 A structural diagram of an exemplary electronic device capable of implementing embodiments of the present disclosure is shown. Electronic device 300 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic device 300 may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0087] like Figure 3 As shown, the electronic device 300 may include a computing unit 301, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 302 or a computer program loaded from a storage unit 308 into a random access memory (RAM) 303. The RAM 303 may also store various programs and data required for the operation of the electronic device 300. The computing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0088] Multiple components in electronic device 300 are connected to I / O interface 305, including: input unit 306, such as keyboard, mouse, etc.; output unit 307, such as various types of displays, speakers, etc.; storage unit 308, such as disk, optical disk, etc.; and communication unit 309, such as network card, modem, wireless transceiver, etc. Communication unit 309 allows electronic device 300 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0089] The computing unit 301 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 301 performs the various methods and processes described above, such as method 100. For example, in some embodiments, method 100 may be implemented as a computer program product, including a computer program tangibly contained in a computer-readable medium, such as storage unit 308. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 300 via ROM 302 and / or communication unit 309. When the computer program is loaded into RAM 303 and executed by the computing unit 301, one or more steps of method 100 described above may be performed. Alternatively, in other embodiments, the computing unit 301 may be configured to perform method 100 by any other suitable means (e.g., by means of firmware).

[0090] The various embodiments described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), payload programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0091] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0092] In the context of this disclosure, a computer-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of computer-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0093] It should be noted that this disclosure also provides a non-transitory computer-readable storage medium storing computer instructions. These computer instructions are used to cause a computer to execute method 100 and achieve the corresponding technical effects achieved by executing the method in the embodiments of this disclosure; for the sake of brevity, they will not be elaborated further here.

[0094] In addition, this disclosure also provides a computer program product including a computer program that implements method 100 when executed by a processor.

[0095] To provide interaction with a user, the embodiments described above can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0096] The embodiments described above can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with the implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0097] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0098] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired results of this disclosure are achieved, and this is not limited herein.

[0099] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for storing time-series data based on partitioned time-series data files, characterized in that, The method includes: Construct partitioned time-series data files; The partitioned time-series data file includes a metadata area, an index area, and a time-series data area; The metadata area is located at the beginning of the partition time-series data file and has a preset first fixed length, wherein metadata describing the global attributes of the partition time-series data file is stored. The index area is located after the metadata area and has a preset second fixed length. It is pre-divided into N consecutive index slots of equal length, where N is the total number of multiple logical time points determined based on the time range and time period of the time series data acquisition corresponding to the partition time series data file. Each index slot corresponds to one logical time point. The time-series data area is located after the index area and is used to store time-series data; Receive the time-series data to be stored, parse it, and determine its corresponding logical time point; The current end offset address of the timing data area is determined as the starting offset address of the timing data. Starting from the starting offset address, the timing data is appended to the timing data area for storage, and the data length occupied by the timing data in the timing data area is counted. Based on the logical time point corresponding to the time series data, the corresponding index slot is located from the index area, and the determined starting offset address and the statistical data length are written into the located index slot.

2. The method according to claim 1, characterized in that, Starting from the starting offset address, the timing data is appended to the timing data area for storage, and the length of the timing data occupied in the timing data area is calculated, including: If a compression algorithm identifier exists in the metadata, the compression algorithm corresponding to the compression algorithm identifier is called to compress the time series data. Starting from the starting offset address, the compressed time series data is appended to the time series data area for storage, and the data length occupied by the compressed time series data in the time series data area is calculated.

3. The method according to claim 1, characterized in that, Starting from the starting offset address, the timing data is appended to the timing data area for storage, and the length of the timing data occupied in the timing data area is calculated, including: If the metadata contains an encryption algorithm identifier, the encryption algorithm corresponding to the encryption algorithm identifier is called to encrypt the time series data. Starting from the starting offset address, the encrypted time series data is appended to the time series data area for storage, and the data length occupied by the encrypted time series data in the time series data area is counted.

4. The method according to claim 1, characterized in that, The method further includes: Receive the latest time series data corresponding to the logical time point that needs to be updated, parse it, and determine the corresponding logical time point; The current end offset address of the time series data area is determined as the starting offset address corresponding to the latest time series data. Starting from the starting offset address, the latest time series data is appended to the time series data area for storage, and the data length occupied by the latest time series data in the time series data area is counted. Based on the logical time point corresponding to the latest time series data, the corresponding index slot is located from the index area, and the determined starting offset address and the statistical data length are written into the located index slot.

5. The method according to claim 1, characterized in that, Each index slot includes four index entries: the current starting offset address entry, the current data length entry, the historical starting offset address entry, and the historical data length entry. The step of writing the determined starting offset address and the statistical data length into the positioning index slot includes: For the index slot being located, its current starting offset address entry and current data length entry are checked; If it is detected that the current starting offset address entry has not been written to the starting offset address and the current data length entry has not been written to the data length, then the determined starting offset address is written to the current starting offset address entry and the calculated data length is written to the current data length entry. If it is detected that the current starting offset address entry has been written to the starting offset address and the current data length entry has been written to the data length, then the starting offset address in the current starting offset address entry is migrated to the historical starting offset address entry, and the data length in the current data length entry is migrated to the historical data length entry. Then, the determined starting offset address is written to the current starting offset address entry, and the statistical data length is written to the current data length entry.

6. The method according to claim 1, characterized in that, The method further includes: Receive the target logical time point from which you need to view the timing data; Based on the target logical time point, locate the corresponding index slot in the index area, and read the starting offset address and data length from the located index slot; In the timing data area, starting from the starting offset address, data corresponding to the data length is read to obtain the timing data to be viewed.

7. The method according to claim 2, characterized in that, The method further includes: Receive the target logical time point from which you need to view the timing data; Based on the target logical time point, locate the corresponding index slot in the index area, and read the starting offset address and data length from the located index slot; If the metadata contains a compression algorithm identifier, then in the time series data area, starting from the starting offset address, data corresponding to the data length is read to obtain the compressed time series data. Then, the decompression algorithm that matches the compression algorithm corresponding to the compression algorithm identifier is called to decompress the compressed time series data to obtain the time series data that needs to be viewed.

8. The method according to claim 3, characterized in that, The method further includes: Receive the target logical time point from which you need to view the timing data; Based on the target logical time point, locate the corresponding index slot in the index area, and read the starting offset address and data length from the located index slot; If the metadata contains an encryption algorithm identifier, then in the time-series data area, starting from the starting offset address, data corresponding to the data length is read to obtain the encrypted time-series data. Then, the decryption algorithm that matches the encryption algorithm corresponding to the encryption algorithm identifier is called to decrypt the encrypted time-series data to obtain the time-series data that needs to be viewed.

9. The method according to claim 5, characterized in that, The method further includes: Receives a specified logical time point for which historical time-series data needs to be traced; Based on the specified logical time point, locate the corresponding index slot in the index area, and read the current starting offset address, current data length, historical starting offset address, and historical data length from the current starting offset address entry, current data length entry, historical starting offset address entry, and historical data length entry in the located index slot, respectively. In the time-series data area, starting from the current starting offset address, data corresponding to the current data length is read to obtain the current time-series data at the specified logical time point; In the time-series data area, starting from the historical starting offset address, data corresponding to the length of historical data is read to obtain the historical time-series data at the specified logical time point.

10. The method according to claim 1, characterized in that, The method further includes: Traverse each index slot in the index area and count the index slots that do not have a starting offset address and data length; Based on the statistical results, a list of empty index slots is generated, and the logical time points where time-series data is missing are determined accordingly.