A time series data processing method, apparatus and device, and a storage medium

By determining the measurement point number through a document search engine and interacting with the HBase cluster using the RPC protocol, the problem of low writing efficiency of time series data was solved, and efficient management and fast response time series data processing were achieved.

CN116521757BActive Publication Date: 2026-06-19DAWNING INFORMATION IND (BEIJING) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DAWNING INFORMATION IND (BEIJING) CO LTD
Filing Date
2023-04-28
Publication Date
2026-06-19

Smart Images

  • Figure CN116521757B_ABST
    Figure CN116521757B_ABST
Patent Text Reader

Abstract

This invention discloses a time-series data processing method, apparatus, device, and storage medium. The method includes: in response to a write request for target time-series data, determining measurement point information and measurement data corresponding to the target time-series data; determining the measurement point number corresponding to the measurement point information based on a preset document search engine; and writing the target time-series data into a preset database and a shared memory queue according to the measurement data and the measurement point number. The technical solution of this invention can quickly determine the measurement point number corresponding to the target time-series data based on a document search engine, improving the writing efficiency of the target time-series data. Simultaneously, by writing the target time-series data into the preset database and the shared memory queue respectively, it facilitates subsequent targeted responses to retrieval requests and broadcast requests for the target time-series data, thereby improving the time-series data processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computers, and more particularly to a time-series data processing method, apparatus, device, and storage medium. Background Technology

[0002] Time-series data is a series of data that is continuously generated over time. Compared with other data, time-series data has a clear time dimension. This type of data is usually written more than read, and needs to support data write frequencies at the second, millisecond, or even nanosecond level.

[0003] Therefore, how to effectively manage the writing process of time-series data and improve the processing efficiency of time-series data is an urgent problem to be solved. Summary of the Invention

[0004] This invention provides a time-series data processing method, apparatus, device, and storage medium, which can improve the processing efficiency of time-series data and better manage time-series data.

[0005] According to one aspect of the present invention, a time-series data processing method is provided, comprising:

[0006] In response to a write request for target time series data, determine the measurement point information and measurement data corresponding to the target time series data;

[0007] Based on a preset document search engine, the measurement point number corresponding to the measurement point information is determined;

[0008] Based on the measurement data and the measurement point number, the target time series data is written into a preset database and a shared memory queue.

[0009] Optionally, based on the measurement data and the measurement point number, the target time-series data is written into a preset database and a shared memory queue, including:

[0010] Based on the remote procedure call protocol, it interacts with a preset HBase cluster to write the measurement data and the measurement point number into the HBase database of the HBase cluster;

[0011] If the target time series data is detected to have been written to the HBase database, then the target time series data is written to a preset shared memory queue according to the measurement point number and the measurement data.

[0012] The above technical solution interacts with the HBase cluster based on the RPC protocol, thereby writing the measurement data and measurement point numbers associated with the target time series data into the HBase database. It provides one implementation method for writing the target time series data into the database. By detecting that the database writing is completed, it further writes the target time series data into a shared memory queue for caching, providing another implementation method for writing the target time series data into the memory queue. By writing the target time series data into the database and the memory queue respectively, it is helpful for subsequent targeted data reading and realize comprehensive management of time series data.

[0013] Optionally, the measurement data and the measurement point number are written into the HBase database of the HBase cluster, including:

[0014] Based on the measurement data and the measurement point number, determine the row key of the preset database storage table;

[0015] Based on the measurement timestamp in the measurement data, determine the target column to be written to the measurement data in the database storage table;

[0016] Based on the row key and the target write column, the measurement data and the measurement point number are written into the database storage table of the preset HBase database in the HBase cluster.

[0017] The above technical solution determines the row key of the database storage table based on the measurement data and measurement point number, determines the target write column based on the measurement timestamp in the measurement data, and finally writes the measurement data and measurement point number into the database storage table of the HBase database based on the row key and the target write column. This provides an implementation method for writing target time series data into a preset database, which can quickly and effectively write target time series data and related data into the HBase database.

[0018] Optionally, based on a preset document search engine, the measurement point number corresponding to the measurement point information is determined, including:

[0019] Based on a preset document search engine, the mapping relationship between pre-stored measurement point information and measurement point number is obtained, and based on the mapping relationship, it is determined whether there is a measurement point number corresponding to the measurement point information.

[0020] If not, determine the maximum value among the measurement point numbers already stored in the document search engine, and increment the maximum value to obtain the target new measurement point number;

[0021] The newly added measurement point number of the target is used as the measurement point number corresponding to the measurement point information.

[0022] The above technical solution, based on a preset document search engine, can accurately determine whether the corresponding measurement point number has been stored in the index information of the document search engine according to the mapping relationship between the pre-stored measurement point information and the measurement point number. If the corresponding measurement point number does not exist, a new measurement point number is added. This provides an implementation method for determining the corresponding measurement point number when the measurement point number does not exist, and can ensure that the target time series data written has a corresponding index in the document search engine.

[0023] Optionally, in response to a time-series data retrieval request, the retrieval point number corresponding to the retrieval point information in the time-series data retrieval request is determined based on the document search engine.

[0024] Based on the retrieval point number and the retrieval start and end time in the time series data retrieval request, retrieve the time series data from the preset database;

[0025] The retrieved time-series data is restored to determine the measurement timestamp and measurement value corresponding to the retrieved time-series data, and the retrieved time-series data is filtered according to the measurement timestamp and the start and end time of the retrieval.

[0026] The time series data retrieval request is responded to based on the filtered retrieval time series data and the corresponding measurement values.

[0027] The above technical solution provides a method to determine the corresponding retrieval measurement point number based on a document search engine when a time-series data retrieval request is detected. Then, based on the determined retrieval measurement point number and the retrieval start and end time in the time-series data retrieval request, a search is performed in a preset database to determine the retrieval time-series data. Furthermore, based on the measurement timestamp and retrieval start and end time of the retrieval time-series data, the retrieval time-series data is further refined, thereby determining more accurate retrieval time-series data for response.

[0028] Optionally, in response to the time-series data broadcast request, the broadcast measurement point number corresponding to the broadcast measurement point information in the time-series data broadcast request is determined based on the document search engine;

[0029] Based on the broadcast measurement point number, the data is read from the shared memory queue to determine the broadcast timing data, and then broadcast based on a preset long connection protocol.

[0030] The above technical solution determines the corresponding broadcast measurement point number based on a document search engine when a time-series data broadcast request is detected, thereby quickly retrieving broadcast time-series data from a shared memory queue based on the determined broadcast measurement point number; through a preset long connection protocol, it can simultaneously broadcast time-series data to multiple clients, improving the efficiency of time-series data broadcasting.

[0031] Optionally, before writing the target time-series data into a preset database, the method further includes:

[0032] Based on the analysis of the measurement data corresponding to the target time series data, hotspot time series data whose measurement values ​​meet preset conditions are determined from the target time series data;

[0033] Determine the measurement point number corresponding to the hotspot time series data and the target row key of the hotspot time series data in the preset database storage table;

[0034] Based on the target row key, a pre-partitioning strategy for the preset database storage table is determined, and the preset database storage table is pre-partitioned based on the pre-partitioning strategy.

[0035] The above technical solution analyzes the measurement values ​​of the target time series data to identify hotspot data that are prone to causing hotspot problems in advance. Then, it adopts the corresponding pre-partitioning strategy to pre-partition in the preset database, which can avoid hotspot problems that may occur when writing hotspot time series data in the future and ensure efficient writing of time series data.

[0036] According to another aspect of the present invention, a time-series data processing apparatus is provided, comprising:

[0037] The first determining module is used to determine the measurement point information and measurement data corresponding to the target time series data in response to the write request for the target time series data;

[0038] The second determining module is used to determine the measurement point number corresponding to the measurement point information based on a preset document search engine.

[0039] The writing module is used to write the target time series data into a preset database and a shared memory queue according to the measurement data and the measurement point number.

[0040] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0041] At least one processor; and

[0042] A memory communicatively connected to the at least one processor; wherein,

[0043] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the timing data processing method according to any embodiment of the present invention.

[0044] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the timing data processing method according to any embodiment of the present invention.

[0045] The technical solution of this invention, in response to a write request for target time-series data, determines the measurement point information and measurement data corresponding to the target time-series data. Based on a preset document search engine, it determines the measurement point number corresponding to the measurement point information. According to the measurement data and the measurement point number, it writes the target time-series data into a preset database and a shared memory queue. Determining the measurement point number corresponding to the target time-series data based on a document search engine effectively improves the write rate of the target time-series data and helps to quickly confirm whether the target time-series data has been stored without querying the database and memory queue. Furthermore, by writing the target time-series data into the preset database and the shared memory queue respectively, it facilitates subsequent targeted responses to retrieval requests and broadcast requests for the target time-series data, improving time-series data processing efficiency and achieving comprehensive and effective management of the time-series data.

[0046] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

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

[0048] Figure 1 This is a flowchart of a time-series data processing method provided according to Embodiment 1 of the present invention;

[0049] Figure 2A This is a flowchart of a time-series data processing method provided according to Embodiment 2 of the present invention;

[0050] Figure 2B This is a structural block diagram of the time-series data processing framework provided in Embodiment 2 of the present invention;

[0051] Figure 3 This is a flowchart of a time-series data processing method provided according to Embodiment 3 of the present invention;

[0052] Figure 4 This is a schematic diagram of the structure of a time-series data processing device according to Embodiment 4 of the present invention;

[0053] Figure 5 This is a schematic diagram of the structure of an electronic device that implements the timing data processing method of the present invention. Detailed Implementation

[0054] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only 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 should fall within the scope of protection of the present invention.

[0055] It should be noted that the terms "first," "second," "target," "candidate," "alternative," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0056] Example 1

[0057] Figure 1 This is a flowchart of a time-series data processing method according to Embodiment 1 of the present invention. This embodiment is applicable to situations where a database architecture for storing and managing time-series data responds to a write request and writes target time-series data. This method can be executed by a time-series data processing device, which can be implemented in hardware and / or software. The time-series data processing device can be configured in an electronic device and executed by an improved time-series database's Extended Time Series Daemon (Extend-TSD). The time-series database can be, for example, an OpenTSDB (Open time series database) database based on HBase. Figure 1 As shown, the time-series data processing method includes:

[0058] S101. In response to the write request for the target time series data, determine the measurement point information and measurement data corresponding to the target time series data.

[0059] Time-series data refers to a series of monitoring data on indicators that are continuously generated based on relatively stable frequency changes over time. For example, when monitoring the air quality of a city, a series of data is generated by collecting a value of sulfur dioxide concentration every second.

[0060] Target time-series data refers to the time-series data to be written to the target data set in the write request. Measurement point information refers to the information of the measurement points corresponding to the target time-series data. Measurement point information can include the measurement point's metric and tag information. A measurement point refers to the data acquisition device for a specific metric point in the time-series data. A measurement point's time-series data can correspond to one metric and multiple tags. A metric characterizes the time-series data monitored by the measurement point; for example, a metric could be wind force, temperature, or humidity. A tag indicates the specific object being monitored by the metric and belongs to a subcategory of data under a specified metric. A tag consists of a tag key and a corresponding tag value; for example, "City (Tag Key) = Hangzhou (Tag Value)" is a tag.

[0061] Measurement data includes measured values ​​(Fields) and measurement timestamps (Timestamps). Measurement data contains at least two measured values, each corresponding to a measurement timestamp. A measured value is a measurement indicator describing how the data source changes over time; for example, sensor measurements include temperature, humidity, and wind speed. A measurement timestamp is the time information recorded when the time-series data was acquired or written.

[0062] Optionally, Extend-TSD under the OpenTSDB architecture can receive write requests for target time series data sent by clients through a preset API (Application Programming Interface).

[0063] Optionally, when Extend-TSD detects a write request for the target time series data through a preset API interface, it can respond to the write request by parsing it and determining the relevant information of the target time series data to be written, namely, the measured value, the measurement timestamp, the measurement point metric, and the measurement point label information. The relevant information is then divided into two parts: measurement point information and measurement data, that is, determining the measurement point information and measurement data corresponding to the target time series data.

[0064] S102. Based on the preset document search engine, determine the measurement point number corresponding to the measurement point information.

[0065] The document search engine can be used to store time-series data measurement point information through indexing. For example, the document search engine can be a search engine provided by a pre-defined Elasticsearch cluster. The measurement point number refers to an ID number (Identity Document) that uniquely identifies a group of measurement point information. The indexed documents of the document search engine can store measurement point information and measurement point numbers, as well as the mapping relationship between the measurement point information and the measurement point numbers.

[0066] For example, considering the need to handle massive amounts of time-series data storage, the measurement point numbers in Elasticsearch can be designed as 000000000 to 999999999, i.e., 9-digit string numbers. The characters are ordered in ascending order according to the integer data type, and numbers less than 9 digits are padded with 0s on the left. It should be noted that, in this way, up to 1 billion data measurement points can be stored, making the solution of this invention effectively applicable to scenarios involving the storage of massive time-series data.

[0067] Optionally, after Extend-TSD determines the measurement point information and measurement data corresponding to the target time series data, it can interact with a preset Elasticsearch cluster based on the HTTP protocol, send the measurement point information to the preset Elasticsearch cluster, and call the document search function of the Elasticsearch cluster to query and determine the measurement point number corresponding to the measurement point information.

[0068] Optionally, based on a preset document search engine, the measurement point number corresponding to the measurement point information is determined, including: based on the preset document search engine, obtaining the mapping relationship between pre-stored measurement point information and measurement point numbers, and determining whether there is a measurement point number corresponding to the measurement point information according to the mapping relationship; if not, determining the maximum value among the measurement point numbers stored in the document search engine, and incrementing the maximum value to obtain the target newly added measurement point number; and using the target newly added measurement point number as the measurement point number corresponding to the measurement point information.

[0069] Among them, the newly added measurement point number of the target refers to the new measurement point number added by the target in the document search engine index file.

[0070] Optionally, based on the mapping relationship, if there is a corresponding measurement point number for a given measurement point, the corresponding measurement point number can be output directly; if there is no corresponding measurement point number for the given measurement point, the maximum value of the stored measurement point number can be found in Elastcisearch.

[0071] Optionally, after determining the maximum value among the measurement point numbers already stored in the document search engine, the integer value corresponding to the maximum value number can be incremented by 1, and the incremented number can be used as the target new measurement point number. That is, the maximum value is incremented to obtain the target new measurement point number.

[0072] Optionally, after using the newly added measurement point number as the measurement point number corresponding to the measurement point information, the newly added measurement point number and measurement point information can be saved as complete measurement point information in the measurement point information index of the document search engine. That is, the relevant information of the newly added measurement point number is written into the index document of the document search engine. Specifically, an index document can be generated based on the newly added measurement point number and related measurement point attribute information, and the index document can be inserted into the measurement point information index of the document search engine using the interface between the document search engine and the document search engine.

[0073] For example, Extend-TSD can create a JSON document (i.e., an index document) containing the target new measurement point number and related measurement point attribute information. Then, it can use the API provided by the document search engine to insert the new JSON document into the document search engine's index. For example, it can use the Bulk API for batch insertion or the Index API for single document insertion.

[0074] Optionally, a separate document can be created in the document search engine to store all the measurement point number values. Each time a new measurement point is inserted, the current maximum number value needs to be retrieved from this document and incremented. Then, the incremented number value is saved back to the document. Correspondingly, after the target new measurement point number is used as the measurement point number corresponding to the measurement point information, the target new measurement point number can also be inserted into the document created in the document search engine that stores the measurement point number values.

[0075] For example, when creating an index in a document search engine based on a preset document search engine, if no test point information has been created, that is, the test point to be written is the first test point, then since the default initial number is 000000000, the number of the first test point can be 000000000, the number of the second test point is 000000001, and so on.

[0076] The above technical solution, based on a preset document search engine, can accurately determine whether the corresponding measurement point number has been stored in the index information of the document search engine according to the mapping relationship between the pre-stored measurement point information and the measurement point number. If the corresponding measurement point number does not exist, a new measurement point number is added. This provides an implementation method for determining the corresponding measurement point number when the measurement point number does not exist, and can ensure that the target time series data written has a corresponding index in the document search engine.

[0077] S103. Based on the measurement data and measurement point number, write the target time series data into the preset database and shared memory queue.

[0078] Here, the preset database refers to a pre-defined database used to store time-series measurement data; for example, it could be an HBase database. The shared memory queue refers to a pre-defined memory region in memory used for inter-process sharing; storing time-series data in a shared memory queue facilitates the rapid retrieval of the target time-series data.

[0079] It should be noted that the target time-series data written to the preset database can be used to read in response to time-series data retrieval requests; the target time-series data written to the shared memory queue can be used to read in response to time-series data broadcast requests.

[0080] Optionally, based on the measurement data and measurement point number, the measurement data and measurement point number corresponding to the target time series data can be integrated according to the data storage format of the preset database to write the target time series data into the preset database; or a preset process can be called to write the measurement data and measurement point number corresponding to the target time series data into the shared memory queue based on the address information of the shared memory queue.

[0081] The technical solution of this invention, in response to a write request for target time-series data, determines the measurement point information and measurement data corresponding to the target time-series data. Based on a preset document search engine, it determines the measurement point number corresponding to the measurement point information. According to the measurement data and the measurement point number, it writes the target time-series data into a preset database and a shared memory queue. Determining the measurement point number corresponding to the target time-series data based on a document search engine effectively improves the write rate of the target time-series data and helps to quickly confirm whether the target time-series data has been stored without querying the database and memory queue. Furthermore, by writing the target time-series data into the preset database and the shared memory queue respectively, it facilitates subsequent targeted responses to retrieval requests and broadcast requests for the target time-series data, improving time-series data processing efficiency and achieving comprehensive and effective management of the time-series data.

[0082] Optionally, by using the time-series data writing scheme described in the above embodiments of the present invention, after writing the target time-series data into the preset database and the shared memory queue respectively, it can further respond to time-series data retrieval requests and time-series data broadcast requests by reading time-series data from the preset database and the shared memory queue to achieve targeted time-series data management and improve data processing efficiency.

[0083] Optionally, in response to a time-series data retrieval request, based on a document search engine, the system determines the retrieval point number corresponding to the retrieval point information in the time-series data retrieval request; based on the retrieval point number and the retrieval start and end times in the time-series data retrieval request, it queries the retrieval time-series data from a preset database; it performs a restoration operation on the retrieval time-series data to determine the measurement timestamp and measurement value corresponding to the retrieval time-series data, and filters the retrieval time-series data based on the measurement timestamp and retrieval start and end times; and it responds to the time-series data retrieval request based on the filtered retrieval time-series data and the corresponding measurement values.

[0084] Here, a time-series data retrieval request refers to a request to retrieve target time-series data. Retrieval measurement point information refers to the measurement point information associated with the target time-series data. Retrieval measurement point information may include retrieval metrics and retrieval tag information. The retrieval measurement point number refers to the measurement point number that corresponds one-to-one with the retrieval measurement point information. The retrieval start and end times characterize the time range of the requested retrieval.

[0085] Optionally, Extend-TSD can receive time-series data retrieval requests sent by clients through a preset API interface, determine the retrieval measurement point information and retrieval start and end times in the time-series data retrieval request; based on the retrieval measurement point information, it interacts with a preset document search cluster (such as an Elasticsearch cluster) to search in the measurement point information index of the document search engine to determine whether there is a retrieval measurement point number corresponding to the retrieval measurement point information.

[0086] Optionally, if it is determined that there is no corresponding retrieval point number for the retrieval point information, a prompt message indicating that the target time-series data does not exist can be directly returned. If it is determined that there is a corresponding retrieval point number for the retrieval point information, a search can be performed in a preset database based on the retrieval point number and the start and end times of the search to determine the measurement data corresponding to the retrieved time-series data. For example, when the preset database is an HBase database, the rowkey scan range of the corresponding database storage table (i.e., the tsdb table) in the HBase database can be determined based on the retrieval point number and the start and end times of the search. Further, based on the scan range, a search can be performed in the HBase database to determine the retrieved time-series data. The tsdb (time series database) table is a preset table in the HBase database used to store time-series data.

[0087] Optionally, based on the data storage rules of a preset database, a restoration operation can be performed on the retrieved time-series data to determine the corresponding measurement timestamp and measurement value. For example, when the preset database is an HBase database, the time-series data can be restored by reversing the process of writing the time-series data into the database storage table, restoring the time-series data points stored in each column to the corresponding measurement timestamp and measurement value. For example, an HBase record with rowkey 123456789463231, column name "2061", and data value of 0.5 will have a converted data point timestamp (i.e., measurement timestamp) of 1667633661, and a measurement value of 0.5.

[0088] For example, if the timestamp measurement is in seconds, the corresponding restoration formula could be:

[0089] INT(substring(rowkey,9:))*3600+INT(t_col)

[0090] Here, INT() performs a rounding operation, substring() performs a string truncation operation on the retrieved time-series data, t_col is the column name corresponding to the retrieved time-series data, and rowkey is the row key corresponding to the retrieved time-series data. If the measurement timestamp is in seconds, then the 3600 in the above restoration formula should be corrected to 3600000.

[0091] Optionally, considering that the start and end times of the retrieval may not require returning all data for each hour, especially the records corresponding to the rowkeys at the start and end times, after determining the retrieval time series data, the retrieval time series data can be further finely filtered based on the measurement timestamp and the retrieval start and end times. Specifically, if the retrieval start and end times include time periods other than the hour, fine filtering can be performed in the database to achieve the filtering of the retrieval time series data.

[0092] For example, after determining the retrieval time series data to be returned based on the start and end times of the retrieval, if the corresponding measurement timestamps range from 1649297288 (corresponding to the time "2022-04-07 10:08:08") to 1649304488 (corresponding to the time "2022-04-07 12:08:08"), then all data from 11:00:00 on 2022-04-07 to 12:00:00 on 2022-04-07 needs to be returned without secondary filtering. The data for the time periods from 10:08:08 to 11:00:00 on April 7, 2022, and from 12:00:00 to 12:08:08 on April 7, 2022, does not need to be returned to the client in its entirety. Instead, it needs to be finely filtered again based on the column names in the database storage table.

[0093] The above technical solution provides a method to determine the corresponding retrieval measurement point number based on a document search engine when a time-series data retrieval request is detected. Then, based on the determined retrieval measurement point number and the retrieval start and end time in the time-series data retrieval request, a search is performed in a preset database to determine the retrieval time-series data. Furthermore, based on the measurement timestamp and retrieval start and end time of the retrieval time-series data, the retrieval time-series data is further refined, thereby determining more accurate retrieval time-series data for response.

[0094] Optionally, in response to a time-series data broadcast request, the broadcast measurement point number corresponding to the broadcast measurement point information in the time-series data broadcast request is determined based on a document search engine; according to the broadcast measurement point number, the data is read from a shared memory queue to determine the broadcast time-series data, and the broadcast time-series data is broadcast based on a preset long connection protocol.

[0095] A time-series data broadcast request refers to a request to broadcast the target's time-series data to all clients. The time-series data broadcast request may include the broadcast measurement point information of the target. A long-connection protocol is a persistent connection protocol used for communication between Extend-TSD and clients, such as the WebSocket protocol.

[0096] It should be noted that, considering the limited memory capacity of the deployed devices, the capacity of the shared memory queue can be set to a fixed length. If it is detected that the length of the measurement point number queue stored in the shared memory queue exceeds the preset queue length, Extend-TSD can first perform a deletion operation on the shared queue based on preset rules, and then cache the real-time time series data.

[0097] Optionally, Extend-TSD can receive websocket requests sent by clients and establish connections with each client separately to receive time-series data broadcast requests sent by the clients.

[0098] Optionally, after receiving the time-series data broadcast request sent by the client, the broadcast measurement point information in the time-series data broadcast request can be determined. Based on the broadcast measurement point information, the system can interact with the preset document search cluster (such as an Elasticsearch cluster) to search in the measurement point information index of the document search engine to determine whether there is a broadcast measurement point number corresponding to the broadcast measurement point information. If not, an error message is sent to the client and the connection is disconnected.

[0099] It should be noted that the measurement point number in the time series data broadcast request can also be directly determined as the broadcast measurement point number, and this invention does not impose any restrictions on this.

[0100] Optionally, if it is determined that there is a broadcast measurement point number corresponding to the broadcast measurement point information, the broadcast timing data can be determined by reading the broadcast measurement point number one by one in the shared memory queue. Finally, based on the websocket, the determined broadcast timing data is broadcast to all clients with established connections.

[0101] The above technical solution determines the corresponding broadcast measurement point number based on a document search engine when a time-series data broadcast request is detected, thereby quickly retrieving broadcast time-series data from a shared memory queue based on the determined broadcast measurement point number; through a preset long connection protocol, it can simultaneously broadcast time-series data to multiple clients, improving the efficiency of time-series data broadcasting.

[0102] Example 2

[0103] Figure 2A This is a flowchart of a time-series data processing method provided according to Embodiment 2 of the present invention; Figure 2B This is a structural block diagram of the time-series data processing framework provided in Embodiment 2 of the present invention. This embodiment is an optimization and improvement based on the above-described technical solutions.

[0104] Furthermore, the phrase "writing the target time series data into a preset database and a shared memory queue based on the measurement data and the measurement point number" is refined to "interacting with a preset HBase cluster based on the Remote Procedure Call (RPC) protocol to write the measurement data and the measurement point number into the HBase database of the HBase cluster; if it is detected that the target time series data has been written to the HBase database, then writing the target time series data into a preset shared memory queue based on the measurement point number and the measurement data" to improve the method of writing the target time series data into the preset database and the shared memory queue.

[0105] Furthermore, the phrase "writing the measurement data and the measurement point number into the HBase database of the HBase cluster" is refined to "determining the row key of the preset database storage table based on the measurement data and the measurement point number; determining the target column for writing the measurement data into the database storage table based on the measurement timestamp in the measurement data; and writing the measurement data and the measurement point number into the database storage table of the preset HBase database in the HBase cluster based on the row key and the target column" to improve the specific feasible implementation of writing the target time-series data into the preset database.

[0106] Furthermore, the steps prior to writing the target time-series data into the preset database are further refined as follows: "Based on the analysis of the measurement data corresponding to the target time-series data, hotspot time-series data whose measurement values ​​meet preset conditions are identified from the target time-series data; based on the measurement data corresponding to the hotspot time-series data, the measurement point number corresponding to the hotspot time-series data and the target row key of the hotspot data in the preset time-series database storage table are determined; based on the target row key, a pre-partitioning strategy for the preset database is determined, and the preset database is pre-partitioned based on the pre-partitioning strategy," in order to improve the efficiency of writing the target time-series data into the database.

[0107] like Figure 2A As shown, the method includes the following specific steps:

[0108] S201. In response to the write request for the target time series data, determine the measurement point information and measurement data corresponding to the target time series data.

[0109] S202. Based on the preset document search engine, determine the measurement point number corresponding to the measurement point information.

[0110] S203. Based on the Remote Procedure Call (RPC) protocol, it interacts with the preset HBase cluster to write the measurement data and measurement point number into the HBase database of the HBase cluster.

[0111] The Remote Procedure Call (RPC) protocol is used to enable communication between Extend-TSD and the HBase cluster. The HBase cluster is a pre-defined database used to store specific measurement data for time-series data.

[0112] Optionally, Extend-TSD can use the PRC interface provided by HBase to write measurement data and measurement point numbers into the HBase database of the HBase cluster. Specifically, writing measurement data and measurement point numbers into the HBase database of the HBase cluster includes: determining the row key of the preset database storage table based on the measurement data and measurement point numbers; determining the target column for writing the measurement data in the database storage table based on the measurement timestamp in the measurement data; and writing the measurement data and measurement point numbers into the preset HBase database storage table in the HBase cluster based on the row key and the target column.

[0113] Extend-TSD can interact with the HBase cluster to write time-series data to the database storage table of the HBase database. Specifically, it stores all measurement values ​​corresponding to the hour within a given hour under each row key of the database storage table. That is, the row key of the database storage table consists of the measurement point number and the hour number of the measurement timestamp. The column names of the database storage table store the offset in seconds corresponding to the hour timestamp in the time-series data. The calculation method for the hour number of the measurement timestamp is timestamp / 3600, where timestamp is the measurement timestamp. If the timestamp is in milliseconds, the calculation method is timestamp / 3600000.

[0114] For example, if the measurement point number is 123456789 and the measurement timestamp is 1667633661 (corresponding to the time point 2022-11-05 15:34:21), then the hour of the measurement timestamp is 463231, and the corresponding rowkey value is "123456789463231".

[0115] Optionally, the column name for the HBase time-series data database storage table can be determined based on the measurement timestamp. This means determining the target column to be written to within column family 't' of the database storage table, using the formula timestamp%3600 (modulo the measurement timestamp). If the measurement timestamp is stored in milliseconds, the target column is calculated as timestamp%3600000. For example, if the measurement timestamp is 1667633661, the corresponding storage column is 2061.

[0116] Optionally, after determining the rowkey and target write column of the database storage table, the measurement values ​​in the target time series measurement data can be written to the corresponding positions of the rowkey and target write column in the database storage table through the PRC interface provided by HBase.

[0117] The above technical solution determines the row key of the database storage table based on the measurement data and measurement point number, determines the target write column based on the measurement timestamp in the measurement data, and finally writes the measurement data and measurement point number into the database storage table of the HBase database based on the row key and the target write column. This provides an implementation method for writing target time series data into a preset database, which can quickly and effectively write target time series data and related data into the HBase database.

[0118] It should be noted that hot time series data, where measurements change frequently or with large fluctuations, will occupy relatively high storage space and put significant pressure on data read and write operations. For application scenarios containing hot time series data, optimization is required to improve data read and write performance and reliability.

[0119] Optionally, for hot time-series data, caching technology can be used to cache the hot data in memory to accelerate data reading. Alternatively, a pre-partitioning strategy based on HBase can be used to distribute adjacent hot time-series data in different regions, thereby avoiding centralized storage of hot time-series data in a single region and avoiding HBase time-series data write failures or cluster downtime caused by data hotspots.

[0120] Optionally, before writing the target time series data into the preset database, the method further includes: determining hot spot time series data whose measurement values ​​meet preset conditions from the target time series data based on the analysis of the measurement data corresponding to the target time series data; determining the measurement point number corresponding to the hot spot time series data and the target row key of the hot spot time series data in the preset database storage table; determining the pre-partitioning strategy for the preset database storage table based on the target row key, and pre-partitioning the preset database storage table based on the pre-partitioning strategy.

[0121] Hotspot time-series data can be, for example, time-series data within the target time-series data whose measurement frequency and magnitude exceed a preset range within a preset time period. Pre-partitioning strategy refers to pre-planning the storage range of the time-series database storage tables to optimize data storage efficiency. Pre-defined database storage tables can be, for example, database storage tables in an HBase database.

[0122] Optionally, after identifying the hotspot time-series data, the corresponding measurement point number can be determined based on the measurement point information of the hotspot time-series data. Further, based on the measurement timestamps in the hotspot time-series data, the start and end times of the hotspot time-series data are converted to the whole-hour timestamp format in HBase to obtain the start and end rowkeys. Finally, the measurement point number corresponding to the hotspot time-series data is concatenated with the calculated start and end rowkeys to obtain the range of rowkeys to be queried, i.e., the target row key.

[0123] Optionally, different pre-partitioning strategies can be determined based on the time range corresponding to the target row key. Specifically, if the time range corresponds to time series data collected over multiple days, the hot spot time series data can be pre-partitioned by day: that is, hot spot time series data collected on the same day are stored in the same region; if the time range corresponds to time series data collected over multiple weeks, the hot spot time series data can be pre-partitioned by week: that is, hot spot time series data collected in the same week are stored in the same region; if the time range corresponds to time series data collected over multiple months, the hot spot time series data can be pre-partitioned by month: that is, hot spot time series data collected in the same month are stored in the same region.

[0124] The above technical solution analyzes the measurement values ​​of the target time series data to identify hotspot data that are prone to causing hotspot problems in advance. Then, it adopts the corresponding pre-partitioning strategy to pre-partition in the preset database, which can avoid hotspot problems that may occur when writing hotspot time series data in the future and ensure efficient writing of time series data.

[0125] S204. If it is detected that the target time series data has been written to the HBase database, then the target time series data is written to the preset shared memory queue according to the measurement point number and measurement data.

[0126] Optionally, when the target time series data is detected to have been written to the HBase database, the measurement data of the time series data can be written to the shared memory queue based on the measurement point number and the measurement data, with the measurement point number as the unique identifier. That is, the target time series data is written to the preset shared memory queue.

[0127] For example, if the measurement timestamp of the target time series data is 1667633661 and the measurement value is 0.5, then the content stored in the shared memory queue is {"timestamp":1667633661,"value":0.5}, and the shared memory queue is identified as the corresponding measurement point number.

[0128] The technical solution of this invention interacts with an HBase cluster based on the RPC protocol, thereby writing the measurement data and measurement point numbers associated with the target time series data into the HBase database. It provides one implementation method for writing the target time series data into the database. By detecting that the database writing is completed, it further writes the target time series data into a shared memory queue for caching, and provides another implementation method for writing the target time series data into the memory queue. By writing the target time series data into the database and the memory queue respectively, it is helpful for subsequent targeted data reading and realizes comprehensive management of time series data.

[0129] Preferred, see Figure 2BOpenTSDB allows configuration of at least two Extend-TSDs to interact with various time-series data applications (i.e., clients) via HTTP and WebSocket for time-series data processing. For example, it can receive time-series data write requests via HTTP and broadcast real-time time-series data to clients via WebSocket. OpenTSDB can also interact with HBase clusters via RPC and Elasticsearch clusters via HTTP, enabling effective management of time-series data.

[0130] Example 3

[0131] Figure 3 This is a flowchart of a time-series data processing method provided in Embodiment 3 of the present invention; this embodiment provides a preferred example based on the above embodiments.

[0132] like Figure 3 As shown, the method includes the following specific steps:

[0133] S301. In response to the write request for the target time series data, determine the measurement point information and measurement data corresponding to the target time series data.

[0134] S302. Based on a preset document search engine, determine the measurement point number corresponding to the measurement point information.

[0135] S303. Based on the measurement data and measurement point number, write the target time series data into the preset database and shared memory queue.

[0136] Optionally, before writing the target time series data into a preset database, the method further includes: determining hotspot time series data whose measurement values ​​meet preset conditions from the target time series data based on the analysis of the measurement data corresponding to the target time series data; determining the measurement point number corresponding to the hotspot time series data and the target row key of the hotspot time series data in the preset database storage table; determining a pre-partitioning strategy for the preset database storage table based on the target row key, and pre-partitioning the preset database storage table based on the pre-partitioning strategy.

[0137] S304. In response to the time series data retrieval request, based on the document search engine, determine the retrieval point number corresponding to the retrieval point information in the time series data retrieval request.

[0138] S305. Based on the retrieval point number and the retrieval start and end time in the time series data retrieval request, query the retrieval time series data from the preset database.

[0139] S306. Perform a restoration operation on the retrieved time series data to determine the measurement timestamp and measurement value corresponding to the retrieved time series data, and filter the retrieved time series data according to the measurement timestamp and the start and end time of the retrieval.

[0140] S307. Respond to the time series data retrieval request based on the filtered time series data and the corresponding measurement values.

[0141] S308. In response to the time series data broadcast request, determine the broadcast measurement point number corresponding to the broadcast measurement point information in the time series data broadcast request based on the document search engine.

[0142] S309. Based on the broadcast test point number, read from the shared memory queue, determine the broadcast timing data, and broadcast the broadcast timing data based on the preset WebSocket long connection protocol.

[0143] It should be noted that in related technologies, the OpenTSDB data architecture built on HBase is often used for basic storage of time series data, but it has the following problems: (1) OpenTSDB stores the mapping relationship between time series data related information and number in the preset tsdb_uid table. When processing time series data, the write status of time series data is often determined by full table scan, resulting in low data processing efficiency. (2) When there is a lot of tag information in time series data, the row key length in the preset tsdb_uid table increases accordingly, increasing the storage overhead of time series data. (3) The number information in the preset tsdb_uid table needs to be generated in real time when inserting time series data points according to the rowkey design rules of the tsdb table. This is not conducive to the pre-partitioning of HBase tables, which makes it easy for hot spots to occur when writing large amounts of data. (4) Since it communicates with the client through the HTTP or Telnet interface, OpenTSDB can only receive query requests sent by the client and cannot actively broadcast time series data to the client.

[0144] The technical solution of this invention takes into account the above problems and proposes a time series data processing scheme. It can save the measurement point number and measurement point information corresponding to the time series data based on a document search engine, and store the measurement data corresponding to the time series data based on an HBase cluster, thereby improving the writing efficiency of time series data. At the same time, it can also ensure the speed of time series data retrieval and broadcasting, effectively improving the above problems, realizing effective management of time series data, and improving the processing efficiency of time series data.

[0145] Specifically, (1) This invention stores the metrics and tags of time-series data in the form of measurement points and records them in the document retrieval engine Elasticsearch. Extend-TSD generates a unique 9-digit auto-incrementing number for each corresponding record as the measurement point number. Each record in Elasticsearch can be regarded as a measurement point or device for time-series data collection. When inserting data, Elasticsearch indexes the metric and tag records of each stored measurement point. By establishing the index, a full table scan of tsdb_uid is avoided, improving the efficiency of precise or fuzzy search for time-series data. (2) This invention simplifies the rowkey construction method of the OpenTSDB time-series data storage table tsdb, reducing the rowkey storage overhead of the tsdb table when there are too many tag attributes. (3) This invention stores the measurement point information in the Elasticsearch storage engine. Users can query the detailed information of the measurement points through the official Elasticsearch API or the API provided by this invention, directly obtaining the mapping relationship between the measurement point number and the metric and tag, simplifying the bidirectional mapping process of metric, tag and uid used for rowkey construction. (4) Based on the construction principle of the rowkey of the database storage table according to the present invention, the pre-partitioning strategy of the database storage table can be specified according to the measurement point number and time range of time series data obtained by querying metric and tag, so as to avoid HBase time series data write failure or cluster crash due to hot spot problems when writing large amounts of data. (5) The present invention provides users with real-time broadcasting function of time series data by adding a websocket-based external interface to Extend-TSD. After receiving a time series data write request, Extend-TSD will record the measurement value and measurement time of the corresponding measurement point in the shared memory list. Thus, the client can establish a connection with Extend-TSD through the websocket interface, and Extend-TSD can broadcast the time series data cached in the memory queue to the user in real time according to the measurement point number specified by the user.

[0146] Example 4

[0147] Figure 4This is a schematic diagram of a time-series data processing device according to Embodiment 4 of the present invention. The time-series data processing device provided in this embodiment is applicable to database architectures that manage and store time-series data, responding to write requests and writing target time-series data. This time-series data processing device can be implemented in hardware and / or software, and can be configured in an electronic device, executed by the extended time series daemon of the time-series database. The time-series database can be, for example, an OpenTSDB database based on HBase. Figure 4 As shown, the device specifically includes: a first determining module 401, a second determining module 402, and a writing module 403. Among them,

[0148] The first determining module 401 is used to determine the measurement point information and measurement data corresponding to the target time series data in response to the writing request for the target time series data;

[0149] The second determining module 402 is used to determine the measurement point number corresponding to the measurement point information based on a preset document search engine.

[0150] The writing module 403 is used to write the target time series data into a preset database and a shared memory queue according to the measurement data and the measurement point number.

[0151] By using a document search engine to determine the measurement point number corresponding to the target time series data, the writing rate of the target time series data can be effectively improved. It also helps to quickly confirm whether the target time series data has been stored without querying the database and memory queue. In addition, by writing the target time series data into a preset database and a shared memory queue respectively, it is possible to respond to the target time series data retrieval requests and broadcast requests in a targeted manner, thereby improving the efficiency of time series data processing and realizing comprehensive and effective management of time series data.

[0152] Furthermore, the write module 403 may include:

[0153] The first writing unit is used to interact with a preset HBase cluster based on the remote procedure call protocol to write the measurement data and the measurement point number into the HBase database of the HBase cluster.

[0154] The second writing unit is used to write the target time series data into a preset shared memory queue according to the measurement point number and the measurement data if the target time series data is detected to have been written to the HBase database.

[0155] Furthermore, the first write unit is specifically used for:

[0156] Based on the measurement data and the measurement point number, determine the row key of the preset database storage table;

[0157] Based on the measurement timestamp in the measurement data, determine the target column to be written to the measurement data in the database storage table;

[0158] Based on the row key and the target write column, the measurement data and the measurement point number are written into the database storage table of the preset HBase database in the HBase cluster.

[0159] Furthermore, the second determining module 402 is specifically used for:

[0160] Based on a preset document search engine, the mapping relationship between pre-stored measurement point information and measurement point number is obtained, and based on the mapping relationship, it is determined whether there is a measurement point number corresponding to the measurement point information.

[0161] If not, determine the maximum value among the measurement point numbers already stored in the document search engine, and increment the maximum value to obtain the target new measurement point number;

[0162] The newly added measurement point number of the target is used as the measurement point number corresponding to the measurement point information.

[0163] Furthermore, the above-mentioned device is also used for:

[0164] In response to a time-series data retrieval request, the retrieval point number corresponding to the retrieval point information in the time-series data retrieval request is determined based on the document search engine.

[0165] Based on the retrieval point number and the retrieval start and end time in the time series data retrieval request, retrieve the time series data from the preset database;

[0166] The retrieved time-series data is restored to determine the measurement timestamp and measurement value corresponding to the retrieved time-series data, and the retrieved time-series data is filtered according to the measurement timestamp and the start and end time of the retrieval.

[0167] The time series data retrieval request is responded to based on the filtered retrieval time series data and the corresponding measurement values.

[0168] Furthermore, the above-mentioned device is also used for:

[0169] In response to the time-series data broadcast request, the broadcast measurement point number corresponding to the broadcast measurement point information in the time-series data broadcast request is determined based on the document search engine;

[0170] Based on the broadcast measurement point number, the data is read from the shared memory queue to determine the broadcast timing data, and then broadcast based on a preset long connection protocol.

[0171] Furthermore, the above-mentioned device is also used for:

[0172] Based on the analysis of the measurement data corresponding to the target time series data, hotspot time series data whose measurement values ​​meet preset conditions are determined from the target time series data;

[0173] Determine the measurement point number corresponding to the hotspot time series data and the target row key of the hotspot time series data in the preset database storage table;

[0174] Based on the target row key, a pre-partitioning strategy for the preset database storage table is determined, and the preset database storage table is pre-partitioned based on the pre-partitioning strategy.

[0175] Example 5

[0176] Figure 5 This is a schematic diagram of the structure of an electronic device that implements the timing data processing method of the present invention. Figure 5 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0177] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

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

[0179] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as timing data processing methods.

[0180] In some embodiments, the timing data processing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the timing data processing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the timing data processing method by any other suitable means (e.g., by means of firmware).

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

[0182] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

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

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

[0185] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0186] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0187] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

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

Claims

1. A time-series data processing method, characterized in that, include: In response to a write request for target time series data, determine the measurement point information and measurement data corresponding to the target time series data; Based on a preset document search engine, the measurement point number corresponding to the measurement point information is determined; the indexed documents of the document search engine store measurement point information and measurement point number, and also store the mapping relationship between measurement point information and measurement point number. Based on the measurement data and the measurement point number, the target time series data is written into a preset database and a shared memory queue, including: interacting with a preset HBase cluster based on the remote procedure call protocol to write the measurement data and the measurement point number into the HBase database of the HBase cluster; if it is detected that the target time series data has been written to the HBase database, then based on the measurement point number and the measurement data, the target time series data is written into a preset shared memory queue. Specifically, the target time-series data written to the preset database is used to read in response to time-series data retrieval requests; the target time-series data written to the shared memory queue is used to read in response to time-series data broadcast requests; the time-series data broadcast request refers to the request to broadcast the target time-series data to all clients.

2. The method according to claim 1, characterized in that, The measurement data and the measurement point number are written into the HBase database of the HBase cluster, including: Based on the measurement data and the measurement point number, determine the row key of the preset database storage table; Based on the measurement timestamp in the measurement data, determine the target column to be written to the measurement data in the database storage table; Based on the row key and the target write column, the measurement data and the measurement point number are written into the database storage table of the preset HBase database in the HBase cluster.

3. The method according to claim 1, characterized in that, Based on a preset document search engine, the measurement point number corresponding to the measurement point information is determined, including: Based on a preset document search engine, the mapping relationship between pre-stored measurement point information and measurement point number is obtained, and based on the mapping relationship, it is determined whether there is a measurement point number corresponding to the measurement point information. If not, determine the maximum value among the measurement point numbers already stored in the document search engine, and increment the maximum value to obtain the target new measurement point number; The newly added measurement point number of the target is used as the measurement point number corresponding to the measurement point information.

4. The method according to claim 1, characterized in that, Also includes: In response to a time-series data retrieval request, the retrieval point number corresponding to the retrieval point information in the time-series data retrieval request is determined based on the document search engine. Based on the retrieval point number and the retrieval start and end time in the time series data retrieval request, retrieve the time series data from the preset database; The retrieved time-series data is restored to determine the measurement timestamp and measurement value corresponding to the retrieved time-series data, and the retrieved time-series data is filtered according to the measurement timestamp and the start and end time of the retrieval. The time series data retrieval request is responded to based on the filtered retrieval time series data and the corresponding measurement values.

5. The method according to claim 1, characterized in that, Also includes: In response to the time-series data broadcast request, the broadcast measurement point number corresponding to the broadcast measurement point information in the time-series data broadcast request is determined based on the document search engine; Based on the broadcast measurement point number, the data is read from the shared memory queue to determine the broadcast timing data, and then broadcast based on a preset long connection protocol.

6. The method according to claim 1, characterized in that, Before writing the target time-series data into the preset database, the process also includes: Based on the analysis of the measurement data corresponding to the target time series data, hotspot time series data whose measurement values ​​meet preset conditions are determined from the target time series data; Determine the measurement point number corresponding to the hotspot time series data and the target row key of the hotspot time series data in the preset database storage table; Based on the target row key, a pre-partitioning strategy for the preset database storage table is determined, and the preset database storage table is pre-partitioned based on the pre-partitioning strategy.

7. A time-series data processing apparatus, characterized in that, include: The first determining module is used to determine the measurement point information and measurement data corresponding to the target time series data in response to the write request for the target time series data; The second determining module is used to determine the measurement point number corresponding to the measurement point information based on a preset document search engine; the indexed documents of the document search engine store measurement point information and measurement point number, and also store the mapping relationship between measurement point information and measurement point number. The writing module is used to write the target time series data into a preset database and a shared memory queue according to the measurement data and the measurement point number; The writing module includes: a first writing unit, used to interact with a preset HBase cluster based on the remote procedure call protocol to write the measurement data and the measurement point number into the HBase database of the HBase cluster; and a second writing unit, used to write the target time series data into a preset shared memory queue according to the measurement point number and the measurement data if it is detected that the target time series data has been written to the HBase database. Specifically, the target time-series data written to the preset database is used to read in response to time-series data retrieval requests; the target time-series data written to the shared memory queue is used to read in response to time-series data broadcast requests; the time-series data broadcast request refers to the request to broadcast the target time-series data to all clients.

8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the timing data processing method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the timing data processing method according to any one of claims 1-6.