A coal mine monitoring time sequence data feature-preserving down-sampling query method and device

CN122946427APending Publication Date: 2026-10-20CHINA COAL TECH & ENG GRP CHONGQING RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611158942.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0004]为此,本发明所要解决的技术问题在于克服现有技术中降采样查询方法在压缩时序数据规模时无法完整保留物理极值点和关键事件特征点,导致数据失真及安全隐患漏报的问题

Benefits of technology

本发明所述的煤矿监控时序数据的保特征降采样查询方法,通过抽象语法树解析将静态配置查询与时序数据查询解耦,避免了跨表联合查询的高开销,降低了底层数据库I/O负载;通过前端像素容限驱动的时间分桶步长计算与标准步长阶梯匹配,实现了降采样粒度与前端渲染能力的精确适配,有效避免了海量数据导致的前端卡顿与渲染崩溃;通过在底层并行执行首尾点、物理极值点提取以及关键事件强制保留,确保瞬态瓦斯超限峰值、设备状态翻转等安全关键特征在数据压缩过程中零遗漏,从根本上避免了传统均值降采样导致的数据失真;进一步通过内存中的全局时序重排与冗余消除,保证了数据的时序一致性与传输高效性。由此,在显著压缩数据传输体积、提升历史趋势查询响应速度的同时,完整保留了煤矿监控数据的原始包络边界与安全告警事件,为煤矿安全隐患识别与事故回溯提供了真实可靠的数据基础。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention relates to the field of downsampling query technology, and in particular to a method, apparatus, equipment, and computer storage medium for feature-preserving downsampling query of coal mine monitoring time-series data. This invention intercepts query requests, parses abstract syntax trees, and decouples static configuration from time-series queries; it determines the theoretical bucket step size based on front-end pixel tolerance and start / end times, and matches a standard step size ladder; it extracts the first and last points, physical extreme values, and their timestamps in parallel within each time bucket, forcibly retaining alarm anomalies and state reversal points as penetrating feature points; it converts the feature points into sequences with timestamps and labels, globally rearranges them according to the original timestamps and removes redundancy, and then streams them to the front end after fusing them with static attributes. This invention compresses the data scale while completely preserving the original envelope boundaries and security events, ensuring data authenticity and reliability, improving the efficiency of large-span queries, and avoiding front-end rendering crashes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of downsampling query technology, and in particular to a method, apparatus, equipment, and computer storage medium for feature-preserving downsampling query of coal mine monitoring time series data. Background Technology

[0002] As the core hub of safety production management, intelligent control platforms for coal mines are widely used in subsystems such as safety monitoring, main ventilation, main drainage, and mine pressure monitoring. Among related technologies, a high-frequency time-series data stream is constructed through the collaborative operation of data acquisition services, industrial network protocols, and proprietary protocols. Specifically, this data stream covers the entire process from writing sensor status data to database storage, including the joint management of static equipment attributes and dynamic monitoring data, providing a foundation for historical trend analysis.

[0003] However, existing downsampling query methods directly use mean calculation or LTTB algorithm, which do not retain physical extreme values ​​and key event state points. This may result in the smoothing out of transient gas over-limit peak values ​​or the discarding of equipment state reversal points, thereby affecting the accurate identification of coal mine safety hazards and the assurance of data authenticity. Summary of the Invention

[0004] Therefore, the technical problem to be solved by the present invention is to overcome the problem that the downsampling query method in the prior art cannot completely retain physical extreme points and key event feature points when compressing the scale of time series data, resulting in data distortion and missed reporting of security risks.

[0005] To address the aforementioned technical problems, this invention provides a method for feature-preserving downsampling query of coal mine monitoring time-series data, comprising: Intercept heterogeneous database query requests, perform abstract syntax tree parsing on the query statements of the query requests, and decouple the query statements into a static configuration query part and a time-series data query part; Based on the pixel tolerance points of the front-end window and the start and end times of the time-series data query section, the theoretical time bucket step size is determined, and the theoretical time bucket step size is matched with the preset standard time bucket step size to obtain the target bucket step size. Based on the target bucket step size, feature preservation extraction is performed on each time bucket in the underlying time series database. The feature preservation extraction includes: extracting the first and last data points and their original timestamps in the bucket, extracting the physical maximum and physical minimum values ​​and their original timestamps in the bucket, and forcibly retaining the feature points in the bucket that meet the preset key event conditions as penetration feature points. Receive each of the aforementioned feature points and their original timestamps, convert the feature points into sequence objects with timestamps and attribute labels, perform global time-series rearrangement based on the original timestamps and eliminate redundant points, and push the rearranged time-series sequence to the front end.

[0006] Preferably, the interception of heterogeneous database query requests, the abstract syntax tree parsing of the query statement of the query request, and the decoupling and separation of the query statement into a static configuration query part and a time-series data query part, includes: The built-in SQL dialect parser intercepts the heterogeneous database query request, performs lexical tagging and syntax analysis on the query statement, and transforms the query statement into a hierarchical abstract syntax tree; Traverse the nodes of the abstract syntax tree, identify and extract the static configuration query part, and route the static configuration query part to the local cache engine for execution; The time series data query part is identified and sent to the underlying time series database for execution.

[0007] Preferably, routing the static configuration query portion to the local caching engine for execution includes: A local embedded database is maintained inside the middleware gateway as an in-process caching engine. The caching engine maintains data consistency with the underlying master relational configuration table through a background asynchronous synchronization mechanism. In the process memory of the middleware gateway, static configuration parameters of the target measurement point are extracted through hash mapping.

[0008] Preferably, after identifying the time-series data query portion, the method further includes: Extract the time span condition of the time series data query part. If the time span condition hits the cold data storage area in the compressed state in the underlying time series database, then intercept the original query request and switch to the adaptive time bucketing and feature downsampling calculation process.

[0009] Preferably, pushing the rearranged time series to the front end includes: The rearranged time sequence is fused with the pre-extracted static configuration information in memory and transformed into a key-value pair data structure. Using TCP-based streaming serialization technology, the merged data is pushed to the client in segments via network sockets.

[0010] Preferably, the step of determining the theoretical time bucketing step size based on the pixel tolerance number of the front-end window and the start and end times of the time-series data query section, and matching the theoretical time bucketing step size with a preset standard time bucketing step size to obtain the target bucketing step size, includes: Parse the client request context and extract the maximum number of valid pixels that the current chart container on the front end can hold. Extract the start and end timestamps of the time-series data query portion; The theoretical time bucket step size is determined based on the difference between the start timestamp and the end timestamp and the number of pixel tolerance points. The theoretical time bucket step size is compared with the preset standard time bucket step mapping table, and then rounded up to match the standard step size to obtain the target bucket step size.

[0011] Preferably, the standard time bucket ladder mapping table includes multiple query span intervals and their corresponding standard step sizes. The query span intervals are determined based on the difference between the start timestamp and the end timestamp, and the standard step size increases in a stepwise manner as the query span increases.

[0012] Preferably, the extraction of the first and last data points and their original timestamps within the bucket includes: Extract the first and last physical monitoring values ​​from the time bucket, and return the original millisecond-level timestamps corresponding to the first and last physical monitoring values ​​respectively.

[0013] Preferably, extracting the physical maximum and physical minimum values ​​and their original timestamps within the bucket includes: Scan all data points within the time bucket, extract the physical highest peak value and its corresponding original occurrence timestamp, and the physical lowest valley value and its corresponding original occurrence timestamp within that time period.

[0014] Preferably, the step of forcibly retaining feature points within the bucket that meet preset key event conditions as penetration feature points includes: For analog sensors, read the alarm status field of each data point. If the alarm status field indicates an abnormal state, then the data point is forcibly retained as a penetration feature point. For digital sensors, if the device's operating status enumeration value changes, the data point that has changed will be forcibly retained as a penetration feature point.

[0015] Preferably, converting the feature points into sequence objects with timestamps and attribute labels includes: The composite result set returned from the underlying layer is structurally decomposed, and the first data point, last data point, physical maximum value point, physical minimum value point, and penetrating feature point collected in a single time bucket are transformed into time series objects composed of a single timestamp, feature value, and feature attribute label.

[0016] Preferably, the step of performing global time-series rearrangement and eliminating redundant points based on the original timestamps includes: Based on the original millisecond-level timestamps of each sequence object, all sequence objects are sorted in memory in ascending order of time; Redundancy detection is performed. If multiple sequence objects correspond to the same measurement point and have the same value at the same time, the label nodes of the multiple sequence objects are merged, and the single-time structure is retained.

[0017] Preferably, before intercepting heterogeneous database query requests, the method further includes: Building a hybrid storage environment includes: Construct a relational table structure to store the static configuration information of monitoring points in each mining area of ​​the coal mine; The relational time series table is converted into a time-based supertable structure. A compression strategy is configured according to the data lifecycle, so that recent data is kept uncompressed, while historical long-period data is compressed and archived into read-only partition blocks.

[0018] This invention also provides a feature-preserving downsampling query device for coal mine monitoring time-series data, comprising: The query parsing module is used to intercept query requests from heterogeneous databases, perform abstract syntax tree parsing on the query statements of the query requests, and decouple the query statements into a static configuration query part and a time-series data query part. The step size calculation module is used to determine the theoretical time bucket step size based on the number of pixel tolerance points of the front-end window and the start and end times of the time series data query part, and to match the theoretical time bucket step size with the preset standard time bucket step size to obtain the target bucket step size. The feature extraction module is used to perform feature-preserving extraction on each time bucket in the underlying time series database based on the target bucket step size. The feature-preserving extraction includes: extracting the first and last data points and their original timestamps in the bucket, extracting the physical maximum and physical minimum values ​​and their original timestamps in the bucket, and forcibly retaining the feature points in the bucket that meet the preset key event conditions as penetrating feature points. The time series reconstruction module is used to receive each feature point and its original timestamp, convert the feature points into sequence objects with timestamps and attribute labels, perform global time series rearrangement according to the original timestamps and eliminate redundant points, and push the rearranged time series sequence to the front end.

[0019] This invention also provides a feature-preserving and feature-reducing sampling query device for coal mine monitoring time series data, comprising: Memory, used to store computer programs; A processor is used to execute the computer program to implement the steps of the above-described method for feature-preserving downsampling query of coal mine monitoring time-series data.

[0020] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described method for feature-preserving downsampling query of coal mine monitoring time-series data.

[0021] The technical solution of the present invention has the following advantages over the prior art: The feature-preserving downsampling query method for coal mine monitoring time-series data described in this invention decouples static configuration queries from time-series data queries through abstract syntax tree parsing, avoiding the high overhead of cross-table join queries and reducing the I / O load of the underlying database. By using front-end pixel tolerance-driven time bucket step size calculation and standard step size ladder matching, it achieves precise adaptation between downsampling granularity and front-end rendering capabilities, effectively avoiding front-end lag and rendering crashes caused by massive data. Through parallel execution of first and last points, physical extreme points extraction, and mandatory retention of key events at the underlying level, it ensures zero omission of safety-critical features such as transient gas exceedance peaks and equipment state reversals during data compression, fundamentally avoiding data distortion caused by traditional mean downsampling. Furthermore, through global time-series rearrangement and redundancy elimination in memory, it guarantees data temporal consistency and transmission efficiency. Therefore, while significantly compressing data transmission volume and improving the response speed of historical trend queries, it completely preserves the original envelope boundaries and safety alarm events of coal mine monitoring data, providing a reliable data foundation for coal mine safety hazard identification and accident backtracking. Attached Figure Description

[0022] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings, wherein: Figure 1 This is a flowchart illustrating the implementation of a feature-preserving downsampling query method for coal mine monitoring time-series data provided by the present invention. Figure 2 This is a flowchart illustrating the implementation of a feature-preserving downsampling query method for coal mine monitoring time-series data, provided in one embodiment of the present invention. Figure 3 This is a schematic diagram of feature extraction and temporal reconstruction. Figure 4 This is a structural block diagram of a coal mine monitoring time-series data feature-preserving downsampling query device provided in an embodiment of the present invention. Detailed Implementation

[0023] The core of this invention is to provide a method, device, equipment, and computer storage medium for feature-preserving downsampling query of coal mine monitoring time series data. This effectively solves the problems of data distortion and missed reporting of safety hazards caused by the inability of existing downsampling technologies to fully preserve physical extreme points and key event feature points. At the same time, it significantly reduces the data scale, improves query efficiency, and avoids front-end rendering crashes.

[0024] To enable those skilled in the art to better understand the present invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] Please refer to Figure 1 and Figure 2 , Figure 1 This is a flowchart illustrating the implementation of a feature-preserving downsampling query method for coal mine monitoring time-series data provided by the present invention. Figure 2 The flowchart below shows an embodiment of a method for feature-preserving downsampling query of coal mine monitoring time-series data according to an embodiment of the present invention; the specific operation steps are as follows: S101: Intercept heterogeneous database query requests, perform abstract syntax tree parsing on the query statement of the query request, and decouple the query statement into a static configuration query part and a time-series data query part; In the coal mine monitoring system, a middleware gateway is built between the business system and the underlying database. This gateway acts as an independent proxy layer, intercepting heterogeneous database query requests from the business system. Once a query request is intercepted, the gateway's built-in parsing engine performs lexical and syntactic analysis on the query statement, converting it into a hierarchical abstract syntax tree structure. Through traversal of the abstract syntax tree and node identification, the gateway can distinguish between query parts involving static attribute information and query parts involving dynamic time-series data, decoupling and separating the two.

[0026] Specifically, the gateway's built-in SQL dialect parser parses the original query statement into an abstract syntax tree, then identifies the static configuration query conditions and time-series query conditions by traversing the nodes, generating independent subquery statements for each. The static configuration query part typically involves low-frequency updated configuration data such as basic device definition information, area information, and alarm thresholds. This part is routed to the gateway's local memory-level caching engine for execution, avoiding high-overhead cross-table join operations to the underlying database. The time-series data query part involves frequently written sensor monitoring values ​​and timestamps. This part is extracted independently and sent to the underlying time-series database for execution.

[0027] In one implementation, the specific method for routing the static configuration query part to the local cache engine is as follows: a local embedded database is maintained inside the middleware gateway as an in-process cache engine. This engine, together with the background asynchronous synchronization mechanism, ensures the data consistency between itself and the underlying master relational configuration table. Subsequently, static configuration parameters such as the name, range and alarm threshold of the target measurement point are extracted directly in the memory of the gateway process through hash mapping, thereby reducing the latency caused by network communication and disk I / O.

[0028] In one implementation, after identifying the time-series data query portion, a cold / hot boundary detection step is also included: extracting the time-domain span condition of the time-series data query portion; if the span is detected to hit the cold data storage area in the compressed state in the underlying time-series database, the original query request is actively intercepted and transferred to the subsequent adaptive time bucketing and feature downsampling calculation process; if the cold data area is not hit, the time-series data query portion is directly sent to the underlying time-series database for execution.

[0029] S102: Determine the theoretical time bucket step size based on the number of pixel tolerance points of the front-end window and the start and end times of the time-series data query part, and match the theoretical time bucket step size with the preset standard time bucket step size to obtain the target bucket step size. This step aims to dynamically calculate the downsampling step size based on the actual display capabilities of the front end, achieving a precise match between the downsampling granularity and the front end's rendering capabilities. Specifically, it first obtains the maximum effective pixel tolerance number that the front end's chart container can hold, reflecting the upper limit constraint of the front end's rendering capabilities on the number of data points; simultaneously, it extracts the start and end timestamps covered by the time-series data query portion, thereby determining the total time span of the data to be queried. Based on these two parameters, a theoretical time bucket step size is calculated, which represents the theoretical time length that each time bucket should contain, provided that the front end's pixel tolerance is met.

[0030] Because the underlying time-series database has higher computational efficiency and cache hit rate for natural standard time granularities (such as whole minutes and whole hours) when performing time-based bucket aggregation, directly using non-integer theoretical step sizes would lead to inefficient execution plans. Therefore, the system internally pre-defines a standard time-based bucketing ladder mapping table, which defines the standard bucketing granularity corresponding to different query spans. The system compares the calculated theoretical step size with this mapping table, automatically rounding up to the nearest standard step size, thus obtaining the final target bucketing step size sent to the underlying database.

[0031] In one implementation, the client's HTTP / WebSocket request context is parsed to extract the maximum number of valid pixel tolerance points that the current chart container on the front end can hold, denoted as... This value is typically determined by the front-end framework based on the pixel width of the chart container and a preset upper limit for rendering density; for example, in one implementation, it can be set to 1000 discrete points. Simultaneously, the start timestamp of the time-series data query portion is extracted. With end timestamp Both are measured in seconds. Theoretical time bucket step size. The number of pixel tolerance points is determined based on the difference between the start timestamp and the end timestamp, and specifically, it can be determined using the formula... The calculation yielded the result.

[0032] Then, The target bucket step size is obtained by comparing the target bucket step size with the preset standard time bucketing ladder mapping table, automatically rounding up to the matching standard step size. In one implementation, the mapping table contains multiple query span intervals and their corresponding standard step sizes, as shown in the table below: Table 1 Standard Time Bucket Ladder Mapping Table

[0033] The standard step size increases in a stepwise manner as the query span increases, that is, the first standard step size to the sixth standard step size increases sequentially.

[0034] In one implementation, when the query span is 0 to 1 hour, the theoretical step size is in the range of 0 to 3.6 seconds, and the standard mapping step size is 60 seconds (i.e., 1 minute); when the query span is 1 hour to 8.3 hours, the theoretical step size is in the range of 3.6 to 30 seconds, and the standard mapping step size is 300 seconds (i.e., 5 minutes); when the query span is 8.3 hours to 1 day, the theoretical step size is in the range of 30 to 86.4 seconds, and the standard mapping step size is 3600 seconds (i.e., 1 hour). When the query span is between 1 day and 16.7 days, the theoretical step size is between 86.4 and 1440 seconds, and the standard mapping step size is 14400 seconds (i.e., 4 hours); when the query span is between 16.7 days and 100 days, the theoretical step size is between 1440 and 8640 seconds, and the standard mapping step size is 86400 seconds (i.e., 1 day); when the query span is more than 100 days, the theoretical step size is more than 8640 seconds, and the standard mapping step size is 604800 seconds (i.e., 1 week).

[0035] S103: Based on the target bucket step size, perform feature preservation extraction on each time bucket in the underlying time series database. The feature preservation extraction includes: extracting the first and last data points and their original timestamps in the bucket, extracting the physical maximum and physical minimum values ​​and their original timestamps in the bucket, and forcibly retaining the feature points in the bucket that meet the preset key event conditions as penetration feature points. This step aims to filter and retain feature points that can characterize the original form of the data and key events within each time bucket from the high-frequency discrete data. It abandons the traditional arithmetic mean downsampling method and adopts a physical feature anchoring and anomaly event penetration strategy.

[0036] Specifically, for each time bucket, the underlying database computing engine executes the following extraction rules in parallel during traversal: First, feature point extraction. Extract the first and last physical monitoring values ​​within the time bucket, and correlate them with the original millisecond-level timestamps that were actually written to the underlying layer, to anchor the basic trend and starting boundary of the data in that time period.

[0037] In one implementation, the system obtains an ordered set of all original data records within the time bucket, these records being arranged in strict ascending order according to their original millisecond-level timestamps at the time of data writing. The system locates the first physical monitoring value and its corresponding original millisecond-level timestamp, as well as the last physical monitoring value and its corresponding original millisecond-level timestamp, from this ordered set. After extraction, the system encapsulates the first and last feature points into binary structures containing both timestamps and values, and temporarily stores them in a buffer pool in the gateway's memory.

[0038] Second, anchoring of the upper and lower envelopes of physical extreme values. Extract the physical maximum and minimum values ​​and their original timestamps within the bucket. That is, scan all data points within the time bucket, extract the physical highest peak value and its corresponding original occurrence timestamp, and the physical lowest valley value and its corresponding original occurrence timestamp, to construct the upper and lower limit envelope boundaries of data fluctuations within the time period, ensuring that any transient surges or drops are fully recorded.

[0039] In one implementation, for analog sensors, the engine directly compares the numerical fields of each data point, records the maximum and minimum values, and associates them with their original millisecond-level timestamps; for digital sensors, the physical values ​​are represented as discrete enumerated values, and the engine similarly compares their numerical values ​​and extracts the maximum and minimum values.

[0040] Third, key features are forcibly retained. Feature points within the bucket that meet preset key event conditions are forcibly retained as penetration feature points. The system introduces an alarm status determination and status reversal determination mechanism unique to coal mine operations. For data points that meet preset key event conditions, regardless of whether they are maximum or minimum values ​​within a local interval, they are assigned the highest priority weight and recorded and extracted separately as independent penetration feature points.

[0041] In one implementation, coal mine monitoring data is divided into two categories: analog sensors and digital sensors. The algorithm processes them separately during the time-sharing process: For analog sensors, each data point is written by the front-end acquisition system based on the alarm threshold at that time, which calculates the alarm status field. This alarm status field is an enumeration type and includes at least the status values ​​of normal, upper limit alarm, lower limit alarm, upper upper limit alarm, and lower lower limit alarm. The system directly reads this alarm status field during the downsampling traversal. If the field indicates an abnormal state (i.e., the state is not "normal"), the data point is forcibly retained as a penetration feature point. For digital sensors, if the equipment operating status enumeration value changes (e.g., the fan changes from running to stopped, or the damper changes from closed to abnormally open), the data point with the change is forcibly retained as a penetration feature point.

[0042] S104: Receive each of the feature points and their original timestamps, convert the feature points into sequence objects with timestamps and attribute labels, perform global time-series rearrangement according to the original timestamps and eliminate redundant points, and push the rearranged time-series sequence to the front end.

[0043] like Figure 3 After feature extraction in step S103, the data volume received by the gateway layer has been significantly compressed. However, since the extracted first data point, last data point, physical maximum value point, physical minimum value point, and penetration feature point all have their own independent original timestamps, the data returned by the database may be out of order on the timeline. The gateway layer allocates a buffer pool in runtime memory and performs the following time-series reordering and push operations.

[0044] First, feature point structure decomposition. The composite result set returned from the bottom layer is decomposed into a structure, and each feature point gathered in a single time bucket is transformed into a time series object array composed of a single timestamp, feature value, and feature attribute label.

[0045] In one implementation, the gateway layer iterates through each record in the composite result set and parses it into independent sequence objects based on the identifier field carried by the record. The first data point is labeled "First Point of Time Period"; the last data point is labeled "Last Point of Time Period"; the physical maximum value point is labeled "Peak Point"; the physical minimum value point is labeled "Valuation Point"; and for penetration feature points, labels are assigned based on their triggering reason, such as "Alarm Penetration Point" or "Status Reversal Point". The data structure of each sequence object includes a timestamp field, a numeric field, and a label field.

[0046] Second, global time-series rearrangement and redundancy elimination. Based on the original timestamps of each sequence object, all sequence objects are sorted in memory in ascending order of time, reconstructing a complete timeline in ascending order of time. Simultaneously, redundancy detection is performed. If multiple sequence objects correspond to the same measurement point and have the same value at the same time, the tag nodes of these multiple sequence objects are merged, retaining a single-time-point structure to compress the data volume.

[0047] In one implementation, the system uses the original millisecond-level timestamp of each feature point to perform global sorting in memory using a quicksort algorithm. During the sorting process, if at a specific moment the starting value of a measurement point happens to be its historical highest peak (i.e., the original timestamps and physical values ​​of both are completely consistent), the deduplication algorithm merges redundant label nodes, retaining only the single-moment structure, for example, marking the point as "first point of time period / highest peak point".

[0048] Third, the rearranged time series is pushed to the front end. The reconstructed time series is fused in memory with the pre-extracted static configuration information, transformed into a key-value pair data structure, and then the fused data is pushed to the client in segments via network sockets using TCP-based streaming serialization technology, enabling fast loading of front-end visualization charts.

[0049] In one implementation, the system associates the reconstructed time sequence with the static configuration parameters extracted in step S101 to form a complete data unit containing timestamps, feature values, feature attribute tags, and device static information. This unit is then uniformly converted into a key-value pair data structure, for example, using a streaming serialization representation in JSON format. During the push phase, the gateway layer serializes the key-value pair data structure into a continuous byte stream and, utilizing the streaming transmission characteristics of the TCP protocol, segments the message into multiple data segments, which are then sequentially sent to the front-end browser or application client through the established network socket connection.

[0050] Based on the above embodiments, in some embodiments, the interception of heterogeneous database query requests, the abstract syntax tree parsing of the query statement of the query request, and the decoupling and separation of the query statement into a static configuration query part and a time-series data query part include: The built-in SQL dialect parser intercepts the heterogeneous database query request, performs lexical tagging and syntax analysis on the query statement, and transforms the query statement into a hierarchical abstract syntax tree; Traverse the nodes of the abstract syntax tree, identify and extract the static configuration query part, and route the static configuration query part to the local cache engine for execution; The time series data query part is identified and sent to the underlying time series database for execution.

[0051] First, the middleware gateway's built-in SQL dialect parser intercepts heterogeneous database query requests initiated by the business system. These requests are typically native database query statements that mix static basic information conditions with historical time-series conditions. The parser performs lexical tagging and syntax analysis on the intercepted text statements, transforming the query statements into a hierarchical abstract syntax tree (AST). Specifically, the lexical analysis phase breaks down the query statement into a series of semantically meaningful minimum lexical units, including keywords, identifiers, operators, constants, delimiters, etc.; the syntax analysis phase, based on preset SQL syntax rules, organizes these lexical units into an abstract syntax tree reflecting the hierarchical structure and semantic relationships of the statement. Each node in the tree represents a grammatical construct, such as SELECT clause nodes, FROM clause nodes, WHERE condition nodes, JOIN join nodes, etc.

[0052] Subsequently, the middleware gateway traverses all nodes of the abstract syntax tree, identifying and extracting the static configuration query portion through node type recognition and semantic analysis. This static configuration query portion is used to query device static configuration information, such as unique identifiers for measurement points, measurement point names, range limits, alarm thresholds, and other low-frequency updated dimensional data. Specifically, the gateway determines the nature of the query based on the table names, field names, and query conditions referenced in the nodes. If a query branch only involves static configuration tables and does not contain references to time-series data tables or time-series aggregation functions, it is identified as a static configuration query portion. After identification, the gateway routes the static configuration query portion to the local caching engine for execution, thereby directly extracting the static configuration parameters of the target measurement point in the gateway process's memory, avoiding high-overhead cross-table join operations to the underlying database.

[0053] Simultaneously, the gateway continues to traverse the nodes of the abstract syntax tree to identify the time-series data query portion. This time-series data query portion is used to query historical monitoring data, and its typical characteristics include: referencing a time-series data table, containing time range filtering conditions, or containing aggregation functions oriented towards time-series data. After identifying the time-series data query portion, the gateway decouples it from the static configuration query portion, retaining its time-domain span conditions and aggregation logic, and distributes the time-series data query portion as a second database dialect to the underlying time-series database for execution. In one implementation, the syntax format of the second database dialect dynamically adapts according to the type of the underlying time-series database. When the underlying database uses a time-series database that supports downsampling expansion, the second database dialect incorporates a target bucketing step size parameter to instruct the underlying database to perform time bucketing aggregation at a specified step size.

[0054] Through the above method, this embodiment achieves decoupling and splitting of static configuration query and time-series data query at the gateway layer. Static configuration data is quickly extracted from the memory-level cache, while time-series data is independently sent to the underlying time-series database for execution. This significantly reduces the I / O pressure and read-write lock contention on the underlying database caused by cross-table join queries, laying a data foundation for the efficient execution of subsequent adaptive time bucketing and feature downsampling calculation processes.

[0055] Based on the above embodiments, in some embodiments, routing the static configuration query portion to the local cache engine for execution includes: A local embedded database is maintained inside the middleware gateway as an in-process caching engine. The caching engine maintains data consistency with the underlying master relational configuration table through a background asynchronous synchronization mechanism. In the process memory of the middleware gateway, static configuration parameters of the target measurement point are extracted through hash mapping.

[0056] First, a local embedded database is maintained within the middleware gateway as an in-process caching engine. This caching engine runs independently of the underlying master relational database, residing in the heap memory space of the gateway process, and has extremely low data access latency. To ensure the accuracy and timeliness of the cached data, the caching engine works in conjunction with a background asynchronous synchronization mechanism to ensure data consistency with the underlying master relational configuration table. Specifically, the background asynchronous synchronization mechanism includes the following processing logic: when static configuration data in the underlying master relational configuration table changes, the change event is asynchronously notified to the gateway layer through a message queue or change data capture component. After receiving the notification, the gateway updates the corresponding record in the local embedded cache. Simultaneously, the caching engine performs periodic full or incremental synchronization tasks at preset time intervals as a fallback guarantee for the change notification mechanism, ensuring that cached data can still maintain consistency with the underlying configuration table in extreme cases (such as message loss or network partitioning). In one embodiment, the preset time interval is 5 minutes.

[0057] While ensuring cached data consistency, once the static configuration query is routed to the local cache engine, the gateway directly extracts the static configuration parameters of the target measurement point from the middleware gateway's process memory via hash mapping. Specifically, the local embedded cache engine uses the unique identifier of the measurement point as the key and the corresponding static configuration information such as the measurement point name, range upper and lower limits, and alarm thresholds as the value to construct an in-memory hash table structure. When a static configuration query request is received, the gateway, based on the measurement point identifier carried in the query conditions, directly locates and extracts the required static configuration parameters in constant time complexity using a hash lookup algorithm. In one implementation, the hash mapping uses chaining to resolve hash collisions, and the load factor is controlled within 0.75 to ensure lookup efficiency.

[0058] In this embodiment, static configuration queries are separated from cross-table join operations in the underlying database, and millisecond-level parameter extraction is achieved in the gateway memory. This significantly reduces the latency caused by network communication and disk I / O. At the same time, the background asynchronous synchronization mechanism ensures the eventual consistency between cached data and the underlying configuration table, providing an accurate and efficient source of static parameters for the subsequent memory fusion of time-series data and static attributes.

[0059] Based on the above embodiments, in some embodiments, after identifying the time-series data query portion, the method further includes: Extract the time span condition of the time series data query part. If the time span condition hits the cold data storage area in the compressed state in the underlying time series database, then intercept the original query request and switch to the adaptive time bucketing and feature downsampling calculation process.

[0060] The gateway extracts the time span condition of the time-series data query portion to obtain the start and end timestamps of the query. In the underlying time-series database, data is divided into different storage areas according to its write time. Recently written data is uncompressed and stored in the hot data area to support high-frequency writes and real-time monitoring I / O requirements; while historical long-period data is automatically compressed and archived into read-only partitions, forming a cold data storage area. The cold data storage area uses a high-compression columnar storage format, which significantly saves storage space, but if a query is performed directly on this area, decompression is required first, consuming significant I / O and CPU resources.

[0061] Based on the aforementioned storage characteristics, the gateway determines the time span condition: if the time span condition hits a cold data storage area in a compressed state in the underlying time-series database, the gateway actively intercepts the original query request, does not directly send it to the underlying database for execution, but instead switches to an adaptive time bucketing and feature downsampling calculation process. The cold data is compressed and extracted using the feature-preserving downsampling method of this invention before returning the result. Specifically, the gateway compares the time-domain range defined by the start and end timestamps of the query with the cold and hot data partition boundaries of the underlying time-series database, calculating the proportion of cold data within that time-domain range to the total data volume. In one embodiment, when the proportion exceeds a preset threshold, it is determined that a cold data storage area has been hit. In one embodiment, the preset threshold is 50%. If no cold data storage area is hit, meaning the query mainly falls within the hot data area, the gateway directly sends the time-series data query portion to the underlying time-series database for regular query execution.

[0062] Through the above method, this embodiment realizes intelligent query routing based on hot and cold boundaries. For historical queries with a large span that hit the cold data area, it actively switches to the adaptive time bucketing and feature downsampling process of the present invention, and completes data compression and feature extraction at the database level. This avoids the database I / O and CPU computing power exhaustion caused by full decompression, and ensures the stability and response performance of the underlying database in high-concurrency query scenarios.

[0063] Based on the above embodiments, in some embodiments, pushing the rearranged time series to the front end includes: The rearranged time sequence is fused with the pre-extracted static configuration information in memory and transformed into a key-value pair data structure. Using TCP-based streaming serialization technology, the merged data is pushed to the client in segments via network sockets.

[0064] First, in the middleware gateway's memory, the reconstructed time series sequence, obtained after global time series rearrangement and redundancy point elimination, is fused with pre-extracted static configuration information. The static configuration information includes parameters extracted from the static configuration query section, such as the unique identifier of the measurement point, measurement point name, upper limit of the measurement range, lower limit of the measurement range, and alarm threshold. These parameters are temporarily stored in the gateway process's memory in the form of a hash mapping. During the fusion process, the system associates each feature point in the reconstructed time series sequence with the corresponding measurement point's static configuration information, forming a complete data unit containing a timestamp, feature value, feature attribute label, and device static information.

[0065] Subsequently, the system transforms the merged data into a unified key-value pair data structure. In one implementation, the key-value pair data structure is represented using a streaming serialization method in JSON format, where the key is a field identifier and the value is the corresponding numerical or text information. For example, a timestamp field is mapped to the key "ts", a monitoring value is mapped to the key "val", a measurement point name is mapped to the key "name", and an alarm threshold is mapped to the key "threshold", etc. In another implementation, Protocol Buffers format is also used for serialization to further improve serialization and deserialization efficiency.

[0066] After completing the data structure transformation, the system employs TCP-based streaming serialization technology to push the final message to the client in segments via network sockets. Specifically, the system serializes the key-value pair data structure into a continuous byte stream and utilizes the streaming transmission characteristics of the TCP protocol to divide the message into multiple data segments. The size of each data segment does not exceed a preset transmission unit threshold, and these segments are sequentially sent to the front-end browser or application client through the established network socket connection. In one embodiment, the preset transmission unit threshold is 64KB to adapt to the MTU limitations of common network environments and reduce IP fragmentation. In another embodiment, the system also uses the WebSocket protocol instead of the TCP protocol to support full-duplex communication and lower interaction latency. During the segmented push process, the system maintains a flow control mechanism between the sending and receiving windows to ensure that the front-end can receive, parse, and render data simultaneously, without waiting for all data to arrive before starting to draw charts.

[0067] Through the above methods, this embodiment achieves efficient transmission of downsampled data and rapid front-end rendering. On the one hand, the reconstructed time-series sequence and static configuration information are directly merged in the gateway memory, avoiding secondary queries or cross-table join operations initiated by the front-end, thus reducing network overhead and front-end computational burden. On the other hand, the use of TCP-based streaming serialization segmented push enables the front-end to progressively load data, quickly reconstructing security anomaly mutation points containing transient extreme values ​​and alarm events within a limited pixel space, improving user experience and the real-time performance of monitoring data.

[0068] Based on the above embodiments, in some embodiments, the step of determining the theoretical time bucketing step size according to the pixel tolerance number of the front-end window and the start and end times of the time-series data query part, and matching the theoretical time bucketing step size with a preset standard time bucketing step size to obtain the target bucketing step size, includes: Parse the client request context and extract the maximum number of valid pixel tolerance points that the current chart container on the front end can hold; Extract the start and end timestamps of the time-series data query portion; The theoretical time bucket step size is determined based on the difference between the start timestamp and the end timestamp and the number of pixel tolerance points; The theoretical time bucket step size is compared with the preset standard time bucket step mapping table, and then rounded up to match the standard step size to obtain the target bucket step size.

[0069] Based on the above embodiments, in some embodiments, the step of determining the theoretical time bucket step size according to the pixel tolerance number of the front-end window and the start and end time of the time-series data query part, and matching the theoretical time bucket step size with the preset standard time bucket step size to obtain the target bucket step size, specifically includes the following implementation methods.

[0070] First, the middleware gateway parses the context information of the client's HTTP or WebSocket request, extracting the maximum effective pixel tolerance number that the current chart container can hold from the request context. This maximum effective pixel tolerance number reflects the maximum number of discrete data points that the front-end chart can clearly render in the horizontal direction. This value is typically determined by the front-end framework based on the pixel width of the chart container and a preset upper limit for rendering density, such as calculated based on the screen resolution, the actual width occupied by the chart, and the minimum rendering spacing per point of the front-end rendering engine. In one implementation, the maximum effective pixel tolerance number is 1000 discrete points, meaning the front-end chart can effectively draw a maximum of 1000 data points in the horizontal direction without visual overlap or rendering performance degradation.

[0071] Simultaneously, the gateway extracts the start and end timestamps of the time-series data query portion from the decoupled and separated time-series data query portion. The start and end timestamps define the total time span of the data to be queried, both measured in time units, such as seconds. In one implementation, the gateway parses the start and end timestamps from the time range filtering conditions (such as the BETWEEN clause or greater than / less than comparison conditions) included in the time-series data query portion.

[0072] Then, the gateway determines the theoretical time bucketing step size based on the difference between the start and end timestamps and the number of pixel tolerance points. This theoretical time bucketing step size represents the theoretical time span represented by each data point in the time dimension under ideal uniform distribution to meet front-end pixel tolerance constraints. Specifically, the theoretical time bucketing step size is obtained by dividing the difference between the end and start timestamps by the number of pixel tolerance points, and its mathematical expression is:

[0073] in, This indicates the theoretical time bucket step size. This indicates the end timestamp. This represents the starting timestamp. This indicates the maximum number of effective pixel tolerance points.

[0074] Finally, because the underlying time-series database has higher computational efficiency and cache hit rate for naturally aligned standard time granularity when performing time-bucket aggregation operations, directly using a non-integer theoretical step size would lead to low efficiency in the underlying execution plan. Therefore, the gateway compares the theoretical time-bucket step size with a preset standard time-bucket ladder mapping table, rounds it up to align it to the matching standard step size, and obtains the target bucket step size. The standard time-bucket ladder mapping table is pre-stored in the gateway's configuration space and contains multiple query span intervals and their corresponding standard time steps. Specifically, the gateway first determines the current query span based on the difference between the start timestamp and the end timestamp, locates the query span interval to which the query span belongs in the mapping table, and then selects the matching standard step size from the standard step sizes corresponding to that interval. In one implementation, the upward rounding alignment means: if the theoretical time bucketing step size is less than or equal to the standard step size corresponding to the current query span interval, then that standard step size is selected; if the theoretical time bucketing step size is greater than the standard step size corresponding to the current query span interval, then the matching continues upward to a coarser-grained next-level standard step size, until the standard step size is greater than or equal to the theoretical time bucketing step size. The standard step size obtained in this way is the target downsampling bucketing step size finally sent to the underlying time series database. This step size ensures that the number of data points after downsampling does not exceed the front-end pixel tolerance, and also utilizes the underlying database's execution optimization capability for standard time granularity, providing accurate and efficient time bucketing boundaries for subsequent feature-preserving extraction.

[0075] Based on the above embodiments, in some embodiments, the standard time bucket ladder mapping table includes multiple query span intervals and their corresponding standard step sizes. The query span intervals are determined based on the difference between the start timestamp and the end timestamp, and the standard step size increases in a stepwise manner as the query span increases.

[0076] Specifically, the standard time-based bucketing ladder mapping table is a system-preset configuration mapping table used to map theoretical non-integer step sizes to the optimal execution granularity of the underlying database. This mapping table contains multiple query span intervals, each defined by a lower span limit and an upper span limit. When the difference between the start and end timestamps of a query falls within a certain query span interval, that interval is the interval matched by the current query.

[0077] In the mapping table, each query span interval corresponds to a standard time step, and the standard time step increases stepwise as the query span increases; that is, the larger the query span interval, the coarser the corresponding standard time step. Specifically, it starts from the minute level granularity and progresses sequentially to the hour level, day level, week level, and so on. In one embodiment, the standard time-divided ladder mapping table includes the following configuration: when the query span is between 0 and a first duration threshold, the theoretical step size is in a first numerical range and mapped to a first standard step size; when the query span is between the first duration threshold and a second duration threshold, the theoretical step size is in a second numerical range and mapped to a second standard step size; when the query span is between the second duration threshold and a third duration threshold, the theoretical step size is in a third numerical range and mapped to a third standard step size; when the query span is between the third duration threshold and a fourth duration threshold, the theoretical step size is in a fourth numerical range and mapped to a fourth standard step size; when the query span is between the fourth duration threshold and a fifth duration threshold, the theoretical step size is in a fifth numerical range and mapped to a fifth standard step size; when the query span is above the fifth duration threshold, the theoretical step size is in a sixth numerical range and mapped to a sixth standard step size; wherein, the first standard step size increases sequentially to the sixth standard step size.

[0078] In a more specific implementation, the standard time-based bucketing ladder mapping table is configured as follows: when the query span is 0 to 1 hour, the theoretical step size is in the range of 0 to 3.6 seconds, and the standard mapping step size is 60 seconds, corresponding to a bucketing granularity of 1 minute; when the query span is 1 hour to 8.3 hours, the theoretical step size is in the range of 3.6 to 30 seconds, and the standard mapping step size is 300 seconds, corresponding to a bucketing granularity of 5 minutes; when the query span is 8.3 hours to 1 day, the theoretical step size is in the range of 30 to 86.4 seconds, and the standard mapping step size is 3600 seconds. The theoretical step size is 1 hour; for query spans from 1 to 16.7 days, the theoretical step size is between 86.4 and 1440 seconds, with a standard step size of 14400 seconds, corresponding to a 4-hour bucket granularity; for query spans from 16.7 to 100 days, the theoretical step size is between 1440 and 8640 seconds, with a standard step size of 86400 seconds, corresponding to a 1-day bucket granularity; for query spans exceeding 100 days, the theoretical step size is exceeding 8640 seconds, with a standard step size of 604800 seconds, corresponding to a 1-week bucket granularity. Through this tiered step size mapping configuration, the system can adaptively align the theoretical step size to the standard time granularity with the highest execution efficiency in the underlying time-series database under different query span conditions, balancing front-end rendering constraints with underlying computational efficiency.

[0079] In one implementation, the preset standard time bucket ladder mapping table is stored in the gateway memory as a hash table or array structure. When the gateway performs step size alignment, it uses an interval search algorithm to quickly locate the position in the mapping table. The time complexity of the interval search algorithm is logarithmic or constant, thereby ensuring that the step size calculation step does not become the performance bottleneck of the overall query process.

[0080] Based on the above embodiments, in some embodiments, the extraction of the first and last data points and their original timestamps within the bucket includes: Extract the first and last physical monitoring values ​​from the time bucket, and return the original millisecond-level timestamps corresponding to the first and last physical monitoring values ​​respectively.

[0081] When the underlying time-series database performs parallel scanning on each time bucket according to the target bucketing step size, the system first obtains an ordered set of all original data records within that time bucket. This ordered set is arranged in strictly ascending order according to the original timestamp at the time the data was written. The system locates the first physical monitoring value from this ordered set, which is the sensor measurement value corresponding to the record with the smallest timestamp within that time bucket. Simultaneously, it locates the last physical monitoring value, which is the sensor measurement value corresponding to the record with the largest timestamp within that time bucket. For both the first and last physical monitoring values, the system not only extracts the physical value itself but also correlates and extracts the original timestamp at which the physical value was actually written to the underlying database. This original timestamp is a high-precision timestamp, capable of uniquely identifying the absolute position of the data point on the timeline. In one implementation, the high-precision timestamp is accurate to the millisecond level.

[0082] Specifically, the system uses aggregate functions or cursor traversal methods from the underlying database to directly retrieve the first and last records when scanning each time bucket, utilizing the built-in sorting index. This eliminates the need for full sorting of all data within the entire bucket, thus ensuring extraction efficiency. In one implementation, the system uses the built-in FIRST() and LAST() aggregate functions of the underlying time-series database to retrieve the first and last records within the bucket, respectively, and then uses the corresponding timestamp extraction functions to obtain the original timestamps corresponding to each record.

[0083] After extraction, the system encapsulates the first and last feature points into binary structures containing timestamps and values, for example, in the form of `{timestamp: 1714550400000, value: 25.3}`, and temporarily stores them in the gateway's memory buffer pool as one of the envelope boundary anchor points of this time bucket. The first and last feature points, together with the subsequently extracted physical maximum and minimum points, and the forcibly retained penetration feature points, constitute the downsampling result set of this bucket, providing an accurate temporal positioning benchmark for subsequent global temporal reordering based on the original timestamps.

[0084] Through the above method, this embodiment can accurately restore the start and end states of the data sequence within each time bucket without introducing any interpolation or averaging calculations. This ensures that the downsampled data sequence has clear boundary information on the time axis, avoiding the time boundary ambiguity problem caused by traditional mean downsampling. This allows the front-end visualization chart to accurately present the start and end times of data changes within each time period, providing a reliable time series anchor for trend analysis of coal mine monitoring data. At the same time, it preserves the original time accuracy when the data is written, laying a precise time benchmark for subsequent time series rearrangement and redundancy elimination.

[0085] Based on the above embodiments, in some embodiments, extracting the physical maximum and physical minimum values ​​and their original timestamps within the bucket includes: Scan all data points within the time bucket, extract the physical highest peak value and its corresponding original occurrence timestamp, and the physical lowest valley value and its corresponding original occurrence timestamp within that time period.

[0086] When the underlying time-series database receives the second database dialect query command rewritten by the middleware gateway, the database computing engine initiates a scanning task for each time bucket divided by the target bucket step size. The input source for this scanning task is all data points stored within the time bucket, and each data point contains a physical value and its corresponding original timestamp. In one implementation, the original timestamp is a millisecond-level timestamp when the data is written to the underlying database, with a precision of milliseconds, which can uniquely identify the absolute position of the data point on the timeline.

[0087] During the scanning process, the computing engine traverses all data points within the bucket, determining the physical highest peak value and its corresponding original timestamp through comparison operations, and simultaneously determining the physical lowest trough value and its corresponding original timestamp. Specifically, for analog sensors, since the physical values ​​of each data point are continuous numerical data, the computing engine directly compares the numerical fields of each data point, recording the data point with the largest value and its corresponding original timestamp as the physical highest peak value, and recording the data point with the smallest value and its corresponding original timestamp as the physical lowest trough value. For digital sensors, the physical values ​​are represented as discrete enumerated values. The computing engine converts these enumerated values ​​into comparable numerical codes before comparison, similarly extracting the maximum and minimum values ​​within the time period and their corresponding timestamps. Through the above processing, two feature anchor points are finally output: the physical highest peak value, containing the peak value and its original timestamp; and the physical lowest trough value, containing the trough value and its original timestamp. These two feature anchor points, together with the first and last data points extracted within the same bucket, and the forcibly retained penetration feature points, constitute the feature-preserving extraction result set for that bucket.

[0088] It should be noted that the extraction process is executed in parallel with the extraction of the first and last feature points within the same bucket and the forced retention of key features, without interference. In one implementation, the underlying time-series database engine adopts a multi-threaded parallel computing model, allocating an independent computing thread to each time bucket. Within each thread, three computing pipelines are executed simultaneously: first and last point acquisition, physical extreme value traversal scanning, and key feature determination. In one implementation, the traversal scanning uses the database's built-in index scanning method, utilizing pre-built sparse indexes or block-level statistical information to quickly locate extreme values ​​within each data block, thereby reducing the overhead of full data scanning. Finally, the feature points of all buckets and their original timestamps are encapsulated into a composite result set and returned to the gateway layer.

[0089] By forcibly extracting the physical extreme values ​​and their actual timestamps within each time bucket, this embodiment preserves the upper and lower limit envelope boundaries of all physical fluctuations within that time period. This ensures that any instantaneous surge or drop is fully recorded, avoiding the smoothing masking of transient extreme values ​​by traditional mean downsampling. Thus, while compressing the data, the original envelope boundaries of the coal mine monitoring time series data are fully preserved, providing a true and reliable extreme value anchor point for subsequent time series reconstruction and visualization, and significantly improving the ability to identify safety hazards.

[0090] Based on the above embodiments, in some embodiments, the forced retention of feature points within the bucket that meet preset key event conditions as penetration feature points includes: For analog sensors, read the alarm status field of each data point. If the alarm status field indicates an abnormal state, then the data point is forcibly retained as a penetration feature point. For digital sensors, if the device's operating status enumeration value changes, the data point that has changed will be forcibly retained as a penetration feature point.

[0091] Coal mine monitoring data is divided into two categories according to sensor type: analog sensors and digital sensors. When the system traverses each time bucket, it executes the corresponding forced retention judgment logic according to the sensor type.

[0092] For analog sensors, these sensors are used to collect continuous numerical monitoring data, such as physical quantities like gas concentration, temperature, and pressure. When each data point is written to the underlying time-series database, the front-end acquisition system calculates the corresponding alarm status field based on the alarm threshold effective at that moment. The alarm status field is an enumeration type, including at least normal states and multiple abnormal states. During the downsampling traversal based on the target bucket step size in the underlying time-series database, the system scans all raw data records within each time bucket one by one. For each data record, the system directly reads the value of its alarm status field and compares it with a preset normal state value. If the alarm status field indicates an abnormal state—that is, the value of the alarm status field does not belong to the normal state value range—then it is determined that the data point has triggered an alarm status abnormality condition. In this case, regardless of whether the data point is a physical maximum or minimum value within that time bucket, the system assigns it the highest priority weight and forcibly retains it as an independent penetration feature point. Specifically, the system extracts the original millisecond-level timestamp, physical value, and alarm status label of the data point and stores them in a temporary result set. In one implementation, the alarm status field includes at least five states: normal, upper limit alarm, lower limit alarm, upper upper limit alarm, and lower lower limit alarm. The upper upper limit alarm indicates that the measured value exceeds an extremely high threshold, and the lower lower limit alarm indicates that the measured value is below an extremely low threshold. In another implementation, the alarm status field also includes a rate of change anomaly alarm state. When the change in the measured value within a unit of time exceeds a preset rate of change threshold, this state is set to abnormal rate of change. The temporary result set, along with the first and last data points, physical maximum value, and physical minimum value extracted within the same time bucket, are output in parallel to constitute the feature-preserving extraction result of that time bucket.

[0093] For the switch quantity sensor, the switch quantity sensor is used to monitor the discrete operating status of coal mine equipment, such as the running or stopping status of the fan, the opening or closing status of the damper, and the start / stop status of the belt conveyor. The data of the switch quantity sensor is recorded in the underlying time series database in the form of discrete enumeration values. Each data point contains the original millisecond-level timestamp, the equipment operating status enumeration value, and the corresponding measurement point identifier. During the downsampling traversal based on the target bucket step size in the underlying time series database, the system traverses all switch quantity data points in each time bucket, reads the status enumeration value of each data point in turn, and compares it with the status enumeration value of the previous data point in the same time bucket (the previous record in ascending order of timestamp). If the status enumeration value of the current data point has changed in any way compared to the previous data point—that is, the two status enumeration values ​​are not equal—then the data point is determined to be an equipment status reversal point. The status reversal point, regardless of whether it is a physical extreme value in the local interval, is given the highest priority weight and is forcibly retained as an independent penetration feature point. Specifically, the system extracts the original millisecond-level timestamp, current state enumeration value, and feature attribute label of the state reversal point and stores them in a temporary result set. In one embodiment, the device operating state enumeration value includes at least a stopped state, a running state, and a fault state; when the monitored object is a damper, the device operating state enumeration value includes at least a closed state, an open state, and an abnormal stuck state. In one embodiment, for devices with multi-speed adjustment functions, the device operating state enumeration value also includes values ​​corresponding to multiple different speed levels, and forced retention is triggered when the speed level value changes. It should be noted that the state reversal determination of the switch sensor is not limited to two adjacent data points. In one embodiment, if a state change occurs between the current data point and the last data point of the previous time bucket, this change point is also forcibly retained as a penetrating feature point to ensure that state changes across bucket boundaries are not missed.

[0094] Through the differentiated forced retention mechanism for analog and digital sensors described above, any alarm data points generated due to threshold exceeding or any flipped data points caused by changes in equipment operating status are forcibly retained independently of the conventional extreme value extraction logic. This mechanism ensures that crucial transient alarm information and equipment status change information in coal mine safety monitoring scenarios are completely retained during downsampling, fundamentally avoiding the loss of key safety hazard information due to data compression. This provides accurate and complete data support for coal mine safety accident retrospective analysis, equipment operating status analysis, and hazard investigation.

[0095] Based on the above embodiments, in some embodiments, converting the feature points into sequence objects with timestamps and attribute labels includes: The composite result set returned from the underlying layer is structurally decomposed, and the first data point, last data point, physical maximum value point, physical minimum value point, and penetrating feature point collected in a single time bucket are transformed into time series objects composed of a single timestamp, feature value, and feature attribute label.

[0096] After the underlying time-series database completes feature extraction for each time bucket, it returns the extraction results to the middleware gateway in the form of a composite result set. This composite result set contains multiple feature points extracted in parallel within each time bucket, specifically including: the first and last data points of the bucket and their corresponding original timestamps; the physical maximum value of the bucket and its corresponding original occurrence timestamp; the physical minimum value of the bucket and its corresponding original occurrence timestamp; and all penetration feature points within the bucket that meet the mandatory retention conditions (including data points with abnormal alarm states and data points with device state reversals). In the return format from the underlying database, each feature point in the composite result set is associated with its own independent and distinct original timestamp, physical value, and an internal field identifying its source type.

[0097] The gateway layer allocates a buffer pool in runtime memory to perform structural decomposition operations on the received composite result set. Specifically, the gateway layer traverses each record in the composite result set, determines the corresponding feature point type based on the identifier field carried by the record, and parses it into an independent sequence object accordingly. For the first data point in each time bucket, the system extracts its original timestamp and physical value, and assigns it a feature attribute label representing "first point of time period"; for the last data point, it assigns a feature attribute label representing "last point of time period"; for the physical maximum value point, it assigns a feature attribute label representing "physical peak"; for the physical minimum value point, it assigns a feature attribute label representing "physical trough"; for penetration feature points that are forcibly retained due to alarm status abnormalities, it assigns a feature attribute label representing "alarm penetration point" based on its triggering reason; for penetration feature points that are forcibly retained due to device status reversal, it assigns a feature attribute label representing "state reversal penetration point". In one implementation, the feature attribute labels are stored in the structure of the sequence object as enumerated constants. For example, integer codes "0x01" represent "first point of time period", "0x02" represent "last point of time period", "0x03" represent "physical peak", "0x04" represent "physical trough", "0x05" represent "alarm penetration point", and "0x06" represent "state reversal penetration point". In another implementation, the feature attribute labels are stored as strings. For example, "START" represents the first point of time period, "END" represents the last point of time period, "PEAK" represents the physical peak, "VALLEY" represents the physical trough, "ALARM" represents the alarm penetration point, and "FLIP" represents the state reversal penetration point.

[0098] Each sequence object's data structure is designed to include at least three basic fields: a timestamp field, used to store the original timestamp when the feature point is actually written to the underlying database, the precision of which is a preset precision level, in one embodiment, the preset precision level is milliseconds; a value field, used to store the physical monitoring value corresponding to the feature point; and a label field, used to store the aforementioned feature attribute label. Through the above decomposition process, the composite result set, originally existing in the form of wide-table row records, is transformed into an array composed of multiple independent sequence objects, each element of which is a time series object containing a single timestamp, feature value, and explicit attribute label. In one embodiment, the data structure of the time series object is implemented in the form of key-value pair mapping, for example, represented in JSON object format as {"timestamp": 1714550400000, "value": 25.3, "label": "PEAK"}.

[0099] The array is then fed into the sorting module in the gateway's memory to perform a global ascending sort based on the original timestamps, providing standardized data input for subsequent time-series reordering.

[0100] Through the above structural decomposition method, this embodiment standardizes the composite wide table result set returned by the underlying layer into a time series object array with a unified format. Each object carries a single timestamp and a clear semantic label, which provides a clear and standardized data foundation for subsequent global time series reordering, redundancy detection and elimination, avoids processing errors caused by mixed data formats, and ensures the accuracy and completeness of the time series reconstruction after downsampling.

[0101] Based on the above embodiments, in some embodiments, the step of performing global time-series rearrangement and eliminating redundant points according to the original timestamp includes: Based on the original millisecond-level timestamps of each sequence object, all sequence objects are sorted in memory in ascending order of time; Redundancy detection is performed. If multiple sequence objects correspond to the same measurement point and have the same value at the same time, the label nodes of the multiple sequence objects are merged, and the single-time structure is retained.

[0102] First, the middleware gateway allocates a buffer pool in runtime memory to receive a composite result set returned from the underlying time-series database. This composite result set contains the first data point, last data point, physical maximum value point, physical minimum value point, and forcibly retained penetration feature points extracted in parallel for each time bucket. Each feature point carries the original millisecond-level timestamp when the data point was actually written to the underlying database. The gateway layer deconstructs the received composite result set, transforming the multiple feature points gathered within a single time bucket into an array of time-series objects composed of a single timestamp, feature value, and feature attribute label. The feature attribute label is used to identify the type or source of the feature point, such as indicating whether the point is the beginning or end of a time period, the highest peak, the lowest trough, an alarm penetration point, or a state reversal point. After completing the structural deconstruction, the system sorts all the sequence objects in memory in ascending order of time based on the original millisecond-level timestamps carried by each sequence object. Specifically, the system uses the original millisecond-level timestamps carried by each sequence object as the sorting key, treats all sequence objects as sorting elements, and employs a comparison-based sorting algorithm to rearrange all sequence objects in ascending order of timestamps, forming a complete timeline that strictly increases on the time axis. Since each feature point is extracted from different time buckets, and multiple feature points within the same bucket have their own independent timestamps, after sorting, the previously disordered and misplaced feature points in the composite result set returned at the lower level are restored to an ordered sequence arranged according to their actual occurrence time. In one implementation, the comparison-based sorting algorithm is Quicksort, which has an average time complexity of O(n log n), enabling efficient processing of the downsampled feature point set cached in the gateway's memory. In another implementation, when the number of sequence objects is small, the comparison-based sorting algorithm is insertion sort to reduce the overhead of recursive calls.

[0103] During the global time-series reordering process, the system synchronously performs redundant point detection and elimination operations. Specifically, the system traverses the sorted sequence, checking whether the timestamp field of each sequence object is the same as the timestamp field of adjacent sequence objects. If it detects that multiple sequence objects correspond to the same measurement point at a certain moment—that is, these sequence objects belong to the same device or the same monitoring indicator, and their numerical fields are also the same—then these sequence objects are determined to be mutually redundant data points. At this time, the system triggers a merging operation, fusing the attribute tags of the multiple sequence objects, merging multiple tags into a single combined tag, while retaining the unique timestamp field and numerical field at that moment, forming a sequence record containing only one structure. It should be noted that "same numerical value" includes the case where the physical values ​​are completely equal, and also includes the case where they are considered equal within a preset precision tolerance range. In one embodiment, for floating-point physical values, if the absolute value of the difference between two values ​​is less than a preset tolerance threshold, they are determined to be the same value. This merging operation effectively avoids data volume expansion caused by multiple feature attributes existing at the same time (e.g., the point is both the first data point and the highest peak point), further compressing the final output message size. After the above sorting and merging processes, the system obtains a simplified feature point sequence in memory that is strictly increasing in time and has no repeating time points. This sequence is the rearranged time series sequence. This time series sequence is then sent to the subsequent data fusion and streaming push stages as the final downsampling result dataset returned to the front end.

[0104] Through the global time-series reordering and redundancy elimination mechanism based on the original millisecond-level timestamps, this embodiment ensures the correct order of feature points on the time axis after downsampling, and eliminates duplicate data points at the same time that may be generated due to parallel extraction of multiple features. Thus, while ensuring the integrity and consistency of data time sequence, the transmission volume is further compressed, the rendering efficiency of the front-end chart is improved, and the front-end parsing anomalies and rendering errors caused by data disorder or redundancy are effectively avoided.

[0105] Based on the above embodiments, in some embodiments, before intercepting heterogeneous database query requests, the method further includes: Building a hybrid storage environment includes: Construct a relational table structure to store the static configuration information of monitoring points in each mining area of ​​the coal mine; The relational time series table is converted into a time-based supertable structure. A compression strategy is configured according to the data lifecycle, so that recent data is kept uncompressed, while historical long-period data is compressed and archived into read-only partition blocks.

[0106] Specifically, the construction of the hybrid storage environment includes the following implementation methods.

[0107] First, a relational table structure is constructed in the underlying database to store the static configuration information of measuring points in each mining area of ​​the coal mine. This static configuration information includes dimensional data such as the unique identifier of the measuring point, the name of the measuring point, the mining area code to which the measuring point belongs, the sensor type, the upper limit of the measuring range, the lower limit of the measuring range, and alarm threshold parameters. The relational table uses the unique identifier of the measuring point as the primary key, and each field is organized according to the normalized design requirements of relational databases to ensure data consistency and integrity. This type of static configuration information is updated infrequently, typically only changing when measuring points are added, equipment is replaced, or alarm thresholds are adjusted. Therefore, a relational table structure is suitable for storage to leverage the transaction support capabilities and index query efficiency of relational databases. In one implementation, the relational table structure adopts a master-slave table design. The master table stores the general attributes of the measuring points, and the slave table stores historical configuration change records of the measuring points within different time periods to support configuration backtracking and auditing functions.

[0108] Secondly, for monitoring stream data with high-frequency writes, the system does not adopt the traditional single-table stacked storage method. Instead, it converts the relational time-series table into a time-dimensional hypertable structure. The hypertable structure is a storage organization method that horizontally partitions data according to the time dimension. It logically maintains the original large table as a single complete table, while automatically dividing it into multiple independent sub-tables (Chunks) according to time ranges at the physical storage level. Each sub-table corresponds to a continuous time interval. By converting the relational time-series table into a hypertable structure, the system can leverage the inherent ordering of the time dimension to achieve sequential writing and sequential storage of data, avoiding page splitting and index maintenance overhead in traditional B+ tree indexes under random write scenarios. In one implementation, the hypertable structure is partitioned based on a timestamp field, with each sub-table corresponding to a preset time span, such as partitioned by day or week. Newly written data automatically falls into the currently active sub-table.

[0109] Simultaneously, the system automatically configures fine-grained compression strategies for the supertable structure based on the data's lifecycle characteristics. These compression strategies define different storage methods and compression algorithms used at different stages of the data's lifecycle. Specifically, for recently written data, the system controls it to remain uncompressed to meet the I / O performance requirements of high-frequency writes and real-time monitoring queries. Recent data refers to data whose write time is within a preset time threshold. This data needs to support fast single-point queries, real-time aggregation, and high-concurrency write operations; therefore, it maintains its original storage format without additional compression processing to ensure minimal read / write latency. In one implementation, the preset time threshold is 7 days, meaning data written within the last 7 days remains uncompressed. In another implementation, the preset time threshold is 3 days. In yet another implementation, the preset time threshold is 30 days, with the specific value adjusted based on the actual data write rate and real-time query requirements of the coal mine monitoring system.

[0110] For long-term historical data, the system automatically compresses and archives it into read-only partitions. Long-term historical data refers to data whose write time exceeds a preset time threshold. Access to this data primarily involves large-scale historical trend analysis, with write operations occurring very rarely or not at all. For this data, the system automatically triggers a compression and archiving process, employing a high compression ratio algorithm suitable for time-series data to compress and store the data, and then transferring the compressed data to read-only partitions. These read-only partitions are set to read-only attributes at the physical storage level, prohibiting any write or modification operations, thereby eliminating read-write lock contention and supporting concurrent reading by multiple query tasks. In one embodiment, the compression strategy includes: differentially encoding data within the same time bucket according to time order, storing the differential values ​​using variable-length integer encoding, and compressing recurring timestamp differences using run-length encoding. In another embodiment, the compression strategy further includes: using a lossy compression algorithm for sensor values, but retaining a numerical accuracy of no less than one-thousandth of the original accuracy. In one implementation, the read-only partition block organizes data in a columnar storage format, so that aggregate queries for a single monitoring indicator only require reading the corresponding column data, significantly reducing disk I / O. In another implementation, the system automatically determines the lifecycle stage of the data based on the data's write time. When the data's timestamp exceeds the preset duration threshold, a background asynchronous compression task is automatically triggered, switching the corresponding sub-table from an uncompressed state to a compressed state and migrating it to the read-only partition block.

[0111] Through a hybrid storage environment combining relational table structures and time-based supertable structures, the system achieves partitioned management of static configuration information and high-frequency monitoring stream data in coal mines. This provides independent physical storage space and access paths for subsequent heterogeneous query decoupling. Static configuration information achieves consistency and fast access through transaction support and index queries in relational tables, while high-frequency monitoring stream data achieves a balance between write performance and storage cost through time partitioning and lifecycle compression strategies in the supertable structure. This hybrid storage architecture enables the middleware gateway to proactively intercept large-span query requests hitting cold data areas and transition to adaptive time bucketing and feature downsampling processes based on cold / hot boundary detection results in subsequent steps. This significantly reduces the overhead of full table scans and the risk of underlying read / write lock contention during large-span joint queries, providing an efficient underlying data organization foundation for ensuring the overall execution efficiency of the feature downsampling query method.

[0112] Please refer to Figure 4 , Figure 4 This invention provides a structural block diagram of a feature-preserving downsampling query device for coal mine monitoring time-series data; the specific device may include: The query parsing module 100 is used to intercept heterogeneous database query requests, perform abstract syntax tree parsing on the query statement of the query request, and decouple the query statement into a static configuration query part and a time-series data query part. The step size calculation module 200 is used to determine the theoretical time bucket step size based on the number of pixel tolerance points of the front-end window and the start and end times of the time series data query part, and to match the theoretical time bucket step size with the preset standard time bucket step size to obtain the target bucket step size. The feature extraction module 300 is used to perform feature-preserving extraction on each time bucket in the underlying time series database based on the target bucket step size. The feature-preserving extraction includes: extracting the first and last data points and their original timestamps in the bucket, extracting the physical maximum and physical minimum values ​​and their original timestamps in the bucket, and forcibly retaining the feature points in the bucket that meet the preset key event conditions as penetrating feature points. The time series reconstruction module 400 is used to receive each of the feature points and their original timestamps, convert the feature points into sequence objects with timestamps and attribute labels, perform global time series rearrangement according to the original timestamps and eliminate redundant points, and push the rearranged time series sequence to the front end.

[0113] The feature-preserving downsampling query device for coal mine monitoring time series data in this embodiment is used to implement the aforementioned feature-preserving downsampling query method for coal mine monitoring time series data. Therefore, the specific implementation method of the feature-preserving downsampling query device for coal mine monitoring time series data can be found in the previous embodiment section of the feature-preserving downsampling query method for coal mine monitoring time series data. For example, the query parsing module 100, the step size calculation module 200, the feature extraction module 300, and the time series reconstruction module 400 are respectively used to implement steps S101, S102, S103, and S104 in the aforementioned feature-preserving downsampling query method for coal mine monitoring time series data. Therefore, its specific implementation method can be referred to the description of the corresponding embodiments, which will not be repeated here.

[0114] A specific embodiment of the present invention also provides a feature-preserving downsampling query device for coal mine monitoring time series data, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of the aforementioned feature-preserving downsampling query method for coal mine monitoring time series data.

[0115] A specific embodiment of the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described method for feature-preserving downsampling query of coal mine monitoring time-series data.

[0116] 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, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0117] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will 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... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0118] 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.

[0119] 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.

[0120] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.

Claims

1. A method for feature-preserving downsampling query of coal mine monitoring time-series data, characterized in that, include: Intercept heterogeneous database query requests, perform abstract syntax tree parsing on the query statements of the query requests, and decouple the query statements into a static configuration query part and a time-series data query part; Based on the pixel tolerance points of the front-end window and the start and end times of the time-series data query section, the theoretical time bucket step size is determined, and the theoretical time bucket step size is matched with the preset standard time bucket step size to obtain the target bucket step size. Based on the target bucket step size, feature preservation extraction is performed on each time bucket in the underlying time series database. The feature preservation extraction includes: extracting the first and last data points and their original timestamps in the bucket, extracting the physical maximum and physical minimum values ​​and their original timestamps in the bucket, and forcibly retaining the feature points in the bucket that meet the preset key event conditions as penetration feature points. Receive each of the aforementioned feature points and their original timestamps, convert the feature points into sequence objects with timestamps and attribute labels, perform global time-series rearrangement based on the original timestamps and eliminate redundant points, and push the rearranged time-series sequence to the front end.

2. The method according to claim 1, characterized in that, The interception of heterogeneous database query requests involves parsing the query statements of the requests using an abstract syntax tree, decoupling the query statements into a static configuration query part and a time-series data query part, including: The built-in SQL dialect parser intercepts the heterogeneous database query request, performs lexical tagging and syntax analysis on the query statement, and transforms the query statement into a hierarchical abstract syntax tree; Traverse the nodes of the abstract syntax tree, identify and extract the static configuration query part, and route the static configuration query part to the local cache engine for execution; The time series data query part is identified and sent to the underlying time series database for execution.

3. The method according to claim 2, characterized in that, The step of routing the static configuration query portion to the local caching engine for execution includes: A local embedded database is maintained inside the middleware gateway as an in-process caching engine. The caching engine maintains data consistency with the underlying master relational configuration table through a background asynchronous synchronization mechanism. In the process memory of the middleware gateway, static configuration parameters of the target measurement point are extracted through hash mapping.

4. The method according to claim 2, characterized in that, After identifying the time-series data query portion, the method further includes: Extract the time span condition of the time series data query part. If the time span condition hits the cold data storage area in the compressed state in the underlying time series database, then intercept the original query request and switch to the adaptive time bucketing and feature downsampling calculation process.

5. The method according to claim 1, characterized in that, The step of pushing the rearranged time series to the front end includes: The rearranged time sequence is fused with the pre-extracted static configuration information in memory and transformed into a key-value pair data structure. Using TCP-based streaming serialization technology, the merged data is pushed to the client in segments via network sockets.

6. The method according to claim 1, characterized in that, The step of determining the theoretical time bucketing step size based on the pixel tolerance number of the front-end window and the start and end times of the time-series data query section, and matching the theoretical time bucketing step size with the preset standard time bucketing step size to obtain the target bucketing step size, includes: Parse the client request context and extract the maximum number of valid pixel tolerance points that the current chart container on the front end can hold; Extract the start and end timestamps of the time-series data query portion; The theoretical time bucket step size is determined based on the difference between the start timestamp and the end timestamp and the number of pixel tolerance points. The theoretical time bucket step size is compared with the preset standard time bucket step mapping table, and then rounded up to match the standard step size to obtain the target bucket step size.

7. The method according to claim 6, characterized in that, The standard time bucket ladder mapping table contains multiple query span intervals and their corresponding standard step sizes. The query span intervals are determined based on the difference between the start timestamp and the end timestamp, and the standard step size increases in a stepwise manner as the query span increases.

8. The method as described in claim 1, characterized in that, The extraction of the first and last data points and their original timestamps within the bucket includes: Extract the first and last physical monitoring values ​​from the time bucket, and return the original millisecond-level timestamps corresponding to the first and last physical monitoring values ​​respectively.

9. The method as described in claim 1, characterized in that, The extraction of the physical maximum and minimum values ​​and their original timestamps within the bucket includes: Scan all data points within the time bucket, extract the physical highest peak value and its corresponding original occurrence timestamp, and the physical lowest valley value and its corresponding original occurrence timestamp within that time period.

10. The method as described in claim 1, characterized in that, The mandatory retention of feature points within the bucket that meet preset key event conditions as penetration feature points includes: For analog sensors, read the alarm status field of each data point. If the alarm status field indicates an abnormal state, then the data point is forcibly retained as a penetration feature point. For digital sensors, if the device's operating status enumeration value changes, the data point that has changed will be forcibly retained as a penetration feature point.

11. The method as described in claim 1, characterized in that, The step of converting the feature points into a sequence object with timestamps and attribute labels includes: The composite result set returned from the underlying layer is structurally decomposed, and the first data point, last data point, physical maximum value point, physical minimum value point, and penetrating feature point collected in a single time bucket are transformed into time series objects composed of a single timestamp, feature value, and feature attribute label.

12. The method as described in claim 1, characterized in that, The process of global time-series rearrangement based on the original timestamps and eliminating redundant points includes: Based on the original millisecond-level timestamps of each sequence object, all sequence objects are sorted in memory in ascending order of time; Redundancy detection is performed. If multiple sequence objects correspond to the same measurement point and have the same value at the same time, the label nodes of the multiple sequence objects are merged, and the single-time structure is retained.

13. The method as described in claim 1, characterized in that, Before intercepting heterogeneous database query requests, the following steps are also included: Building a hybrid storage environment includes: Construct a relational table structure to store the static configuration information of monitoring points in each mining area of ​​the coal mine; The relational time series table is converted into a time-based supertable structure. A compression strategy is configured according to the data lifecycle, so that recent data is kept uncompressed, while historical long-period data is compressed and archived into read-only partition blocks.

14. A feature-preserving and feature-reducing sampling query device for coal mine monitoring time-series data, characterized in that, include: The query parsing module is used to intercept query requests from heterogeneous databases, perform abstract syntax tree parsing on the query statements of the query requests, and decouple the query statements into a static configuration query part and a time-series data query part. The step size calculation module is used to determine the theoretical time bucket step size based on the number of pixel tolerance points of the front-end window and the start and end times of the time series data query part, and to match the theoretical time bucket step size with the preset standard time bucket step size to obtain the target bucket step size. The feature extraction module is used to perform feature-preserving extraction on each time bucket in the underlying time series database based on the target bucket step size. The feature-preserving extraction includes: extracting the first and last data points and their original timestamps in the bucket, extracting the physical maximum and physical minimum values ​​and their original timestamps in the bucket, and forcibly retaining the feature points in the bucket that meet the preset key event conditions as penetrating feature points. The time series reconstruction module is used to receive each feature point and its original timestamp, convert the feature points into sequence objects with timestamps and attribute labels, perform global time series rearrangement according to the original timestamps and eliminate redundant points, and push the rearranged time series sequence to the front end.

15. A feature-preserving and feature-reducing sampling query device for coal mine monitoring time-series data, characterized in that, include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the feature-preserving downsampling query method for coal mine monitoring time-series data as described in any one of claims 1 to 13.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the feature-preserving downsampling query method for coal mine monitoring time series data as described in any one of claims 1 to 13.