WO2020252822A1 - Time series data processing method and apparatus - Google Patents

Time series data processing method and apparatus Download PDF

Info

Publication number
WO2020252822A1
WO2020252822A1 PCT/CN2019/095065 CN2019095065W WO2020252822A1 WO 2020252822 A1 WO2020252822 A1 WO 2020252822A1 CN 2019095065 W CN2019095065 W CN 2019095065W WO 2020252822 A1 WO2020252822 A1 WO 2020252822A1
Authority
WO
WIPO (PCT)
Prior art keywords
time point
state
observation window
energy
mode
Prior art date
Application number
PCT/CN2019/095065
Other languages
French (fr)
Chinese (zh)
Inventor
谢鹏
金超
晋文静
Original Assignee
北京天泽智云科技有限公司
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 北京天泽智云科技有限公司 filed Critical 北京天泽智云科技有限公司
Publication of WO2020252822A1 publication Critical patent/WO2020252822A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/5866Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, manually generated location and time information
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2218/00Aspects of pattern recognition specially adapted for signal processing
    • G06F2218/08Feature extraction
    • G06F2218/10Feature extraction by analysing the shape of a waveform, e.g. extracting parameters relating to peaks

Definitions

  • the invention relates to the field of data processing, in particular to a method and device for processing time series data.
  • Time series data refers to data collected in chronological order. This type of data reflects the change state or degree of a certain thing, phenomenon, etc. over time. It can be intuitively represented in the plane as a time series waveform, such as electrocardiogram (ECG) ), electroencephalogram (EEG), current and voltage signals in manufacturing, K lines for stock trading, time-domain waveforms of voice signals, etc.
  • ECG electrocardiogram
  • EEG electroencephalogram
  • current and voltage signals in manufacturing K lines for stock trading
  • time-domain waveforms of voice signals etc.
  • the embodiments of the present invention provide a time series data processing method and device to solve one or more of the above-mentioned problems in the prior art.
  • a time series data processing method includes:
  • the state includes: a temporary state and a stable state
  • the stable state at the time point is taken as the state mode at the time point; the state mode includes: a steady mode, a rising mode, and a falling mode.
  • the loop traversing each time point in the time sequence, and determining the state of the time point according to the fluctuating energy at each time point includes:
  • the stable state at the time point is determined according to the absolute value of the fluctuating energy at the time point and the temporary state.
  • the determining the temporary state at the time point according to the fluctuating energy at the time point includes:
  • the determining the stable state at the time point according to the absolute value of the fluctuating energy at the time point and the temporary state includes:
  • the dynamic observation window is used to track the unstable state, and the stable state at each time point in the observation window is determined.
  • the use of the dynamic observation window to track the unstable state, and determining the stable state at the current time point includes:
  • the termination condition includes any one of the following:
  • a specific time point appears in the observation window, and the specific time point refers to a time point at which the absolute value of fluctuating energy abs(E(i)) is greater than or equal to the fluctuating energy threshold;
  • the observation window reaches the set length threshold w;
  • the absolute value abs(sum(E)) of the accumulated energy at all time points in the observation window is greater than or equal to the fluctuating energy threshold;
  • the determining a stable state at each time point in the observation window according to the termination condition includes:
  • observation window terminated at the specific time point appears in the observation window: move the termination point of the observation window to a time point before the specific time point to obtain an updated observation window; if updated The length of the observation window is greater than half of the set length threshold w, then the stable state at each time point in the updated observation window is set to the last stable state, otherwise the stable state at each time point in the updated observation window Set to steady mode;
  • the observation window reaches the set length threshold w to terminate the observation window: if the absolute value of the cumulative energy abs(sum(E)) is greater than the fluctuating energy threshold, and the cumulative energy sum(E) >0, the stable state at each time point in the observation window is set to the rising mode; if the absolute value of the cumulative energy abs(sum(E)) is greater than the fluctuating energy threshold, and the cumulative energy sum( E) ⁇ 0, the stable state at each time point in the observation window is set to the falling mode; if the absolute value of the cumulative energy abs(sum(E)) is less than or equal to the fluctuating energy threshold, the The stable state at each time point in the observation window is set to stable mode;
  • the absolute value of the cumulative energy abs(sum(E)) at all time points in the observation window is greater than or equal to the fluctuating energy threshold to terminate the observation window: if the absolute value of the cumulative energy abs(sum(E) ) Is greater than the fluctuating energy threshold, and the cumulative energy sum(E)>0, then the stable state at each time point in the observation window is set to the rising mode; if the absolute value of the cumulative energy abs(sum (E)) is greater than the fluctuating energy threshold, and the accumulated energy sum(E) ⁇ 0, then the stable state at each time point in the observation window is set to the falling mode.
  • the acquiring time series data includes:
  • sampling of the timing diagram includes:
  • the method further includes:
  • a time series data processing device comprising:
  • a data acquisition module for acquiring time series data, where each data in the time series is a value at a time point;
  • the traversal module is configured to traverse each time point in the time sequence in a loop, and determine the state of the time point according to the fluctuating energy at each time point, and the state includes: a temporary state and a stable state;
  • the output module is configured to use the stable state at the time point as the state mode at the time point; the state mode includes: a steady mode, an ascending mode, and a descending mode.
  • the traversal module includes:
  • a temporary state determining module configured to loop through each time point in the time sequence, and determine the temporary state at the time point according to the fluctuating energy at the time point;
  • the stable state determining module is used to determine the stable state at the time point according to the absolute value of the fluctuating energy at the time point and the temporary state.
  • the temporary state determination module is specifically configured to determine that the temporary state St(n) at the current time point is in the rising mode when the fluctuating energy E(n) at the current time point is in the rising mode; the fluctuation at the current time point When the energy E(n) ⁇ 0, the temporary state St(n) at the current time point is determined to be a descending mode; when the fluctuating energy E(n) at the current time point is 0, the temporary state St(n) at the current time point is determined It is a steady mode.
  • the stable state determination module includes:
  • the judging unit is used to determine whether the absolute value of fluctuating energy abs(E(n)) at the current time point is greater than or equal to the set fluctuating energy threshold, and the temporary state St(n) at the current time point and the temporary state at the previous time point Whether the state St(n-1) is the same;
  • the first steady-state determination unit is used to use the temporary state St(n) at the current time point as the current time when the absolute value of the fluctuating energy abs(E(n)) at the current time point is greater than or equal to the set fluctuating energy threshold Point of steady state;
  • the second steady-state determination unit is used for the absolute value abs(E(n)) of the fluctuating energy at the current time point is less than the fluctuating energy threshold, and the temporary state St(n) at the current time point and the previous time point When the temporary state St(n-1) is the same, the last stable state is taken as the stable state at the current time point;
  • the third steady state determination unit is used for the absolute value abs(E(n)) of the fluctuating energy at the current time point is less than the fluctuating energy threshold, and the temporary state St(n) at the current time point and the previous time point When the temporary state St(n-1) is different, the dynamic observation window is used to track the unstable state to determine the stable state at each time point in the observation window.
  • the third steady-state determination unit is specifically configured to open a dynamic observation window, record the length of the observation window, and calculate the cumulative energy sum(E) and the cumulative energy at all time points in the observation window The absolute value of abs(sum(E)), terminates the observation window after the observation window meets the termination condition, and determines the stable state at each time point in the observation window according to the termination condition.
  • the termination condition includes any one of the following:
  • a specific time point appears in the observation window, and the specific time point refers to a time point at which the absolute value of fluctuating energy abs(E(i)) is greater than or equal to the fluctuating energy threshold;
  • the observation window reaches the set length threshold w;
  • the absolute value abs(sum(E)) of the accumulated energy at all time points in the observation window is greater than or equal to the fluctuating energy threshold;
  • the third steady state determination unit determines the steady state at each time point in the observation window in the following manner:
  • observation window terminated at the specific time point appears in the observation window: move the termination point of the observation window to a time point before the specific time point to obtain an updated observation window; if updated The length of the observation window is greater than half of the set length threshold w, then the stable state at each time point in the updated observation window is set to the last stable state, otherwise the stable state at each time point in the updated observation window Set to steady mode;
  • the observation window reaches the set length threshold w to terminate the observation window: if the absolute value of the cumulative energy abs(sum(E)) is greater than the fluctuating energy threshold, and the cumulative energy sum(E) >0, the stable state at each time point in the observation window is set to the rising mode; if the absolute value of the cumulative energy abs(sum(E)) is greater than the fluctuating energy threshold, and the cumulative energy sum( E) ⁇ 0, the stable state at each time point in the observation window is set to the falling mode; if the absolute value of the cumulative energy abs(sum(E)) is less than or equal to the fluctuating energy threshold, the The stable state at each time point in the observation window is set to stable mode;
  • the absolute value of the cumulative energy abs(sum(E)) at all time points in the observation window is greater than or equal to the fluctuating energy threshold to terminate the observation window: if the absolute value of the cumulative energy abs(sum(E) ) Is greater than the fluctuating energy threshold, and the cumulative energy sum(E)>0, then the stable state at each time point in the observation window is set to the rising mode; if the absolute value of the cumulative energy abs(sum (E)) is greater than the fluctuating energy threshold, and the accumulated energy sum(E) ⁇ 0, then the stable state at each time point in the observation window is set to the falling mode.
  • the data acquisition module is specifically configured to sample the time sequence diagram to obtain time series data.
  • the data acquisition module sampling the timing diagram includes: periodically sampling the timing diagram, or non-periodically sampling the timing diagram.
  • the device further includes:
  • the display module is used to display the state mode of each time point in the time series data.
  • An electronic device including: one or more processors and memories;
  • the memory is used to store computer-executable instructions
  • the processor is used to execute the computer-executable instructions to implement the aforementioned method.
  • a readable storage medium having instructions stored thereon, and the instructions are executed to implement the aforementioned method.
  • the time series data processing method and device provided by the embodiments of the present invention calculate and calculate the fluctuation energy at each time point for the time series data, and use the fluctuation energy at each time point to loop through the time series at each time point.
  • the method determines the state mode at each time point.
  • the division of steady state and non-steady state is proposed.
  • the traversal process first determine the temporary state of the time point according to the fluctuating energy at each time point; then according to the absolute value of the fluctuating energy and the temporary state of the time point By determining the stable state at the time point, the state mode at each time point can be obtained.
  • the dynamic observation window is used to track the unstable state to determine the stability of each time point in the observation window State, that is to say, when it is impossible to determine the state pattern at the current time point only based on the fluctuating energy at the current time point and the temporary state at the previous time point, consider the temporary status at one or more time points after the current time point.
  • the state condition can finally determine the state mode at the current time point, so that the determination result of the state mode at each time point can be more accurate, and the continuation of the temporary state can be accurately divided effectively, reducing the impact of the short-term change of the energy direction. Improper segmentation of time-continuous state patterns.
  • the non-steady state tracking can accurately determine the impact of a certain length or time of energy accumulation changes on the current point in time, which improves the accuracy of state mode judgment.
  • Fig. 1 is a flowchart of a time series data processing method according to an embodiment of the present invention
  • FIG. 2 is a flow chart of using a dynamic observation window to track unstable states in an embodiment of the present invention
  • FIG. 3 is a structural block diagram of a time series data processing device according to an embodiment of the present invention.
  • Fig. 4 is another structural block diagram of a time series data processing device according to an embodiment of the present invention.
  • the embodiment of the present invention provides a time series data processing method and device.
  • By calculating the fluctuating energy at each time point in the time series data using the fluctuating energy at each time point to cycle through each time point in the time series, according to
  • the fluctuating energy at each time point determines the state at the time point, and the state includes: a temporary state and a stable state; and the stable state at the time point is taken as the state mode at the time point.
  • FIG. 1 it is a flowchart of a time series data processing method according to an embodiment of the present invention, which includes the following steps:
  • Step 101 Obtain time series data, where each data in the time series is a value at a time point.
  • the time series data may be sampling data for an arbitrary waveform, that is, a timing diagram, and may be periodic sampling or aperiodic sampling, which is not limited in the embodiment of the present invention.
  • the data in the time series data is sorted in ascending order of time or index.
  • E(n) is the fluctuating energy at the current time point
  • V(n) is the value at the current time point
  • V(n-1) is the value at the previous time point.
  • Step 103 Loop through each time point in the time sequence, and determine the state of the time point according to the fluctuating energy at each time point, and the state includes: a temporary state and a stable state.
  • the fluctuating energy Since the fluctuating energy only reflects the change between the current time point and the previous time point, it is only a relative state, not a final state.
  • the final state of each time point is not only related to the state of the previous time point, but also It may also be related to the state at one or more subsequent points in time. Therefore, in the embodiment of the present invention, the temporary state at that time can be determined according to the fluctuating energy at each time point, and then the absolute value and the temporary state of the fluctuating energy at the time point can be determined by loop traversal. The steady state at that point in time.
  • the absolute value of fluctuating energy will be recorded as abs(E) later.
  • the temporary state indicates that the state mode at the current time point has not been finalized, and will be affected by the state mode at one or more subsequent time points; the stable state indicates that the state mode at the time point has stabilized and is not affected by the subsequent time.
  • the impact of changes in the state of the point In the embodiment of the present invention, there can be three state modes at each time point, namely: a steady mode, an ascending mode, and a descending mode.
  • the state mode can also be divided into a stable mode and a fluctuating mode. Of course, there may be more divisions with different granularities, which is not limited in the embodiment of the present invention.
  • the following takes the status mode including steady mode, rising mode, and falling mode as examples for description.
  • the status mode including steady mode, rising mode, and falling mode as examples for description.
  • use 0, 1, and 2 to represent the above three state modes.
  • the temporary state and the stable state also respectively include the above three state modes.
  • the temporary state is denoted as St and the stable state is denoted as S.
  • the last stable state (denoted as Sp) is taken as the stable state at the current time point, that is, the current time
  • the stable state of the point inherits the last stable state Sp; it should be noted that the last stable state refers to the last stable state before the current point in time, not the stable state at the previous point in time;
  • Step 104 Use the stable state at the time point as the state mode at the time point; the state mode includes: a steady mode, an ascending mode, and a descending mode.
  • the stable state means that the state mode at that time point has been stabilized and is not affected by the state changes at subsequent time points. Therefore, after the stable state at each time point is determined, each time point can be changed The steady state output.
  • Different status modes can be represented by different marks.
  • the numbers 0, 1, and 2 mentioned above represent steady mode, rising mode, and falling mode respectively.
  • the state mode corresponding to each time point can be output in the form of a state mode sequence or a table.
  • the state mode of each time point in the time series data can also be displayed in the form of a waveform diagram, wherein different state modes can be displayed in different forms, such as using Different colors or shapes represent different state modes of data points.
  • FIG. 2 it is a flow chart of using a dynamic observation window to track an unstable state in an embodiment of the present invention, which includes the following steps:
  • Step 201 Open the dynamic observation window.
  • the dynamic observation window refers to that the observation window is dynamically changing, that is, it extends backward in sequence from the current time point when the dynamic observation window is opened, adding a subsequent time point each time. Moreover, each time a subsequent time point is added in the observation window, the following step 202 needs to be executed again.
  • Step 202 Record the length of the observation window and calculate the cumulative energy sum(E) and the absolute value of the cumulative energy abs(sum(E)) at all time points in the observation window.
  • Step 203 Determine whether the observation window meets the termination condition; if so, perform step 204; otherwise, return to step 202.
  • the termination condition may include any one of the following:
  • a specific time point appears in the observation window, and the specific time point refers to a time point at which the absolute value of fluctuating energy abs(E(i)) is greater than or equal to the fluctuating energy threshold;
  • Step 204 Terminate the observation window, and determine a stable state at each time point in the observation window according to the termination condition.
  • the time series data processing method calculates the fluctuation energy at each time point for time series data, and uses the fluctuation energy at each time point to determine by looping through each time point in the time series State mode at each point in time. Further, the division of steady state and non-steady state is proposed. In the traversal process, first determine the temporary state of the time point according to the fluctuating energy at each time point; then according to the absolute value of the fluctuating energy and the temporary state of the time point By determining the stable state at the time point, the state mode at each time point can be obtained.
  • the dynamic observation window is used to track the unstable state to determine the stability of each time point in the observation window State, that is to say, when it is impossible to determine the state pattern at the current time point only based on the fluctuating energy at the current time point and the temporary state at the previous time point, consider the temporary status at one or more time points after the current time point.
  • the state condition can finally determine the state mode at the current time point, so that the determination result of the state mode at each time point can be more accurate, and the continuation of the temporary state can be accurately divided effectively, reducing the impact of the short-term change of the energy direction. Improper segmentation of time-continuous state patterns.
  • the non-steady state tracking can accurately determine the impact of a certain length or time of energy accumulation changes on the current point in time, which improves the accuracy of state mode judgment.
  • the embodiment of the present invention also provides a time series data processing device, as shown in FIG. 3, which is a structural block diagram of the device.
  • the device includes the following modules:
  • the data acquisition module 301 is used to acquire time series data.
  • Each data in the time series is a value at a time point; for example, the time series diagram is sampled periodically or non-periodically to obtain the time series data, or the user Sampling data provided by time, etc.;
  • the traversal module 303 is configured to loop through each time point in the time sequence, and determine the state of the time point according to the fluctuating energy at each time point, and the state includes: a temporary state and a stable state;
  • the output module 304 is configured to use the stable state at the time point as the state mode at the time point; the state mode includes: a steady mode, an ascending mode, and a descending mode.
  • the aforementioned traversal module may include: a temporary state determination module and a stable state determination module; wherein:
  • the temporary state determining module is configured to loop through each time point in the time sequence, and determine the temporary state at the time point according to the fluctuating energy at the time point;
  • the stable state determining module is configured to determine the stable state at the time point according to the absolute value of the fluctuating energy at the time point and the temporary state.
  • the above-mentioned temporary state determination module can specifically determine the temporary state at each time point according to the following principles: when the fluctuating energy at the current time point E(n)>0, determine that the temporary state St(n) at the current time point is in the rising mode; When the fluctuating energy E(n) ⁇ 0 at the time point, the temporary state St(n) at the current time point is determined to be a descending mode; when the fluctuating energy E(n) at the current time point is 0, the temporary state at the current time point is determined St(n) is the stationary mode.
  • the aforementioned stable state determination module may specifically include the following units:
  • the judging unit is used to determine whether the absolute value of fluctuating energy abs(E(n)) at the current time point is greater than or equal to the set fluctuating energy threshold, and the temporary state St(n) at the current time point and the temporary state at the previous time point Whether the state St(n-1) is the same;
  • the first steady-state determination unit is used to use the temporary state St(n) at the current time point as the current time when the absolute value of the fluctuating energy abs(E(n)) at the current time point is greater than or equal to the set fluctuating energy threshold Point of steady state;
  • the second steady-state determination unit is used for the absolute value abs(E(n)) of the fluctuating energy at the current time point is less than the fluctuating energy threshold, and the temporary state St(n) at the current time point and the previous time point When the temporary state St(n-1) is the same, the last stable state is taken as the stable state at the current time point;
  • the third steady state determination unit is used for the absolute value abs(E(n)) of the fluctuating energy at the current time point is less than the fluctuating energy threshold, and the temporary state St(n) at the current time point and the previous time point When the temporary state St(n-1) is different, the dynamic observation window is used to track the unstable state to determine the stable state at each time point in the observation window.
  • the third steady-state determination unit is specifically configured to open a dynamic observation window, record the length of the observation window, and calculate the cumulative energy sum(E) at all time points in the observation window and the absolute value of the cumulative energy abs( sum(E)), terminate the observation window after the observation window meets a termination condition, and determine the stable state at each time point in the observation window according to the termination condition.
  • the time series data processing device calculates and calculates the fluctuating energy at each time point for time series data, and uses the fluctuating energy at each time point to determine by looping through each time point in the time series State mode at each point in time. Further, the division of steady state and non-steady state is proposed. In the traversal process, first determine the temporary state of the time point according to the fluctuating energy at each time point; then according to the absolute value of the fluctuating energy and the temporary state of the time point By determining the stable state at the time point, the state mode at each time point can be obtained.
  • the dynamic observation window is used to track the unstable state to determine the stability of each time point in the observation window State, that is to say, when it is impossible to determine the state pattern at the current time point only based on the fluctuating energy at the current time point and the temporary state at the previous time point, consider the temporary status at one or more time points after the current time point.
  • the state condition can finally determine the state mode at the current time point, so that the determination result of the state mode at each time point can be more accurate, and the continuation of the temporary state can be accurately divided effectively, reducing the impact of the short-term change of the energy direction. Improper segmentation of time-continuous state patterns.
  • the non-steady state tracking can accurately determine the impact of a certain length or time of energy accumulation changes on the current point in time, which improves the accuracy of state mode judgment.
  • FIG. 4 it is another structural block diagram of the time series data processing device of the embodiment of the present invention.
  • the apparatus further includes:
  • the display module 401 is used to display the state mode of each time point in the time series data.
  • Different status modes can be represented by different marks.
  • the numbers 0, 1, and 2 mentioned above represent steady mode, rising mode, and falling mode respectively.
  • the state mode corresponding to each time point can be output in the form of a state mode sequence or a table.
  • the display module 401 can display the state mode of each time point in the time series data in the form of a waveform graph, wherein different state modes can be displayed in different forms, such as using different colors or shapes to represent the data. Different state modes of points.
  • the time series data processing method and device provided by the embodiments of the present invention can realize the segmentation of arbitrary waveform time series data and state mode judgment, such as electrocardiogram, electroencephalogram, current and voltage signals in manufacturing, and stock trading K-line, the time-domain waveform of the voice signal, etc., and is not affected by noise data, does not require training data, and has high accuracy and universality.
  • state mode at each time point in the time series data the change point of the time series can be obtained, or different state modes can be combined into a compound mode, so as to provide effective information for industry analysis and application.
  • the solution of the present invention can perform accurate state pattern recognition on arbitrarily sampled, without data distribution assumptions, with or without time series period, steady-state or non-steady-state time series data, which can not only realize Offline recognition, and online recognition can be realized, with strong versatility, and not restricted by the application environment.
  • the program can be stored in a computer-readable storage medium, which is referred to as storage herein. Medium, such as: ROM/RAM, magnetic disk, optical disk, etc.
  • an embodiment of the present invention also provides a device for a time series data processing method.
  • the device is an electronic device, such as a mobile terminal, a computer, a tablet device, a medical device, a fitness device, or a personal digital assistant. Wait.
  • the electronic device may include one or more processors and memories; wherein the memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions to implement the foregoing method.

Abstract

A time series data processing method and apparatus, the method comprising: acquiring time series data, each item of data in the time series being a value at a time point (101); sequentially calculating the fluctuating energy at each time point E(n)=V(n)‑V(n‑1), wherein E(n) is the fluctuating energy at a current time point, V(n) is a value at the current time point, and V(n‑1) is a value at a previous time point (102); cyclically traversing each time point in the time series, and determining the state at the time points according to the fluctuating energy at each time point, the states comprising: a temporary state and a stable state (103); and using a stable state at the time points as the state mode of the time points, the state mode comprising: a steady mode, an ascending mode, and a descending mode (104). By using the present method, the segmentation of time series data and the identification of state modes may be simply and accurately achieved.

Description

时间序列数据处理方法及装置Time series data processing method and device 技术领域Technical field
本发明涉及数据处理领域,具体涉及一种时间序列数据处理方法及装置。The invention relates to the field of data processing, in particular to a method and device for processing time series data.
背景技术Background technique
时间序列数据是指按时间顺序收集的数据,这类数据反映了某一事物、现象等随时间的变化状态或程度,其可以直观地在平面中表示为时间序列的波形,比如如心电图(ECG)、脑电图(EEG)、生产制造中的电流电压信号、股票交易的K线、语音信号的时域波形等。在这类数据的分析应用中,通常需要对其波形进行分割,并对分割出的波形进行分类,进行为各种应用提供相应的信息。Time series data refers to data collected in chronological order. This type of data reflects the change state or degree of a certain thing, phenomenon, etc. over time. It can be intuitively represented in the plane as a time series waveform, such as electrocardiogram (ECG) ), electroencephalogram (EEG), current and voltage signals in manufacturing, K lines for stock trading, time-domain waveforms of voice signals, etc. In the analysis and application of this kind of data, it is usually necessary to segment the waveforms and classify the segmented waveforms to provide corresponding information for various applications.
在现有技术中,已有多种方式对时间序列数据进行分割,但现有技术大都存在各种不同的局限或缺陷,比如:计算复杂度高、在复杂场景中分割不准确、不能适用于实时计算、受噪音数据影响大、对数据的分布或来源具有强假设、监督学习需要训练数据及标签或者只适用于某种具有特定图形模式的信号等。In the prior art, there are many ways to segment time series data, but most of the prior art has various limitations or defects, such as high computational complexity, inaccurate segmentation in complex scenes, and inapplicability to Real-time calculation, large influence by noisy data, strong assumptions on the distribution or source of data, supervised learning requires training data and labels, or only suitable for a certain signal with a specific graphic mode.
发明内容Summary of the invention
本发明实施例提供一种时间序列数据处理方法及装置,以解决现有技术中存在的上述一种或多种问题。The embodiments of the present invention provide a time series data processing method and device to solve one or more of the above-mentioned problems in the prior art.
为此,本发明提供如下技术方案:To this end, the present invention provides the following technical solutions:
一种时间序列数据处理方法,所述方法包括:A time series data processing method, the method includes:
获取时间序列数据,所述时间序列中的每个数据为一个时间点的值;Acquiring time series data, where each data in the time series is a value at a time point;
依次计算各时间点的波动能量E(n)=V(n)-V(n-1),其中,E(n)为当前时 间点的波动能量,V(n)为当前时间点的值,V(n-1)为前一时间点的值;Calculate the fluctuating energy E(n)=V(n)-V(n-1) at each time point in turn, where E(n) is the fluctuating energy at the current time point, and V(n) is the value at the current time point, V(n-1) is the value at the previous time point;
循环遍历所述时间序列中的每个时间点,根据各时间点的波动能量确定所述时间点的状态,所述状态包括:暂时状态和稳定状态;Loop through each time point in the time sequence, and determine the state of the time point according to the fluctuating energy at each time point, the state includes: a temporary state and a stable state;
将所述时间点的稳定状态作为所述时间点的状态模式;所述状态模式包括:平稳模式、上升模式、下降模式。The stable state at the time point is taken as the state mode at the time point; the state mode includes: a steady mode, a rising mode, and a falling mode.
可选地,所述循环遍历所述时间序列中的每个时间点,根据各时间点的波动能量确定所述时间点的状态包括:Optionally, the loop traversing each time point in the time sequence, and determining the state of the time point according to the fluctuating energy at each time point includes:
循环遍历所述时间序列中的每个时间点,并根据所述时间点的波动能量确定所述时间点的暂时状态;Loop through each time point in the time sequence, and determine the temporary state of the time point according to the fluctuating energy at the time point;
根据所述时间点的波动能量的绝对值和暂时状态确定所述时间点的稳定状态。The stable state at the time point is determined according to the absolute value of the fluctuating energy at the time point and the temporary state.
可选地,所述根据所述时间点的波动能量确定所述时间点的暂时状态包括:Optionally, the determining the temporary state at the time point according to the fluctuating energy at the time point includes:
如果当前时间点的波动能量E(n)>0,则确定当前时间点的暂时状态St(n)为上升模式;If the fluctuating energy E(n)>0 at the current time point, it is determined that the temporary state St(n) at the current time point is the rising mode;
如果当前时间点的波动能量E(n)<0,则确定当前时间点的暂时状态St(n)为下降模式;If the fluctuating energy E(n) at the current time point is less than 0, it is determined that the temporary state St(n) at the current time point is in a descending mode;
如果当前时间点的波动能量E(n)=0,则确定当前时间点的暂时状态St(n)为平稳模式。If the fluctuating energy E(n) at the current time point is equal to 0, it is determined that the temporary state St(n) at the current time point is a steady mode.
可选地,所述根据所述时间点的波动能量的绝对值和暂时状态确定所述时间点的稳定状态包括:Optionally, the determining the stable state at the time point according to the absolute value of the fluctuating energy at the time point and the temporary state includes:
如果当前时间点的波动能量的绝对值abs(E(n))大于等于设定的波动能量阈值,则将当前时间点的暂时状态St(n)作为当前时间点的稳定状态;If the absolute value of fluctuating energy abs(E(n)) at the current time point is greater than or equal to the set fluctuating energy threshold, then the temporary state St(n) at the current time point is taken as the stable state at the current time point;
如果当前时间点的波动能量的绝对值abs(E(n))小于所述波动能量阈值,并且当前时间点的暂时状态St(n)和前一时间点的暂时状态St(n-1)相同,则将上一个稳定状态作为当前时间点的稳定状态;If the absolute value abs(E(n)) of fluctuating energy at the current time point is less than the fluctuating energy threshold, and the temporary state St(n) at the current time point is the same as the temporary state St(n-1) at the previous time point , The last stable state is regarded as the stable state at the current time point;
如果当前时间点的波动能量的绝对值abs(E(n))小于所述波动能量阈值,并且当前时间点的暂时状态St(n)和前一时间点的暂时状态St(n-1)不同, 则利用动态观察窗口进行非稳定状态追踪,确定所述观察窗口内各时间点的稳定状态。If the absolute value abs(E(n)) of fluctuating energy at the current time point is less than the fluctuating energy threshold, and the temporary state St(n) at the current time point is different from the temporary state St(n-1) at the previous time point , The dynamic observation window is used to track the unstable state, and the stable state at each time point in the observation window is determined.
可选地,所述利用动态观察窗口进行非稳定状态追踪,确定当前时间点的稳定状态包括:Optionally, the use of the dynamic observation window to track the unstable state, and determining the stable state at the current time point includes:
开启动态观察窗口;Open the dynamic observation window;
记录所述观察窗口的长度并计算所述观察窗口内所有时间点的累积能量sum(E)和所述累积能量的绝对值abs(sum(E));Record the length of the observation window and calculate the cumulative energy sum(E) and the absolute value of the cumulative energy abs(sum(E)) at all time points in the observation window;
判断所述观察窗口是否满足终止条件;Determine whether the observation window meets the termination condition;
如果是,则终止所述观察窗口,并根据所述终止条件确定所述观察窗口内各时间点的稳定状态。If so, terminate the observation window, and determine the stable state at each time point in the observation window according to the termination condition.
可选地,所述终止条件包括以下任意一项:Optionally, the termination condition includes any one of the following:
所述观察窗口内出现特定时间点,所述特定时间点是指其波动能量的绝对值abs(E(i))大于等于所述波动能量阈值的时间点;A specific time point appears in the observation window, and the specific time point refers to a time point at which the absolute value of fluctuating energy abs(E(i)) is greater than or equal to the fluctuating energy threshold;
所述观察窗口达到设定的长度阈值w;The observation window reaches the set length threshold w;
所述观察窗口内所有时间点的累积能量的绝对值abs(sum(E))大于等于所述波动能量阈值;The absolute value abs(sum(E)) of the accumulated energy at all time points in the observation window is greater than or equal to the fluctuating energy threshold;
所述根据所述终止条件确定所述观察窗口内各时间点的稳定状态包括:The determining a stable state at each time point in the observation window according to the termination condition includes:
在所述观察窗口内出现所述特定时间点终止观察窗口的情况下:将所述观察窗口的终止点移到所述特定时间点的前一个时间点,得到更新后的观察窗口;如果更新后的观察窗口的长度大于设定的长度阈值w的一半,则将更新后的观察窗口内各时间点的稳定状态设置为上一个稳定状态,否则将更新后的观察窗口内各时间点的稳定状态设置为平稳模式;In the case where the observation window terminated at the specific time point appears in the observation window: move the termination point of the observation window to a time point before the specific time point to obtain an updated observation window; if updated The length of the observation window is greater than half of the set length threshold w, then the stable state at each time point in the updated observation window is set to the last stable state, otherwise the stable state at each time point in the updated observation window Set to steady mode;
在所述观察窗口达到设定的长度阈值w终止观察窗口的情况下:如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)>0,则将所述观察窗口内各时间点的稳定状态设置为上升模式;如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)<0,则将所述观察窗口内各时间点的稳定状态设置为下降 模式;如果所述累积能量的绝对值abs(sum(E))小于等于所述波动能量阈值,则将所述观察窗口内各时间点的稳定状态设置为平稳模式;When the observation window reaches the set length threshold w to terminate the observation window: if the absolute value of the cumulative energy abs(sum(E)) is greater than the fluctuating energy threshold, and the cumulative energy sum(E) >0, the stable state at each time point in the observation window is set to the rising mode; if the absolute value of the cumulative energy abs(sum(E)) is greater than the fluctuating energy threshold, and the cumulative energy sum( E)<0, the stable state at each time point in the observation window is set to the falling mode; if the absolute value of the cumulative energy abs(sum(E)) is less than or equal to the fluctuating energy threshold, the The stable state at each time point in the observation window is set to stable mode;
在所述观察窗口内所有时间点的累积能量的绝对值abs(sum(E))大于等于所述波动能量阈值终止观察窗口的情况下:如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)>0时,则将所述观察窗口内各时间点的稳定状态设置为上升模式;如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)<0,则将所述观察窗口内各时间点的稳定状态设置为下降模式。When the absolute value of the cumulative energy abs(sum(E)) at all time points in the observation window is greater than or equal to the fluctuating energy threshold to terminate the observation window: if the absolute value of the cumulative energy abs(sum(E) ) Is greater than the fluctuating energy threshold, and the cumulative energy sum(E)>0, then the stable state at each time point in the observation window is set to the rising mode; if the absolute value of the cumulative energy abs(sum (E)) is greater than the fluctuating energy threshold, and the accumulated energy sum(E)<0, then the stable state at each time point in the observation window is set to the falling mode.
可选地,所述获取时间序列数据包括:Optionally, the acquiring time series data includes:
对时序图进行采样,得到时间序列数据。Sampling the timing diagram to obtain time series data.
可选地,所述对时序图进行采样包括:Optionally, the sampling of the timing diagram includes:
对时序图进行周期性采样,或者对时序图进行非周期性采样。Perform periodic sampling on the timing diagram, or perform aperiodic sampling on the timing diagram.
可选地,所述方法还包括:Optionally, the method further includes:
展现所述时间序列数据中各时间点的状态模式。Show the state mode at each time point in the time series data.
一种时间序列数据处理装置,所述装置包括:A time series data processing device, the device comprising:
数据获取模块,用于获取时间序列数据,所述时间序列中的每个数据为一个时间点的值;A data acquisition module for acquiring time series data, where each data in the time series is a value at a time point;
波动能量计算模块,用于依次计算各时间点的波动能量E(n)=V(n)-V(n-1),其中,E(n)为当前时间点的波动能量,V(n)为当前时间点的值,V(n-1)为前一时间点的值;The fluctuating energy calculation module is used to sequentially calculate the fluctuating energy at each time point E(n)=V(n)-V(n-1), where E(n) is the fluctuating energy at the current time point, V(n) Is the value at the current time point, and V(n-1) is the value at the previous time point;
遍历模块,用于循环遍历所述时间序列中的每个时间点,根据各时间点的波动能量确定所述时间点的状态,所述状态包括:暂时状态和稳定状态;The traversal module is configured to traverse each time point in the time sequence in a loop, and determine the state of the time point according to the fluctuating energy at each time point, and the state includes: a temporary state and a stable state;
输出模块,用于将所述时间点的稳定状态作为所述时间点的状态模式;所述状态模式包括:平稳模式、上升模式、下降模式。The output module is configured to use the stable state at the time point as the state mode at the time point; the state mode includes: a steady mode, an ascending mode, and a descending mode.
可选地,所述遍历模块包括:Optionally, the traversal module includes:
暂时状态确定模块,用于循环遍历所述时间序列中的每个时间点,并根据所述时间点的波动能量确定所述时间点的暂时状态;A temporary state determining module, configured to loop through each time point in the time sequence, and determine the temporary state at the time point according to the fluctuating energy at the time point;
稳定状态确定模块,用于根据所述时间点的波动能量的绝对值和暂时状态确定所述时间点的稳定状态。The stable state determining module is used to determine the stable state at the time point according to the absolute value of the fluctuating energy at the time point and the temporary state.
可选地,所述暂时状态确定模块,具体用于在当前时间点的波动能量E(n)>0时,确定当前时间点的暂时状态St(n)为上升模式;在当前时间点的波动能量E(n)<0时,确定当前时间点的暂时状态St(n)为下降模式;在当前时间点的波动能量E(n)=0时,确定当前时间点的暂时状态St(n)为平稳模式。Optionally, the temporary state determination module is specifically configured to determine that the temporary state St(n) at the current time point is in the rising mode when the fluctuating energy E(n) at the current time point is in the rising mode; the fluctuation at the current time point When the energy E(n)<0, the temporary state St(n) at the current time point is determined to be a descending mode; when the fluctuating energy E(n) at the current time point is 0, the temporary state St(n) at the current time point is determined It is a steady mode.
可选地,所述稳定状态确定模块包括:Optionally, the stable state determination module includes:
判断单元,用于确定当前时间点的波动能量的绝对值abs(E(n))是否大于等于设定的波动能量阈值、以及当前时间点的暂时状态St(n)和前一时间点的暂时状态St(n-1)是否相同;The judging unit is used to determine whether the absolute value of fluctuating energy abs(E(n)) at the current time point is greater than or equal to the set fluctuating energy threshold, and the temporary state St(n) at the current time point and the temporary state at the previous time point Whether the state St(n-1) is the same;
第一稳态确定单元,用于在当前时间点的波动能量的绝对值abs(E(n))大于等于设定的波动能量阈值时,将当前时间点的暂时状态St(n)作为当前时间点的稳定状态;The first steady-state determination unit is used to use the temporary state St(n) at the current time point as the current time when the absolute value of the fluctuating energy abs(E(n)) at the current time point is greater than or equal to the set fluctuating energy threshold Point of steady state;
第二稳态确定单元,用于在当前时间点的波动能量的绝对值abs(E(n))小于所述波动能量阈值、并且当前时间点的暂时状态St(n)和前一时间点的暂时状态St(n-1)相同时,将上一个稳定状态作为当前时间点的稳定状态;The second steady-state determination unit is used for the absolute value abs(E(n)) of the fluctuating energy at the current time point is less than the fluctuating energy threshold, and the temporary state St(n) at the current time point and the previous time point When the temporary state St(n-1) is the same, the last stable state is taken as the stable state at the current time point;
第三稳态确定单元,用于在当前时间点的波动能量的绝对值abs(E(n))小于所述波动能量阈值、并且当前时间点的暂时状态St(n)和前一时间点的暂时状态St(n-1)不同时,利用动态观察窗口进行非稳定状态追踪,确定所述观察窗口内各时间点的稳定状态。The third steady state determination unit is used for the absolute value abs(E(n)) of the fluctuating energy at the current time point is less than the fluctuating energy threshold, and the temporary state St(n) at the current time point and the previous time point When the temporary state St(n-1) is different, the dynamic observation window is used to track the unstable state to determine the stable state at each time point in the observation window.
可选地,所述第三稳态确定单元,具体用于开启动态观察窗口,记录所述观察窗口的长度并计算所述观察窗口内所有时间点的累积能量sum(E)和所述累积能量的绝对值abs(sum(E)),在所述观察窗口满足终止条件后终止所述观察窗口,并根据所述终止条件确定所述观察窗口内各时间点的稳定状态。Optionally, the third steady-state determination unit is specifically configured to open a dynamic observation window, record the length of the observation window, and calculate the cumulative energy sum(E) and the cumulative energy at all time points in the observation window The absolute value of abs(sum(E)), terminates the observation window after the observation window meets the termination condition, and determines the stable state at each time point in the observation window according to the termination condition.
可选地,所述终止条件包括以下任意一项:Optionally, the termination condition includes any one of the following:
所述观察窗口内出现特定时间点,所述特定时间点是指其波动能量的 绝对值abs(E(i))大于等于所述波动能量阈值的时间点;A specific time point appears in the observation window, and the specific time point refers to a time point at which the absolute value of fluctuating energy abs(E(i)) is greater than or equal to the fluctuating energy threshold;
所述观察窗口达到设定的长度阈值w;The observation window reaches the set length threshold w;
所述观察窗口内所有时间点的累积能量的绝对值abs(sum(E))大于等于所述波动能量阈值;The absolute value abs(sum(E)) of the accumulated energy at all time points in the observation window is greater than or equal to the fluctuating energy threshold;
所述第三稳态确定单元按以下方式确定所述观察窗口内各时间点的稳定状态:The third steady state determination unit determines the steady state at each time point in the observation window in the following manner:
在所述观察窗口内出现所述特定时间点终止观察窗口的情况下:将所述观察窗口的终止点移到所述特定时间点的前一个时间点,得到更新后的观察窗口;如果更新后的观察窗口的长度大于设定的长度阈值w的一半,则将更新后的观察窗口内各时间点的稳定状态设置为上一个稳定状态,否则将更新后的观察窗口内各时间点的稳定状态设置为平稳模式;In the case where the observation window terminated at the specific time point appears in the observation window: move the termination point of the observation window to a time point before the specific time point to obtain an updated observation window; if updated The length of the observation window is greater than half of the set length threshold w, then the stable state at each time point in the updated observation window is set to the last stable state, otherwise the stable state at each time point in the updated observation window Set to steady mode;
在所述观察窗口达到设定的长度阈值w终止观察窗口的情况下:如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)>0,则将所述观察窗口内各时间点的稳定状态设置为上升模式;如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)<0,则将所述观察窗口内各时间点的稳定状态设置为下降模式;如果所述累积能量的绝对值abs(sum(E))小于等于所述波动能量阈值,则将所述观察窗口内各时间点的稳定状态设置为平稳模式;When the observation window reaches the set length threshold w to terminate the observation window: if the absolute value of the cumulative energy abs(sum(E)) is greater than the fluctuating energy threshold, and the cumulative energy sum(E) >0, the stable state at each time point in the observation window is set to the rising mode; if the absolute value of the cumulative energy abs(sum(E)) is greater than the fluctuating energy threshold, and the cumulative energy sum( E)<0, the stable state at each time point in the observation window is set to the falling mode; if the absolute value of the cumulative energy abs(sum(E)) is less than or equal to the fluctuating energy threshold, the The stable state at each time point in the observation window is set to stable mode;
在所述观察窗口内所有时间点的累积能量的绝对值abs(sum(E))大于等于所述波动能量阈值终止观察窗口的情况下:如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)>0时,则将所述观察窗口内各时间点的稳定状态设置为上升模式;如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)<0,则将所述观察窗口内各时间点的稳定状态设置为下降模式。When the absolute value of the cumulative energy abs(sum(E)) at all time points in the observation window is greater than or equal to the fluctuating energy threshold to terminate the observation window: if the absolute value of the cumulative energy abs(sum(E) ) Is greater than the fluctuating energy threshold, and the cumulative energy sum(E)>0, then the stable state at each time point in the observation window is set to the rising mode; if the absolute value of the cumulative energy abs(sum (E)) is greater than the fluctuating energy threshold, and the accumulated energy sum(E)<0, then the stable state at each time point in the observation window is set to the falling mode.
可选地,所述数据获取模块,具体用于对时序图进行采样,得到时间序列数据。Optionally, the data acquisition module is specifically configured to sample the time sequence diagram to obtain time series data.
可选地,所述数据获取模块对时序图进行采样包括:对时序图进行周期性采样,或者对时序图进行非周期性采样。Optionally, the data acquisition module sampling the timing diagram includes: periodically sampling the timing diagram, or non-periodically sampling the timing diagram.
可选地,所述装置还包括:Optionally, the device further includes:
展现模块,用于展现所述时间序列数据中各时间点的状态模式。The display module is used to display the state mode of each time point in the time series data.
一种电子设备,包括:一个或多个处理器、存储器;An electronic device, including: one or more processors and memories;
所述存储器用于存储计算机可执行指令,所述处理器用于执行所述计算机可执行指令,以实现前面所述的方法。The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the aforementioned method.
一种可读存储介质,其上存储有指令,所述指令被执行以实现前面所述的方法。A readable storage medium having instructions stored thereon, and the instructions are executed to implement the aforementioned method.
本发明实施例提供的时间序列数据处理方法及装置,针对时间序列数据,计算计算各时间点的波动能量,利用各时间点的波动能量,通过循环遍历所述时间序列中的每个时间点的方式确定各时间点的状态模式。The time series data processing method and device provided by the embodiments of the present invention calculate and calculate the fluctuation energy at each time point for the time series data, and use the fluctuation energy at each time point to loop through the time series at each time point. The method determines the state mode at each time point.
进一步地,提出稳定状态与非稳定状态的划分,在遍历过程中,首先根据各时间点的波动能量确定所述时间点的暂时状态;然后根据所述时间点的波动能量的绝对值和暂时状态确定所述时间点的稳定状态,即可得到各时间点的状态模式。Further, the division of steady state and non-steady state is proposed. In the traversal process, first determine the temporary state of the time point according to the fluctuating energy at each time point; then according to the absolute value of the fluctuating energy and the temporary state of the time point By determining the stable state at the time point, the state mode at each time point can be obtained.
进一步地,在当前时间点的波动能量较小时,如果当前时间点的暂时状态和前一时间点的暂时状态不同,则利用动态观察窗口进行非稳定状态追踪,确定观察窗口内各时间点的稳定状态,也就是说,在无法仅根据当前时间点的波动能量及其前一时间点的暂时状态确定当前时间点的状态模式的情况下,考虑当前时间点之后的一个或多个时间点的暂时状态情况来最终确定当前时间点的状态模式,从而可以使各时间点的状态模式的确定结果更准确,而且可以准确地对暂时状态的延续进行有效划分,减少由于能量方向的短暂改变对具有长时间持续性的状态模式的不当切分。另外,通过非稳定状态追踪可以准确地判断一定长度或时间的能量累积变化对当前时间点的影响,提高了状态模式判断的准确性。Further, when the fluctuating energy at the current time point is small, if the temporary state at the current time point is different from the temporary state at the previous time point, the dynamic observation window is used to track the unstable state to determine the stability of each time point in the observation window State, that is to say, when it is impossible to determine the state pattern at the current time point only based on the fluctuating energy at the current time point and the temporary state at the previous time point, consider the temporary status at one or more time points after the current time point. The state condition can finally determine the state mode at the current time point, so that the determination result of the state mode at each time point can be more accurate, and the continuation of the temporary state can be accurately divided effectively, reducing the impact of the short-term change of the energy direction. Improper segmentation of time-continuous state patterns. In addition, the non-steady state tracking can accurately determine the impact of a certain length or time of energy accumulation changes on the current point in time, which improves the accuracy of state mode judgment.
附图说明Description of the drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附 图仅仅是本发明中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings in the following description are only those described in the present invention. For some of the embodiments, for those of ordinary skill in the art, other drawings may be obtained based on these drawings.
图1是本发明实施例时间序列数据处理方法的一种流程图;Fig. 1 is a flowchart of a time series data processing method according to an embodiment of the present invention;
图2是本发明实施例中利用动态观察窗口进行非稳定状态追踪的流程图;FIG. 2 is a flow chart of using a dynamic observation window to track unstable states in an embodiment of the present invention;
图3是本发明实施例时间序列数据处理装置的一种结构框图;3 is a structural block diagram of a time series data processing device according to an embodiment of the present invention;
图4是本发明实施例时间序列数据处理装置的另一种结构框图。Fig. 4 is another structural block diagram of a time series data processing device according to an embodiment of the present invention.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本发明实施例的方案,下面结合附图和实施方式对本发明实施例作进一步的详细说明。In order to enable those skilled in the art to better understand the solutions of the embodiments of the present invention, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and implementation manners.
本发明实施例提供一种时间序列数据处理方法及装置,通过计算时间序列数据中各时间点的波动能量,利用各时间点的波动能量,循环遍历所述时间序列中的每个时间点,根据各时间点的波动能量确定所述时间点的状态,所述状态包括:暂时状态和稳定状态;将所述时间点的稳定状态作为所述时间点的状态模式。The embodiment of the present invention provides a time series data processing method and device. By calculating the fluctuating energy at each time point in the time series data, using the fluctuating energy at each time point to cycle through each time point in the time series, according to The fluctuating energy at each time point determines the state at the time point, and the state includes: a temporary state and a stable state; and the stable state at the time point is taken as the state mode at the time point.
如图1所示,是本发明实施例时间序列数据处理方法的一种流程图,包括以下步骤:As shown in FIG. 1, it is a flowchart of a time series data processing method according to an embodiment of the present invention, which includes the following steps:
步骤101,获取时间序列数据,所述时间序列中的每个数据为一个时间点的值。Step 101: Obtain time series data, where each data in the time series is a value at a time point.
在本发明实施例中,所述时间序列数据可以是针对任意波形即时序图的采样数据,可以是周期性采样、也可以是非周期性采样,对此本发明实施例不做限定。In the embodiment of the present invention, the time series data may be sampling data for an arbitrary waveform, that is, a timing diagram, and may be periodic sampling or aperiodic sampling, which is not limited in the embodiment of the present invention.
所述时间序列数据中数据以时间或索引升序排序。The data in the time series data is sorted in ascending order of time or index.
步骤102,依次计算各时间点的波动能量E(n)=V(n)-V(n-1)。Step 102: Calculate the fluctuation energy E(n)=V(n)-V(n-1) at each time point in sequence.
其中,E(n)为当前时间点的波动能量,V(n)为当前时间点的值,V(n-1)为前一时间点的值。Among them, E(n) is the fluctuating energy at the current time point, V(n) is the value at the current time point, and V(n-1) is the value at the previous time point.
对于所述时间序列数据中的第一个时间点,可以将其波动能量设置为 0,即E(1)=0。For the first time point in the time series data, the fluctuation energy can be set to 0, that is, E(1)=0.
步骤103,循环遍历所述时间序列中的每个时间点,根据各时间点的波动能量确定所述时间点的状态,所述状态包括:暂时状态和稳定状态。Step 103: Loop through each time point in the time sequence, and determine the state of the time point according to the fluctuating energy at each time point, and the state includes: a temporary state and a stable state.
由于所述波动能量仅仅反映了当前时间点与前一时间点相比的变化情况,只是一个相对状态,而非最终状态,每个时间点的最终状态不仅与其前一时间点的状态相关,而且还可能与其后的一个或多个时间点的状态相关。因此,在本发明实施例中,可以先根据各时间点的波动能量,确定该时间点的暂时状态,然后再根据所述时间点的波动能量的绝对值和暂时状态确定通过循环遍历的方式确定所述时间点的稳定状态。为了描述方便,后续将波动能量的绝对值记为abs(E)。Since the fluctuating energy only reflects the change between the current time point and the previous time point, it is only a relative state, not a final state. The final state of each time point is not only related to the state of the previous time point, but also It may also be related to the state at one or more subsequent points in time. Therefore, in the embodiment of the present invention, the temporary state at that time can be determined according to the fluctuating energy at each time point, and then the absolute value and the temporary state of the fluctuating energy at the time point can be determined by loop traversal. The steady state at that point in time. For the convenience of description, the absolute value of fluctuating energy will be recorded as abs(E) later.
所述暂时状态表示当前时间点的状态模式还没有最终确定,会受其后一个或多个时间点的状态模式的影响;所述稳定状态表示该时间点的状态模式已经稳定并且不受之后时间点的状态变化的影响。在本发明实施例中,可以将各时间点的状态模式分别三种,分别为:平稳模式、上升模式、下降模式。另外,在实际应用中,有些应用只需区分序列中数据的走向是否平稳,因此,根据应用需求的不同,也可以将所述状态模式划分为平稳模式和波动模式。当然还可以有更多不同粒度的划分,对此本发明实施例不做限定。The temporary state indicates that the state mode at the current time point has not been finalized, and will be affected by the state mode at one or more subsequent time points; the stable state indicates that the state mode at the time point has stabilized and is not affected by the subsequent time. The impact of changes in the state of the point. In the embodiment of the present invention, there can be three state modes at each time point, namely: a steady mode, an ascending mode, and a descending mode. In addition, in practical applications, some applications only need to distinguish whether the trend of the data in the sequence is stable. Therefore, according to different application requirements, the state mode can also be divided into a stable mode and a fluctuating mode. Of course, there may be more divisions with different granularities, which is not limited in the embodiment of the present invention.
下面以状态模式包括平稳模式、上升模式、下降模式为例进行说明。为了描述方便,分别用0、1、2表示上述三种状态模式。The following takes the status mode including steady mode, rising mode, and falling mode as examples for description. For the convenience of description, use 0, 1, and 2 to represent the above three state modes.
相应地,所述暂时状态和稳定状态也分别包括上述三种状态模式,为了描述方便,将所述暂时状态记为St,将所述稳定状态记为S。Correspondingly, the temporary state and the stable state also respectively include the above three state modes. For the convenience of description, the temporary state is denoted as St and the stable state is denoted as S.
在确定各时间点的暂时状态时,可以根据以下原则:When determining the temporary state at each point in time, the following principles can be used:
如果当前时间点的波动能量E(n)>0,则确定当前时间点的暂时状态St(n)为上升模式,记为St(n)=1;If the fluctuating energy E(n)>0 at the current time point, the temporary state St(n) at the current time point is determined to be in the rising mode, denoted as St(n)=1;
如果当前时间点的波动能量E(n)<0,则确定当前时间点的暂时状态St(n)为下降模式,记为St(n)=2;If the fluctuating energy E(n) at the current time point is less than 0, it is determined that the temporary state St(n) at the current time point is in a descending mode, which is recorded as St(n)=2;
如果当前时间点的波动能量E(n)=0,则确定当前时间点的暂时状态 St(n)为平稳模式,记为St(n)=0。If the fluctuating energy E(n)=0 at the current time point, then the temporary state St(n) at the current time point is determined to be a steady mode, which is recorded as St(n)=0.
需要说明的是,对于所述时间序列数据中的第一个时间点,可以将其暂时状态设置为平稳模式,即St(1)=0。It should be noted that, for the first time point in the time series data, its temporary state can be set to a stationary mode, that is, St(1)=0.
在确定各时间点的稳定状态时,可以根据以下原则:When determining the stable state at each time point, the following principles can be used:
如果当前时间点的波动能量的绝对值abs(E(n))大于等于设定的波动能量阈值e,即abs(E(n))>=e,则将当前时间点的暂时状态St(n)作为当前时间点的稳定状态,也就是说,当前时间点的暂时状态成为稳定状态;If the absolute value abs(E(n)) of the fluctuating energy at the current time point is greater than or equal to the set fluctuating energy threshold e, that is, abs(E(n))>=e, then the temporary state St(n) at the current time point ) As the stable state at the current time point, that is, the temporary state at the current time point becomes a stable state;
如果当前时间点的波动能量的绝对值abs(E(n))小于所述波动能量阈值e,并且当前时间点的暂时状态St(n)和前一时间点的暂时状态St(n-1)相同,即abs(E(n))<e并且St(n)=St(n-1),则将上一个稳定状态(记为Sp)作为当前时间点的稳定状态,也就是说,当前时间点的稳定状态继承上一个稳定状态Sp;需要说明的是,所述上一个稳定状态是指当前时间点之前最近的一个稳定状态,而非前一个时间点的稳定状态;If the absolute value abs(E(n)) of the fluctuating energy at the current time point is less than the fluctuating energy threshold e, and the temporary state St(n) at the current time point and the temporary state St(n-1) at the previous time point Same, that is, abs(E(n))<e and St(n)=St(n-1), then the last stable state (denoted as Sp) is taken as the stable state at the current time point, that is, the current time The stable state of the point inherits the last stable state Sp; it should be noted that the last stable state refers to the last stable state before the current point in time, not the stable state at the previous point in time;
如果当前时间点的波动能量的绝对值abs(E(n))小于所述波动能量阈值e,并且当前时间点的暂时状态St(n)和前一时间点的暂时状态St(n-1)不同,即abs(E(n))<e并且St(n)!=St(n-1),则利用动态观察窗口进行非稳定状态追踪,确定所述观察窗口内各时间点的稳定状态。If the absolute value abs(E(n)) of the fluctuating energy at the current time point is less than the fluctuating energy threshold e, and the temporary state St(n) at the current time point and the temporary state St(n-1) at the previous time point Different, namely abs(E(n))<e and St(n)! = St(n-1), then use the dynamic observation window to track the unstable state, and determine the stable state at each time point in the observation window.
利用动态观察窗口进行非稳定状态追踪的过程将在后面详细说明。The process of using the dynamic observation window to track the unstable state will be described in detail later.
步骤104,将所述时间点的稳定状态作为所述时间点的状态模式;所述状态模式包括:平稳模式、上升模式、下降模式。Step 104: Use the stable state at the time point as the state mode at the time point; the state mode includes: a steady mode, an ascending mode, and a descending mode.
在前面提到,所述稳定状态表示该时间点的状态模式已经稳定并且不受之后时间点的状态变化的影响,因此,在确定了每个时间点的稳定状态后,即可将各时间点的稳定状态输出。当然,也可以每确定一个时间点的稳定状态,即输出该时间点的状态模式,对此本发明实施例不做限定。As mentioned earlier, the stable state means that the state mode at that time point has been stabilized and is not affected by the state changes at subsequent time points. Therefore, after the stable state at each time point is determined, each time point can be changed The steady state output. Of course, it is also possible to determine the stable state at a time point every time, that is, to output the state mode at that time point, which is not limited in the embodiment of the present invention.
不同的状态模式,可以采用不同的标记来表示,比如前面提到的采用数字0、1、2分别表示平稳模式、上升模式、下降模式。相应地,在输出时,可以以状态模式序列或者表格等形式输出各时间点对应的状态模式。进一步地,为了使数据的变化看起来更直观,也可以以波形图的方式展现 所述时间序列数据中各时间点的状态模式,其中不同的状态模式可以采用不同的表现形式来展现,比如利用不同颜色或形状等来代表数据点的不同状态模式。Different status modes can be represented by different marks. For example, the numbers 0, 1, and 2 mentioned above represent steady mode, rising mode, and falling mode respectively. Correspondingly, when outputting, the state mode corresponding to each time point can be output in the form of a state mode sequence or a table. Further, in order to make the changes of the data look more intuitive, the state mode of each time point in the time series data can also be displayed in the form of a waveform diagram, wherein different state modes can be displayed in different forms, such as using Different colors or shapes represent different state modes of data points.
如图2所示,是本发明实施例中利用动态观察窗口进行非稳定状态追踪的流程图,包括以下步骤:As shown in Fig. 2, it is a flow chart of using a dynamic observation window to track an unstable state in an embodiment of the present invention, which includes the following steps:
步骤201,开启动态观察窗口。Step 201: Open the dynamic observation window.
所述动态观察窗口是指该观察窗口是动态变化的,即从开启动态观察窗口的当前时间点依次向后延伸,每次增加一个后续时间点。而且观察窗口内每增加一个后续时间点,都需要重新执行下面的步骤202。The dynamic observation window refers to that the observation window is dynamically changing, that is, it extends backward in sequence from the current time point when the dynamic observation window is opened, adding a subsequent time point each time. Moreover, each time a subsequent time point is added in the observation window, the following step 202 needs to be executed again.
步骤202,记录所述观察窗口的长度并计算所述观察窗口内所有时间点的累积能量sum(E)和所述累积能量的绝对值abs(sum(E))。Step 202: Record the length of the observation window and calculate the cumulative energy sum(E) and the absolute value of the cumulative energy abs(sum(E)) at all time points in the observation window.
步骤203,判断所述观察窗口是否满足终止条件;如果是,则执行步骤204;否则,返回步骤202。Step 203: Determine whether the observation window meets the termination condition; if so, perform step 204; otherwise, return to step 202.
由于时间序列数据变化的不确定性,因此,可以针对不同的变化特点,设定不同的终止条件。在本发明实施例中,所述终止条件可以包括以下任意一项:Due to the uncertainty of time series data changes, different termination conditions can be set for different changes characteristics. In the embodiment of the present invention, the termination condition may include any one of the following:
(1)所述观察窗口内出现特定时间点,所述特定时间点是指其波动能量的绝对值abs(E(i))大于等于所述波动能量阈值的时间点;(1) A specific time point appears in the observation window, and the specific time point refers to a time point at which the absolute value of fluctuating energy abs(E(i)) is greater than or equal to the fluctuating energy threshold;
(2)所述观察窗口达到设定的长度阈值w;(2) The observation window reaches the set length threshold w;
(3)所述观察窗口内所有时间点的累积能量的绝对值abs(sum(E))大于等于所述波动能量阈值。(3) The absolute value abs(sum(E)) of the accumulated energy at all time points in the observation window is greater than or equal to the fluctuating energy threshold.
也就是说,只要满足上述任意一项条件,立即终止所述观察窗口。That is, as long as any one of the above conditions is met, the observation window is immediately terminated.
步骤204,终止所述观察窗口,并根据所述终止条件确定所述观察窗口内各时间点的稳定状态。Step 204: Terminate the observation window, and determine a stable state at each time point in the observation window according to the termination condition.
由于满足不同终止条件下观察窗口内的时间点会有不同的变化特点,因此,在确定所述观察窗口内的时间点的稳定状态时也需要依据其特点来确定,以保证最终确定的各时间点的状态模式的准确性。Since the time points in the observation window will have different characteristics under different termination conditions, it is necessary to determine the stable state of the time points in the observation window according to its characteristics to ensure the final determination of each time The accuracy of the point's state pattern.
与上述各终止条件相对应,具体可以有以下几种情况:Corresponding to the above termination conditions, there can be the following specific situations:
1)在所述观察窗口内出现所述特定时间点终止观察窗口的情况下:将所述观察窗口的终止点移到所述特定时间点的前一个时间点,得到更新后的观察窗口;如果更新后的观察窗口的长度大于设定的长度阈值w的一半,则将更新后的观察窗口内各时间点的稳定状态设置为上一个稳定状态Sp,否则将更新后的观察窗口内各时间点的稳定状态设置为平稳模式;1) In the case where the observation window is terminated at the specified time point in the observation window: move the termination point of the observation window to a time point before the specified time point to obtain the updated observation window; if The length of the updated observation window is greater than half of the set length threshold w, then the stable state of each time point in the updated observation window is set to the last stable state Sp, otherwise the time point in the updated observation window is set The steady state is set to steady mode;
2)在所述观察窗口达到设定的长度阈值w终止观察窗口的情况下:如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,即abs(sum(E))>e,并且所述累积能量sum(E)>0,则将所述观察窗口内各时间点的稳定状态设置为上升模式;如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,即abs(sum(E))>e,并且所述累积能量sum(E)<0,则将所述观察窗口内各时间点的稳定状态设置为下降模式;如果所述累积能量的绝对值abs(sum(E))小于等于所述波动能量阈值,即abs(sum(E))<=e,则将所述观察窗口内各时间点的稳定状态设置为平稳模式;2) When the observation window reaches the set length threshold w to terminate the observation window: if the absolute value of the cumulative energy abs(sum(E)) is greater than the fluctuating energy threshold, that is, abs(sum(E) )>e, and the accumulated energy sum(E)>0, set the stable state at each time point in the observation window to the rising mode; if the absolute value of the accumulated energy abs(sum(E)) is greater than If the fluctuating energy threshold is abs(sum(E))>e, and the accumulated energy sum(E)<0, then the stable state at each time point in the observation window is set to the falling mode; if the The absolute value of the accumulated energy abs(sum(E)) is less than or equal to the fluctuating energy threshold, that is, abs(sum(E))<=e, then the stable state at each time point in the observation window is set to the stable mode;
3)在所述观察窗口内所有时间点的累积能量的绝对值abs(sum(E))大于等于所述波动能量阈值终止观察窗口的情况下:如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,即abs(sum(E))>e,并且所述累积能量sum(E)>0时,则将所述观察窗口内各时间点的稳定状态设置为上升模式;如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)<0,则将所述观察窗口内各时间点的稳定状态设置为下降模式。3) In the case where the absolute value of the cumulative energy abs(sum(E)) at all time points in the observation window is greater than or equal to the fluctuating energy threshold to terminate the observation window: if the absolute value of the cumulative energy abs(sum( E)) is greater than the fluctuating energy threshold, that is, abs(sum(E))>e, and the accumulated energy sum(E)>0, then the stable state at each time point in the observation window is set to rise Mode; if the absolute value of the cumulative energy abs(sum(E)) is greater than the fluctuating energy threshold, and the cumulative energy sum(E)<0, set the stable state at each time point in the observation window It is down mode.
本发明实施例提供的时间序列数据处理方法,针对时间序列数据,计算计算各时间点的波动能量,利用各时间点的波动能量,通过循环遍历所述时间序列中的每个时间点的方式确定各时间点的状态模式。进一步地,提出稳定状态与非稳定状态的划分,在遍历过程中,首先根据各时间点的波动能量确定所述时间点的暂时状态;然后根据所述时间点的波动能量的绝对值和暂时状态确定所述时间点的稳定状态,即可得到各时间点的状态模式。The time series data processing method provided by the embodiment of the present invention calculates the fluctuation energy at each time point for time series data, and uses the fluctuation energy at each time point to determine by looping through each time point in the time series State mode at each point in time. Further, the division of steady state and non-steady state is proposed. In the traversal process, first determine the temporary state of the time point according to the fluctuating energy at each time point; then according to the absolute value of the fluctuating energy and the temporary state of the time point By determining the stable state at the time point, the state mode at each time point can be obtained.
进一步地,在当前时间点的波动能量较小时,如果当前时间点的暂时 状态和前一时间点的暂时状态不同,则利用动态观察窗口进行非稳定状态追踪,确定观察窗口内各时间点的稳定状态,也就是说,在无法仅根据当前时间点的波动能量及其前一时间点的暂时状态确定当前时间点的状态模式的情况下,考虑当前时间点之后的一个或多个时间点的暂时状态情况来最终确定当前时间点的状态模式,从而可以使各时间点的状态模式的确定结果更准确,而且可以准确地对暂时状态的延续进行有效划分,减少由于能量方向的短暂改变对具有长时间持续性的状态模式的不当切分。另外,通过非稳定状态追踪可以准确地判断一定长度或时间的能量累积变化对当前时间点的影响,提高了状态模式判断的准确性。Further, when the fluctuating energy at the current time point is small, if the temporary state at the current time point is different from the temporary state at the previous time point, the dynamic observation window is used to track the unstable state to determine the stability of each time point in the observation window State, that is to say, when it is impossible to determine the state pattern at the current time point only based on the fluctuating energy at the current time point and the temporary state at the previous time point, consider the temporary status at one or more time points after the current time point. The state condition can finally determine the state mode at the current time point, so that the determination result of the state mode at each time point can be more accurate, and the continuation of the temporary state can be accurately divided effectively, reducing the impact of the short-term change of the energy direction. Improper segmentation of time-continuous state patterns. In addition, the non-steady state tracking can accurately determine the impact of a certain length or time of energy accumulation changes on the current point in time, which improves the accuracy of state mode judgment.
相应地,本发明实施例还提供一种时间序列数据处理装置,如图3所示,是该装置的一种结构框图。Correspondingly, the embodiment of the present invention also provides a time series data processing device, as shown in FIG. 3, which is a structural block diagram of the device.
在该实施例中,所述装置包括以下各模块:In this embodiment, the device includes the following modules:
数据获取模块301,用于获取时间序列数据,所述时间序列中的每个数据为一个时间点的值;比如,对时序图进行周期性或非周期性采样,得到时间序列数据,或者由用户提供的依时间采样数据等;The data acquisition module 301 is used to acquire time series data. Each data in the time series is a value at a time point; for example, the time series diagram is sampled periodically or non-periodically to obtain the time series data, or the user Sampling data provided by time, etc.;
波动能量计算模块302,用于依次计算各时间点的波动能量E(n)=V(n)-V(n-1),其中,E(n)为当前时间点的波动能量,V(n)为当前时间点的值,V(n-1)为前一时间点的值;The fluctuating energy calculation module 302 is used to sequentially calculate the fluctuating energy E(n)=V(n)-V(n-1) at each time point, where E(n) is the fluctuating energy at the current time point, and V(n) ) Is the value at the current time point, and V(n-1) is the value at the previous time point;
遍历模块303,用于循环遍历所述时间序列中的每个时间点,根据各时间点的波动能量确定所述时间点的状态,所述状态包括:暂时状态和稳定状态;The traversal module 303 is configured to loop through each time point in the time sequence, and determine the state of the time point according to the fluctuating energy at each time point, and the state includes: a temporary state and a stable state;
输出模块304,用于将所述时间点的稳定状态作为所述时间点的状态模式;所述状态模式包括:平稳模式、上升模式、下降模式。The output module 304 is configured to use the stable state at the time point as the state mode at the time point; the state mode includes: a steady mode, an ascending mode, and a descending mode.
由于所述波动能量仅仅反映了当前时间点与前一时间点相比的变化情况,只是一个相对状态,而非最终状态,每个时间点的最终状态不仅与其前一时间点的状态相关,而且还可能与其后的一个或多个时间点的状态相关。因此,在本发明实施例中,可以先根据各时间点的波动能量,确定该时间点的暂时状态,然后再根据所述时间点的波动能量的绝对值和暂时状 态确定通过循环遍历的方式确定所述时间点的稳定状态。相应地,上述遍历模块可以包括:暂时状态确定模块和稳定状态确定模块;其中:Since the fluctuating energy only reflects the change between the current time point and the previous time point, it is only a relative state, not a final state. The final state of each time point is not only related to the state of the previous time point, but also It may also be related to the state at one or more subsequent points in time. Therefore, in the embodiment of the present invention, the temporary state at that time can be determined according to the fluctuating energy at each time point, and then the absolute value and the temporary state of the fluctuating energy at the time point can be determined by loop traversal. The steady state at that point in time. Correspondingly, the aforementioned traversal module may include: a temporary state determination module and a stable state determination module; wherein:
所述暂时状态确定模块用于循环遍历所述时间序列中的每个时间点,并根据所述时间点的波动能量确定所述时间点的暂时状态;The temporary state determining module is configured to loop through each time point in the time sequence, and determine the temporary state at the time point according to the fluctuating energy at the time point;
所述稳定状态确定模块用于根据所述时间点的波动能量的绝对值和暂时状态确定所述时间点的稳定状态。The stable state determining module is configured to determine the stable state at the time point according to the absolute value of the fluctuating energy at the time point and the temporary state.
上述暂时状态确定模块具体可以按照以下原则确定各时间点的暂时状态:在当前时间点的波动能量E(n)>0时,确定当前时间点的暂时状态St(n)为上升模式;在当前时间点的波动能量E(n)<0时,确定当前时间点的暂时状态St(n)为下降模式;在当前时间点的波动能量E(n)=0时,确定当前时间点的暂时状态St(n)为平稳模式。另外,对于所述时间序列数据中的第一个时间点,可以将其暂时状态设置为平稳模式,即St(1)=0。The above-mentioned temporary state determination module can specifically determine the temporary state at each time point according to the following principles: when the fluctuating energy at the current time point E(n)>0, determine that the temporary state St(n) at the current time point is in the rising mode; When the fluctuating energy E(n)<0 at the time point, the temporary state St(n) at the current time point is determined to be a descending mode; when the fluctuating energy E(n) at the current time point is 0, the temporary state at the current time point is determined St(n) is the stationary mode. In addition, for the first time point in the time series data, its temporary state can be set to a stationary mode, that is, St(1)=0.
上述稳定状态确定模块具体可以包括以下各单元:The aforementioned stable state determination module may specifically include the following units:
判断单元,用于确定当前时间点的波动能量的绝对值abs(E(n))是否大于等于设定的波动能量阈值、以及当前时间点的暂时状态St(n)和前一时间点的暂时状态St(n-1)是否相同;The judging unit is used to determine whether the absolute value of fluctuating energy abs(E(n)) at the current time point is greater than or equal to the set fluctuating energy threshold, and the temporary state St(n) at the current time point and the temporary state at the previous time point Whether the state St(n-1) is the same;
第一稳态确定单元,用于在当前时间点的波动能量的绝对值abs(E(n))大于等于设定的波动能量阈值时,将当前时间点的暂时状态St(n)作为当前时间点的稳定状态;The first steady-state determination unit is used to use the temporary state St(n) at the current time point as the current time when the absolute value of the fluctuating energy abs(E(n)) at the current time point is greater than or equal to the set fluctuating energy threshold Point of steady state;
第二稳态确定单元,用于在当前时间点的波动能量的绝对值abs(E(n))小于所述波动能量阈值、并且当前时间点的暂时状态St(n)和前一时间点的暂时状态St(n-1)相同时,将上一个稳定状态作为当前时间点的稳定状态;The second steady-state determination unit is used for the absolute value abs(E(n)) of the fluctuating energy at the current time point is less than the fluctuating energy threshold, and the temporary state St(n) at the current time point and the previous time point When the temporary state St(n-1) is the same, the last stable state is taken as the stable state at the current time point;
第三稳态确定单元,用于在当前时间点的波动能量的绝对值abs(E(n))小于所述波动能量阈值、并且当前时间点的暂时状态St(n)和前一时间点的暂时状态St(n-1)不同时,利用动态观察窗口进行非稳定状态追踪,确定所述观察窗口内各时间点的稳定状态。The third steady state determination unit is used for the absolute value abs(E(n)) of the fluctuating energy at the current time point is less than the fluctuating energy threshold, and the temporary state St(n) at the current time point and the previous time point When the temporary state St(n-1) is different, the dynamic observation window is used to track the unstable state to determine the stable state at each time point in the observation window.
所述第三稳态确定单元具体用于开启动态观察窗口,记录所述观察窗口的长度并计算所述观察窗口内所有时间点的累积能量sum(E)和所述累积 能量的绝对值abs(sum(E)),在所述观察窗口满足终止条件后终止所述观察窗口,并根据所述终止条件确定所述观察窗口内各时间点的稳定状态。The third steady-state determination unit is specifically configured to open a dynamic observation window, record the length of the observation window, and calculate the cumulative energy sum(E) at all time points in the observation window and the absolute value of the cumulative energy abs( sum(E)), terminate the observation window after the observation window meets a termination condition, and determine the stable state at each time point in the observation window according to the termination condition.
其中,所述终止条件及根据所述终止条件确定所述观察窗口内各时间点的稳定状态的方式可参见前面本发明方法实施例中的描述,在此不再赘述。For the termination condition and the manner of determining the stable state at each time point in the observation window according to the termination condition, please refer to the description in the foregoing method embodiment of the present invention, which will not be repeated here.
本发明实施例提供的时间序列数据处理装置,针对时间序列数据,计算计算各时间点的波动能量,利用各时间点的波动能量,通过循环遍历所述时间序列中的每个时间点的方式确定各时间点的状态模式。进一步地,提出稳定状态与非稳定状态的划分,在遍历过程中,首先根据各时间点的波动能量确定所述时间点的暂时状态;然后根据所述时间点的波动能量的绝对值和暂时状态确定所述时间点的稳定状态,即可得到各时间点的状态模式。The time series data processing device provided by the embodiment of the present invention calculates and calculates the fluctuating energy at each time point for time series data, and uses the fluctuating energy at each time point to determine by looping through each time point in the time series State mode at each point in time. Further, the division of steady state and non-steady state is proposed. In the traversal process, first determine the temporary state of the time point according to the fluctuating energy at each time point; then according to the absolute value of the fluctuating energy and the temporary state of the time point By determining the stable state at the time point, the state mode at each time point can be obtained.
进一步地,在当前时间点的波动能量较小时,如果当前时间点的暂时状态和前一时间点的暂时状态不同,则利用动态观察窗口进行非稳定状态追踪,确定观察窗口内各时间点的稳定状态,也就是说,在无法仅根据当前时间点的波动能量及其前一时间点的暂时状态确定当前时间点的状态模式的情况下,考虑当前时间点之后的一个或多个时间点的暂时状态情况来最终确定当前时间点的状态模式,从而可以使各时间点的状态模式的确定结果更准确,而且可以准确地对暂时状态的延续进行有效划分,减少由于能量方向的短暂改变对具有长时间持续性的状态模式的不当切分。另外,通过非稳定状态追踪可以准确地判断一定长度或时间的能量累积变化对当前时间点的影响,提高了状态模式判断的准确性。Further, when the fluctuating energy at the current time point is small, if the temporary state at the current time point is different from the temporary state at the previous time point, the dynamic observation window is used to track the unstable state to determine the stability of each time point in the observation window State, that is to say, when it is impossible to determine the state pattern at the current time point only based on the fluctuating energy at the current time point and the temporary state at the previous time point, consider the temporary status at one or more time points after the current time point. The state condition can finally determine the state mode at the current time point, so that the determination result of the state mode at each time point can be more accurate, and the continuation of the temporary state can be accurately divided effectively, reducing the impact of the short-term change of the energy direction. Improper segmentation of time-continuous state patterns. In addition, the non-steady state tracking can accurately determine the impact of a certain length or time of energy accumulation changes on the current point in time, which improves the accuracy of state mode judgment.
如图4所示,是本发明实施例时间序列数据处理装置的另一种结构框图。As shown in FIG. 4, it is another structural block diagram of the time series data processing device of the embodiment of the present invention.
与图3所示实施例不同的是,在该实施例中,所述装置还包括:Different from the embodiment shown in FIG. 3, in this embodiment, the apparatus further includes:
展现模块401,用于展现所述时间序列数据中各时间点的状态模式。The display module 401 is used to display the state mode of each time point in the time series data.
不同的状态模式,可以采用不同的标记来表示,比如前面提到的采用数字0、1、2分别表示平稳模式、上升模式、下降模式。相应地,在输出 模块304输出各时间点的状态模式时,可以以状态模式序列或者表格等形式输出各时间点对应的状态模式。Different status modes can be represented by different marks. For example, the numbers 0, 1, and 2 mentioned above represent steady mode, rising mode, and falling mode respectively. Correspondingly, when the output module 304 outputs the state mode at each time point, the state mode corresponding to each time point can be output in the form of a state mode sequence or a table.
进一步地,展现模块401可以以波形图的方式展现所述时间序列数据中各时间点的状态模式,其中不同的状态模式可以采用不同的表现形式来展现,比如利用不同颜色或形状等来代表数据点的不同状态模式。Further, the display module 401 can display the state mode of each time point in the time series data in the form of a waveform graph, wherein different state modes can be displayed in different forms, such as using different colors or shapes to represent the data. Different state modes of points.
需要说明的是,对于上述时间序列数据处理装置各实施例而言,由于各模块、单元的功能实现与相应的方法中类似,因此对所述对话生成装置各实施例描述得比较简单,相关之处可参见方法实施例的相应部分说明。It should be noted that, for each embodiment of the above-mentioned time-series data processing device, since the function implementation of each module and unit is similar to that of the corresponding method, the description of each embodiment of the dialog generation device is relatively simple, and related For details, refer to the description of the corresponding part of the method embodiment.
利用本发明实施例提供的时间序列数据处理方法及装置,可以实现对任意波形的时间序列数据的分割及状态模式判断,比如,心电图、脑电图、生产制造中的电流电压信号、股票交易的K线、语音信号的时域波形等,而且不受噪音数据影响,不需要训练数据,具有较高的准确性和普适性。根据时间序列数据中各时间点的状态模式,可以得到时间序列的变点,或者可以由不同的状态模式组合成复合模式,从而为行业分析及应用提供有效信息。The time series data processing method and device provided by the embodiments of the present invention can realize the segmentation of arbitrary waveform time series data and state mode judgment, such as electrocardiogram, electroencephalogram, current and voltage signals in manufacturing, and stock trading K-line, the time-domain waveform of the voice signal, etc., and is not affected by noise data, does not require training data, and has high accuracy and universality. According to the state mode at each time point in the time series data, the change point of the time series can be obtained, or different state modes can be combined into a compound mode, so as to provide effective information for industry analysis and application.
相比于现有技术,本发明方案可以对任意采样的、无需数据分布假设、具有或不具有时间序列周期的、稳态或非稳态的时间序列数据进行准确的状态模式识别,不仅可以实现离线识别,而且可以实现在线识别,具有强通用性,而且不受应用环境限制。Compared with the prior art, the solution of the present invention can perform accurate state pattern recognition on arbitrarily sampled, without data distribution assumptions, with or without time series period, steady-state or non-steady-state time series data, which can not only realize Offline recognition, and online recognition can be realized, with strong versatility, and not restricted by the application environment.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first" and "second" in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and not necessarily used to describe a specific sequence or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations of them are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to the clearly listed Those steps or units may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or equipment.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相 同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。而且,以上所描述的系统实施例仅仅是示意性的,其中作为分离部件说明的模块和单元可以是或者也可以不是物理上分开的,即可以位于一个网络单元上,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. Moreover, the system embodiments described above are only illustrative, and the modules and units described as separate components may or may not be physically separated, that is, they may be located on one network unit, or may be distributed to multiple On the network unit. Some or all of the modules may be selected according to actual needs to achieve the objectives of the solutions of the embodiments. Those of ordinary skill in the art can understand and implement it without creative work.
本领域普通技术人员可以理解实现上述方法实施方式中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,所述的程序可以存储于计算机可读取存储介质中,这里所称的存储介质,如:ROM/RAM、磁碟、光盘等。A person of ordinary skill in the art can understand that all or part of the steps in the above-mentioned method embodiments can be implemented by a program instructing relevant hardware. The program can be stored in a computer-readable storage medium, which is referred to as storage herein. Medium, such as: ROM/RAM, magnetic disk, optical disk, etc.
相应地,本发明实施例还提供一种用于时间序列数据处理方法的装置,该装置是一种电子设备,比如,可以是移动终端、计算机、平板设备、医疗设备、健身设备、个人数字助理等。所述电子设备可以包括一个或多个处理器、存储器;其中,所述存储器用于存储计算机可执行指令,所述处理器用于执行所述计算机可执行指令,以实现前面各实施例所述的方法。Correspondingly, an embodiment of the present invention also provides a device for a time series data processing method. The device is an electronic device, such as a mobile terminal, a computer, a tablet device, a medical device, a fitness device, or a personal digital assistant. Wait. The electronic device may include one or more processors and memories; wherein the memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions to implement the foregoing method.
以上对本发明实施例进行了详细介绍,本文中应用了具体实施方式对本发明进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及装置,其仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围,本说明书内容不应理解为对本发明的限制。因此,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The embodiments of the present invention are described in detail above, and specific implementations are used to illustrate the present invention. The descriptions of the above embodiments are only used to help understand the methods and devices of the present invention, and they are only part of the embodiments of the present invention. Not all examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention, and the contents of this specification should not be construed as limiting the present invention. Therefore, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (20)

  1. 一种时间序列数据处理方法,其特征在于,所述方法包括:A time series data processing method, characterized in that the method includes:
    获取时间序列数据,所述时间序列中的每个数据为一个时间点的值;Acquiring time series data, where each data in the time series is a value at a time point;
    依次计算各时间点的波动能量E(n)=V(n)-V(n-1),其中,E(n)为当前时间点的波动能量,V(n)为当前时间点的值,V(n-1)为前一时间点的值;Calculate the fluctuating energy E(n)=V(n)-V(n-1) at each time point in turn, where E(n) is the fluctuating energy at the current time point, and V(n) is the value at the current time point, V(n-1) is the value at the previous time point;
    循环遍历所述时间序列中的每个时间点,根据各时间点的波动能量确定所述时间点的状态,所述状态包括:暂时状态和稳定状态;Loop through each time point in the time sequence, and determine the state of the time point according to the fluctuating energy at each time point, the state includes: a temporary state and a stable state;
    将所述时间点的稳定状态作为所述时间点的状态模式;所述状态模式包括:平稳模式、上升模式、下降模式。The stable state at the time point is taken as the state mode at the time point; the state mode includes: a steady mode, a rising mode, and a falling mode.
  2. 根据权利要求1所述的方法,其特征在于,所述循环遍历所述时间序列中的每个时间点,根据各时间点的波动能量确定所述时间点的状态包括:The method according to claim 1, wherein the looping through each time point in the time sequence, and determining the state of the time point according to fluctuating energy at each time point comprises:
    循环遍历所述时间序列中的每个时间点,并根据所述时间点的波动能量确定所述时间点的暂时状态;Loop through each time point in the time sequence, and determine the temporary state of the time point according to the fluctuating energy at the time point;
    根据所述时间点的波动能量的绝对值和暂时状态确定所述时间点的稳定状态。The stable state at the time point is determined according to the absolute value of the fluctuating energy at the time point and the temporary state.
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述时间点的波动能量确定所述时间点的暂时状态包括:The method according to claim 2, wherein the determining the temporary state at the time point according to the fluctuating energy at the time point comprises:
    如果当前时间点的波动能量E(n)>0,则确定当前时间点的暂时状态St(n)为上升模式;If the fluctuating energy E(n)>0 at the current time point, it is determined that the temporary state St(n) at the current time point is the rising mode;
    如果当前时间点的波动能量E(n)<0,则确定当前时间点的暂时状态St(n)为下降模式;If the fluctuating energy E(n) at the current time point is less than 0, it is determined that the temporary state St(n) at the current time point is in a descending mode;
    如果当前时间点的波动能量E(n)=0,则确定当前时间点的暂时状态St(n)为平稳模式。If the fluctuating energy E(n) at the current time point is equal to 0, it is determined that the temporary state St(n) at the current time point is a steady mode.
  4. 根据权利要求2所述的方法,其特征在于,所述根据所述时间点的波动能量的绝对值和暂时状态确定所述时间点的稳定状态包括:The method according to claim 2, wherein the determining the stable state at the time point according to the absolute value of the fluctuating energy at the time point and the temporary state comprises:
    如果当前时间点的波动能量的绝对值abs(E(n))大于等于设定的波动能量阈值,则将当前时间点的暂时状态St(n)作为当前时间点的稳定状态;If the absolute value of fluctuating energy abs(E(n)) at the current time point is greater than or equal to the set fluctuating energy threshold, then the temporary state St(n) at the current time point is taken as the stable state at the current time point;
    如果当前时间点的波动能量的绝对值abs(E(n))小于所述波动能量阈值,并且当前时间点的暂时状态St(n)和前一时间点的暂时状态St(n-1)相同,则将上一个稳定状态作为当前时间点的稳定状态;If the absolute value abs(E(n)) of fluctuating energy at the current time point is less than the fluctuating energy threshold, and the temporary state St(n) at the current time point is the same as the temporary state St(n-1) at the previous time point , The last stable state is regarded as the stable state at the current time point;
    如果当前时间点的波动能量的绝对值abs(E(n))小于所述波动能量阈值,并且当前时间点的暂时状态St(n)和前一时间点的暂时状态St(n-1)不同,则利用动态观察窗口进行非稳定状态追踪,确定所述观察窗口内各时间点的稳定状态。If the absolute value abs(E(n)) of fluctuating energy at the current time point is less than the fluctuating energy threshold, and the temporary state St(n) at the current time point is different from the temporary state St(n-1) at the previous time point , The dynamic observation window is used to track the unstable state, and the stable state at each time point in the observation window is determined.
  5. 根据权利要求4所述的方法,其特征在于,所述利用动态观察窗口进行非稳定状态追踪,确定当前时间点的稳定状态包括:The method according to claim 4, characterized in that said using the dynamic observation window to track the unstable state and determining the stable state at the current time point comprises:
    开启动态观察窗口;Open the dynamic observation window;
    记录所述观察窗口的长度并计算所述观察窗口内所有时间点的累积能量sum(E)和所述累积能量的绝对值abs(sum(E));Record the length of the observation window and calculate the cumulative energy sum(E) and the absolute value of the cumulative energy abs(sum(E)) at all time points in the observation window;
    判断所述观察窗口是否满足终止条件;Determine whether the observation window meets the termination condition;
    如果是,则终止所述观察窗口,并根据所述终止条件确定所述观察窗口内各时间点的稳定状态。If so, terminate the observation window, and determine the stable state at each time point in the observation window according to the termination condition.
  6. 根据权利要求5所述的方法,其特征在于,所述终止条件包括以下任意一项:The method according to claim 5, wherein the termination condition includes any one of the following:
    所述观察窗口内出现特定时间点,所述特定时间点是指其波动能量的绝对值abs(E(i))大于等于所述波动能量阈值的时间点;A specific time point appears in the observation window, and the specific time point refers to a time point at which the absolute value of fluctuating energy abs(E(i)) is greater than or equal to the fluctuating energy threshold;
    所述观察窗口达到设定的长度阈值w;The observation window reaches the set length threshold w;
    所述观察窗口内所有时间点的累积能量的绝对值abs(sum(E))大于等于所述波动能量阈值;The absolute value abs(sum(E)) of the accumulated energy at all time points in the observation window is greater than or equal to the fluctuating energy threshold;
    所述根据所述终止条件确定所述观察窗口内各时间点的稳定状态包括:The determining a stable state at each time point in the observation window according to the termination condition includes:
    在所述观察窗口内出现所述特定时间点终止观察窗口的情况下:将所述观察窗口的终止点移到所述特定时间点的前一个时间点,得到更新后的观察窗口;如果更新后的观察窗口的长度大于设定的长度阈值w的一半,则将更新后的观察窗口内各时间点的稳定状态设置为上一个稳定状态,否 则将更新后的观察窗口内各时间点的稳定状态设置为平稳模式;In the case where the observation window terminated at the specific time point appears in the observation window: move the termination point of the observation window to a time point before the specific time point to obtain an updated observation window; if updated The length of the observation window is greater than half of the set length threshold w, then the stable state at each time point in the updated observation window is set to the last stable state, otherwise the stable state at each time point in the updated observation window Set to steady mode;
    在所述观察窗口达到设定的长度阈值w终止观察窗口的情况下:如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)>0,则将所述观察窗口内各时间点的稳定状态设置为上升模式;如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)<0,则将所述观察窗口内各时间点的稳定状态设置为下降模式;如果所述累积能量的绝对值abs(sum(E))小于等于所述波动能量阈值,则将所述观察窗口内各时间点的稳定状态设置为平稳模式;When the observation window reaches the set length threshold w to terminate the observation window: if the absolute value of the cumulative energy abs(sum(E)) is greater than the fluctuating energy threshold, and the cumulative energy sum(E) >0, the stable state at each time point in the observation window is set to the rising mode; if the absolute value of the cumulative energy abs(sum(E)) is greater than the fluctuating energy threshold, and the cumulative energy sum( E)<0, the stable state at each time point in the observation window is set to the falling mode; if the absolute value of the cumulative energy abs(sum(E)) is less than or equal to the fluctuating energy threshold, the The stable state at each time point in the observation window is set to stable mode;
    在所述观察窗口内所有时间点的累积能量的绝对值abs(sum(E))大于等于所述波动能量阈值终止观察窗口的情况下:如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)>0时,则将所述观察窗口内各时间点的稳定状态设置为上升模式;如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)<0,则将所述观察窗口内各时间点的稳定状态设置为下降模式。When the absolute value of the cumulative energy abs(sum(E)) at all time points in the observation window is greater than or equal to the fluctuating energy threshold to terminate the observation window: if the absolute value of the cumulative energy abs(sum(E) ) Is greater than the fluctuating energy threshold, and the cumulative energy sum(E)>0, then the stable state at each time point in the observation window is set to the rising mode; if the absolute value of the cumulative energy abs(sum (E)) is greater than the fluctuating energy threshold, and the accumulated energy sum(E)<0, then the stable state at each time point in the observation window is set to the falling mode.
  7. 根据权利要求1所述的方法,其特征在于,所述获取时间序列数据包括:The method according to claim 1, wherein said acquiring time series data comprises:
    对时序图进行采样,得到时间序列数据。Sampling the timing diagram to obtain time series data.
  8. 根据权利要求1所述的方法,其特征在于,所述对时序图进行采样包括:The method according to claim 1, wherein the sampling a timing diagram comprises:
    对时序图进行周期性采样,或者对时序图进行非周期性采样。Perform periodic sampling on the timing diagram, or perform aperiodic sampling on the timing diagram.
  9. 根据权利要求1至8任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 8, wherein the method further comprises:
    展现所述时间序列数据中各时间点的状态模式。Show the state mode at each time point in the time series data.
  10. 一种时间序列数据处理装置,其特征在于,所述装置包括:A time series data processing device, characterized in that the device includes:
    数据获取模块,用于获取时间序列数据,所述时间序列中的每个数据为一个时间点的值;A data acquisition module for acquiring time series data, where each data in the time series is a value at a time point;
    波动能量计算模块,用于依次计算各时间点的波动能量E(n)=V(n)-V(n-1),其中,E(n)为当前时间点的波动能量,V(n)为当前时间 点的值,V(n-1)为前一时间点的值;The fluctuating energy calculation module is used to sequentially calculate the fluctuating energy at each time point E(n)=V(n)-V(n-1), where E(n) is the fluctuating energy at the current time point, V(n) Is the value at the current time point, and V(n-1) is the value at the previous time point;
    遍历模块,用于循环遍历所述时间序列中的每个时间点,根据各时间点的波动能量确定所述时间点的状态,所述状态包括:暂时状态和稳定状态;The traversal module is configured to traverse each time point in the time sequence in a loop, and determine the state of the time point according to the fluctuating energy at each time point, and the state includes: a temporary state and a stable state;
    输出模块,用于将所述时间点的稳定状态作为所述时间点的状态模式;所述状态模式包括:平稳模式、上升模式、下降模式。The output module is configured to use the stable state at the time point as the state mode at the time point; the state mode includes: a steady mode, an ascending mode, and a descending mode.
  11. 根据权利要求10所述的装置,其特征在于,所述遍历模块包括:The device according to claim 10, wherein the traversal module comprises:
    暂时状态确定模块,用于循环遍历所述时间序列中的每个时间点,并根据所述时间点的波动能量确定所述时间点的暂时状态;A temporary state determining module, configured to loop through each time point in the time sequence, and determine the temporary state at the time point according to the fluctuating energy at the time point;
    稳定状态确定模块,用于根据所述时间点的波动能量的绝对值和暂时状态确定所述时间点的稳定状态。The stable state determining module is used to determine the stable state at the time point according to the absolute value of the fluctuating energy at the time point and the temporary state.
  12. 根据权利要求11所述的装置,其特征在于,The device according to claim 11, wherein:
    所述暂时状态确定模块,具体用于在当前时间点的波动能量E(n)>0时,确定当前时间点的暂时状态St(n)为上升模式;在当前时间点的波动能量E(n)<0时,确定当前时间点的暂时状态St(n)为下降模式;在当前时间点的波动能量E(n)=0时,确定当前时间点的暂时状态St(n)为平稳模式。The temporary state determining module is specifically used to determine that the temporary state St(n) at the current time point is in the rising mode when the fluctuating energy E(n) at the current time point is in the rising mode; the fluctuating energy E(n) at the current time point When )<0, it is determined that the temporary state St(n) at the current time point is a descending mode; when the fluctuating energy E(n) at the current time point is 0, it is determined that the temporary state St(n) at the current time point is a steady mode.
  13. 根据权利要求11所述的装置,其特征在于,所述稳定状态确定模块包括:The device according to claim 11, wherein the stable state determining module comprises:
    判断单元,用于确定当前时间点的波动能量的绝对值abs(E(n))是否大于等于设定的波动能量阈值、以及当前时间点的暂时状态St(n)和前一时间点的暂时状态St(n-1)是否相同;The judging unit is used to determine whether the absolute value of fluctuating energy abs(E(n)) at the current time point is greater than or equal to the set fluctuating energy threshold, and the temporary state St(n) at the current time point and the temporary state at the previous time point Whether the state St(n-1) is the same;
    第一稳态确定单元,用于在当前时间点的波动能量的绝对值abs(E(n))大于等于设定的波动能量阈值时,将当前时间点的暂时状态St(n)作为当前时间点的稳定状态;The first steady-state determination unit is used to use the temporary state St(n) at the current time point as the current time when the absolute value of the fluctuating energy abs(E(n)) at the current time point is greater than or equal to the set fluctuating energy threshold Point of steady state;
    第二稳态确定单元,用于在当前时间点的波动能量的绝对值abs(E(n))小于所述波动能量阈值、并且当前时间点的暂时状态St(n)和前一时间点的暂时状态St(n-1)相同时,将上一个稳定状态作为当前时间点的稳定状态;The second steady-state determination unit is used for the absolute value abs(E(n)) of the fluctuating energy at the current time point is less than the fluctuating energy threshold, and the temporary state St(n) at the current time point and the previous time point When the temporary state St(n-1) is the same, the last stable state is taken as the stable state at the current time point;
    第三稳态确定单元,用于在当前时间点的波动能量的绝对值abs(E(n)) 小于所述波动能量阈值、并且当前时间点的暂时状态St(n)和前一时间点的暂时状态St(n-1)不同时,利用动态观察窗口进行非稳定状态追踪,确定所述观察窗口内各时间点的稳定状态。The third steady-state determination unit is used for the absolute value abs(E(n)) of the fluctuating energy at the current time point is less than the fluctuating energy threshold, and the temporary state St(n) at the current time point and the previous time point When the temporary state St(n-1) is different, the dynamic observation window is used to track the unstable state to determine the stable state at each time point in the observation window.
  14. 根据权利要求13所述的装置,其特征在于,The device according to claim 13, wherein:
    所述第三稳态确定单元,具体用于开启动态观察窗口,记录所述观察窗口的长度并计算所述观察窗口内所有时间点的累积能量sum(E)和所述累积能量的绝对值abs(sum(E)),在所述观察窗口满足终止条件后终止所述观察窗口,并根据所述终止条件确定所述观察窗口内各时间点的稳定状态。The third steady-state determination unit is specifically configured to open a dynamic observation window, record the length of the observation window, and calculate the cumulative energy sum(E) at all time points in the observation window and the absolute value abs of the cumulative energy (sum(E)), terminate the observation window after the observation window meets a termination condition, and determine the stable state at each time point in the observation window according to the termination condition.
  15. 根据权利要求14所述的装置,其特征在于,所述终止条件包括以下任意一项:The device according to claim 14, wherein the termination condition comprises any one of the following:
    所述观察窗口内出现特定时间点,所述特定时间点是指其波动能量的绝对值abs(E(i))大于等于所述波动能量阈值的时间点;A specific time point appears in the observation window, and the specific time point refers to a time point at which the absolute value of fluctuating energy abs(E(i)) is greater than or equal to the fluctuating energy threshold;
    所述观察窗口达到设定的长度阈值w;The observation window reaches the set length threshold w;
    所述观察窗口内所有时间点的累积能量的绝对值abs(sum(E))大于等于所述波动能量阈值;The absolute value abs(sum(E)) of the accumulated energy at all time points in the observation window is greater than or equal to the fluctuating energy threshold;
    所述第三稳态确定单元按以下方式确定所述观察窗口内各时间点的稳定状态:The third steady state determination unit determines the steady state at each time point in the observation window in the following manner:
    在所述观察窗口内出现所述特定时间点终止观察窗口的情况下:将所述观察窗口的终止点移到所述特定时间点的前一个时间点,得到更新后的观察窗口;如果更新后的观察窗口的长度大于设定的长度阈值w的一半,则将更新后的观察窗口内各时间点的稳定状态设置为上一个稳定状态,否则将更新后的观察窗口内各时间点的稳定状态设置为平稳模式;In the case where the observation window terminated at the specific time point appears in the observation window: move the termination point of the observation window to a time point before the specific time point to obtain an updated observation window; if updated The length of the observation window is greater than half of the set length threshold w, then the stable state at each time point in the updated observation window is set to the last stable state, otherwise the stable state at each time point in the updated observation window Set to steady mode;
    在所述观察窗口达到设定的长度阈值w终止观察窗口的情况下:如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)>0,则将所述观察窗口内各时间点的稳定状态设置为上升模式;如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)<0,则将所述观察窗口内各时间点的稳定状态设置为下降模式;如果所述累积能量的绝对值abs(sum(E))小于等于所述波动能量阈值, 则将所述观察窗口内各时间点的稳定状态设置为平稳模式;When the observation window reaches the set length threshold w to terminate the observation window: if the absolute value of the cumulative energy abs(sum(E)) is greater than the fluctuating energy threshold, and the cumulative energy sum(E) >0, the stable state at each time point in the observation window is set to the rising mode; if the absolute value of the cumulative energy abs(sum(E)) is greater than the fluctuating energy threshold, and the cumulative energy sum( E)<0, the stable state at each time point in the observation window is set to the falling mode; if the absolute value of the accumulated energy abs(sum(E)) is less than or equal to the fluctuating energy threshold, then the The stable state at each time point in the observation window is set to stable mode;
    在所述观察窗口内所有时间点的累积能量的绝对值abs(sum(E))大于等于所述波动能量阈值终止观察窗口的情况下:如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)>0时,则将所述观察窗口内各时间点的稳定状态设置为上升模式;如果所述累积能量的绝对值abs(sum(E))大于所述波动能量阈值,并且所述累积能量sum(E)<0,则将所述观察窗口内各时间点的稳定状态设置为下降模式。When the absolute value of the cumulative energy abs(sum(E)) at all time points in the observation window is greater than or equal to the fluctuating energy threshold to terminate the observation window: if the absolute value of the cumulative energy abs(sum(E) ) Is greater than the fluctuating energy threshold, and the cumulative energy sum(E)>0, then the stable state at each time point in the observation window is set to the rising mode; if the absolute value of the cumulative energy abs(sum (E)) is greater than the fluctuating energy threshold, and the accumulated energy sum(E)<0, then the stable state at each time point in the observation window is set to the falling mode.
  16. 根据权利要求10所述的装置,其特征在于,The device according to claim 10, wherein:
    所述数据获取模块,具体用于对时序图进行采样,得到时间序列数据。The data acquisition module is specifically used to sample the time sequence diagram to obtain time series data.
  17. 根据权利要求10所述的装置,其特征在于,所述数据获取模块对时序图进行采样包括:对时序图进行周期性采样,或者对时序图进行非周期性采样。The device according to claim 10, wherein the sampling of the timing diagram by the data acquisition module comprises: sampling the timing diagram periodically, or sampling the timing diagram aperiodically.
  18. 根据权利要求10至17任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 10 to 17, wherein the device further comprises:
    展现模块,用于展现所述时间序列数据中各时间点的状态模式。The display module is used to display the state mode of each time point in the time series data.
  19. 一种电子设备,其特征在于,包括:一个或多个处理器、存储器;An electronic device, characterized in that it includes: one or more processors and memories;
    所述存储器用于存储计算机可执行指令,所述处理器用于执行所述计算机可执行指令,以实现如权利要求1至9任一项所述的方法。The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the method according to any one of claims 1 to 9.
  20. 一种可读存储介质,其上存储有指令,所述指令被执行以实现如权利要求1至9任一项所述的方法。A readable storage medium having instructions stored thereon, and the instructions are executed to implement the method according to any one of claims 1 to 9.
PCT/CN2019/095065 2019-06-18 2019-07-08 Time series data processing method and apparatus WO2020252822A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910526163.6A CN110232132B (en) 2019-06-18 2019-06-18 Time series data processing method and device
CN201910526163.6 2019-06-18

Publications (1)

Publication Number Publication Date
WO2020252822A1 true WO2020252822A1 (en) 2020-12-24

Family

ID=67859606

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/095065 WO2020252822A1 (en) 2019-06-18 2019-07-08 Time series data processing method and apparatus

Country Status (2)

Country Link
CN (1) CN110232132B (en)
WO (1) WO2020252822A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110035188A1 (en) * 2009-07-16 2011-02-10 European Space Agency Method and apparatus for analyzing time series data
CN104268660A (en) * 2014-10-13 2015-01-07 国家电网公司 Trend recognition method for electric power system predication-like data
CN108803408A (en) * 2017-04-28 2018-11-13 横河电机株式会社 process control system and data processing method

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9110111B1 (en) * 2013-04-26 2015-08-18 Texas Instruments Incorporated Methods and systems to determine a final value of random telegraph noise time constant and magnitude
CN103690156B (en) * 2013-11-22 2016-01-27 东软熙康健康科技有限公司 The processing method of a kind of heart rate acquisition methods and electrocardiosignal
CN103840970B (en) * 2014-01-24 2017-09-15 珠海多玩信息技术有限公司 A kind of method and device for obtaining service operation state
CN104573321B (en) * 2014-12-11 2017-12-08 国家电网公司 A kind of identification of Gases Dissolved in Transformer Oil bad data and processing method
CN105607475A (en) * 2015-12-24 2016-05-25 西安交通大学 Electrical appliance operating state recognition method based on dual-sliding window
CN108959704B (en) * 2018-05-28 2022-10-14 华北电力大学 Rewarding and punishing weight type simulation sequence similarity analysis method considering morphological change
CN108804703B (en) * 2018-06-19 2021-09-17 北京焦点新干线信息技术有限公司 Data anomaly detection method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110035188A1 (en) * 2009-07-16 2011-02-10 European Space Agency Method and apparatus for analyzing time series data
CN104268660A (en) * 2014-10-13 2015-01-07 国家电网公司 Trend recognition method for electric power system predication-like data
CN108803408A (en) * 2017-04-28 2018-11-13 横河电机株式会社 process control system and data processing method

Also Published As

Publication number Publication date
CN110232132B (en) 2020-11-06
CN110232132A (en) 2019-09-13

Similar Documents

Publication Publication Date Title
US11670325B2 (en) Voice activity detection using a soft decision mechanism
Bevilacqua et al. Continuous realtime gesture following and recognition
CN109697207A (en) The abnormality monitoring method and system of time series data
Roma et al. Recurrence quantification analysis features for environmental sound recognition
CN108344895B (en) Signal detection method and device
KR20120052610A (en) Apparatus and method for recognizing motion using neural network learning algorithm
CN109656366B (en) Emotional state identification method and device, computer equipment and storage medium
US20230013170A1 (en) Method and apparatus for detecting jitter in video, electronic device, and storage medium
CN112435142B (en) Power load identification method and load power utilization facility knowledge base construction method thereof
CN107909042B (en) continuous gesture segmentation recognition method
CN107391230B (en) Implementation method and device for determining load of virtual machine
WO2020252822A1 (en) Time series data processing method and apparatus
US9298312B2 (en) Automated perceptual quality assessment of touchscreen devices
CN114429767A (en) Video generation method and device, electronic equipment and storage medium
CN107894837A (en) Dynamic sentiment analysis model sample processing method and processing device
CN110070891B (en) Song identification method and device and storage medium
JP2019526070A (en) Method and apparatus for speech recognition
CN116048282A (en) Data processing method, system, device, equipment and storage medium
US20170285902A1 (en) Modifying Settings of an Electronic Test or Measurement Instrument
Li et al. Design of automatic scoring system for oral English test based on sequence matching and big data analysis
CN107657962B (en) Method and system for identifying and separating throat sound and gas sound of voice signal
Yu et al. Network inference and change point detection for piecewise-stationary time series
Khan et al. Hybrid BiLSTM-HMM based event detection and classification system for food intake recognition
CN109903753A (en) More human speech sentence classification methods, equipment, medium and system based on sound source angle
CN112308099A (en) Sample feature importance determination method, and classification model training method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19933648

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19933648

Country of ref document: EP

Kind code of ref document: A1