CN113032461A - Time series data processing method, time series data processing device and storage medium - Google Patents

Time series data processing method, time series data processing device and storage medium Download PDF

Info

Publication number
CN113032461A
CN113032461A CN202110322088.9A CN202110322088A CN113032461A CN 113032461 A CN113032461 A CN 113032461A CN 202110322088 A CN202110322088 A CN 202110322088A CN 113032461 A CN113032461 A CN 113032461A
Authority
CN
China
Prior art keywords
data
time sequence
sampling
time
sequence data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110322088.9A
Other languages
Chinese (zh)
Inventor
陈键冬
李旦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Huya Technology Co Ltd
Original Assignee
Guangzhou Huya Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Huya Technology Co Ltd filed Critical Guangzhou Huya Technology Co Ltd
Priority to CN202110322088.9A priority Critical patent/CN113032461A/en
Publication of CN113032461A publication Critical patent/CN113032461A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2474Sequence data queries, e.g. querying versioned data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2465Query processing support for facilitating data mining operations in structured databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2216/00Indexing scheme relating to additional aspects of information retrieval not explicitly covered by G06F16/00 and subgroups
    • G06F2216/03Data mining

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Fuzzy Systems (AREA)
  • Software Systems (AREA)
  • Probability & Statistics with Applications (AREA)
  • Mathematical Physics (AREA)
  • Image Generation (AREA)

Abstract

The application discloses a time sequence data processing method, a time sequence data processing device and a computer readable storage medium. The processing method of the time series data comprises the following steps: and acquiring the number of data points of the first time sequence data to be rendered within the set duration. And in response to the maximum rendering data number of which the data point number is greater than the set duration, performing down-sampling on the first time sequence data by adopting a down-sampling method matched with the data point number to obtain second time sequence data after down-sampling. And drawing a timing chart for the second timing data. When the number of data points of the first time sequence data to be drawn is excessive, the first time sequence data are subjected to down-sampling, and a time sequence diagram is drawn for the second time sequence data subjected to down-sampling processing.

Description

Time series data processing method, time series data processing device and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method for processing time series data, a time series data processing apparatus, and a computer readable storage medium.
Background
With the rapid development of computer technology, data mining technology is becoming more and more important. The time sequence is an important high-dimensional data type, is a sequence formed by arranging sampling values of certain physical quantity of an objective object at different time points according to time sequence, and has wide application in the fields of economic management and engineering. By utilizing time series data mining, useful information related to time contained in the data can be obtained, and the extraction of knowledge is realized.
In the current scheme of time-series downsampling drawing, all known time-series databases only provide Min/Max/Avg/Sum downsampling, and this general downsampling can meet the drawing requirement in most scenes, but a large amount of data details are lost when a large amount of data is encountered, because after a plurality of data points are aggregated and calculated into one, some original detail features are erased.
Disclosure of Invention
The technical problem mainly solved by the application is a time sequence data processing method, a time sequence data processing device and a computer readable storage medium, which can improve the data drawing efficiency.
The technical scheme adopted by the application is to provide a time sequence data processing method, and the time sequence data processing method comprises the following steps: and acquiring the number of data points of the first time sequence data to be rendered within the set duration. And in response to the maximum rendering data number of which the data point number is greater than the set duration, performing down-sampling on the first time sequence data by adopting a down-sampling method matched with the data point number to obtain second time sequence data after down-sampling. And drawing a timing chart for the second timing data.
Further, in response to the maximum number of the rendering data with the number of the data points being greater than the set duration, the step of down-sampling the first time series data by adopting a down-sampling method matched with the number of the data points to obtain the down-sampled second time series data includes: and in response to the maximum rendering data number of the data points larger than the set duration, performing down-sampling on the first time sequence data by adopting an LTTB down-sampling algorithm to obtain second time sequence data.
Further, in response to the maximum number of the rendering data of which the number of the data points is greater than the set duration, the step of performing down-sampling on the first time sequence data by using an LTTB down-sampling algorithm to obtain second time sequence data includes: and in response to the data point number being larger than the maximum rendering data number of the set duration and the data point number being smaller than the set multiple number of the maximum rendering data number, directly performing down-sampling on the first time sequence data by adopting an LTTB down-sampling algorithm to obtain second time sequence data. And in response to the number of the data points not less than the number of the set multiple of the maximum rendering data number, performing down-sampling on the first time sequence data by adopting a mean value down-sampling method. And performing down-sampling on the first time sequence data after the mean value down-sampling by adopting an LTTB down-sampling algorithm to obtain second time sequence data. Wherein the set multiple is greater than 1.
Further, the number of data points is the quotient of the set duration and the reporting frequency. The step of down-sampling the first time sequence data by adopting a mean value down-sampling method comprises the following steps: and determining the down-sampling proportion according to the reporting frequency. And performing mean value down-sampling on the first time sequence data according to the down-sampling proportion.
Further, determining the down-sampling ratio according to the reporting frequency includes: and taking the reporting frequency or the set multiple of the reporting frequency as a down-sampling proportion, so that the number of data points of the first time sequence data after mean down-sampling is smaller than the number of the set multiple of the maximum rendering data number.
Further, the step of down-sampling the first time series data by using an LTTB down-sampling algorithm to obtain second time series data includes: and dividing the first time sequence data into N first sub-time sequence data according to a preset down-sampling proportion. And traversing all the first sub-time sequence data, respectively determining a data point from each first sub-time sequence data, and forming second time sequence data by N data points according to time sequence. The area of a triangle formed by the data point of the kth first sub-time-series data, the last data point of the kth first sub-time-series data and the first data point of the (K + 1) th first sub-time-series data is the largest, and K is 2, … …, N-1.
Further, still include: and in response to the data point number of the first time sequence data being smaller than the maximum rendering data number, directly drawing a time sequence diagram for the first time sequence data.
In order to solve the above technical problem, another technical solution adopted by the present application is: provided is a time-series data processing apparatus including: the acquisition module is used for acquiring the number of data points of the first time sequence data to be rendered within the set duration. And the down-sampling module is used for responding to the maximum rendering data number of which the data point number is greater than the set duration, and down-sampling the first time sequence data by adopting a down-sampling method matched with the data point number to obtain the down-sampled second time sequence data. And the drawing module is used for drawing a time sequence diagram for the second time sequence data.
In order to solve the above technical problem, another technical solution adopted by the present application is: provided is a time-series data processing apparatus including: the processor is used for executing the sequence data to realize the processing method of the sequence data.
In order to solve the above technical problem, another technical solution adopted by the present application is: there is provided a computer-readable storage medium in which program data is stored, the program data being for implementing the above-described method of processing time series data when executed by a processor.
The beneficial effect of this application is: different from the prior art, the method for processing the time series data provided by the application comprises the following steps: and acquiring the number of data points of the first time sequence data to be rendered within the set duration. And in response to the maximum rendering data number of which the data point number is greater than the set duration, performing down-sampling on the first time sequence data by adopting a down-sampling method matched with the data point number to obtain second time sequence data after down-sampling. And drawing a timing chart for the second timing data. When the number of data points of the first time sequence data to be drawn is excessive, the first time sequence data are subjected to down-sampling, and a time sequence diagram is drawn for the second time sequence data subjected to down-sampling processing.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts. Wherein:
fig. 1 is a schematic flow chart of a first embodiment of a method for processing time series data provided in the present application;
FIG. 2 is a schematic flow chart illustrating an embodiment of step S20 in FIG. 1;
FIG. 3 is a schematic flow chart illustrating another embodiment of step S20 in FIG. 1;
FIG. 4 is a schematic flow chart illustrating one embodiment of step S23 in FIG. 3;
FIG. 5(a) is a timing diagram plotted after a mean downsampling algorithm is used to downsample memory data for a service for a recent day;
fig. 5(b) is a timing chart drawn after the memory data of the latest day of a service is processed by using the timing data processing method provided by the present application;
FIG. 6 is a schematic structural diagram of an embodiment of a sequential data processing apparatus provided in the present application;
FIG. 7 is a schematic structural diagram of another embodiment of a time-series data processing apparatus provided in the present application;
FIG. 8 is a schematic structural diagram of a sequential data processing apparatus according to another embodiment of the present application;
FIG. 9 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The inventor of the application finds that an optimal downsampling drawing scheme capable of supporting mass data is absent at present, the bottleneck is large when a graph is rendered at the front end of a browser, the browser is easy to jam or even stop working due to the data quantity of more than ten thousand levels, and the Time sequence Database is often unstable due to the fact that mass data are read and retrieved from the Time Sequence Database (TSDB), and the performance of the Time sequence Database is affected.
For example, if data is reported at a frequency of 5 seconds, the data volume of a day is 86400, and the data volume of a week is 604800, when a change trend of the index of the week is desired to be seen, if a down-sampling algorithm is not adopted, the front end of the data volume cannot be rendered and operated at all, and the data reading mode has a great influence on the performance of the time-series database. With the common down-sampling algorithm (Min/Max/Avg/Sum), the details of the peaks and the troughs are probably lost, i.e. a local optimal solution is pursued. LTTB (target Triangle Three buckets) is a down-sampling algorithm based on triangular area calculation, is a relatively small down-sampling drawing scheme, and is characterized in that feature details of peaks and troughs in time sequence data drawing can be retained, and the trend of a graph line can be better maintained in a scene of drawing a large amount of data.
Based on this, the scheme of the application provides a processing method of time series data, when the number of data points of the time series data to be drawn is too large, the number of the data points to be drawn is reduced in a down-sampling mode, and therefore drawing efficiency is improved.
In this embodiment, after the time sequence diagram is drawn, a user can visually see the development trend or rule of the time sequence data through the time sequence data diagram. The embodiment may implement rendering of the time sequence data in multiple ways, and render the time sequence data by using various drawing software or by using a front end of a browser, which is not specifically limited herein.
Referring to fig. 1, fig. 1 is a schematic flow chart of a first embodiment of a method for processing time series data provided by the present application, as shown in fig. 1, the method for processing time series data provided by the present application includes the following steps:
s10: and acquiring the number of data points of the first time sequence data to be rendered within the set duration.
The time series data is a data format recorded according to index time sequence, and is used in a large scale in a monitoring scene of internet service application. In this embodiment, the first time series data may be, but is not limited to, acquired from a time series database, for example, acquired by a manual input manner of a user. The Time Series Database (TSDB) is a Database for storing Time Series data, and various open source and commercial services have been implemented in the industry.
Optionally, the number of data points is a quotient of the set duration and the reporting frequency. For example, when rendering is performed on monitoring time series data acquired by a monitoring device in one day, if the reporting frequency is 5 seconds, the set time length is 24 × 60, and the number of the acquired first time series data is 24 × 60 × 12.
S20: and in response to the maximum rendering data number of which the data point number is greater than the set duration, performing down-sampling on the first time sequence data by adopting a down-sampling method matched with the data point number to obtain second time sequence data after down-sampling.
The maximum number of rendering data can be a parameter for reflecting the rendering performance and the display requirement of a drawing time sequence chart of various drawing software or an online drawing tool, and can also be a drawing parameter artificially set according to the performance of a browser. The maximum number of rendering data represents the number of data points that the timing chart of the final drawing can maximally include. And if the number of the data points needing to be rendered is larger than the maximum number of the rendered data, the front end cannot execute the rendering work. The problem to be solved by the sample application is abstracted to be that the trend of the index with the reporting frequency S in the T time period is drawn as truly as possible under the condition that the number of data needing to be rendered does not exceed the maximum number of rendered data.
In this embodiment, in order to enable a drawing tool such as a front end of a browser to draw a timing chart of time-series data without pause, the maximum number of rendering data is used as a parameter, and downsampling processing is performed on first time-series data larger than the maximum number of rendering data, so that the number of finally obtained second time-series data is not larger than the maximum number of rendering data.
It will be appreciated that the timing graph is drawn directly for the first time series data in response to the number of data points for the first time series data being less than the maximum number of rendering data points. That is to say, when the number of data points of the first time sequence data is smaller than the maximum number of rendering data, in order to ensure the authenticity of the drawn time sequence diagram, the time sequence diagram is drawn directly for the first time sequence data without performing down-sampling processing on the first time sequence data.
Optionally, in this embodiment, in response to the maximum number of rendering data of which the number of data points is greater than the set duration, the LTTB downsampling algorithm is used to downsample the first time series data to obtain the second time series data.
In this embodiment, if the number of data points of the first time sequence data is greater than the maximum number of rendering data, the down-sampling algorithm is used to down-sample the first time sequence data, so as to reduce the number of data points to be rendered by a drawing tool, such as a front end of a browser, to be not greater than the maximum number of rendering data.
In a specific application scene, in response to the maximum rendering data number of which the data point number is greater than the set duration and the data point number is less than the set multiple number of the maximum rendering data number, the first time sequence data is directly subjected to down-sampling by adopting an LTTB down-sampling algorithm to obtain second time sequence data. Wherein the set multiple is greater than 1.
Alternatively, the multiple is set to be the down-sampling ratio of the LTTB down-sampling algorithm, for example, if the down-sampling value is 1 point from 10 time series data points, the multiple is set to be 10. In this way, the number of data of the second time-series data after the first time-series data is down-sampled by the LTTB down-sampling algorithm is necessarily smaller than the maximum number of rendering data.
Referring to fig. 2, fig. 2 is a flowchart illustrating an implementation manner of step S20 in fig. 1, and as shown in fig. 2, in this embodiment, the down-sampling the first time sequence data by using the LTTB down-sampling algorithm specifically includes the following sub-steps:
s21: dividing the first time series data into N first sub time series data according to a preset down-sampling proportion, wherein the first sub time series data arranged from small to large according to time sequence only comprises one data point, namely the first data point arranged from small to large according to time sequence in the first time series data is the data point included in the first sub time series data, and the last first sub time series data also only comprises one data point, namely the last data point arranged from small to large according to time sequence in the first time series data is the data point included in the last first sub time series data.
Optionally, the number of data points included in the middle N-2 first sub-time-series data is equal, and if the down-sampling ratio is set to be α, the number of data points included in each first sub-time-series data is (N-2)/α.
S22: and traversing all the first sub-time sequence data, and respectively determining a data point from each first sub-time sequence data, so that the N data points form second time sequence data according to time sequence.
N is a positive integer greater than or equal to 3, an area of a triangle formed by the data point of the kth first sub-time-series data, the last data point of the kth first sub-time-series data, and the first data point of the K +1 th first sub-time-series data is the largest, and K is 2, … …, N-1.
Specifically, the first sub-time series data and the last first sub-time series data in time series include only one data point, and thus it is selected by default.
For example, each data point of the third first sub-time-series data is traversed according to time sequence, the area of a triangle formed by each data point of the third first sub-time-series data, the last data point of the second first sub-time-series data and the first data point of the fourth first sub-time-series data is calculated, so as to obtain (N-2)/α areas of the triangle, the data point corresponding to the largest area of the triangle is selected, and the data point is used as a data point in the second time-series data.
In another specific application scenario, in response to the number of data points not less than the number of the set multiple of the maximum rendering data number, the first time series data is down-sampled by adopting a mean down-sampling method. And performing down-sampling on the first time sequence data after the mean value down-sampling by adopting an LTTB down-sampling algorithm to obtain second time sequence data.
Specifically, referring to fig. 3, fig. 3 is a schematic flowchart of another embodiment of step S20 in fig. 1, and as shown in fig. 3, step S20 may include the following sub-steps:
s23: and in response to the number of the data points not less than the number of the set multiple of the maximum rendering data number, performing down-sampling on the first time sequence data by adopting a mean value down-sampling method.
When the number of data points of the first time sequence data is not less than the number of the set multiple of the maximum rendering data number, in order to ensure the stability of the time sequence database when the time sequence data is acquired, when the time sequence diagram of the first time sequence data is drawn, the first step is not to acquire the first time sequence data from the time sequence database, but to customize an optimized strategy for inquiring the time sequence database according to the number of data points of the first time sequence data.
Specifically, referring to fig. 4, fig. 4 is a schematic flowchart of an embodiment of step S23 in fig. 3, and as shown in fig. 4, step S23 may specifically include the following steps:
s231: and determining the down-sampling proportion according to the reporting frequency.
Optionally, in this embodiment, the reporting frequency or the set multiple of the reporting frequency is used as the down-sampling ratio, so that the number of data points of the first time-series data after the average down-sampling is smaller than the number of the set multiple of the maximum number of rendering data.
Because the influence of reading more data from the time sequence database at one time on the performance of the time sequence database is larger, and the influence of less read original data on the accuracy of the trend of the time sequence diagram is also larger, the time sequence database is inquired after the optimal data magnitude is calculated before the time sequence database is inquired, and the authenticity of the drawn time sequence diagram can be ensured on the basis of ensuring the performance of the time sequence database.
That is, the down-sampling ratio is determined such that the number of data points after the mean down-sampling is less than or equal to the number of set multiples of the maximum number of rendering data and as close as possible to the number of set multiples of the maximum number of rendering data. For example, if the number of data points after the mean down-sampling is twice the reporting frequency, so that the number of data points is smaller than the number of the set multiple of the maximum rendering data number, and is closest to (relative to the reporting frequency or another multiple of the reporting frequency) the number of the set multiple of the maximum rendering data number, it is determined that the mean down-sampling is performed at twice the reporting frequency.
S232: and performing mean value down-sampling on the first time sequence data according to the down-sampling proportion.
In this embodiment, it is considered that reading a large amount of data from the time series database may cause instability of the time series database and affect performance of the database, and therefore, when the number of data points to be rendered is too large, for example, the number of data points to be rendered exceeds the number of the set multiple of the maximum number of rendered data, the embodiment obtains the final second time series data through two downsampling processes.
S24: and performing down-sampling on the first time sequence data after the mean value down-sampling by adopting an LTTB down-sampling algorithm to obtain second time sequence data.
The data point number of the first time sequence data after mean value down-sampling meets the maximum rendering data number which is greater than the set duration, and the data point number is less than the set multiple number of the maximum rendering data number, therefore, the first time sequence data after mean value down-sampling is directly down-sampled by adopting an LTTB down-sampling algorithm to obtain the second time sequence data, and the specific implementation steps of the LTTB down-sampling algorithm refer to the step S21 and the step S22, which is not described in detail herein.
S30: and drawing a timing chart for the second timing data.
In summary, the method for processing time series data provided by the present application includes: and acquiring the number of data points of the first time sequence data to be rendered within the set duration. And in response to the maximum rendering data number of which the data point number is greater than the set duration, performing down-sampling on the first time sequence data by adopting a down-sampling method matched with the data point number to obtain second time sequence data after down-sampling. And drawing a timing chart for the second timing data. When the number of data points of the first time sequence data to be drawn is excessive, the first time sequence data are subjected to down-sampling, and a time sequence diagram is drawn for the second time sequence data subjected to down-sampling processing.
In a specific application scenario, referring to fig. 5(a) and 5(b), fig. 5(a) is a timing chart drawn after memory data of a service in a day after being downsampled by using a mean downsampling algorithm, and fig. 5(b) is a timing chart drawn after memory data of a service in a day after being processed by using the timing data processing method provided by the present application. The reporting frequency of the memory data is set to be 5s, so that the number of data points of the memory data is larger than the number of the set multiple of the maximum rendering data number. As shown in fig. 5(a), it can be seen that the time series data is down-sampled averagely to 4m points, and the peak value is still below 50% at around 12/1904: 53. As shown in fig. 5(b), after the memory data in the last day of the service is processed by the time series data processing method provided in the present application, firstly, the mean value sampling algorithm is utilized to carry out one-time downsampling on the time sequence data, the number of the time sequence data points to be drawn is downsampled to be less than or equal to the number of the set multiple of the maximum rendering data number, then, the time sequence data after the average value is down-sampled again by utilizing the LTTB algorithm, the number of the data points of the obtained time sequence data is less than the maximum number of the rendering data, at the moment, the time sequence data is down-sampled from one point of 5 seconds to one point of 10 seconds, so, after the memory has exploded to 100% at 12/1904: 54, the service has actually overflowed memory and is being used by the operating system kill, the comparison shows that the problem can be quickly located by using the processing method of the time series data provided by the application.
Furthermore, if the time-series data is only down-sampled by using LTTB algorithm (not shown), the time-series data amount of one day may make the down-sampling granularity larger, the selected data point may not be so accurate, for example, the peak is ignored or the trough is ignored when there are continuous small peaks and troughs, in fact, the averaging of the small peaks and troughs should be more suitable, because the fluctuation is acceptable in view of the overall global dimension, and the performance of the time-series database is greatly influenced by reading a large amount of data. The dynamic combination of the LTTB algorithm and the mean downsampling algorithm solves such problems well, so that the finally drawn timing diagram is more realistic.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an embodiment of the time series data processing apparatus provided in the present application, and as shown in fig. 6, the time series data processing apparatus 100 includes an obtaining module 101, a down-sampling module 102, and a drawing module 103, where the obtaining module 101 is configured to obtain a number of data points of first time series data to be rendered within a set duration. The down-sampling module 102 is configured to down-sample the first time sequence data by using a down-sampling method matched with the number of data points in response to the maximum number of rendering data of which the number of data points is greater than the set duration, and obtain down-sampled second time sequence data. The drawing module 103 is configured to draw a timing chart for the second timing data.
Referring to fig. 7, fig. 7 is a schematic structural diagram of another embodiment of the time series data processing apparatus provided in the present application, and as shown in fig. 7, the time series data processing apparatus 200 includes an obtaining module 201 and a drawing module 202, where the obtaining module 201 is configured to obtain data points of first time series data to be rendered within a set time length. The drawing module 202 is configured to draw the timing diagram for the first time series data directly in response to the number of data points of the first time series data being less than the maximum number of rendering data.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a time series data processing apparatus according to another embodiment of the present application. As shown in fig. 8, the time series data processing apparatus 300 may include a memory 310, and a processor 320 connected to the memory 310. The memory 310 is used for storing program data, and the processor 320 is used for executing the program data to implement the steps of the processing method of time series data provided by the present application. For example, processor 320 is configured to implement the following steps:
and acquiring the number of data points of the first time sequence data to be rendered within the set duration. And in response to the maximum rendering data number of which the data point number is greater than the set duration, performing down-sampling on the first time sequence data by adopting a down-sampling method matched with the data point number to obtain second time sequence data after down-sampling. And drawing a timing chart for the second timing data.
Processor 320 may be a central processing unit CPU or an application Specific Integrated circuit asic or one or more Integrated circuits configured to implement embodiments of the present application.
Memory 310 is used for executable instructions. Memory 310 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. Memory 310 may also be a memory array. The storage 310 may also be partitioned, and the blocks may be combined into virtual volumes according to certain rules. The instructions stored by the memory 310 may be executable by the processor 320 to enable the processor 320 to perform a method of processing time series data provided in any of the method embodiments described above.
Referring to fig. 9, fig. 9 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided in the present application. As shown in fig. 9, the computer-readable storage medium 400 has program data 401 stored thereon, and the program data 401 realizes the steps of the time series data processing method provided in the present application when executed by a processor. For example, program data 401, when executed by a processor, performs the steps of:
and acquiring the number of data points of the first time sequence data to be rendered within the set duration. And in response to the maximum rendering data number of which the data point number is greater than the set duration, performing down-sampling on the first time sequence data by adopting a down-sampling method matched with the data point number to obtain second time sequence data after down-sampling. And drawing a timing chart for the second timing data. The computer-readable storage medium 400 may be any available media or data storage device that can be accessed by a computer, including but not limited to magnetic memory (e.g., floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc.), optical memory (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor memory (e.g., ROMs, EPROMs, EEPROMs, nonvolatile memory 110(NANDFLASH), Solid State Disks (SSDs)), etc.
In summary, the method for processing time series data provided by the present application includes: and acquiring the number of data points of the first time sequence data to be rendered within the set duration. And in response to the maximum rendering data number of which the data point number is greater than the set duration, performing down-sampling on the first time sequence data by adopting a down-sampling method matched with the data point number to obtain second time sequence data after down-sampling. And drawing a timing chart for the second timing data. When the number of data points of the first time sequence data to be drawn is excessive, the first time sequence data are subjected to down-sampling, and a time sequence diagram is drawn for the second time sequence data subjected to down-sampling processing.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other manners. For example, the above-described device embodiments are merely illustrative, and for example, the division of the above modules or units is only one logical functional division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated units in the other embodiments described above may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above embodiments are merely examples and are not intended to limit the scope of the present disclosure, and all modifications, equivalents, and flow charts using the contents of the specification and drawings of the present disclosure or those directly or indirectly applied to other related technical fields are intended to be included in the scope of the present disclosure.

Claims (10)

1. A processing method of time series data is characterized in that the processing method of the time series data comprises the following steps:
acquiring the number of data points of first time sequence data to be rendered within a set duration;
in response to the maximum rendering data number of the data points which is larger than the set duration, adopting a down-sampling method matched with the data points to down-sample the first time sequence data to obtain down-sampled second time sequence data;
and drawing a timing chart for the second timing data.
2. The method for processing time series data according to claim 1, wherein the step of down-sampling the first time series data by a down-sampling method matched with the number of the data points in response to the number of the data points being greater than the maximum number of the rendering data with the set duration to obtain the down-sampled second time series data comprises:
and in response to the maximum rendering data number of the data points which is larger than the set duration, performing down-sampling on the first time sequence data by adopting an LTTB down-sampling algorithm to obtain second time sequence data.
3. The method of processing time series data according to claim 2,
the step of performing downsampling on the first time sequence data by adopting an LTTB downsampling algorithm in response to the maximum rendering data number of which the data point number is greater than the set duration to obtain the second time sequence data comprises the following steps of:
in response to the data point number is larger than the maximum rendering data number of the set duration and the data point number is smaller than the set multiple number of the maximum rendering data number, directly adopting the LTTB down-sampling algorithm to down-sample the first time sequence data to obtain second time sequence data;
in response to the number of the data points is not less than the number of the set multiple of the maximum rendering data number, performing down-sampling on the first time sequence data by adopting a mean value down-sampling method;
performing down-sampling on the first time sequence data subjected to mean value down-sampling by adopting the LTTB down-sampling algorithm to obtain second time sequence data; wherein the set multiple is greater than 1.
4. The method of processing time series data according to claim 3,
the number of the data points is the quotient of the set duration and the reporting frequency;
the step of down-sampling the first time series data by using the mean down-sampling method includes:
determining a down-sampling proportion according to the reporting frequency;
and performing mean value down-sampling on the first time sequence data according to the down-sampling proportion.
5. The method of claim 4, wherein the determining the down-sampling ratio according to the reporting frequency comprises:
and taking the reporting frequency or the set multiple of the reporting frequency as the down-sampling proportion, so that the number of data points of the first time sequence data after mean down-sampling is smaller than the number of the set multiple of the maximum rendering data number.
6. The method for processing time series data according to any one of claims 2 to 5, wherein the step of down-sampling the first time series data by using LTTB down-sampling algorithm to obtain the second time series data comprises:
dividing the first time sequence data into N first sub-time sequence data according to a preset down-sampling proportion;
traversing all the first sub-time sequence data, respectively determining a data point from each first sub-time sequence data, and forming the second time sequence data by the N data points according to time sequence;
the area of a triangle formed by the data point of the kth first sub-time-series data, the last data point of the kth first sub-time-series data and the first data point of the (K + 1) th first sub-time-series data is the largest, and K is 2, … …, N-1.
7. The method for processing time series data according to any one of claims 1 to 5, further comprising:
and in response to the data point number of the first time sequence data being smaller than the maximum rendering data number, directly drawing a time sequence diagram for the first time sequence data.
8. A time-series data processing apparatus, characterized by comprising:
the system comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring the number of data points of first time sequence data to be rendered in a set duration;
the down-sampling module is used for responding to the maximum rendering data number of which the data point number is greater than the set duration, and down-sampling the first time sequence data by adopting a down-sampling method matched with the data point number to obtain second time sequence data after down-sampling;
and the drawing module is used for drawing a time sequence diagram for the second time sequence data.
9. A time series data processing apparatus, characterized in that it comprises a processor and a memory for storing program data, the processor being adapted to execute the program data to implement the method according to any of claims 1-7.
10. A computer-readable storage medium, in which program data are stored which, when being executed by a processor, are adapted to carry out the method according to any one of claims 1-7.
CN202110322088.9A 2021-03-25 2021-03-25 Time series data processing method, time series data processing device and storage medium Pending CN113032461A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110322088.9A CN113032461A (en) 2021-03-25 2021-03-25 Time series data processing method, time series data processing device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110322088.9A CN113032461A (en) 2021-03-25 2021-03-25 Time series data processing method, time series data processing device and storage medium

Publications (1)

Publication Number Publication Date
CN113032461A true CN113032461A (en) 2021-06-25

Family

ID=76474027

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110322088.9A Pending CN113032461A (en) 2021-03-25 2021-03-25 Time series data processing method, time series data processing device and storage medium

Country Status (1)

Country Link
CN (1) CN113032461A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103634006A (en) * 2013-04-28 2014-03-12 中国科学院电子学研究所 Rapid mixed sampling method for ultra wide band signal
CN108986201A (en) * 2018-08-02 2018-12-11 苏州蜗牛数字科技股份有限公司 Utilize the method, apparatus and storage medium of the data-optimized HDR rendering of multiframe
CN111597225A (en) * 2020-04-21 2020-08-28 杭州安脉盛智能技术有限公司 Adaptive data reduction method based on segmented transient recognition
CN112231531A (en) * 2020-09-15 2021-01-15 山东浪潮通软信息科技有限公司 Data display method, equipment and medium based on openstb

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103634006A (en) * 2013-04-28 2014-03-12 中国科学院电子学研究所 Rapid mixed sampling method for ultra wide band signal
CN108986201A (en) * 2018-08-02 2018-12-11 苏州蜗牛数字科技股份有限公司 Utilize the method, apparatus and storage medium of the data-optimized HDR rendering of multiframe
CN111597225A (en) * 2020-04-21 2020-08-28 杭州安脉盛智能技术有限公司 Adaptive data reduction method based on segmented transient recognition
CN112231531A (en) * 2020-09-15 2021-01-15 山东浪潮通软信息科技有限公司 Data display method, equipment and medium based on openstb

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨冠泽等: "地震前兆大数据可视化相似度评价技术研究", 防灾科技学院学报, vol. 22, no. 03, pages 42 - 46 *

Similar Documents

Publication Publication Date Title
CN115733498B (en) Time sequence data compression method, device, computer equipment and medium
CN110289994B (en) Cluster capacity adjusting method and device
CN110033247B (en) Payment channel recommendation method and system
CN112367384B (en) Kafka cluster-based dynamic speed limiting method and device and computer equipment
CN112529767B (en) Image data processing method, device, computer equipment and storage medium
US11360684B2 (en) Data storage method and apparatus, storage medium and computer device
US20140114723A1 (en) Method and system for estimating a number of users of a website based on lossy compressed data
CN111324533A (en) A/B test method and device and electronic equipment
CN110390563A (en) Quantization method, device, computer equipment and the storage medium of user's value
US10819368B2 (en) Method for compressing and restoring time series data
CN110765360B (en) Text topic processing method and device, electronic equipment and computer storage medium
CN113032461A (en) Time series data processing method, time series data processing device and storage medium
US11797480B2 (en) Storage of order books with persistent data structures
CN112100143B (en) File compression storage method, device, equipment and storage medium
CN107783990B (en) Data compression method and terminal
CN112784165A (en) Training method of incidence relation estimation model and method for estimating file popularity
CN111164633B (en) Method and device for adjusting scoring card model, server and storage medium
CN109213906B (en) Session duration calculation method, device and system
CN115017215B (en) Data processing method and computing device
CN112306824B (en) Disk performance evaluation method, system, device and computer readable storage medium
US8700366B1 (en) Variable transport delay modelling mechanism
CN110874268A (en) Data processing method, device and equipment
CN112069212B (en) Data processing method, data processing device, computer equipment and storage medium
CN112612415B (en) Data processing method and device, electronic equipment and storage medium
WO2016186634A1 (en) Maximizing information value of web content

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination