A method, apparatus, device, and medium for querying change points in time-series data.

By obtaining statistical information from data blocks to identify change points, and only loading data blocks for detailed queries when inconsistencies occur, the problem of wasted disk bandwidth and CPU resources in existing technologies is solved, and efficient change point querying is achieved.

CN123115243APending Publication Date: 2026-11-17TIANMOU TECH (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611354367.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2026-07-13
Filing Date
2026-09-02
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing technologies consume excessive disk bandwidth, waste significant CPU resources, and are time-consuming when querying change points, and cannot meet real-time requirements.

Method used

By obtaining statistical information about the data blocks, including maximum and minimum values, it can be determined whether there are any points of change in the data blocks. Only when there is inconsistency, the data blocks are loaded for detailed querying, reducing invalid data reading and CPU traversal.

Benefits of technology

This significantly reduces the number of CPU traversals and comparisons, lowers query latency, improves processing efficiency, and meets real-time requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123115243A_ABST
    Figure CN123115243A_ABST
Patent Text Reader

Abstract

This application relates to the field of data processing, and more particularly to a method, apparatus, device, and medium for querying change points in time-series data. In the embodiments of this application, based on the characteristic of time-series data being stored in blocks, the maximum and minimum values ​​of each data block within the query range are determined. This allows for the detection of whether a valid change point exists in the entire data block without reading the corresponding time-series data during the change point query process; the statistical information alone is sufficient. A change point is determined to exist in the data block only if at least two of the maximum and minimum values ​​of the data block and the first value of the latest detected change point are inconsistent. This significantly reduces the number of CPU traversals and comparisons, further reducing query latency.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Cross-references to related applications

[0002] This application claims priority to Chinese Patent Application No. 202611033286.2, filed on July 13, 2026, with the State Intellectual Property Office of the People's Republic of China, entitled "A Method, Apparatus, Device and Medium for Querying Change Points in Time Series Data", the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application relates to the field of data processing, and in particular to a method, apparatus, device, and medium for querying change points in time-series data. Background Technology

[0004] With the rapid development of industries such as the Industrial Internet of Things, smart grids, and smart manufacturing, massive amounts of sensor devices continuously generate time-series data arranged in an orderly manner along the time dimension. Because time-series data is characterized by high write frequency, large total data volume, and long steady-state time, a change point query method has been proposed in related technologies to more accurately understand the changes in time-series data. This method removes consecutive and repeated collected values ​​from time-series data within a specified sensor and time range, retaining only the first record of each group of consecutive identical values.

[0005] However, when querying change points, related technologies first read all the time-series data stored in all original data blocks within the query time range from disk into memory, and then iterate through each time-series data point to determine the change points where the values ​​changed. However, storing all the time-series data into memory will directly fill up the disk bandwidth in massive data scenarios, and iterating through each time-series data point will also cause a serious waste of CPU computing resources, resulting in long processing times and failing to meet real-time requirements. Summary of the Invention

[0006] This application provides a method, apparatus, device, and medium for querying time-series data change points, in order to solve the problems of excessive disk bandwidth consumption, serious waste of CPU resources, long processing time, and inability to meet real-time requirements in the prior art.

[0007] In a first aspect, embodiments of this application provide a method for querying change points in time-series data, the method comprising: Based on the collection time sequence of the time series data corresponding to each data block within the query time range, the following steps are executed sequentially for each data block: Obtain statistical information of the data block, wherein the statistical information carries the maximum and minimum values ​​of the time-series data corresponding to the data block; If at least two of the maximum value, the minimum value, and the first value of the latest detected change point are determined to be inconsistent, then a change point in the time-series data is determined to exist in the data block; wherein, the change point is the starting data point in the time-series data sequence where the value changes. The content stored in the data block is loaded into memory, and based on the loaded content and the first value, a change point query is performed on the data block.

[0008] In one possible implementation, the statistical information also carries the data encoding method of the time-series data corresponding to the data block; If the data encoding method is Run-Length Encoding (RLE), then the content stored in the data block is a tuple sequence, wherein the tuple sequence includes at least one tuple, and any tuple carries the third value of the time series data corresponding to the tuple and the number of times the third value is repeated consecutively.

[0009] In one possible implementation, if the data encoding method is RLE, the step of querying the change points of the data block based on the loaded content and the first value includes: Perform the following steps sequentially for each tuple in the tuple sequence: If the first value is inconsistent with the third value carried in the tuple, then the first time series data corresponding to the tuple is determined as the point of change; the acquisition time of the first time series data is determined according to the time offset of the tuple; the first value is updated using the third value, and the next tuple is traversed. If the third value is the same as the first value, it is determined that there is no change point in the tuple, and the process continues to traverse the next tuple.

[0010] In one possible implementation, if the data encoding method is non-RLE, the step of querying the change points of the data block based on the loaded content and the first value includes: The loaded content is decoded to obtain each time-series data; The following steps are performed sequentially on each of the time-series data: If the first value is inconsistent with the fourth value corresponding to the time series data, the time series data is determined to be a point of change; the acquisition time of the time series data is determined, and the first value is updated using the fourth value, and the next time series data is traversed. If the fourth value is consistent with the first value, then it is determined that the time series data is not a point of change, and the process continues to traverse the next time series data.

[0011] In one possible implementation, if the data block is the first data block, before determining that at least two of the maximum value, the minimum value, and the first value of the currently detected latest change point are inconsistent, the method further includes: Set the first value of the latest change point to a null value; wherein the null value is inconsistent with any non-null value.

[0012] In one possible implementation, after performing a change point query on the data block, the method further includes: Save the queried change points and their corresponding collection times to a preset change point result set.

[0013] In one possible implementation, the method further includes: If the maximum value, the minimum value, and the first value of the latest change point are all the same, it is determined that there is no change point of time series data in the data block, the data block is skipped, no loading or change point query is performed on the data block, and the next data block is processed.

[0014] In one possible implementation, the method further includes: Based on the query time range and the collection time corresponding to the queried change points, the queried change points are filtered so that the collection time corresponding to the retained change points belongs to the query time range.

[0015] Secondly, embodiments of this application also provide a time-series data change point query device, the device comprising: The acquisition module is used to acquire statistical information of each data block according to the collection time order of the time series data corresponding to each data block within the query time range, wherein the statistical information carries the maximum and minimum values ​​of the time series data corresponding to the data block; The processing module is configured to sequentially process each data block and, if at least two of the maximum value, the minimum value, and the first value of the latest detected change point are inconsistent, determine that there is a change point in the time-series data in the data block; load the content stored in the data block into memory, and perform a change point query on the data block based on the loaded content and the first value; wherein, the change point is the starting data point in the time-series data sequence where the value changes.

[0016] In one possible implementation, the statistical information also carries the data encoding method of the time-series data corresponding to the data block; If the data encoding method is RLE, then the content stored in the data block is a tuple sequence, wherein the tuple sequence includes at least one tuple, and any tuple carries the third value of the time series data corresponding to the tuple and the number of times the third value is repeated consecutively.

[0017] In one possible implementation, if the data encoding method is RLE, the processing module is specifically configured to perform the following steps sequentially for each tuple in the tuple sequence: if the first value is inconsistent with the third value carried in the tuple, then determine the first time series data corresponding to the tuple as a change point; determine the acquisition time of the first time series data according to the time offset of the tuple; update the first value with the third value, and continue to traverse the next tuple; if the third value is consistent with the first value, then determine that there is no change point in the tuple, and continue to traverse the next tuple.

[0018] In one possible implementation, if the data encoding method is non-RLE, the processing module is specifically used to decode the loaded content to obtain each time-series data; and sequentially perform the following steps on each time-series data: if the first value is inconsistent with the fourth value corresponding to the time-series data, then the time-series data is determined to be a change point; the acquisition time of the time-series data is determined, and the first value is updated using the fourth value, and the next time-series data is traversed; if the fourth value is consistent with the first value, then the time-series data is determined not to be a change point, and the next time-series data is traversed.

[0019] In one possible implementation, if the data block is the first data block, the processing module is further configured to set the first value of the latest change point to a null value; wherein the null value is inconsistent with any non-null value.

[0020] In one possible implementation, the processing module is further configured to save the queried change points and their corresponding collection times to a preset change point result set.

[0021] In one possible implementation, the processing module is further configured to determine that there is no change point of time-series data in the data block if the maximum value, the minimum value and the first value of the latest change point are all consistent, skip the data block, not load the data block and query the change point, and process the next data block.

[0022] In one possible implementation, the processing module is further configured to filter the queried change points based on the query time range and the collection time corresponding to the queried change points, so that the collection time corresponding to the retained change points belongs to the query time range.

[0023] Thirdly, embodiments of this application also provide an electronic device, the electronic device including a processor, the processor being configured to execute a computer program stored in a memory to implement the steps of the time-series data change point query method as described in any of the preceding claims.

[0024] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the time-series data change point query method as described in any of the preceding claims.

[0025] In this embodiment, based on the characteristic of time-series data being stored in blocks, the maximum and minimum values ​​of each data block within the query range are determined. This allows for the detection of whether a valid change point exists in the entire data block without reading the corresponding time-series data during the change point query process. A change point is determined to exist in the data block only if at least two of the maximum and minimum values ​​of the data block and the first value of the latest detected change point are inconsistent. This significantly reduces the number of CPU traversals and comparisons, further reducing query latency. Attached Figure Description

[0026] To more clearly illustrate the technical solutions of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This application provides a schematic diagram of a process for querying change points in time-series data, as illustrated in an embodiment of the present application. Figure 2 A schematic diagram of the RLE principle provided for an embodiment of this application; Figure 3 A detailed schematic diagram illustrating a process for querying change points in time-series data, provided in an embodiment of this application; Figure 4 This is a schematic diagram comparing the change point query method of related technologies with the change point query method of the embodiments of this application; Figure 5 A flowchart illustrating an accelerated method for querying time-series data change points provided in this application embodiment; Figure 6 A schematic diagram of a time-series data change point query device provided in an embodiment of this application; Figure 7 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Detailed Implementation

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

[0029] With the rapid development of industries such as the Industrial Internet of Things, smart grids, and smart manufacturing, massive amounts of sensor devices continuously generate time-series data sequences arranged in an orderly manner along the time dimension. These time-series data sequences are characterized by high write frequency, large data volume, and long steady-state time. For example, switch sensors that record the on / off state of equipment, and pressure / level sensors with minimal fluctuations in steady-state values, maintain constant values ​​for over 90% of the time, with value jumps occurring only at a few moments.

[0030] Therefore, to more accurately understand the changes in time-series data, a change point query method has been proposed in related technologies. This method removes consecutive and repeated collected values ​​from time-series data within a specified sensor and time range, retaining only the first record of each group of consecutive identical values, i.e., the starting point of the value change. For example, if the original time-series data sequence is [1,1,1,2,2,3,3,3], the change point query result is [1,2,3], retaining only the timestamp and value of the first occurrence of each value. This change point query method is widely used in core scenarios such as equipment status monitoring, threshold alarm triggering, time-series data compression and archiving, and operational dashboard visualization. Users only need to focus on the time and result of the value change, without needing to obtain the full amount of consecutive and repeated data.

[0031] However, current industry-standard solutions for querying change points have the following core flaws: 1. Disk I / O overhead is extremely high, resulting in significant resource waste. Related technologies do not consider whether all values ​​within the query time range are repeated or whether there are valid points of change; instead, they require reading all data blocks within the query time range from disk into memory. However, for sensor data with a very high proportion of steady-state data, over 90% of disk I / O is meaningless and ineffective. This method of full reading and downloading will directly consume disk bandwidth in massive data scenarios, impacting the overall performance of the time-series database.

[0032] 2. Significant waste of CPU computing resources and low processing efficiency. Related technologies require decompressing and deserializing all read data blocks to obtain the time-series data corresponding to each block, and then traversing the entire time-series data line by line to perform continuous deduplication logic. Even if the values ​​of the time-series data within the entire data block are completely identical, the deserialization and traversal of that data block still need to be completed, generating a large amount of unnecessary CPU computation and further increasing query time.

[0033] 3. High query latency, failing to meet real-time requirements. In practical applications, scenarios such as industrial monitoring and alarm triggering have extremely high requirements for the latency of querying change points. In long-cycle, large-volume query scenarios, related technologies are limited by disk I / O and computing overhead, and the query latency can reach the second level or even the minute level, which cannot meet the business needs of real-time monitoring and timely alarms.

[0034] 4. The optimization solutions for related technologies have significant shortcomings. Some pre-computation optimization solutions improve query performance by pre-generating change point indexes and pre-storing deduplication results during writing. However, such solutions significantly increase the computational and storage overhead of the write chain, resulting in a write amplification effect, which violates the core design goal of high-throughput writing in time-series databases. At the same time, pre-computation indexes need to cope with data update and deletion maintenance scenarios, which makes them extremely complex and has poor fault tolerance.

[0035] Therefore, there is an urgent need for a change point query method that can quickly and accurately determine the change points in time series data without consuming excessive CPU computing resources and disk I / O.

[0036] Based on this, in order to avoid consuming excessive CPU computing resources and disk I / O, and to quickly and accurately determine the change points in time-series data, this application provides a method for querying change points in time-series data. This method can be executed in an electronic device, such as a time-series database, processor, server, or other components with computing capabilities. The method filters data blocks within a query time range, removing data blocks that do not contain change points, thereby reducing the number of data blocks to be loaded, reducing the consumption of disk I / O and CPU computing resources, reducing the time spent on change point queries, and improving processing efficiency.

[0037] The change point query involves, for a specified sensor and a specified time range, removing consecutively repeated collected values ​​and retaining only the first record of each group of consecutive identical values. This first record represents the starting point of the value change. In other words, in this embodiment, the change point to be queried is each starting data point in the time series data sequence within the query time range where the data changes.

[0038] Specifically, the time-series data change point query method provided in this application embodiment includes: according to the collection time order of the time-series data corresponding to each data block within the query time range, performing the following steps for each data block in sequence: obtaining the saved statistical information of the data block, wherein the statistical information carries the maximum and minimum values ​​of the time-series data corresponding to the data block; if at least two of the maximum value, minimum value, and the first value of the latest detected change point are inconsistent, then it is determined that there is a change point of time-series data in the data block; loading the content saved in the data block into memory, and performing a change point query on the data block based on the loaded content and the first value.

[0039] Current time-series databases primarily employ a block-based storage architecture, storing time-series data in the form of data blocks. Each data block contains at least one time-series data record. A data block is a storage unit partitioned by time, storing time-series data for a specific parameter within a defined time range. For example, a data block is the smallest persistent storage unit for time-series data in a time-series database. Data from the same sensor is segmented into multiple data blocks based on fixed time ranges, with each data block corresponding to a continuous time interval.

[0040] The time-series data can be sensor data collected in an ordered manner according to the time dimension. Each piece of time-series data contains at least three core fields: timestamp (t), collected value (val), and sensor unique identifier. Data from the same sensor is stored in ascending order of time.

[0041] For example, if the time series database receives the time series data corresponding to the first parameter at the first time, the time series database will traverse each data block corresponding to the first parameter that has been configured locally, determine the target time interval containing the first time according to the time interval corresponding to each data block, and write the time series data into the data block corresponding to the target time interval.

[0042] Alternatively, if it is determined that there is no target time interval that includes the first time interval based on the time interval corresponding to each data block, a new data block can be created. The time interval corresponding to this data block includes the first time interval, and the range of the time interval of this data block is consistent with the range of the time interval of the existing data blocks in the time series database. The time series data is then written into this new data block.

[0043] The first parameter can be any parameter, and the first time can be any time.

[0044] In this embodiment, the electronic device can receive a change point query request, which carries at least the identifier of the second parameter to be queried and the query time range. For example, the change point query request may carry the unique identifier of the target sensor, the start query time, and so on. ), End time of query ( ).

[0045] The change point query request can be sent by other electronic devices, triggered by a scheduled task, or triggered by its own task thread.

[0046] For example, when other electronic devices need to use the change point of the second parameter, a change point query request can be sent to that electronic device. The other electronic device can be any electronic device other than the one currently being used. Alternatively, the electronic device may have a scheduled task that queries the change point of the second parameter. If the current time is the start time of the scheduled task, the change point query request can be automatically triggered. Or, if a task thread currently being executed by the electronic device needs to use the change point of the second parameter, the change point query request can be automatically triggered.

[0047] It should be noted that change point query requests can be initiated using SQL statements, time series database-specific DSLs, etc. For example, the SQL syntax can be expanded to: SELECT CHANGE_POINTS(s1) FROM root.db.d1 WHERE timeBETWEEN start_ts AND end_ts.

[0048] In this embodiment of the application, after receiving a change point query request, the electronic device can parse the change point query request to obtain the identifier of the second parameter to be queried and the query time range carried in the change point query request.

[0049] The identifier of the second parameter to be queried can be the name, code, serial number, or other characters used to identify the second parameter.

[0050] After determining the identifier and time range of the second parameter to be queried, the electronic device can access a time-series database and, based on the identifier of the second parameter, determine the data block in the time-series database used to store the time-series data of the second parameter. Then, based on the query time range and the acquisition time range corresponding to each data block stored in the time-series database, the electronic device can determine at least one candidate data block whose acquisition time range contains at least one time within the query time range. The electronic device then identifies this at least one candidate data block as each data block within the query time range.

[0051] In practical applications, the index of any data block in a time-series database can include, but is not limited to, the identifier of the third parameter corresponding to that data block and the acquisition time range corresponding to that data block. When accessing the time-series database, electronic devices can determine each data block within the query time range based on the index of the data block in the time-series database. Alternatively, the index of any data block in the time-series database can be a unique string, and the time-series database also stores the correspondence between the index of each data block and the identifier of the parameter and the acquisition time range. When accessing the time-series database, electronic devices can determine the index of each data block within the query time range based on this correspondence, and then determine each data block within the query time range based on the index.

[0052] For example, an electronic device can parse a change point query request to obtain the sensor identifier and the query time range. Then, based on the parsed sensor identifier and query time range, the electronic device can access the index of each data block in the time series database, locate all data blocks for that sensor within the query time range, and generate a list of data blocks to be traversed, sorted in ascending order of time. Where B1 represents the earliest data block in the corresponding time range, and Bn represents the latest data block in the corresponding time range.

[0053] In this embodiment, the electronic device only needs to access the index of the data block, without needing to read the original content of any data block.

[0054] In this embodiment of the application, after the electronic device acquires each data block within the query time range, the electronic device can sort each data block according to the time sequence based on the collection time range corresponding to each data block, and detect whether there are any change points in each data block according to the sorting result. For data blocks with change points, the change points contained in the data block are further extracted.

[0055] In the following embodiments, the change point query method for time series data provided in this application will be described using the example of an electronic device processing a change point query for any data block within a query time range.

[0056] In one possible implementation, Figure 1 This application provides a schematic diagram of a process for querying change points in time-series data, which includes: S101: Obtain statistical information of the data block, wherein the statistical information carries the maximum and minimum values ​​of the time-series data corresponding to the data block.

[0057] In this embodiment of the application, during the process of writing time-series data into data blocks of the time-series database, the time-series database can also save statistical information of the data blocks, including but not limited to the maximum and minimum values ​​of the time-series data corresponding to the data blocks.

[0058] For example, when saving the time series data of the first time step of the first parameter to the corresponding data block, if the time series data is the first time series data saved in the data block, then the maximum and minimum values ​​of the saved data block are both set to the values ​​corresponding to the time series data. If the time series data is not the first time series data saved in the data block, then the relationship between the value of the time series data and the minimum and maximum values ​​of the saved data block is determined; if the value of the time series data is less than the minimum value of the data block, then the minimum value of the saved data block is updated to the value of the time series data; if the value of the time series data is greater than the maximum value of the data block, then the maximum value of the saved data block is updated to the value of the time series data; if the value of the time series data is not less than the minimum value of the data block and not greater than the maximum value of the data block, then the maximum and minimum values ​​of the saved data block are not adjusted.

[0059] Based on this, in this embodiment of the application, when the electronic device determines whether there is a change point in the data block, the electronic device can obtain the statistical information of the data block, and detect whether there is a change point in the data block based on the maximum and minimum values ​​carried in the statistical information.

[0060] Among them, the time series database can save the statistical information of any data block and the corresponding index of that data block, and the time series database can also add the statistical information of any data block to the index of that data block.

[0061] For example, the index of a data block can record the sensor identifier, acquisition time range, storage address, and statistical information corresponding to that data block.

[0062] In this embodiment, if the time-series database stores the statistical information of any data block in correspondence with the index of that data block, then when the electronic device obtains the statistical information of a data block, it can search for and download the statistical information corresponding to the index of that data block in the storage location configured in the time-series database for storing the correspondence between statistical information and index. If the time-series database stores the statistical information of any data block in the index of that data block, then when the electronic device obtains the statistical information of a data block, it can directly download the index of that data block and parse the index to obtain the statistical information carried in the index.

[0063] Optionally, after determining each data block within the query range, the electronic device can also batch download the statistical information corresponding to each data block to its local machine. When performing a change point query for any data block, the statistical information of that data block can be directly obtained from the local machine. The process of the electronic device batch downloading the statistical information corresponding to each data block to its local machine is the same as the process of the electronic device downloading the statistical information of a single data block to its local machine, and will not be described again here.

[0064] In this embodiment of the application, the electronic device can directly obtain the maximum and minimum values ​​of the data block through statistical information without reading the contents of the data block, which greatly reduces the amount of data read by the electronic device, thereby reducing the occupation of the IO disk and avoiding the waste of resources.

[0065] S102: If at least two of the maximum value, the minimum value, and the first value of the latest detected change point are inconsistent, then it is determined that there is a change point of time-series data in the data block; wherein, the change point is the starting data point in the time-series data sequence where the value changes.

[0066] In this embodiment, after obtaining statistical information about a data block, the electronic device can detect whether there are any time-series data change points in the data block based on the maximum and minimum values ​​carried in the statistical information. A change point is the starting data point in the time-series data sequence where the value changes.

[0067] The following describes several possible methods for detecting the presence of time-series data change points in data blocks: Method 1: Detect whether there are time-series data change points in the data block based on whether the maximum and minimum values ​​carried in the statistical information are consistent.

[0068] In this embodiment of the application, the electronic device can directly detect whether there are time-series data change points in the data block based on whether the maximum and minimum values ​​carried in the statistical information of the data block are consistent.

[0069] Specifically, if the maximum and minimum values ​​carried in the statistical information are the same, the electronic device determines that the values ​​of the time-series data corresponding to that data block are completely consistent and have not changed; therefore, the electronic device determines that there are no points of change in the time-series data in that data block. If the maximum and minimum values ​​carried in the statistical information are inconsistent, the electronic device determines that the values ​​of the time-series data corresponding to that data block have changed at least once; therefore, the electronic device determines that there are points of change in the time-series data in that data block.

[0070] In this embodiment of the application, when the electronic device detects whether there is a change point in the time-series data in the data block based on the first method, the electronic device can immediately perform a change point query on the data block after determining that there is a change point in the data block; the electronic device can also detect the next data block after determining that there is a change point in the data block, until all data blocks within the query time range have been detected, and then the electronic device performs a change point query on the data blocks among all the data blocks whose detection results show that there is a change point.

[0071] Method 2: Based on whether the maximum and minimum values ​​carried in the statistical information are consistent with the first value of the latest detected change point, detect whether there are time series data change points in the data block.

[0072] In practical applications, it's possible for the values ​​of the time-series data corresponding to a data block to be completely identical. However, the value of the first time-series data corresponding to that data block may differ from the value of the last time-series data corresponding to the previous data block, meaning the first time-series data is a point of change. In this case, if the electronic device detects the presence of a point of change in that data block using Method 1, the detection result will be that no point of change exists in that data block. That is, if the electronic device uses Method 1 to detect the presence of a point of change in a data block, it may miss some points. Here, the previous data block refers to a data block whose acquisition time range precedes that data block and is adjacent to the acquisition time range of that data block.

[0073] Based on this, in Embodiment 2 of this application, a method is proposed to detect whether there are time-series data change points in a data block based on the first value of the latest detected change point and the maximum and minimum values ​​carried in the statistical information.

[0074] In the second embodiment of this application, the electronic device performs change point detection on each data block sequentially according to the collection time order of the time series data corresponding to each data block within the query time range. For any data block, when the electronic device detects a change point in the data block, the electronic device will directly extract the change point of the data block and perform change point detection on the next data block based on the latest detected change point.

[0075] It should be noted that the latest detected change point is the change point with the latest acquisition time among all detected change points; all detected change points are the change points in each data block whose acquisition time range is before the data block currently being detected.

[0076] In this embodiment of the application, since the change point detection process based on Method 2 is related to the first value of the latest change point, but if the data block currently being detected is the first data block in the query time range, then there is no latest change point, and the electronic device will not be able to perform change point detection on the data block based on the above Method 2.

[0077] Therefore, in order to ensure the smooth progress of the change point detection process, in this embodiment of the application, the electronic device can use any of the following methods to perform change point detection on the first data block within the acquisition time range: Method 1: Before starting change point detection, the electronic device will first determine whether the data block to be detected is the first data block. If the electronic device determines that the data block is the first data block, it will directly determine that there is a change point in the data block.

[0078] In one possible implementation, the electronic device can determine whether a data block is the first data block based on the query time range and the collection time range corresponding to the data block to be detected. Specifically, if the electronic device determines that the collection time range corresponding to the data block includes the start query time of the query time range, then the electronic device determines that the data block is the first data block; if the electronic device determines that the collection time range corresponding to the data block does not include the start query time of the query time range, then the electronic device determines that the data block is not the first data block.

[0079] In another possible implementation, the electronic device can also determine whether the data block to be detected is the first data block based on whether a change point has been detected. Specifically, if the electronic device determines that no change point has been detected, it determines that the data block to be detected is the first data block; if the electronic device determines that a change point has been detected, it determines that the data block to be detected is not the first data block.

[0080] In another possible implementation, since the electronic device performs change point detection on each data block sequentially according to the acquisition time order of the time-series data corresponding to each data block within the query time range, the electronic device can also determine whether the data block to be detected is the first data block based on whether other data blocks within the query time range have undergone change point detection. Specifically, if the electronic device determines that no other data blocks within the query time range have undergone change point detection, it determines that the data block to be detected is the first data block; if the electronic device determines that other data blocks within the query time range have undergone change point detection, it determines that the data block to be detected is not the first data block.

[0081] Method 2: Before starting change point detection, the electronic device first sets the first value of the latest change point to a null value, and then begins change point detection. This null value is inconsistent with any non-null value.

[0082] To achieve change point detection for each data block, based on the above embodiments, in this embodiment, if the data block is the first data block, before determining that at least two of the maximum value, the minimum value, and the first value of the currently detected latest change point are inconsistent, the method further includes: The first value of the latest change point is set to a null value; wherein the null value is inconsistent with any non-null value. Specifically, in this embodiment, the electronic device determines whether the data block to be detected is the first data block. If the electronic device determines that the data block is the first data block, before starting to detect the change point of the data block, the electronic device first sets the first value of the pre-configured latest change point to a null value.

[0083] Furthermore, the electronic device can set the latest change point as a fixed parameter in the change point query process, and set the initial value of the first value of the latest change point to null. Based on this, when the electronic device determines that the data block to be detected is the first data block, it does not need to set the first value of the latest change point again.

[0084] It should be noted that the null value in the embodiments of this application is not consistent with any non-null value.

[0085] In this embodiment of the application, the process of the electronic device detecting change points in a data block based on the maximum and minimum values ​​carried in the statistical information and the first value of the latest detected change point can be as follows: the electronic device determines whether the maximum and minimum values ​​carried in the statistical information of the data block are consistent with the first value of the latest detected change point. If they are consistent, it is determined that there is no change point in the data block. If they are inconsistent, it is determined that there is a change point in the data block.

[0086] In one possible implementation, if the electronic device determines that at least two of the maximum value, minimum value, and the first value of the latest detected change point are inconsistent, then it determines that there is a change point in the time-series data in the data block.

[0087] For example, if the electronic device determines that the maximum value and the minimum value are the same, but the minimum value (maximum value) is not the same as the first value of the latest change point, then it is determined that there is a change point in the time-series data in the data block; if the electronic device determines that the maximum value and the first value of the latest change point are the same, but the maximum value and the minimum value are not the same, then it is determined that there is a change point in the time-series data in the data block; if the electronic device determines that the maximum value and the minimum value are not the same, and the maximum value and the minimum value are also not the same as the first value of the latest change point, then it is determined that there is a change point in the time-series data in the data block.

[0088] In another possible implementation, the method further includes: If the maximum value, the minimum value, and the first value of the latest change point are all the same, it is determined that there is no change point of time series data in the data block, the data block is skipped, no loading or change point query is performed on the data block, and the next data block is processed.

[0089] In this embodiment, if the electronic device determines that the maximum value, minimum value, and the first value of the latest detected change point are all consistent, it determines that there is no change point of time-series data in the data block. After determining that there is no change point of time-series data in the data block, the electronic device can directly skip the data block, that is, the electronic device will not load the data block or query for change points, and then the electronic device will continue to detect change points for the next data block.

[0090] In addition, in this embodiment of the application, if the electronic device uses the above-described method 2 for processing, when the electronic device performs change point detection on the current data block to be detected, it can first determine whether the first value of the latest detected change point is empty. If the electronic device determines that the first value is empty, the electronic device can directly determine that there is a change point in the data block without having to make a judgment based on the maximum and minimum values. If the electronic device determines that the first value is not empty, the electronic device will use the above-described method of whether the maximum and minimum values ​​are consistent with the first value of the latest detected change point to perform change point detection on the data block.

[0091] S103: Load the content stored in the data block into memory, and perform a change point query on the data block based on the loaded content and the first value; wherein, the change point is the starting data point in the time-series data sequence where the value changes.

[0092] In this embodiment of the application, after the electronic device determines that there is a change point in the time-series data in the data block, the electronic device performs a change point query on the data block.

[0093] Specifically, the electronic device can load the content stored in the data block into memory and perform a change point query on the data block based on the loaded content and a first value. Optionally, the electronic device can load the content stored in the data block from the time-series database into its memory via an input / output interface.

[0094] In this embodiment of the application, the time-series database can use various data encoding methods to store time-series data. Some data encoding methods involve directly writing the time-series data into data blocks, while others involve encoding the time-series data into any format and then writing the encoded data into data blocks.

[0095] Specifically, based on the above embodiments, in this application embodiment, the statistical information also carries the data encoding method of the time-series data corresponding to the data block; If the data encoding method is Run Length Encoding (RLE), then the content stored in the data block is a tuple sequence, wherein the tuple sequence includes at least one tuple, and any tuple carries the third value of the time series data corresponding to the tuple and the number of times the third value is repeated consecutively.

[0096] In this application embodiment, the data encoding methods that the data block may adopt include, but are not limited to, RLE, Delta encoding, and Plain encoding. Delta encoding means that the data block does not directly store the value of the time-series data, but instead stores the difference between the value of the current time-series data and the value of the previous time-series data; Plain encoding means that the time-series data is not processed and is directly saved into the data block; RLE is an efficient compression encoding for continuously repeating data, storing the continuously repeating numerical sequence as... A sequence of tuples in the form of, where For numerical values, This represents the number of times the value is repeated consecutively.

[0097] Figure 2 A schematic diagram of the RLE principle provided for an embodiment of this application, such as Figure 2As shown, the time-series data sequence includes nine time-series data points: 111223333. When using Repetitive Extraction (RLE) to save these nine time-series data points (111223333) into a data block, the word stream is first scanned bit by bit, then the occurrence count of consecutive identical numbers is counted, and finally, the data is output in the format of a tuple consisting of [repetition count + numerical value]. Based on this, the data block stores three tuples: (3,1), (2,2), and (4,3), reducing the total length to six numbers. The pink dashed box on the far right of the figure summarizes this achievement: the data length is reduced from 9 to 6, achieving a lossless compression rate of 33%, which intuitively demonstrates the efficiency of RLE in processing consecutive repetitive data.

[0098] Based on this, in one possible implementation, after loading the contents stored in the data block into memory, the electronic device can parse the data block to determine each corresponding time-series data in the data block.

[0099] Subsequently, the electronic device iterates through each time-series data obtained from parsing, according to the acquisition time sequence of each time-series data, and identifies the first time-series data whose corresponding value differs from the first value, thus designating this time-series data as the change point. The electronic device then updates the first value using the value of the time-series data designated as the change point, and continues to iterate through other time-series data following that data point until all time-series data within the data block has been traversed.

[0100] In this embodiment of the application, if the data encoding method is RLE, the content stored in the data block is a tuple sequence, wherein the tuple sequence includes at least one tuple, and any tuple carries the third value of the time series data corresponding to the tuple and the number of times the third value is repeated consecutively.

[0101] Since RLE is an efficient compression code for continuously repeating data, it can store continuously repeating numerical sequences as tuple sequences. Therefore, in another possible implementation, if the data encoding method is RLE, the electronic device can directly determine the change point in the data block based on the third value carried by each tuple in the tuple sequence stored in the data block and the first value of the latest change point. This eliminates the need to decode the tuple sequence into time-series data and traverse the time-series data, enabling rapid determination of whether a change point exists and locating the position where the change occurs. This significantly reduces the number of CPU traversals and comparisons, further reducing the latency of change point lookup.

[0102] To reduce the number of CPU traversals and comparisons, and further reduce the latency of change point lookup, based on the above embodiments, in this embodiment, if the data encoding method is RLE, the change point lookup of the data block based on the loaded content and the first value includes: Perform the following steps sequentially for each tuple in the tuple sequence: If the first value is inconsistent with the third value carried in the tuple, then the first time series data corresponding to the tuple is determined as the point of change; the acquisition time of the first time series data is determined according to the time offset of the tuple; the first value is updated using the third value, and the next tuple is traversed. If the third value is the same as the first value, it is determined that there is no change point in the tuple, and the process continues to traverse the next tuple.

[0103] In this embodiment, each tuple in the tuple sequence carries highly condensed information. The tuple contains not only the value of a specific time-series data point, i.e., a third numerical value, but also a count value indicating the number of times the third numerical value appears consecutively in the time-series data corresponding to the data block. For example, a tuple could be (5, 1000), indicating that the time-series data point with the value 5 appears consecutively 1000 times in the data block. This structure significantly reduces the storage of redundant data, especially for system monitoring data whose state remains unchanged for long periods, resulting in extremely high compression efficiency.

[0104] In this embodiment, since the value of the time series data corresponding to each tuple in the tuple sequence is consistent, even if there is a change point in any tuple, that change point is the first time series data in the time series data corresponding to that tuple. This first time series data is the time series data with the earliest acquisition time in the time series data corresponding to that tuple.

[0105] Based on this, the electronic device can sequentially traverse each tuple in the tuple sequence and determine whether the first time-series data in each tuple is a change point based on the relationship between the third value corresponding to each tuple and the first value of the latest change point.

[0106] The following example illustrates the process of an electronic device querying the change points of a tuple: In this embodiment of the application, the electronic device can determine whether the third value corresponding to the tuple is consistent with the first value of the latest change point, and determine whether the first time-series data in the tuple is a change point based on the determination result.

[0107] In one possible implementation, if the third value corresponding to a tuple is consistent with the first value of the latest change point, it indicates that the time series data corresponding to that tuple is merely a continuation of the value of the time series data corresponding to the previous tuple. For example, if the first value is 1, the tuple (1, 100) represents the value 1 repeated 100 times consecutively, meaning the third value of the tuple is 1. If the electronic device determines that the first value is consistent with the third value, then the electronic device determines that there are no change points in the time series data within the time range corresponding to that tuple, and the electronic device does not need to check these 100 repeated data points one by one.

[0108] Furthermore, in this embodiment of the application, if the electronic device determines that there is no change point in the tuple, the electronic device directly skips the tuple and continues to traverse the next tuple in the tuple sequence.

[0109] In another possible implementation, if the third value corresponding to the tuple is inconsistent with the first value of the latest change point, the electronic device determines that the first time-series data corresponding to the tuple has changed, and the electronic device determines that the first time-series data is a change point. For example, if the first value is 0, and the third value corresponding to the tuple is 1, the third value is inconsistent with the first value, and the electronic device determines that the first time-series data corresponding to the tuple is a change point.

[0110] In this embodiment, if the electronic device determines that the time-series data corresponding to the tuple is a point of change, in order to accurately record the point of change, the electronic device can further determine the acquisition time corresponding to the point of change. Specifically, the electronic device can calculate the acquisition time corresponding to the point of change using the time offset of the tuple.

[0111] The following describes several possible methods for determining the data collection time corresponding to points of change: Method 1: If the time interval for collecting time-series data is fixed, the collection time of the change point can be determined by varying the starting collection time of the change point in the data block and the order of the change point in the data block.

[0112] Specifically, in this embodiment, if the time interval for collecting time-series data is fixed, and the electronic device determines that the time-series data corresponding to a tuple is a point of change, the electronic device can determine the number of time-series data preceding the tuple in the tuple sequence based on the number of times each preceding tuple in the tuple sequence has occurred. Then, the electronic device determines the collection duration of the time-series data preceding the tuple based on the number of time-series data preceding the tuple in the tuple sequence and the time interval for collecting time-series data. The electronic device then determines the time offset corresponding to the tuple based on the start time of the collection time range corresponding to the data block containing the tuple and the collection duration, and determines the collection time of the first time-series data of the tuple based on the time offset.

[0113] Specifically, the electronic device can calculate the product of the number of time-series data preceding the tuple and the time interval between the acquisition of the time-series data, and calculate the sum of this product and the starting acquisition time corresponding to the data block. The electronic device determines this sum as the time offset. The electronic device then determines this time offset as the acquisition time of the first time-series data.

[0114] For example, the acquisition time of the first time series data of tuple k can be expressed as:

[0115] in, This indicates the acquisition time of the first time-series data in tuple k, T represents the start acquisition time of the data block, and 1 represents the preceding tuple 1. This indicates the number of times the third value corresponding to the preceding tuple 1 is repeated consecutively, and 2 indicates the preceding tuple 2. This indicates the number of times the third value corresponding to the preceding tuple 2 is repeated consecutively. This represents the preceding tuple k-1. This indicates the number of times the third value corresponding to the preceding tuple k-1 is repeated consecutively. This indicates the time interval for collecting time-series data.

[0116] Method 2: Electronic devices can decode the acquisition time series of the time-series data stored in the data block where the change point is located to obtain the acquisition time of the change point.

[0117] In practical applications, the values ​​and acquisition times of time-series data are encoded and stored separately within the data block. Based on this, in this embodiment, the electronic device can also decode the acquisition time sequence of the encoded time-series data stored in the data block to obtain the acquisition time sequence. Then, the electronic device retrieves the acquisition time corresponding to the point of change from the decoded acquisition time sequence.

[0118] The encoded acquisition time series can be written into the data block or into the index of the data block.

[0119] Specifically, after obtaining the decoded acquisition time series, the electronic device can determine the acquisition time corresponding to the change point in the acquisition time series based on the order of the change points in the data block.

[0120] For example, in the tuple sequence corresponding to the data block where the change point is located, the electronic device can retrieve the number of times the third value recorded in each of the other tuples preceding the tuple containing the change point is repeated consecutively. Based on the number of repetitions in each of the other tuples, the electronic device determines the quantity of time-series data preceding the change point in the data block, thereby determining the order of the change point within the data block. The electronic device then determines the acquisition time corresponding to this order in the time series as the acquisition time of the change point.

[0121] The electronic device determines the sum of the occurrences of each other tuple; this sum represents the number of time-series data points preceding the change point in the data block. The electronic device increments this sum by 1 and uses the incremented sum as the order of the change point within the data block. That is, if the electronic device determines that the number of time-series data points preceding the change point in the data block is N, then the order of the change point in the data block is N+1.

[0122] It should be noted that the above method two can be applied to any scenario, and this method two does not need to consider whether the time interval of time series data collection is consistent.

[0123] In this embodiment, the electronic device identifies the first time-series data point of the tuple as the point of change, and after determining the acquisition time of this point of change, the first time-series data point becomes the latest point of change. Therefore, to ensure the accuracy of the first value and to ensure the accuracy of subsequent point of change lookup processes, the electronic device also updates the saved first value of the latest point of change using the third value corresponding to the tuple, thereby ensuring that the first value always corresponds to the latest point of change. Then, the electronic device uses the updated first value to perform a point of change lookup for the next tuple.

[0124] To enable change point lookup for data blocks using other data encoding methods, based on the above embodiments, in this embodiment, if the data encoding method is not RLE, the change point lookup for the data block based on the loaded content and the first value includes: The loaded content is decoded to obtain each time-series data; The following steps are performed sequentially on each of the time-series data: If the first value is inconsistent with the fourth value corresponding to the time series data, the time series data is determined to be a point of change; the acquisition time of the time series data is determined, and the first value is updated using the fourth value, and the next time series data is traversed. If the fourth value is consistent with the first value, then it is determined that the time series data is not a point of change, and the process continues to traverse the next time series data.

[0125] In this embodiment, if the data block with a change point is not encoded using RLE, the electronic device decodes the content of the loaded data block to obtain each timing data. For example, if the data block is encoded using Delta encoding, the content of the data block includes the value of the starting timing data of the data block and the difference between the values ​​of every two adjacent timing data to determine each timing data corresponding to the data block; if the data block is encoded using Plain encoding, the content of the data block is each timing data corresponding to the data block.

[0126] Based on this, the electronic device can sequentially traverse each time-series data corresponding to the data block, and determine whether each time-series data is a change point based on the relationship between the fourth value corresponding to each time-series data and the first value of the latest change point.

[0127] The following example illustrates the process of an electronic device querying the change points of time-series data: In this embodiment of the application, the electronic device can determine whether the fourth value corresponding to the timing data is consistent with the first value of the latest change point, and determine whether the first timing data in the timing data is a change point based on the determination result.

[0128] In one possible implementation, if the fourth value corresponding to the timing data is consistent with the first value of the latest change point, it indicates that the timing data is a continuation of the value corresponding to the previous timing data. For example, if the first value is 1 and the fourth value of the timing data is also 1, and the electronic device determines that the first value and the fourth value are consistent, then the electronic device determines that the timing data is not a change point.

[0129] Furthermore, in this embodiment, if the timing data of the electronic device is not a point of change, the electronic device skips the timing data and continues to traverse the next timing data.

[0130] In another possible implementation, if the fourth value corresponding to the timing data is inconsistent with the first value of the latest change point, the electronic device determines that the timing data is a change point. For example, if the first value is 0, and the fourth value corresponding to the timing data is 1, the electronic device determines that the timing data is a change point because the fourth value is inconsistent with the first value.

[0131] In this embodiment, if the electronic device determines that the timing data is a point of change, in order to accurately record the point of change, the electronic device can further determine the acquisition time corresponding to the point of change. The timing data stored in the data block includes not only the value of the timing data but also the acquisition time of the timing data. Therefore, the electronic device can calculate the acquisition time corresponding to the point of change by reading the timing data.

[0132] The following section uses the processing of data block Bi as an example to describe in detail the change point query method provided in this application embodiment. The process includes: Step 1: Extract the statistical information of data block Bi directly from the index of data block Bi. The statistical information includes the maximum value max_i, the minimum value min_i, and the data encoding method encoding_i. There is no need to read the original data content of data block Bi, and there is no disk I / O overhead.

[0133] Step 2: Determine whether the statistical information of data block Bi simultaneously meets the following two core conditions, and execute the corresponding branch based on the determination result.

[0134] Condition 1: max_i == min_i; This condition being true indicates that all collected values ​​within the current data block are identical, and there is no change in any value within the block. Condition 2: current_value == max_i; This condition being true means that the value in the current data block is exactly the same as the first value of the previous valid change point, and no new change points will be generated in the block. Here, current_value represents the first value of the latest change point.

[0135] If both conditions are met: it is determined that there are no valid change points in data block Bi, then step 3 is executed to skip the current data block; if either condition is not met: it is determined that there may be valid change points in data block Bi, then step 4 is executed to read and process the current data block.

[0136] Step 3: Skip the current data block, directly end the processing of data block Bi, and enter the traversal process of the next data block Bi+1. The entire process involves no disk I / O, no data deserialization, and no data traversal operations, completing the processing of this data block with zero overhead.

[0137] Step 4: Perform a complete read and adaptive deduplication process on data block Bi. The specific steps are as follows: 1. Read the contents of data block Bi from the disk; 2. Execute the corresponding adaptive processing logic based on the data encoding method: Scenario A: If data block Bi uses RLE to encode the corresponding time-series data into a tuple sequence, and the tuples in this sequence are arranged in ascending time order, then there is no need to decode the tuple sequence into time-series data. Instead, a change point lookup can be performed directly based on this tuple sequence. This change point lookup process includes: a. sequentially traversing each tuple in the tuple sequence. b. If the first value of the latest change point is null (current_value = NULL), then calculate the acquisition time of the first time series data of the tuple based on the time offset of the tuple, and compare this acquisition time with the third value of the first time series data. Add the change point result set and update the first value to the third value. Continue iterating through the next tuple; c. If the first value of the latest changed point is not null (i.e., current_value != NULL), and the third value is inconsistent with the first value, i.e. != current_value: Determines the first time series data point of this tuple as the point of change, calculates the acquisition time of the first time series data point, and compares this acquisition time with the third value of the first time series data point. Add the change point result set and update the first value to the third value. d. If the first value of the latest changed point is not null (i.e., current_value != NULL) and the third value is the same as the first value (i.e., val_k == current_value): it is determined that there is no changed point in the tuple, and the current tuple is skipped directly, and the next tuple is traversed; e. After completing the traversal of all RLE tuples, the processing of data block Bi ends, and the traversal process of the next data block Bi+1 begins.

[0138] Case B: Data block Bi uses non-RLE encoding (such as Delta encoding, Plain encoding, etc.). For non-RLE encoded data blocks, the traditional line-by-line processing logic is executed: a. Decompress and deserialize the compressed data block to obtain the time-series data sequence DataList=[R1,R2,...,Rm] arranged in ascending order of time within data block Bi, where each time-series data Rj contains a timestamp ts and a collected value val; b. Traverse each time-series data Rj in DataList in ascending order of time and execute the following deduplication logic for consecutive duplicate values: If the first value of the latest change point is null, i.e., current_value == NULL, then add the time series data Rj to the change point result set Result, update the first value current_value to the fourth value val of the time series data Rj, and continue to traverse the next time series data; If the first value of the latest change point is not null (i.e., current_value != NULL), and the fourth value val of the time series data Rj is inconsistent with the first value (i.e., Rj.val != current_value), then the time series data Rj is determined to be a change point. The time series data Rj is added to the change point result set Result, the first value current_value is updated to the fourth value val of the time series data Rj, and the process continues to traverse the next time series data. If the first value of the latest change point is not null (i.e., current_value != NULL), and the fourth value val of the time series data Rj is the same as the first value (i.e., Rj.val == current_value), then the time series data is determined to be a continuous repeating value, and the time series data Rj is skipped directly, and the next time series data is traversed. After completing the full traversal of the time-series data sequence DataList, the processing of data block Bi ends, and the traversal process of the next data block Bi+1 begins.

[0139] To better manage the queried change points, based on the above embodiments, in this embodiment, after querying the change points of the data block, the method further includes: Save the queried change points and their corresponding collection times to a preset change point result set.

[0140] In this embodiment of the application, after the electronic device identifies the change points and their corresponding acquisition times through the above processes, the electronic device can also convert the discrete query results into structured persistent data.

[0141] Specifically, in this embodiment, before starting the change point query, the electronic device can construct a change point result set (Result) and initialize it as an empty list to store the final change point query results. For example, the change point result set can be set as a key-value pair or a structure, where the key is the acquisition time and the value is the numerical value of the change point.

[0142] The change point result set is used to store information about all the change points obtained from the query. The information for each change point includes the acquisition time of the time series data corresponding to the change point and the value of the time series data.

[0143] Based on this, once the electronic device determines a point of change and its corresponding acquisition time, it saves the point of change and its corresponding acquisition time to a preset set of change point results.

[0144] Furthermore, to prevent memory overflow, a maximum capacity threshold can be set for the change point result set. When the number of change points stored in the change point result set reaches this maximum capacity threshold, the electronic device can trigger a persistence operation to serialize the content written to the change point result set and write it to a preset storage medium, such as a log table in a relational database, a document collection in a NoSQL database, or a specific file path in a distributed file system.

[0145] In this embodiment of the application, after each data block within the query time range has undergone change point query in the manner described in the above embodiments, the electronic device can return the change point result set as the final result of the change point query to the device that initiated the request.

[0146] In practical applications, the query time range may be aligned with the data block's collection time range, meaning the start query time of the query time range coincides with the start collection time of a certain data block, and the end query time of the query time range coincides with the end collection time of that data block. Alternatively, the query time range may not be aligned with the data block's collection time range, meaning at least one of the start and end query times may fall in the middle of a data block's collection time range.

[0147] Therefore, in this embodiment of the application, if the query time range is not aligned with the data block collection time range, the collection time corresponding to the change point obtained by the above embodiment may not be within the query time range.

[0148] Therefore, in order to further improve the accuracy of change point query, in this embodiment of the application, after the electronic device determines the change point, it can further filter the change point based on the collection time of the change point to ensure that the final change points are all generated within the query time range.

[0149] Specifically, based on the above embodiments, in this application embodiment, the method further includes: Based on the query time range and the collection time corresponding to the queried change points, the queried change points are filtered so that the collection time corresponding to the retained change points belongs to the query time range.

[0150] In this embodiment, the electronic device can filter the retrieved change points based on whether the collection time of the change point belongs to the query time range. Specifically, for each change point, if the collection time corresponding to the change point belongs to the query time range, then the change point is determined to be a qualified change point and is retained; if the collection time corresponding to the change point does not belong to the query time range, then the change point is determined to be a unqualified change point and is deleted.

[0151] For example, if the collection time range of data block Bi is 08:00-09:00 and the query time range is 08:30-12:30, and the collection time of a change point determined by the electronic device is 08:15, and the collection of this change point is not within the query time range, then the electronic device determines that this change point is not a change point generated within the query time range, and the electronic device deletes the change point from the change point result set, or does not add the change point to the change point result set.

[0152] It should be noted that, in one possible implementation, the electronic device can perform change point queries on all data blocks within the query time range, and then filter the queried change points based on the above method.

[0153] In another possible implementation, the electronic device may further filter the changes found in the first data block within the query time range after querying the changes; filter the changes found in the last data block within the query time range after querying the changes; and not filter the changes found in data blocks that are neither the first nor the last.

[0154] In addition, in this embodiment of the application, before the electronic device performs change point detection on the first and last data blocks within the query time range, it can first remove the time-series data in the first and last data blocks that are not within the query time range, and only perform change point detection on the time-series data in the first and last data blocks that are within the query time range.

[0155] Figure 3 A detailed schematic diagram illustrating a process for querying change points in time-series data, as provided in an embodiment of this application, is shown below. Figure 3 As shown, the entire process begins with a change point query request, i.e., the... Figure 3 In the user request, the change point query is first received and parsed by the request parsing module to determine the second parameter to be queried and the query time range. Subsequently, the data block location module, based on the parsing results, locates the specific data block containing the target data in the metadata index of the time-series database metadata layer. After location, the state initialization module prepares the necessary runtime state for the query operation, such as initializing the first value used for comparison. Next, the data block traversal and prediction module loads the target data block from the data block storage of the time-series database storage layer and traverses and performs preliminary analysis. During traversal, if encoded data needs to be processed, the process switches to the encoding adaptive processing module, which decodes or processes the data according to the data block's encoding method and writes the results back or updates the state. After completing the data block traversal and all necessary processing, the process enters the result return module, which summarizes the change points and other information found during the query process and finally presents the processed results to the user through the final result output stage.

[0156] The change point query method provided in this application fully reuses the existing storage architecture of time-series databases, requiring no modification to the write link, storage format, or metadata structure. It requires no additional pre-computation or index storage; only statistical information prediction logic is added during the query execution phase to achieve acceleration. This solution does not affect the core write performance of the time-series database, has no write amplification effect, and incurs no additional storage overhead. It can seamlessly adapt to all time-series databases using a block-based storage architecture with block-level statistics, demonstrating strong compatibility and feasibility.

[0157] The following is a comparison and explanation of the change point query method in related technologies and the change point query method in the embodiment of this application, using a specific example: For example, suppose the time-series database automatically uses RLE encoding to store steady-state data blocks: A factory equipment's on / off status sensor collects data at a frequency of 1 second / time. The time-series database stores data in blocks of 3600 records each, with each block containing 1 hour. A user initiates a query to retrieve the equipment status changes over a 24-hour period from 00:00:00 on January 1, 2026 to 00:00:00 on January 2, 2026. This involves 24 data blocks, one for each hour. Let's assume the data block with the collection time range of 00:00 on January 1, 2026 to 01:00 on January 1, 2026 is designated B1, and so on, defining B2-B24 accordingly.

[0158] The data distribution and encoding method are as follows: The device is powered off during the period from 00:00 to 08:00 on January 1, 2026. During this period, the values ​​of the switch status sensor are all 0. Therefore, the statistical information of any one of the 8 data blocks corresponding to this period is max=0, min=0. Using RLE encoding, the tuple sequence corresponding to this data block is [(0,3600)]. The device is powered on between 08:00 and 20:00 on January 1, 2026. During this period, the values ​​of the switch status sensor are all 1. Therefore, the statistical information of any one of the 12 data blocks corresponding to this period is max=1, min=1. Using RLE encoding, the tuple sequence corresponding to this data block is [(1,3600)]. The device is powered off during the period from 20:00 on January 1, 2026 to 00:00 on January 2, 2026. During this period, the values ​​of the switch status sensor are all 0. Therefore, the statistical information of any one of the four data blocks corresponding to this period is max=0, min=0, using RLE encoding and stored as [(0,3600)].

[0159] Based on the above scenario, the change point query method in related technologies needs to download 24 data blocks corresponding to the 24 hours from 00:00:00 on January 1, 2026 to 00:00:00 on January 2, 2026 to the local machine, and decompress and deserialize the 24 data blocks to obtain 86,400 time series data. Then, iterate through the 86,400 time series data and continuously remove duplicates to finally obtain 3 change points, namely 0 at 00:00 on January 1, 2026, 1 at 08:00 on January 1, 2026, and 0 at 20:00 on January 1, 2026.

[0160] Based on the above scenarios, the change point query process provided in this application embodiment includes the following steps: Step 1: Initialize the first value (current_value) of the latest changed point to an empty set (NULL), and initialize the result set of changed points to an empty list; Step 2: Traverse the statistics of the first data block B1 to find that the maximum value (max) and minimum value (min) of data block B1 are 0. At this time, the first value of the latest change point is NULL. If at least two of the maximum value, minimum value and the first value are inconsistent, it is determined that there is a change point in data block B1. According to the data encoding method carried in the statistics of data block B1, which is RLE encoding, the tuple sequence [(0,3600)] stored in the data block is obtained. The first time series data of tuple (0,3600) is determined as the change point. The value 0 of the change point and the key-value pair (00:00:00,0) corresponding to the collection time are added to the result change set. The first value of the latest change point is updated to 0. Step 3: Traverse the statistical information of data blocks B2 to B8 to obtain the maximum value (max) and minimum value (min) of data blocks B2 to B8. At this time, the first value of the latest change point is 0. Since the maximum value, minimum value and first value are completely consistent, skip data blocks B2 to B8 directly without reading them. Step 4: Traverse the statistical information of data block B9 to obtain the maximum value (max) of data block B9 as 1 and the minimum value (min) as 1. At this time, the first value of the latest change point is 0. If at least two of the maximum value, minimum value and the first value are inconsistent, it is determined that there is a change point in data block B9. According to the data encoding method carried in the statistical information of data block B9, which is RLE encoding, the tuple sequence [(1,3600)] stored in the data block is obtained. The first time series data of tuple (1,3600) is determined as the change point. The value 1 of the change point and the key-value pair (08:00:00,1) corresponding to the collection time are added to the result change set. The first value of the latest change point is updated to 1. Step 5: Traverse the statistical information of data blocks B10 to B20 to obtain the maximum value (max) and minimum value (min) of data blocks B10 to B20. At this time, the first value of the latest change point is 1. Since the maximum value, minimum value and first value are completely consistent, data blocks B10 to B20 can be skipped directly without reading. Step 6: Traverse the statistical information of data block B21 to find that the maximum value (max) of data block B21 is 0 and the minimum value (min) is 0. At this time, the first value of the latest change point is 1. If at least two of the maximum value, minimum value and the first value are inconsistent, it is determined that there is a change point in data block B21. According to the data encoding method carried in the statistical information of data block B21, which is RLE encoding, the tuple sequence [(0,3600)] stored in the data block is obtained. The first time series data of tuple (0,3600) is determined as the change point. The value 0 of the change point and the key-value pair (20:00:00,0) corresponding to the collection time are added to the result change set. The first value of the latest change point is updated to 0. Step 7: Traverse the statistical information of data blocks B22 to B24. The maximum value (max) of data blocks B22 to B24 is 0 and the minimum value (min) is 0. At this time, the first value of the latest change point is 0. Since the maximum value, minimum value and first value are completely consistent, data blocks B22 to B24 can be skipped directly without reading. Step 8: After traversal is complete, return the result set of change points, which records 3 change points.

[0161] Based on the above embodiments, the change point query method of related technologies needs to read 24 data blocks, deserialize and traverse 86,400 time series data; while the change point query method of this application embodiment only needs to read 3 data blocks and traverse 3 RLE tuples. The embodiment of this application significantly reduces the number of CPU traversals and comparisons, and further reduces query latency.

[0162] The following section compares and explains the change point query method of related technologies with the change point query method of the embodiments of this application, using flowcharts as examples: Figure 4 This is a comparative diagram of the change point query method in related technologies and the change point query method in the embodiments of this application, as shown in the diagram. Figure 4As shown, in the change point query method of this application embodiment, the electronic device first traverses the data block and uses a statistical information prediction mechanism for fast filtering. If the prediction result shows that there are no change points in the data block, the electronic device will skip the data block directly without performing subsequent reading and decompression operations. If the prediction shows that there are change points in the data block, the electronic device will read the data block and determine the encoding method. For data blocks with RLE encoding, the electronic device uses parsing tuples for fast processing, utilizing encoding characteristics to accelerate calculation; for data blocks with non-RLE encoding, standard line-by-line traversal processing is performed. After all branches are processed, the electronic device continues to the next data block until the traversal is complete and the result is returned.

[0163] In contrast, the execution flow of the change point query method for related technologies appears rather cumbersome. It does not make any predictions, but directly reads all data blocks in full, then decompresses and deserializes all data, and finally iterates through all data line by line to remove duplicates. Regardless of whether the data has changed or what encoding is used, it must go through the entire calculation process before finally returning the result.

[0164] Figure 5 A flowchart illustrating an accelerated method for querying time-series data change points, as provided in this application embodiment, is shown below. Figure 5 As shown, the entire process starts from the beginning node. First, it receives and parses the change point query request to determine the target time range. The electronic device then locates the list of data blocks to be traversed within the target time range and initializes the current_value state variable and the change point result set, i.e., the first value (current_value) of the latest change point and the change point result set used to store the results. The electronic device retrieves the data block Bi to be processed in ascending time order: The electronic device first obtains the max_i / min_i / encoding method of Bi from the metadata index, that is, it quickly obtains the statistical information (max_i, min_i) and data encoding method of data block Bi from the index of data block Bi. Next, it determines whether max_i == min_i and current_value == max_i, that is, whether the maximum value max_i, minimum value min_i of data block Bi are completely equal to the first value current_value. If the above conditions are met, that is, the maximum value max_i and the minimum value min_i of data block Bi are completely equal to the first value current_value, it means that all the timing data in data block Bi has not changed. The electronic device will directly skip the detailed parsing of data block Bi and determine whether there are any unprocessed data blocks. If so, it will proceed to the processing of the next data block Bi+1.

[0165] If the above conditions are not met, the electronic device reads the time-series data (raw data) of data block Bi. At this point, processing is split according to the encoding method: If data block Bi uses RLE encoding, the electronic device directly parses the RLE tuple sequence and compares it directly with the current_value to quickly locate the change point. That is, the electronic device directly parses the tuple sequence in data block Bi, utilizing its structural characteristics to quickly locate the change point without decompressing all the data; if data block Bi does not use RLE encoding, the electronic device first decompresses and deserializes it to obtain the time-series data sequence, then iterates through the data sequence sequentially and performs deduplication of consecutive repeating values ​​to find the change point.

[0166] Regardless of the path taken, after processing the current data block Bi, the electronic device updates the change point result set and the first value, current_value. It then checks if there are any unprocessed data blocks; if so, the loop continues; otherwise, it exits the loop and finally returns the summarized change point result set, ending the process.

[0167] Based on the above embodiments, this application also provides a device for querying change points based on time-series data. Figure 6 A schematic diagram of a change point query device based on time-series data provided in this application embodiment is shown. The device includes: The acquisition module 601 is used to acquire statistical information of each data block according to the collection time order of the time series data corresponding to each data block within the query time range, wherein the statistical information carries the maximum and minimum values ​​of the time series data corresponding to the data block; The processing module 602 is configured to sequentially process each data block and, if at least two of the maximum value, the minimum value, and the first value of the latest detected change point are inconsistent, determine that there is a change point in the time-series data in the data block; load the content stored in the data block into memory, and perform a change point query on the data block based on the loaded content and the first value; wherein, the change point is the starting data point in the time-series data sequence where the value changes.

[0168] In one possible implementation, the statistical information also carries the data encoding method of the time-series data corresponding to the data block; If the data encoding method is RLE, then the content stored in the data block is a tuple sequence, wherein the tuple sequence includes at least one tuple, and any tuple carries the third value of the time series data corresponding to the tuple and the number of times the third value is repeated consecutively.

[0169] In one possible implementation, if the data encoding method is RLE, the processing module 602 is specifically configured to perform the following steps sequentially for each tuple in the tuple sequence: if the first value is inconsistent with the third value carried in the tuple, then determine the first time series data corresponding to the tuple as a change point; determine the acquisition time of the first time series data according to the time offset of the tuple; update the first value with the third value, and continue to traverse the next tuple; if the third value is consistent with the first value, then determine that there is no change point in the tuple, and continue to traverse the next tuple.

[0170] In one possible implementation, if the data encoding method is non-RLE, the processing module 602 is specifically used to decode the loaded content to obtain each time-series data; and sequentially perform the following steps on each time-series data: if the first value is inconsistent with the fourth value corresponding to the time-series data, then the time-series data is determined to be a change point; the acquisition time of the time-series data is determined, and the first value is updated using the fourth value, and the process continues to traverse the next time-series data; if the fourth value is consistent with the first value, then the time-series data is determined not to be a change point, and the process continues to traverse the next time-series data.

[0171] In one possible implementation, if the data block is the first data block, the processing module 602 is further configured to set the first value of the latest change point to a null value; wherein the null value is inconsistent with any non-null value.

[0172] In one possible implementation, the processing module 602 is further configured to save the queried change points and their corresponding collection times to a preset change point result set.

[0173] In one possible implementation, the processing module 602 is further configured to determine that there is no change point of time series data in the data block if the maximum value, the minimum value and the first value of the latest change point are all consistent, skip the data block, not load the data block and query the change point, and process the next data block.

[0174] In one possible implementation, the processing module 602 is further configured to filter the queried change points according to the query time range and the collection time corresponding to the queried change points, so that the collection time corresponding to the retained change points belongs to the query time range.

[0175] Based on the above embodiments, this application also provides an electronic device. Figure 7 This application provides a schematic diagram of an electronic device structure, such as... Figure 7As shown, it includes: processor 701, communication interface 702, memory 703 and communication bus 704, wherein processor 701, communication interface 702 and memory 703 communicate with each other through communication bus 704. The memory 703 stores a computer program, which, when executed by the processor 701, causes the processor 701 to perform the following steps: Based on the collection time sequence of the time series data corresponding to each data block within the query time range, the following steps are executed sequentially for each data block: Obtain statistical information of the data block, wherein the statistical information carries the maximum and minimum values ​​of the time-series data corresponding to the data block; If at least two of the maximum value, the minimum value, and the first value of the latest detected change point are determined to be inconsistent, then a change point in the time-series data is determined to exist in the data block; wherein, the change point is the starting data point in the time-series data sequence where the value changes. The content stored in the data block is loaded into memory, and based on the loaded content and the first value, a change point query is performed on the data block.

[0176] In one possible implementation, the statistical information also carries the data encoding method of the time-series data corresponding to the data block; If the data encoding method is RLE, then the content stored in the data block is a tuple sequence, wherein the tuple sequence includes at least one tuple, and any tuple carries the third value of the time series data corresponding to the tuple and the number of times the third value is repeated consecutively.

[0177] In one possible implementation, if the data encoding method is RLE, the step of querying the change points of the data block based on the loaded content and the first value includes: Perform the following steps sequentially for each tuple in the tuple sequence: If the first value is inconsistent with the third value carried in the tuple, then the first time series data corresponding to the tuple is determined as the point of change; the acquisition time of the first time series data is determined according to the time offset of the tuple; the first value is updated using the third value, and the next tuple is traversed. If the third value is the same as the first value, it is determined that there is no change point in the tuple, and the process continues to traverse the next tuple.

[0178] In one possible implementation, if the data encoding method is non-RLE, the step of querying the change points of the data block based on the loaded content and the first value includes: The loaded content is decoded to obtain each time-series data; The following steps are performed sequentially on each of the time-series data: If the first value is inconsistent with the fourth value corresponding to the time series data, the time series data is determined to be a point of change; the acquisition time of the time series data is determined, and the first value is updated using the fourth value, and the next time series data is traversed. If the fourth value is consistent with the first value, then it is determined that the time series data is not a point of change, and the process continues to traverse the next time series data.

[0179] In one possible implementation, if the data block is the first data block, before determining that at least two of the maximum value, the minimum value, and the first value of the currently detected latest change point are inconsistent, the method further includes: Set the first value of the latest change point to a null value; wherein the null value is inconsistent with any non-null value.

[0180] In one possible implementation, after performing a change point query on the data block, the method further includes: Save the queried change points and their corresponding collection times to a preset change point result set.

[0181] In one possible implementation, the method further includes: If the maximum value, the minimum value, and the first value of the latest change point are all the same, it is determined that there is no change point of time series data in the data block, the data block is skipped, no loading or change point query is performed on the data block, and the next data block is processed.

[0182] In one possible implementation, the method further includes: Based on the query time range and the collection time corresponding to the queried change points, the queried change points are filtered so that the collection time corresponding to the retained change points belongs to the query time range. Since the principle of the above-mentioned electronic device in solving the problem is similar to the method of querying the change points of time series data, the implementation of the above-mentioned electronic device can be referred to the embodiments of the method, and the repeated parts will not be described again.

[0183] The communication bus mentioned in the aforementioned electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not indicate that there is only one bus or one type of bus. Communication interface 702 is used for communication between the aforementioned electronic device and other devices. The memory can include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory can also be at least one storage device located remotely from the aforementioned processor.

[0184] The processors mentioned above can be general-purpose processors, including central processing units, network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits, field-programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0185] Based on the above embodiments, this invention also provides a computer-readable storage medium storing a computer program executable by a processor. When the program is run on the processor, it causes the processor to perform the following steps: Based on the collection time sequence of the time series data corresponding to each data block within the query time range, the following steps are executed sequentially for each data block: Obtain statistical information of the data block, wherein the statistical information carries the maximum and minimum values ​​of the time-series data corresponding to the data block; If at least two of the maximum value, the minimum value, and the first value of the latest detected change point are determined to be inconsistent, then a change point in the time-series data is determined to exist in the data block; wherein, the change point is the starting data point in the time-series data sequence where the value changes. The content stored in the data block is loaded into memory, and based on the loaded content and the first value, a change point query is performed on the data block.

[0186] In one possible implementation, the statistical information also carries the data encoding method of the time-series data corresponding to the data block; If the data encoding method is RLE, then the content stored in the data block is a tuple sequence, wherein the tuple sequence includes at least one tuple, and any tuple carries the third value of the time series data corresponding to the tuple and the number of times the third value is repeated consecutively.

[0187] In one possible implementation, if the data encoding method is RLE, the step of querying the change points of the data block based on the loaded content and the first value includes: Perform the following steps sequentially for each tuple in the tuple sequence: If the first value is inconsistent with the third value carried in the tuple, then the first time series data corresponding to the tuple is determined as the point of change; the acquisition time of the first time series data is determined according to the time offset of the tuple; the first value is updated using the third value, and the next tuple is traversed. If the third value is the same as the first value, it is determined that there is no change point in the tuple, and the process continues to traverse the next tuple.

[0188] In one possible implementation, if the data encoding method is non-RLE, the step of querying the change points of the data block based on the loaded content and the first value includes: The loaded content is decoded to obtain each time-series data; The following steps are performed sequentially on each of the time-series data: If the first value is inconsistent with the fourth value corresponding to the time series data, the time series data is determined to be a point of change; the acquisition time of the time series data is determined, and the first value is updated using the fourth value, and the next time series data is traversed. If the fourth value is consistent with the first value, then it is determined that the time series data is not a point of change, and the process continues to traverse the next time series data.

[0189] In one possible implementation, if the data block is the first data block, before determining that at least two of the maximum value, the minimum value, and the first value of the currently detected latest change point are inconsistent, the method further includes: Set the first value of the latest change point to a null value; wherein the null value is inconsistent with any non-null value.

[0190] In one possible implementation, after performing a change point query on the data block, the method further includes: Save the queried change points and their corresponding collection times to a preset change point result set.

[0191] In one possible implementation, the method further includes: If the maximum value, the minimum value, and the first value of the latest change point are all the same, it is determined that there is no change point of time series data in the data block, the data block is skipped, no loading or change point query is performed on the data block, and the next data block is processed.

[0192] In one possible implementation, the method further includes: Based on the query time range and the collection time corresponding to the queried change points, the queried change points are filtered so that the collection time corresponding to the retained change points belongs to the query time range.

[0193] Since the principle of the computer-readable storage medium in solving the problem is similar to the method for querying change points of time-series data, the implementation of the computer-readable storage medium can be found in the embodiments of the method, and repeated details will not be repeated.

[0194] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CA-ROM, optical storage, etc.) containing computer-usable program code.

[0195] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0196] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0197] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0198] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for querying change points in time-series data, characterized in that, The method includes: Based on the collection time sequence of the time series data corresponding to each data block within the query time range, the following steps are executed sequentially for each data block: Obtain statistical information of the data block, wherein the statistical information carries the maximum and minimum values ​​of the time-series data corresponding to the data block; If at least two of the maximum value, the minimum value, and the first value of the latest detected change point are determined to be inconsistent, then a change point in the time-series data is determined to exist in the data block; wherein, the change point is the starting data point in the time-series data sequence where the value changes. The content stored in the data block is loaded into memory, and based on the loaded content and the first value, a change point query is performed on the data block.

2. The method according to claim 1, characterized in that, The statistical information also carries the data encoding method of the time-series data corresponding to the data block; If the data encoding method is Run-Length Encoding (RLE), then the content stored in the data block is a tuple sequence, wherein the tuple sequence includes at least one tuple, and any tuple carries the third value of the time-series data corresponding to the tuple and the number of times the third value is repeated consecutively.

3. The method according to claim 2, characterized in that, If the data encoding method is RLE, the step of querying the change points of the data block based on the loaded content and the first value includes: Perform the following steps sequentially for each tuple in the tuple sequence: If the first value is inconsistent with the third value carried in the tuple, then the first time series data corresponding to the tuple is determined as the point of change; the acquisition time of the first time series data is determined according to the time offset of the tuple; the first value is updated using the third value, and the next tuple is traversed. If the third value is the same as the first value, it is determined that there is no change point in the tuple, and the process continues to traverse the next tuple.

4. The method according to claim 2, characterized in that, If the data encoding method is not RLE, the change point query of the data block based on the loaded content and the first value includes: The loaded content is decoded to obtain each time-series data; The following steps are performed sequentially on each of the time-series data: If the first value is inconsistent with the fourth value corresponding to the time series data, the time series data is determined to be a point of change; the acquisition time of the time series data is determined, and the first value is updated using the fourth value, and the next time series data is traversed. If the fourth value is consistent with the first value, then it is determined that the time series data is not a point of change, and the process continues to traverse the next time series data.

5. The method according to claim 1, characterized in that, If the data block is the first data block, before determining that at least two of the maximum value, the minimum value, and the first value of the currently detected latest change point are inconsistent, the method further includes: Set the first value of the latest change point to a null value; wherein the null value is inconsistent with any non-null value.

6. The method according to claim 1, characterized in that, After performing a change point query on the data block, the method further includes: Save the queried change points and their corresponding collection times to a preset change point result set.

7. The method according to claim 1, characterized in that, The method further includes: If the maximum value, the minimum value, and the first value of the latest change point are all the same, it is determined that there is no change point of time series data in the data block, the data block is skipped, no loading or change point query is performed on the data block, and the next data block is processed.

8. The method according to any one of claims 1-7, characterized in that, The method further includes: Based on the query time range and the collection time corresponding to the queried change points, the queried change points are filtered so that the collection time corresponding to the retained change points belongs to the query time range.

9. A device for querying change points in time-series data, characterized in that, The device includes: The acquisition module is used to acquire statistical information of each data block according to the collection time order of the time series data corresponding to each data block within the query time range, wherein the statistical information carries the maximum and minimum values ​​of the time series data corresponding to the data block; The processing module is configured to sequentially process each data block and, if at least two of the maximum value, the minimum value, and the first value of the latest detected change point are inconsistent, determine that there is a change point in the time-series data in the data block; load the content stored in the data block into memory, and perform a change point query on the data block based on the loaded content and the first value; wherein, the change point is the starting data point in the time-series data sequence where the value changes.

10. An electronic device, characterized in that, The electronic device includes a processor that executes a computer program stored in a memory to implement the steps of the time-series data change point query method as described in any one of claims 1-7.

11. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the steps of the time-series data change point query method as described in any one of claims 1-7.