A data query method, apparatus, server, and storage medium

By constructing time conditions and using multi-threaded processing, the problem of data querying consuming a large amount of memory in distributed storage systems is solved, achieving efficient data querying and processing.

CN115905277BActive Publication Date: 2025-10-31BEIJING ROUKENENGDA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111164687.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2025-10-31
Estimated Expiration
2041-09-30

AI Technical Summary

Technical Problem

In existing technologies, data querying methods based on distributed storage systems consume a large amount of memory and are inefficient.

Method used

By constructing multiple time conditions, time series data of time sub-intervals are obtained and processed, and the results are merged during the processing until the last batch of data is obtained. Multi-threaded processing and aggregation operators are used to improve efficiency.

Benefits of technology

It reduces memory usage and improves data query efficiency, enabling simultaneous data processing and retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115905277B_ABST
    Figure CN115905277B_ABST
Patent Text Reader

Abstract

This invention provides a data query method, apparatus, server, and storage medium. The method includes: acquiring a data query request; constructing multiple time conditions based on the time interval indicated by the data query request, each time condition corresponding to a time sub-interval; acquiring a batch of time-series data corresponding to the time sub-interval that meets the current time condition; processing the batch of time-series data corresponding to the time sub-interval according to a preset processing method to obtain the corresponding processing result; merging the processing result with the currently stored processing result; during this process, determining the next time condition as the current time condition and returning to the step of acquiring a batch of time-series data corresponding to the time sub-interval that meets the current time condition, until the data is the last batch of time-series data; and determining the currently stored processing result as the query result. By processing the current batch of time-series data while simultaneously retrieving a batch of time-series data corresponding to the next time condition, data query efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of big data technology, and in particular to a data query method, apparatus, server, and storage medium. Background Technology

[0002] With the advent of the big data era, distributed storage systems are being used more and more widely. Common distributed storage databases include time-series databases such as OpenTSDB (Opentime series database) and InfluxDB, which can store large amounts of data and provide a data foundation for data querying, data processing, and data analysis.

[0003] Currently, the processing method for query operations based on distributed storage systems is as follows: first, all data that meets the query conditions is retrieved from the database, and all the retrieved data is loaded into memory; then, the retrieved data is processed to obtain the query results. In other words, data processing only occurs after all data has been retrieved.

[0004] In the above query methods, data processing after retrieving all data will consume a lot of memory, and the data query efficiency is also low. Summary of the Invention

[0005] The purpose of this invention is to provide a data query method, apparatus, server, and storage medium to solve the problems of high memory consumption and low efficiency in data querying. The specific technical solution is as follows:

[0006] In a first aspect, embodiments of the present invention provide a data query method applied to a time-series database server, the method comprising:

[0007] Obtain a data query request, and construct multiple time conditions based on the time interval indicated by the data query request, wherein each time condition corresponds to a time sub-interval in the time interval;

[0008] Retrieve a batch of time series data corresponding to the time sub-intervals that meet the current time conditions;

[0009] A batch of time-series data corresponding to the time sub-interval is processed according to a preset processing method to obtain the corresponding processing result, and the processing result is merged with the currently stored processing result;

[0010] In the process of processing a batch of time-series data corresponding to the time sub-interval according to a preset processing method to obtain the corresponding processing result, and merging the processing result with the currently stored processing result, the next time condition is determined as the current time condition, and the step of obtaining a batch of time-series data corresponding to the time sub-interval that meets the current time condition is returned, until the obtained time-series data is the last batch of time-series data; wherein, the preset processing method is a data calculation method determined according to the data query request, and the currently stored processing result is obtained by merging the processing results of each batch of processed time-series data;

[0011] The currently stored processing results are used as the query results.

[0012] Optionally, before the step of merging the processing result with the currently stored processing result, the method includes:

[0013] If the processing result is the processing result corresponding to the first batch of time series data, a result cache is created and the processing result is stored.

[0014] If the processing result is not the processing result corresponding to the first batch of time-series data, the step of merging the processing result with the currently stored processing result is performed.

[0015] Optionally, before the step of obtaining a batch of time-series data corresponding to the time sub-intervals that meet the current time conditions, the method includes:

[0016] The data calculation method is determined based on the data query request;

[0017] Register aggregation operators based on the data calculation method, wherein the aggregation operators include at least one of: downsampling calculation operator, aggregation calculation operator, and rate of change calculation operator;

[0018] The step of processing a batch of time-series data corresponding to the time sub-interval according to a preset processing method includes:

[0019] For a batch of time-series data corresponding to the time sub-intervals that meet the current time conditions, the data is processed according to the data calculation method corresponding to the registered aggregation operators.

[0020] Optionally, the aggregation operator includes multiple operators;

[0021] The step of registering aggregation operators based on the data calculation method includes:

[0022] The registration order of the various operators is determined according to the calculation order indicated by the data query request;

[0023] Register the aggregation operators according to the registration order described above;

[0024] The step of processing a batch of time-series data corresponding to time sub-intervals that meet the current time conditions according to the data calculation method corresponding to the registered aggregation operator includes:

[0025] For a batch of time-series data corresponding to the time sub-intervals that meet the current time conditions, the data is processed according to the data calculation method and the corresponding calculation order of the registered aggregation operators.

[0026] Optionally, the step of constructing multiple data query conditions based on the time interval indicated by the data query request includes:

[0027] Construct data query conditions based on the time interval indicated by the data query request;

[0028] The data query conditions are divided into multiple time conditions according to preset rules, wherein the preset rules include at least the division according to the time information corresponding to the time series data.

[0029] Optionally, the step of obtaining a batch of time-series data corresponding to a time sub-interval that meets the current time condition includes:

[0030] The first thread retrieves a batch of time-series data corresponding to the time sub-intervals that meet the current time conditions.

[0031] The step of processing a batch of time-series data corresponding to the time sub-interval according to a preset processing method includes:

[0032] The second thread processes a batch of time-series data corresponding to the time sub-interval according to a preset processing method.

[0033] Secondly, embodiments of the present invention provide a data query device applied to a time-series database server, the device comprising:

[0034] A construction module is used to obtain a data query request and construct multiple time conditions according to the time interval indicated by the data query request, wherein each time condition corresponds to a time sub-interval in the time interval;

[0035] The acquisition module is used to acquire a batch of time series data corresponding to the time sub-intervals that meet the current time conditions;

[0036] The processing module is used to process a batch of time-series data corresponding to the time sub-interval according to a preset processing method, obtain the corresponding processing result, and merge the processing result with the currently stored processing result;

[0037] The condition determination module is used to determine the next time condition as the current time condition during the process of processing a batch of time-series data corresponding to the time sub-interval according to a preset processing method, obtaining the corresponding processing result, and merging the processing result with the currently stored processing result, and triggering the acquisition module until the acquired time-series data is the last batch of time-series data; wherein, the preset processing method is a data calculation method determined according to the data query request, and the currently stored processing result is obtained by merging the processing results of each batch of processed time-series data;

[0038] The result determination module is used to determine the currently stored processing results as query results.

[0039] Optionally, the device further includes:

[0040] A creation module is used to create a result cache and store the processing result when the processing result is the processing result corresponding to the first batch of time series data;

[0041] The triggering module is used to trigger the processing module to merge the processing result with the currently stored processing result when the processing result is not the processing result corresponding to the first batch of time-series data.

[0042] Optionally, the device further includes:

[0043] The data determination module is used to determine the data calculation method based on the data query request;

[0044] The registration module is used to register aggregation operators based on the data calculation method, wherein the aggregation operators include at least one of: downsampling calculation operator, aggregation calculation operator, and rate of change calculation operator;

[0045] The processing module includes:

[0046] The data processing unit is used to process a batch of time-series data corresponding to the time sub-intervals that meet the current time conditions, according to the data calculation method corresponding to the registered aggregation operator.

[0047] Optionally, the registration module includes:

[0048] The registration order unit is used to determine the registration order of the various operators according to the calculation order indicated by the data query request;

[0049] A registration operator unit is used to register aggregation operators according to the registration order;

[0050] The data processing unit includes:

[0051] The data processing subunit is used to process a batch of time-series data corresponding to the time sub-intervals that meet the current time conditions, according to the data calculation methods and calculation order corresponding to the registered aggregation operators.

[0052] Optionally, the construction module includes:

[0053] The construction unit is used to construct data query conditions based on the time interval indicated by the data query request;

[0054] The splitting unit is used to split the data query conditions into multiple time conditions according to preset rules, wherein the preset rules include at least dividing according to the time information corresponding to the time series data.

[0055] Optionally, the acquisition module includes:

[0056] The first processing unit is used to obtain a batch of time series data corresponding to the time sub-interval that meets the current time conditions through the first thread;

[0057] The processing module includes:

[0058] The second processing unit is used to process a batch of time-series data corresponding to the time sub-interval according to a preset processing method through a second thread.

[0059] Thirdly, embodiments of the present invention provide a server, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0060] Memory, used to store computer programs;

[0061] When a processor executes a program stored in memory, it implements any of the steps described in the first aspect above.

[0062] Fourthly, embodiments of the present invention provide a storage medium storing a computer program, which, when executed by a processor, implements any of the steps described in the first aspect above.

[0063] In the technical solution provided by this invention, the server can obtain a data query request and construct multiple time conditions according to the time interval indicated by the data query request. Each time condition corresponds to a time sub-interval within the time interval. A batch of time-series data corresponding to the time sub-interval that meets the current time condition is obtained. The batch of time-series data corresponding to the time sub-interval is processed according to a preset processing method to obtain the corresponding processing result. The processing result is merged with the currently stored processing result. During the process of processing a batch of time-series data corresponding to the time sub-interval according to the preset processing method to obtain the corresponding processing result and merging the processing result with the currently stored processing result, the next time condition is determined as the current time condition, and the step of obtaining a batch of time-series data corresponding to the time sub-interval that meets the current time condition is returned. This process continues until the obtained data is the last batch of time-series data. The preset processing method is a data calculation method determined according to the data query request. The currently stored processing result is obtained by merging the processing results of each batch of processed time-series data. The currently stored processing result is determined as the query result. In this solution, processing of the time-series data corresponding to the current time condition begins immediately after acquisition, rather than loading all time-series data into memory before processing. This saves memory. Furthermore, while processing the batch of time-series data corresponding to the current time condition, the next batch of time-series data corresponding to the next time condition is fetched simultaneously, improving data query efficiency. Of course, implementing any product or method of this invention does not necessarily require achieving all of the advantages described above simultaneously. Attached Figure Description

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

[0065] Figure 1 A flowchart of a data query method provided in an embodiment of the present invention;

[0066] Figure 2 Based on Figure 1 A flowchart illustrating a registration method for aggregation operators in the illustrated embodiment;

[0067] Figure 3 Based on Figure 1 A flowchart illustrating a method for constructing time conditions in the illustrated embodiment;

[0068] Figure 4 Based on Figure 1Another flowchart of the data query method in the illustrated embodiment;

[0069] Figure 5 This is a schematic diagram of the structure of a data query device provided in an embodiment of the present invention;

[0070] Figure 6 Based on Figure 5 Another schematic diagram of the data query device of the illustrated embodiment;

[0071] Figure 7 This is a schematic diagram of the structure of a server provided in an embodiment of the present invention. Detailed Implementation

[0072] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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 based on the present invention are within the scope of protection of the present invention.

[0073] To reduce the memory usage and improve the efficiency of data querying, embodiments of the present invention provide a data querying method, apparatus, server, computer-readable storage medium, and computer program product. The following first describes a data querying method provided by an embodiment of the present invention.

[0074] The data query method provided in this embodiment of the invention can be applied to a time-series database server. For ease of understanding, the method of storing time-series data in a time-series database is first introduced. Time-series data in a time-series database is generally stored according to timelines. A timeline consists of metrics and tags, representing a time-dimensional model where a metric continuously generates data over time. These metrics are numerical indicators that are constantly updated over time; examples include CPU (Central Processing Unit) utilization, memory usage, and surveillance video. The tags are used to locate the metrics; examples include rack number, host name, process ID, application ID, and CPU number. A metric may be identified by multiple tags, and the combination of multiple tags will locate a unique metric.

[0075] For example, for time-series data generated between 2:00 and 3:00, with host name web001, app identifier Csdb, and CPU number i7-8705G, its storage method in the time-series database can be as shown in the table below:

[0076]

[0077] Based on the aforementioned time-series database, a data query method provided by an embodiment of the present invention will be introduced. For example... Figure 1 As shown, a data query method is applied to a time-series database server, the method comprising:

[0078] S101, Obtain a data query request, and construct multiple time conditions based on the time interval indicated by the data query request;

[0079] Each time condition corresponds to a time sub-interval within the time interval.

[0080] S102, Obtain a batch of time series data corresponding to the time sub-interval that meets the current time conditions;

[0081] S103, process a batch of time-series data corresponding to the time sub-interval according to a preset processing method to obtain the corresponding processing result, and merge the processing result with the currently stored processing result;

[0082] S104, In the process of processing a batch of time series data corresponding to the time sub-interval according to a preset processing method to obtain the corresponding processing result, and merging the processing result with the currently stored processing result, the next time condition is determined as the current time condition, and the process returns to step S102 until the data obtained is the last batch of time series data.

[0083] The preset processing method is a data calculation method determined according to the data query request, and the currently stored processing result is obtained by merging the processing results of each batch of time-series data that has been processed.

[0084] S105, determine the currently stored processing result as the query result.

[0085] As can be seen, in the technical solution provided by the embodiments of the present invention, the server can obtain a data query request and construct multiple time conditions according to the time interval indicated by the data query request. Each time condition corresponds to a time sub-interval in the time interval. A batch of time-series data corresponding to the time sub-interval that meets the current time condition is obtained. The batch of time-series data corresponding to the time sub-interval is processed according to a preset processing method to obtain the corresponding processing result. The processing result is merged with the currently stored processing result. During the process of processing a batch of time-series data corresponding to the time sub-interval according to the preset processing method to obtain the corresponding processing result and merging the processing result with the currently stored processing result, the next time condition is determined as the current time condition, and the step of obtaining a batch of time-series data corresponding to the time sub-interval that meets the current time condition is returned until the obtained data is the last batch of time-series data. The preset processing method is the data calculation method determined according to the data query request. The currently stored processing result is obtained by merging the processing results of each batch of processed time-series data. The currently stored processing result is determined as the query result. In this solution, processing of the batch of time series data corresponding to the current time condition begins immediately after acquisition, rather than loading all time series data into memory before processing. This saves memory. Furthermore, while processing the batch of time series data corresponding to the current time condition, the solution simultaneously retrieves the batch of time series data corresponding to the next time condition, meaning the two processes are performed concurrently, which also improves data query efficiency.

[0086] When a user wants to query data, they can issue a data query command. The server can then receive a data query request containing information related to the data the user wants to query. The data query request can include: the time information corresponding to the time series data that the user wants to query, the device name, the specific content of the query results, and other related information. The server can then construct multiple time conditions based on the time interval indicated by the data query request, i.e., the time interval indicated by the time information. Each time condition corresponds to a sub-interval of the time interval indicated by the time information.

[0087] For example, in the OpenTSDB time-series database based on HBase (Hadoop Database), after receiving a data query request, the server can construct multiple time conditions based on the time interval indicated by the query request. HBase is a distributed, column-oriented open-source database system. A time-series database is used to store time-series data. Time-series data is data that is continuously generated over time, typically numerical data generated periodically with a fixed frequency. It is very common in the Internet of Things (IoT) field and can include, for example, server monitoring information and device status information.

[0088] Time series data stored in time series databases are generally stored according to timelines. The timeline consists of metrics and tags. The metrics are numerical indicators that are constantly updated over time. The tags are used to locate the metrics. A metric may be identified by multiple tags, and the combination of multiple tags will locate a unique metric.

[0089] In one implementation, the data that satisfies the data query request is multiple time series data with the same timeline stored in the time series database. Then, the time sub-interval corresponding to each time condition can be the timeline, that is, each time condition corresponds to the time series data corresponding to a timeline in the time series database.

[0090] For example, the server receives a data query request that includes: Time information: 10:00-17:00; Host name: web001-web020; App identifier: Bsdb; CPU number: i7-8705G. The server can then construct 20 data query conditions including time parameters, such as: Time condition: 10:00-17:00; Host name: web001; App identifier: Bsdb; CPU number: i7-8705G; Time condition: 10:00-17:00; Host name: web002; App identifier: Bsdb; CPU number: i7-8705G… Time condition: 10:00-17:00; Host name: web020; App identifier: Bsdb; CPU number: i7-8705G. See Table 1 below for details.

[0091]

[0092]

[0093] In another implementation, the data that satisfies the data query request is the time series data of a timeline stored in the time series database. Then, the time sub-interval corresponding to each time condition can be a time period included in the timeline. That is, each time condition corresponds to the time series data within a time period in a timeline of the time series database.

[0094] For example, the server receives a data query request with the following information: Time: 10:00-17:00; Hostname: web001; App ID: Bsdb; CPU ID: i7-8705G. Based on this time information, the server can construct seven time-based data query conditions: Time condition: 10:00-11:00; Hostname: web001; App ID: Bsdb; CPU ID: i7-8705G; Time condition: 11:00-12:00; Hostname: web001; App ID: Bsdb; CPU ID: i7-8705G… Time condition: 16:00-17:00; Hostname: web001; App ID: Bsdb; CPU ID: i7-8705G. See Table 2 below for details.

[0095] Data query conditions Time conditions Host Name CPU number App ID 1 10:00-11:00 web001 i7-8705G Bsdb 2 11:00-12:00 web001 i7-8705G Bsdb … … … … … 7 16:00-17:00 web001 i7-8705G Bsdb

[0096] After constructing the above multiple data query conditions, although the time series data that meets each time condition is not actually retrieved, the time series data that meets each data query condition is different. Therefore, it is equivalent to dividing the time series data that meets the data query request and obtaining multiple batches of time series data.

[0097] For example, based on the multiple time conditions shown in Table 1 above, the time series data that meets the data query request is equivalent to being divided into multiple batches of time series data according to Table 3 below:

[0098]

[0099]

[0100] Based on the multiple time conditions shown in Table 2 above, the time-series data that meets the data query request is equivalent to being divided into multiple batches of time-series data according to Table 4 below:

[0101]

[0102]

[0103] Next, the server can execute step S102 above, that is, obtain a batch of time series data corresponding to the time sub-intervals that meet the current time conditions. When retrieving time series data for the first time, the current time condition is the first time condition.

[0104] In one implementation, the server can determine the time-series data that satisfies the current time condition based on the current time condition, and use this data as a batch of time-series data corresponding to the time-series interval of the current time condition. Then, this batch of time-series data is retrieved and stored in memory. Of course, each batch of time-series data, in addition to satisfying the corresponding time condition, must also satisfy other conditions indicated by the data query request.

[0105] For example, as shown in Table 1 above, if the current time condition is time condition 5 in Table 1, then the time series data with batch number 5 in Table 3 above corresponds to time condition 5.

[0106] After obtaining a batch of time series data corresponding to the current time condition, the server can execute the above step S103. That is, the server can process a batch of time series data corresponding to the time sub-interval of the current time condition according to a preset processing method, obtain the corresponding processing result, and merge the processing result with the currently stored processing result.

[0107] The server processes a batch of time-series data corresponding to the current time condition according to a preset processing method to obtain the corresponding processing result. The preset processing method can be a calculation method determined according to the data query request, such as downsampling calculation, aggregation calculation, rate of change calculation, etc.

[0108] At this point, the storage device stores the currently stored processing result obtained by merging the processing results of each batch of processed time-series data. The server can merge the processing result obtained in this processing with the currently stored processing result, and the merged result is used as the currently stored processing result.

[0109] During the process of processing a batch of time series data corresponding to the above time sub-intervals according to the preset processing method, obtaining the corresponding processing results, and merging the processing results with the currently stored processing results, the server can determine the next time condition as the current time condition and return to the above step S102, that is, repeat the above steps S102-S104 until the obtained time series data is the last batch of time series data.

[0110] As one implementation method, while the server is processing a batch of time-series data corresponding to the current time condition according to a preset processing method, it can determine the next time condition as the current time condition and return to the above step S102, so as to achieve the purpose of the server processing and retrieving time-series data simultaneously.

[0111] For example, after the server obtains the time-series data of batch 5 in Table 3 above, it can process the time-series data of batch 5 according to the preset processing method, and then obtain the processing result corresponding to the time-series data of batch 5. At this time, the storage device stores the processing results corresponding to the time-series data of batches 1-4 that have been merged, that is, the processing results of the first four batches. The server can then merge the processing result corresponding to the time-series data of batch 5 with the processing results of the first four batches to obtain the processing results of the first five batches. Assuming that the preset processing method is aggregation calculation, the processing results of the first five batches can be obtained as shown in Table 5 below:

[0112]

[0113] During the process of processing the time series data of batch 5 according to the preset processing method to obtain the processing result corresponding to the time series data of batch 5, and merging the processing result corresponding to the time series data of batch 5 with the processing results of the previous four batches, the server can determine the time condition 6 as the current time condition, and then return to execute the above step S102, that is, obtain a batch of time series data corresponding to the time sub-interval that meets the time condition 6.

[0114] If the batch of time-series data acquired this time is the last batch, the server processes the last batch of time-series data according to a preset processing method to obtain the corresponding processing result. This processing result is then merged with the currently stored processing results. The merged result is the processing result corresponding to all time-series data that satisfies the data query request. Since the time-series data acquired this time is the last batch, step S102 is not executed again. Instead, the merged result is determined as the final query result, completing the data query process.

[0115] For example, when time condition 20 in Table 1 above is the current time condition, the time series data of batch 20 in Table 3 above can be obtained. The server can process the time series data of batch 20 according to the preset processing method to obtain the corresponding processing result, and then merge the processing result with the merged processing results of the previous 19 batches stored in memory to obtain the final processing result. At this time, the final processing result can be determined as the query result corresponding to the data query request, as shown in Table 6 below:

[0116]

[0117] As one embodiment of the present invention, before the step of merging the processing result with the currently stored processing result, the method includes:

[0118] If the processing result corresponds to the processing result of the first batch of time series data, a result cache is created and the processing result is stored; if the processing result does not correspond to the processing result of the first batch of time series data, the step of merging the processing result with the currently stored processing result is executed.

[0119] After the server obtains a batch of time series data corresponding to the current time condition, it processes the data according to the preset processing method to obtain the corresponding processing result. If the processing result is the processing result corresponding to the first batch of time series data, a result cache can be created in memory and the processing result can be stored in the result cache.

[0120] For example, the server processes the time series data of batch 1 in Table 3 above according to the preset processing method and obtains the corresponding processing result. At this time, since the processing result is the processing result corresponding to the first batch of time series data, the merged result is not stored in memory. Therefore, a result cache can be created in memory and the processing result corresponding to the time series data of batch 1 can be stored in the result cache.

[0121] If the processing result is not the processing result corresponding to the first batch of time series data, it means that there is already a stored merged result. Therefore, the server can perform the above steps to merge the processing result with the currently stored processing result.

[0122] As can be seen, in this embodiment, when the processing result is the processing result corresponding to the first batch of time-series data, the server can create a result cache and store the processing result. When the processing result is not the processing result corresponding to the first batch of time-series data, the server can continue to execute the above steps of merging the processing result with the currently stored processing result. In this way, appropriate storage methods can be adopted for different batches of processing results to ensure the accuracy of the final query result.

[0123] As one embodiment of the present invention, before the step of obtaining a batch of time-series data corresponding to the time sub-interval that meets the current time condition, the method includes:

[0124] The data calculation method is determined based on the data query request; an aggregation operator is registered based on the data calculation method.

[0125] After receiving a data query request, the server determines the data calculation method based on the query request to decide how to process the acquired time-series data. This calculation method can include at least one of downsampling calculation, aggregation calculation, and rate of change calculation. For example, if the query result in the data query request is an average value, then the average value needs to be calculated, and the data calculation method can be determined to be average value calculation.

[0126] After determining the data calculation method, the server can register the aggregation operator corresponding to the data calculation method so that different batches of time series data can be processed according to the data calculation method corresponding to the registered aggregation operator. The aggregation operator can include at least one of the following: downsampling calculation operator, aggregation calculation operator, and rate of change calculation operator.

[0127] As one implementation method, the data query process can be performed in the iterator of the server. After determining the data calculation method, the aggregation operator corresponding to the data calculation method can be registered in the iterator.

[0128] Since the aforementioned time-series data is from a time-series database, aggregation operators can represent a method of performing certain calculations on time points of the same time across different timelines or on time-series data within a single timeline. Specifically, the downsampling operator represents sampling data corresponding to a fixed sampling time interval within a timeline. Further support can be provided for various calculation functions, such as averaging, summing, and finding maximum / minimum values.

[0129] Aggregation operators combine time-series data from different timelines at the same point in time, and may include averaging, summing, and finding maximum / minimum values. Rate of change operators calculate the rate of change between data points at different points in time-series data within a single timeline.

[0130] Accordingly, the steps described above for processing a batch of time-series data corresponding to the time sub-interval conditions according to a preset processing method may include:

[0131] For a batch of time series data corresponding to a time sub-interval that meets the current time conditions, process it according to the data calculation method corresponding to the registered aggregation operator.

[0132] After obtaining a batch of time-series data corresponding to the time sub-interval that meets the current time conditions, the server can process the batch of time-series data according to the data calculation method corresponding to the registered aggregation operator. For example, if the data calculation method corresponding to the currently registered aggregation operator is rate of change calculation, the server can perform rate of change calculation on the batch of time-series data corresponding to the time sub-interval of the current time conditions to obtain the corresponding processing result.

[0133] As can be seen, in this embodiment, before obtaining a batch of time series data corresponding to the time sub-interval that meets the current time condition, the server can determine the data calculation method based on the data query request, register an aggregation operator based on the data calculation method, and then, after obtaining a batch of time series data corresponding to the time sub-interval that meets the current time condition, the batch of time series data can be processed according to the data calculation method corresponding to the registered aggregation operator. In this way, the complex and rich data calculation methods can be abstracted into corresponding aggregation operators, which makes it easier for the server to process the time series data and further improves the data processing efficiency.

[0134] As one embodiment of the present invention, the above-mentioned aggregation operator may include a variety of operators. For example, it may include at least two of the following: downsampling calculation operator, aggregation calculation operator, and rate of change calculation operator.

[0135] Correspondingly, such as Figure 2 As shown, the steps for registering aggregation operators based on data calculation methods described above may include:

[0136] S201, determine the registration order of the various operators according to the calculation order indicated by the data query request;

[0137] After receiving a data query request, the server can determine the required data calculation method and corresponding calculation order for the time series data based on the specific content of the query results included in the data query request, and then determine the registration order of various aggregation operators.

[0138] For example, if the server determines that the calculation order of the data calculation method indicated by the data query request is to perform downsampling calculation first and then change rate calculation, then the registration order of various operators can be determined as: downsampling calculation operator - change rate calculation operator.

[0139] S202, Register the aggregation operator according to the registration order.

[0140] Once the registration order of various operators is determined, the server can register aggregation operators according to that order. For example, if the server determines the registration order of various operators to be: downsampling calculation operator - rate of change calculation operator, then the aggregation operators can be performed according to this registration order. That is, the calculation order identified by the registered aggregation operators is: downsampling calculation first, then rate of change calculation.

[0141] Accordingly, the steps described above for processing a batch of time-series data corresponding to time sub-intervals that meet the current time conditions according to the data calculation method corresponding to the registered aggregation operators may include:

[0142] For a batch of time-series data corresponding to the time sub-intervals that meet the current time conditions, the data is processed according to the data calculation method and the corresponding calculation order of the registered aggregation operators.

[0143] For example, if the registered aggregation operator is a downsampling calculation operator - a rate of change calculation operator, and its identified calculation order is to perform downsampling calculation first and then rate of change calculation, then the server can perform downsampling calculation first and then rate of change calculation on a batch of time series data corresponding to the time sub-interval that meets the current time condition, thereby obtaining the processing result corresponding to the batch of data.

[0144] As can be seen, in this embodiment, when the aggregation operator includes multiple operators, the server can determine the registration order of the multiple operators according to the calculation order indicated by the data query request, register the aggregation operator according to the registration order, and then process a batch of time series data corresponding to the time sub-interval that meets the current time condition according to the data calculation method corresponding to the registered aggregation operator. In this way, the time series data that the user wants to query can be processed in multiple ways according to the requirements of the data query request.

[0145] As one embodiment of the present invention, such as Figure 3 As shown, the steps described above for constructing multiple data query conditions based on the time interval indicated by the data query request may include:

[0146] S301, Construct data query conditions based on the time interval indicated by the data query request;

[0147] After receiving a data query request, the server can construct data query conditions based on the time range indicated by the data query request. For example, if the time information in the data query request is 10:00-17:00, then this time range can be used as the condition to construct HBase data query conditions.

[0148] S302, the data query conditions are split into multiple time conditions according to preset rules.

[0149] After constructing the data query conditions, these conditions can be broken down into multiple time conditions. Since obtaining time-series data for each time condition can achieve the effect of batching the time-series data in the storage device, it is equivalent to one time condition corresponding to one batch of time-series data after splitting. Depending on the splitting method, different batch division methods can be obtained.

[0150] For the data query conditions of the aforementioned time-series database, the preset rules can at least include categorizing the data according to its corresponding time information. Specifically, the preset rules can be at least one of the following:

[0151] The first type of data query request includes: Time information: 10:00-17:00; Host name: web001-web0020; App identifier: Asbd-Zsdb; CPU number: i7-8705K, i7-8705G, and i7-8705U. The server can then construct seven data query conditions, each divided by hourly time intervals, corresponding to a sub-interval per hour. These conditions are: Time condition: +1h; All host names; All App identifiers; All CPU numbers; Time condition: +2h; All host names; All App identifiers; All CPU numbers… Time condition: +7h; All host names; All App identifiers; All CPU numbers. See Table 7 below for details.

[0152]

[0153] The second type: The data query request includes: Time information: 10:00-17:00; Host name: web001; App identifier: Asbd-Zsdb; CPU number: i7-8705G; Then, the server can construct 24 data query conditions including time conditions, namely: Time condition: 10:00-17:00; Host name: web001; App identifier: Asdb; CPU number: i7-8705G. Time condition: 10:00-17:00; Host name: web001; App identifier: Bsdb; CPU number: i7-8705G… Time condition: 10:00-17:00; Host name: web001; App identifier: Zsdb; CPU number: i7-8705G. See Table 8 below for details:

[0154]

[0155] Among them, Asdb, Bsdb...Zsdb are just for identifying different apps, and their actual names are determined by the actual situation.

[0156] The third type: The data query request includes: Time information: 10:00-17:00; Host name: web001; App identifier: Asbd; CPU number: i7-8705K, i7-8705G, and i7-8705U. Therefore, the server can construct three data query conditions including time conditions: Time condition: 10:00-17:00; Host name: web001; App identifier: Asdb; CPU number: i7-8705K; Time condition: 10:00-17:00; Host name: web001; App identifier: Asdb; CPU number: i7-8705G; Time condition: 10:00-17:00; Host name: web001; App identifier: Asdb; CPU number: i7-8705U. See Table 9 below for details.

[0157]

[0158] As can be seen, in this embodiment, the server can construct data query conditions based on the time interval indicated by the data query request, and split the data query conditions into multiple time conditions according to preset rules. In this way, the data query conditions constructed based on the data query request can be split into multiple time conditions, and multiple time conditions correspond to multiple batches of data. This can achieve the purpose of processing the time series data corresponding to the time sub-interval of the current time condition while fetching a batch of time series data corresponding to the next time condition, thereby achieving the effect of saving memory and improving data query efficiency.

[0159] As one embodiment of the present invention, the step of obtaining a batch of time series data corresponding to a time sub-interval that meets the current time conditions may include: obtaining a batch of time series data corresponding to a time sub-interval that meets the current time conditions through a first thread.

[0160] Accordingly, the steps of processing a batch of time-series data corresponding to the time sub-interval according to a preset processing method may include: processing a batch of time-series data corresponding to the time sub-interval according to a preset processing method through a second thread.

[0161] In one implementation, after constructing multiple times, the server can obtain a batch of time-series data corresponding to the time sub-interval that meets the current time conditions through a first thread. Then, the second thread processes the batch of time-series data corresponding to the time sub-interval according to a preset processing method. While the second thread is processing the batch of time-series data corresponding to the time sub-interval according to the preset processing method, the first thread obtains the next batch of time-series data.

[0162] For example, the first thread obtains the time series data corresponding to time condition 6 in Table 1 above, and then the second thread processes it according to the preset processing method to obtain the corresponding processing result. During the process of obtaining the corresponding processing result by the second thread according to the preset processing method, the first thread obtains the data corresponding to time condition 7 in Table 1 above.

[0163] As can be seen, in this embodiment, the server can obtain a batch of time-series data corresponding to the time sub-interval that meets the current time conditions through the first thread, and process the batch of time-series data corresponding to the time sub-interval according to the preset processing method through the second thread. In this way, the process of the server pulling time-series data and the process of the server processing time-series data can be carried out through different threads, and the process of the server pulling time-series data and the process of the server processing time-series data can be carried out simultaneously, thereby achieving the purpose of saving memory and improving query efficiency.

[0164] The following is combined Figure 4 The data query method provided in the embodiments of the present invention will be described by way of example. The data query method provided in the embodiments of the present invention may include the following steps:

[0165] S401, Get data query request;

[0166] S402, Determine the data calculation method based on the data query request;

[0167] S403, Registering aggregation operators based on data calculation methods;

[0168] S404, construct multiple time conditions based on the time interval indicated by the data query request;

[0169] S405, Obtain a batch of time series data corresponding to the time sub-interval that meets the current time conditions;

[0170] S406, Process the batch of time series data corresponding to the time sub-interval according to the preset processing method to obtain the corresponding processing result, and determine whether it is the first batch of time series data and whether it is the last batch of time series data; if it is the first batch of time series data, execute step S407; if it is neither the first batch of time series data nor the last batch of time series data, execute step S408; if it is the last batch of time series data, execute step S409.

[0171] S407, determine the next time condition as the current time condition, return to step S405, and create a result cache and store the processing result;

[0172] S408, determine the next time condition as the current time condition, return to step S405, and merge the processing result with the currently stored processing result;

[0173] S409: Merge the processing result with the currently stored processing result, and determine the currently stored processing result as the query result.

[0174] As can be seen, the data query method of this invention can start processing a batch of time-series data corresponding to the time sub-interval that meets the current time condition after obtaining the data, instead of loading all the time-series data into memory before processing. This saves memory. Furthermore, while processing the batch of time-series data corresponding to the current time sub-interval according to a preset processing method and obtaining the corresponding processing result, the process of merging the processing result with the currently stored processing result is carried out simultaneously, and a batch of time-series data corresponding to the next time condition is retrieved. This also improves the efficiency of data query.

[0175] Corresponding to the above-described data query method, this embodiment of the invention also provides a data query device, which will be described below.

[0176] like Figure 5 As shown, a data query device is applied to a time-series database server, the device comprising:

[0177] The construction module 510 is used to obtain a data query request and construct multiple time conditions according to the time interval indicated by the data query request.

[0178] Each time condition corresponds to a time sub-interval within the time interval.

[0179] The acquisition module 520 is used to acquire a batch of time series data corresponding to the time sub-intervals that meet the current time conditions;

[0180] The processing module 530 is used to process a batch of time series data corresponding to the time sub-interval according to a preset processing method to obtain the corresponding processing result, and merge the processing result with the currently stored processing result;

[0181] The condition determination module 540 is used to determine the next time condition as the current time condition and trigger the acquisition module 520 during the process of processing a batch of time series data corresponding to the time sub-interval according to a preset processing method, obtaining the corresponding processing result, and merging the processing result with the currently stored processing result, until the acquired time series data is the last batch of time series data.

[0182] The preset processing method is a data calculation method determined according to the data query request, and the currently stored processing result is obtained by merging the processing results of each batch of time-series data that has been processed.

[0183] The result determination module 550 is used to determine the currently stored processing result as the query result.

[0184] As can be seen, in the technical solution provided by the embodiments of the present invention, the server can obtain a data query request and construct multiple time conditions according to the time interval indicated by the data query request. Each time condition corresponds to a time sub-interval in the time interval. A batch of time-series data corresponding to the time sub-interval that meets the current time condition is obtained. The batch of time-series data corresponding to the time sub-interval is processed according to a preset processing method to obtain the corresponding processing result. The processing result is merged with the currently stored processing result. During the process of processing a batch of time-series data corresponding to the time sub-interval according to the preset processing method to obtain the corresponding processing result and merging the processing result with the currently stored processing result, the next time condition is determined as the current time condition, and the step of obtaining a batch of time-series data corresponding to the time sub-interval that meets the current time condition is returned until the obtained time-series data is the last batch of time-series data. The preset processing method is a data calculation method determined according to the data query request. The currently stored processing result is obtained by merging the processing results of each batch of processed time-series data. The currently stored processing result is determined as the query result. In this solution, processing of the batch of time series data corresponding to the current time condition begins immediately after acquisition, rather than loading all time series data into memory before processing. This saves memory. Furthermore, while processing the batch of time series data corresponding to the current time condition, the solution simultaneously retrieves the batch of time series data corresponding to the next time condition, meaning the two processes are performed concurrently, which also improves data query efficiency.

[0185] As one embodiment of the present invention, such as Figure 6 As shown, the above-mentioned data query device also includes:

[0186] A creation module 560 is used to create a result cache and store the processing result when the processing result is the processing result corresponding to the first batch of time series data;

[0187] The triggering module is used to trigger the processing module 530 to merge the processing result with the currently stored processing result when the processing result is not the processing result corresponding to the first batch of time-series data.

[0188] As one embodiment of the present invention, such as Figure 6 As shown, the above-mentioned data query device also includes:

[0189] Data determination module 570 is used to determine the data calculation method based on the data query request;

[0190] The registration module 580 is used to register an aggregation operator based on the data calculation method, wherein the aggregation operator includes at least one of a downsampling calculation operator, an aggregation calculation operator, and a rate of change calculation operator;

[0191] The aforementioned processing module 530 may include:

[0192] The data processing unit is used to process a batch of time-series data corresponding to the time sub-intervals that meet the current time conditions, according to the data calculation method corresponding to the registered aggregation operator.

[0193] As one embodiment of the present invention, the registration module 580 may include:

[0194] The registration order unit is used to determine the registration order of the various operators according to the calculation order indicated by the data query request;

[0195] A registration operator unit is used to register aggregation operators according to the registration order;

[0196] The aforementioned data processing unit includes:

[0197] The data processing subunit is used to process a batch of time-series data corresponding to the time sub-intervals that meet the current time conditions, according to the data calculation methods and calculation order corresponding to the registered aggregation operators.

[0198] As one embodiment of the present invention, the above-mentioned construction module 510 may include:

[0199] The construction unit is used to construct data query conditions based on the time interval indicated by the data query request;

[0200] The splitting unit is used to split the data query conditions into multiple time conditions according to preset rules, wherein the preset rules include at least dividing according to the time information corresponding to the time series data.

[0201] As one embodiment of the present invention, the acquisition module 520 may include:

[0202] The first processing unit is used to obtain a batch of time series data corresponding to the time sub-interval that meets the current time conditions through the first thread;

[0203] The processing module includes:

[0204] The second processing unit is used to process a batch of time-series data corresponding to the time sub-interval conditions according to a preset processing method through a second thread.

[0205] This invention also provides a server, such as... Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703, and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.

[0206] Memory 703 is used to store computer programs;

[0207] When the processor 701 executes the program stored in the memory 703, it implements a data query method as described in any of the above embodiments.

[0208] As can be seen, in the technical solution provided by the embodiments of the present invention, the server can obtain a data query request and construct the indicated time interval and multiple time conditions according to the data query request. Each time condition corresponds to a time sub-interval in the time interval. A batch of time-series data corresponding to the time sub-interval that meets the current time condition is obtained. The batch of time-series data corresponding to the time sub-interval is processed according to a preset processing method to obtain the corresponding processing result. The processing result is merged with the currently stored processing result. In the process of processing a batch of time-series data corresponding to the time sub-interval according to the preset processing method to obtain the corresponding processing result and merging the processing result with the currently stored processing result, the next time condition is determined as the current time condition, and the step of obtaining a batch of time-series data corresponding to the time sub-interval that meets the current time condition is returned until the obtained time-series data is the last batch of time-series data. The preset processing method is the data calculation method determined according to the data query request. The currently stored processing result is obtained by merging the processing results of each batch of processed time-series data. The currently stored processing result is determined as the query result. In this solution, processing of the batch of time series data corresponding to the current time condition begins immediately after acquisition, rather than loading all time series data into memory before processing. This saves memory. Furthermore, while processing the batch of time series data corresponding to the current time condition, the solution simultaneously retrieves the batch of time series data corresponding to the next time condition, meaning the two processes are performed concurrently, which also improves data query efficiency.

[0209] The communication bus mentioned in the above server can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0210] The communication interface is used for communication between the aforementioned server and other devices.

[0211] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

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

[0213] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described data query methods.

[0214] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the data query methods described in the above embodiments.

[0215] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0216] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0217] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the descriptions of methods, apparatuses, servers, computer-readable storage media, and computer program products are relatively simple because they are fundamentally similar to the method embodiments; relevant parts can be referred to the descriptions of the method embodiments.

[0218] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.

Claims

1. A data query method, characterized in that, The method, applied to a time-series database server, includes: Obtain a data query request, and construct multiple time conditions based on the time interval indicated by the data query request, wherein each time condition corresponds to a time sub-interval in the time interval; Retrieve a batch of time series data corresponding to the time sub-intervals that meet the current time conditions; A batch of time-series data corresponding to the time sub-interval is processed according to a preset processing method to obtain the corresponding processing result, and the processing result is merged with the currently stored processing result; In the process of processing a batch of time-series data corresponding to the time sub-interval according to a preset processing method to obtain the corresponding processing result, and merging the processing result with the currently stored processing result, the next time condition is determined as the current time condition, and the step of obtaining a batch of time-series data corresponding to the time sub-interval that meets the current time condition is returned, until the obtained time-series data is the last batch of time-series data; wherein, the preset processing method is a data calculation method determined according to the data query request, and the currently stored processing result is obtained by merging the processing results of each batch of processed time-series data; The currently stored processing results are used as the query results.

2. The method according to claim 1, characterized in that, Before the step of merging the processing result with the currently stored processing result, the method includes: If the processing result is the processing result corresponding to the first batch of time series data, a result cache is created and the processing result is stored. If the processing result is not the processing result corresponding to the first batch of time-series data, the step of merging the processing result with the currently stored processing result is performed.

3. The method according to claim 1, characterized in that, Before the step of obtaining a batch of time-series data corresponding to the time sub-interval that meets the current time condition, the method includes: The data calculation method is determined based on the data query request; Register aggregation operators based on the data calculation method, wherein the aggregation operators include at least one of: downsampling calculation operator, aggregation calculation operator, and rate of change calculation operator; The step of processing a batch of time-series data corresponding to the time sub-interval according to a preset processing method includes: For a batch of time-series data corresponding to the time sub-intervals that meet the current time conditions, the data is processed according to the data calculation method corresponding to the registered aggregation operators.

4. The method according to claim 3, characterized in that, The aggregation operator includes a variety of operators; The step of registering aggregation operators based on the data calculation method includes: The registration order of the various operators is determined according to the calculation order indicated by the data query request; Register the aggregation operators according to the registration order described above; The step of processing a batch of time-series data corresponding to time sub-intervals that meet the current time conditions according to the data calculation method corresponding to the registered aggregation operator includes: For a batch of time-series data corresponding to the time sub-intervals that meet the current time conditions, the data is processed according to the data calculation method and the corresponding calculation order of the registered aggregation operators.

5. The method according to claim 1, characterized in that, The step of constructing multiple data query conditions based on the time interval indicated by the data query request includes: Construct data query conditions based on the time interval indicated by the data query request; The data query conditions are divided into multiple time conditions according to preset rules, wherein the preset rules include at least the division according to the time information corresponding to the time series data.

6. The method according to any one of claims 1-5, characterized in that, The step of obtaining a batch of time-series data corresponding to the time sub-interval that meets the current time conditions includes: The first thread retrieves a batch of time-series data corresponding to the time sub-intervals that meet the current time conditions. The step of processing a batch of time-series data corresponding to the time sub-interval according to a preset processing method includes: The second thread processes a batch of time-series data corresponding to the time sub-interval according to a preset processing method.

7. A data query device, characterized in that, A server for a time-series database, the device comprising: A construction module is used to obtain a data query request and construct multiple time conditions according to the time interval indicated by the data query request, wherein each time condition corresponds to a time sub-interval in the time interval; The acquisition module is used to acquire a batch of time series data corresponding to the time sub-intervals that meet the current time conditions; The processing module is used to process a batch of time-series data corresponding to the time sub-interval according to a preset processing method, obtain the corresponding processing result, and merge the processing result with the currently stored processing result; The condition determination module is used to determine the next time condition as the current time condition during the process of processing a batch of time-series data corresponding to the time sub-interval according to a preset processing method, obtaining the corresponding processing result, and merging the processing result with the currently stored processing result, and triggering the acquisition module until the acquired time-series data is the last batch of time-series data; wherein, the preset processing method is a data calculation method determined according to the data query request, and the currently stored processing result is obtained by merging the processing results of each batch of processed time-series data; The result determination module is used to determine the currently stored processing results as query results.

8. The apparatus according to claim 7, characterized in that, The device further includes: A creation module is used to create a result cache and store the processing result when the processing result is the processing result corresponding to the first batch of time series data; The triggering module is used to trigger the processing module to merge the processing result with the currently stored processing result when the processing result is not the processing result corresponding to the first batch of time-series data.

9. The apparatus according to claim 7, characterized in that, The device further includes: The data determination module is used to determine the data calculation method based on the data query request; The registration module is used to register aggregation operators based on the data calculation method, wherein the aggregation operators include at least one of: downsampling calculation operator, aggregation calculation operator, and rate of change calculation operator; The processing module includes: The data processing unit is used to process a batch of time-series data corresponding to the time sub-intervals that meet the current time conditions, according to the data calculation method corresponding to the registered aggregation operators.

10. The apparatus according to claim 9, characterized in that, The aggregation operator includes multiple operators; the registration module includes: The registration order unit is used to determine the registration order of the various operators according to the calculation order indicated by the data query request; A registration operator unit is used to register aggregation operators according to the registration order; The data processing unit includes: The data processing subunit is used to process a batch of time-series data corresponding to the time sub-intervals that meet the current time conditions, according to the data calculation methods and calculation order corresponding to the registered aggregation operators.

11. The apparatus according to claim 7, characterized in that, The construction module includes: The construction unit is used to construct data query conditions based on the time interval indicated by the data query request; The splitting unit is used to split the data query conditions into multiple time conditions according to preset rules, wherein the preset rules include at least dividing according to the time information corresponding to the time series data.

12. The apparatus according to any one of claims 7-11, characterized in that, The acquisition module includes: The first processing unit is used to obtain a batch of time series data corresponding to the time sub-interval that meets the current time conditions through the first thread; The processing module includes: The second processing unit is used to process a batch of time-series data corresponding to the time sub-interval according to a preset processing method through a second thread.

13. A server, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-6.

14. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the method described in any one of claims 1-6.

Citation Information

Patent Citations

  • Data application method and platform taking time sequence dynamic graph as core

    CN111523003A

  • Method for realizing data splicing and system for realizing data splicing

    CN112632053A