Abnormal sequence insertion method based on state consistency

By using non-overlapping window partitioning and position indexing techniques, abnormal patterns are generated and inserted, solving the problems of label conflict and state inconsistency in existing technologies. This achieves the continuity of time series and the uniqueness of labels, thereby improving the model's learning performance.

CN123178970APending Publication Date: 2026-11-27NORTHWESTERN POLYTECHNICAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611413844.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-11
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies, when processing time-series data, suffer from problems such as overlapping windows leading to label conflicts and inconsistencies between abnormal insertion locations and adjacent normal time-series data states, which affect the model's learning performance.

Method used

A non-overlapping window partitioning mechanism is adopted. The target window is selected by the position index, anomaly patterns are generated and the original time series data is superimposed or replaced in the target window to ensure the consistency of the time series status and the uniqueness of the labels. After the anomaly insertion is completed, the original time series is restored according to the position index.

Benefits of technology

It achieves complete continuity of time series and uniqueness of labels, reduces label conflict interference, and improves the stability of model learning and the consistency of state between abnormal samples and normal samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178970A_ABST
    Figure CN123178970A_ABST
Patent Text Reader

Abstract

The application discloses an abnormal sequence insertion method based on state consistency, and relates to the technical field of timing exception processing, and the technical solution points of the application include the following steps: dividing an original time sequence into a plurality of non-overlapping time windows, and selecting at least one target window from the plurality of non-overlapping time windows; generating an abnormal mode within the time range of the target window, and superimposing or replacing the abnormal mode to the original time sequence data of the target window to generate a target construction window after inserting the abnormality; restoring the target construction window after inserting the abnormality to the corresponding position in the original time sequence according to the position index, and forming an enhanced time sequence which is time-continuous according to the target construction window and other non-overlapping time windows which are not selected, so that the time point level abnormality detection result is output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of time-series anomaly handling technology, and more specifically, to an anomaly sequence insertion method based on state consistency. Background Technology

[0002] In many practical engineering scenarios such as industrial equipment monitoring and sensor signal acquisition, equipment is in normal operation for a long time, and abnormal failure events are low-probability events. As a result, the raw time series datasets collected generally suffer from sample imbalance, with a large number of normal samples and a small number of abnormal samples.

[0003] Current technologies generally employ manual anomaly insertion for time series data augmentation. For example, while AnomalyBERT introduces a windowing mechanism, it mostly uses overlapping windows instead of directly inserting anomalous data at random points along the entire original time series. When using overlapping windows for anomaly insertion, the same time point may belong to multiple different windows, resulting in inconsistent anomaly labels within different windows, causing label conflicts and interfering with model learning. Furthermore, traditional anomaly insertion methods can easily alter surrounding normal time series data, leading to boundary fragments such as numerical jumps and trend breaks between the anomaly insertion location and adjacent normal time series data. The consistency between the artificially synthesized anomaly fragments and the surrounding normal time series data is also poor. Summary of the Invention

[0004] In view of the shortcomings of the existing technology, the purpose of this invention is to provide an abnormal sequence insertion method based on state consistency.

[0005] To achieve the above objectives, the present invention provides the following technical solution:

[0006] The method for inserting abnormal sequences based on state consistency includes the following steps:

[0007] The original time series is divided into multiple non-overlapping time windows, and at least one target window is selected from the multiple non-overlapping time windows.

[0008] Generate anomaly patterns within the time range of the target window, and overlay or replace the original time series data of the target window with the anomaly patterns to generate the target constructed window after inserting the anomaly.

[0009] Based on the position index, the target constructed window after the insertion anomaly is restored to its corresponding position in the original time series. The target constructed window and other non-overlapping time windows that were not selected are used to form a time-continuous enhanced time series.

[0010] Preferably, the method further includes the following steps:

[0011] Initial state labels are marked for multiple non-overlapping time windows. The initial state labels represent the normal state of the corresponding time window on the time axis. When an anomaly is constructed, the anomaly label of the corresponding time point is updated. Finally, the enhanced time series and its corresponding label sequence are output.

[0012] Based on the initial state label, the state label of each time point on the time axis is determined to be unique and continuous.

[0013] Preferably, selecting at least one target window from multiple non-overlapping time windows includes:

[0014] Determine the position index of at least one target window within multiple non-overlapping time windows;

[0015] Locate the corresponding target window based on the location index.

[0016] Preferably, generating an abnormal pattern within the time range of the target window specifically includes the following steps:

[0017] Extract the steady-state operating trend corresponding to the original time series data within the target window, and delineate the continuous state baseline within the window based on the steady-state operating trend;

[0018] The evolution of the temporal state is adjusted along the direction of change of the state baseline to obtain a continuous transition state offset sequence;

[0019] Anomaly patterns are generated based on the state offset sequence.

[0020] Preferably, generating an anomaly pattern based on the state offset sequence specifically includes the following steps:

[0021] The continuity of adjacent state nodes in the state offset sequence is checked to obtain the morphological inflection point where the offset direction changes sharply.

[0022] The state offset sequence is divided into continuously connected offset segments based on the morphological inflection point. Morphological constraints are applied to each offset segment. The offset segments that have undergone morphological constraint processing are then reassembled according to the original connection order to obtain an abnormal pattern with a smooth morphological transition.

[0023] Preferably, the abnormal pattern is overlaid or replaced on the original time-series data of the target window to generate the target constructed window after the insertion of the abnormal pattern, specifically including the following steps:

[0024] Based on the state boundaries of the abnormal pattern and the original time series data of the target window, determine the implantation method of superposition or replacement;

[0025] If the method is superimposed, the state variables of the abnormal mode will be fused into the original time series data at the corresponding positions segment by segment;

[0026] If the implantation method is to be replaced, the corresponding segment of the original time series data will be overwritten using the abnormal mode.

[0027] After an insertion error, restore the non-overlapping windows to the time series in their original order.

[0028] Preferably, restoring the target construction window after the insertion anomaly to its corresponding position in the original time series based on the position index specifically includes the following steps:

[0029] Locate the window region to be replaced in the original time series based on the location index;

[0030] After aligning the target construction window of the implanted anomaly to the starting boundary of the window region, place it into the position corresponding to the original time series.

[0031] Preferably, locking the window region to be replaced in the original time series based on the location index specifically includes the following steps:

[0032] Backtrack the corresponding time series segment within the original time series based on the location index;

[0033] Extract the time-series boundary markers of the time-series segments, and determine the window region to be replaced based on the boundary markers.

[0034] Preferably, constructing a time series based on the target window and other non-overlapping time windows to form a time-continuous enhanced time series specifically includes the following steps:

[0035] The target construction window is docked with other non-overlapping time windows that are not selected. The temporal state of the docking position of the adjacent windows is read. The state trend at the end of the unselected window is used as a reference to smoothly connect the abnormal state at the edge of the target construction window after adjustment, so as to form a time-continuous enhanced time series.

[0036] Compared with the prior art, the present invention has the following beneficial effects:

[0037] This invention resets the target construction window based on its position index, placing the modified target construction window back to its pre-corresponding position in the original time series. Then, it performs temporal concatenation between the target construction window and other unselected non-overlapping time windows, ensuring a smooth transition of temporal states at the connection points of each window. This allows the final enhanced time series to maintain complete temporal continuity. The non-overlapping window partitioning mechanism ensures that each time point within the sequence corresponds to a unique anomaly label, effectively avoiding label ambiguity and reducing long-term dependency interference caused by label conflicts. This allows the model to learn more stable temporal patterns, resulting in high state consistency between anomalous samples and surrounding normal time series. Attached Figure Description

[0038] Figure 1A flowchart illustrating the anomaly sequence insertion method based on state consistency is provided for embodiments of the present invention.

[0039] Figure 2 A flowchart illustrating the generation of anomaly patterns in an anomaly sequence insertion method based on state consistency is provided for embodiments of the present invention.

[0040] Figure 3 This invention provides a flowchart illustrating the process of obtaining a window region in an abnormal sequence insertion method based on state consistency, as provided in an embodiment of the invention. Detailed Implementation

[0041] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0042] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0043] Secondly, the term "an embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places throughout this specification does not necessarily refer to the same embodiment, nor is it a single embodiment or an embodiment selectively excluded from other embodiments.

[0044] Reference Figures 1-3 As shown.

[0045] The embodiments further illustrate the abnormal sequence insertion method based on state consistency proposed in this invention.

[0046] The method for inserting abnormal sequences based on state consistency includes the following steps:

[0047] The original time series is divided into multiple non-overlapping time windows, and at least one target window is selected from the multiple non-overlapping time windows.

[0048] Generate anomaly patterns within the time range of the target window, and overlay or replace the original time series data of the target window with the anomaly patterns to generate the target constructed window after inserting the anomaly.

[0049] The abnormal construction methods are soft replacement, uniform replacement, peak noise, and length adjustment.

[0050] Based on the position index, the target constructed window after the insertion anomaly is restored to its corresponding position in the original time series. The target constructed window and other non-overlapping time windows that were not selected are used to form a time-continuous enhanced time series.

[0051] It also includes the following steps:

[0052] Initial state labels are marked for multiple non-overlapping time windows. The initial state labels represent the normal state of the corresponding time window on the time axis. When an anomaly is constructed, the anomaly label of the corresponding time point is updated. Finally, the enhanced time series and its corresponding label sequence are output.

[0053] Based on the initial state label, the state label of each time point on the time axis is determined to be unique and continuous.

[0054] The initial state label is a window-level state identifier used to mark that the entire time series interval covered by the current corresponding time window is in normal operation without implanted anomalies. Since there are no overlapping time series segments between the time windows, the time ranges of different windows are independent and do not overlap. The time series intervals of the initial state labels will not coincide. Based on the initial state label corresponding to each window, it is mapped down to each time point contained within the window, and a corresponding state label is assigned to the time point on the time axis. This ensures that any time point can belong to only one time window and can only obtain a unique state judgment result. This guarantees that the state label corresponding to each time point in the entire time series is unique. Non-overlapping windows are arranged sequentially according to the original time sequence, and the windows are closely connected end to end without any time series breakpoints. The initial state labels of each window are passed forward along the time axis, so that the state labels of all time points on the time axis remain continuous and uninterrupted in the direction of time series evolution. This avoids the problem of conflict between normal and abnormal labels caused by the same time point belonging to multiple windows. This invention achieves state consistency at the label level through a non-overlapping window partitioning mechanism, ensuring that each time point has a unique state label and eliminating label ambiguity. At the same time, the subsequent boundary smoothing splicing process of the target construction window achieves state consistency at the waveform numerical level, avoiding sequence numerical jumps and trend breaks. The semantic consistency of labels and waveform smoothing work together to achieve overall state consistency of the time series.

[0055] Select at least one target window from multiple non-overlapping time windows, including:

[0056] Determine the position index of at least one target window within multiple non-overlapping time windows;

[0057] Locate the corresponding target window based on the location index.

[0058] The target window for the anomaly implantation operation is determined from all time windows. In the ordered set of multiple non-overlapping time windows, at least one target window position index is determined. This position index is used to uniquely identify the position of the target window in the time series window arrangement sequence. Since there is no temporal overlap between the time windows, each window corresponds to a unique and non-conflicting position index. This index forms a corresponding mapping relationship with the specific time segment covered by the window. According to the position index, a search and matching is performed in all non-overlapping time windows to locate the target window corresponding to the position index, thereby converting the index identifier into a window entity. An anomaly pattern is generated within the time range of the target window, and the anomaly implantation operation is performed to provide a clear operation object. The uniqueness of the position index ensures that the selection result of the target window is unambiguous and avoids the anomaly implantation position deviating from the expectation due to window misselection.

[0059] Generating an abnormal mode within the target window's time frame involves the following steps:

[0060] Extract the steady-state operating trend corresponding to the original time series data within the target window, and delineate the continuous state baseline within the window based on the steady-state operating trend;

[0061] The evolution of the temporal state is adjusted along the direction of change of the state baseline to obtain a continuous transition state offset sequence;

[0062] Anomaly patterns are generated based on the state offset sequence.

[0063] The steady-state trend of the original time-series data within the target window is extracted. This trend represents the changes in the time-series data under conditions without abnormal disturbances. Based on this trend, a state baseline is defined that runs through the entire time interval of the target window and has a continuous, uninterrupted trend. This baseline serves as a reference for generating abnormal changes. Using the original direction of change of the state baseline as an evolution reference, a directional offset adjustment is applied to the subsequent evolution of the time-series state to maintain the continuity of the time-series numerical changes. This generates a state offset sequence with smooth transition characteristics, which carries information about changes deviating from normal operating conditions. Configurable implementation parameters include abnormal offset amplitude, abnormal duration percentage, and abnormal evolution curvature. Multiple preset abnormal types are supported, including amplitude offset anomalies, trend drift anomalies, and local oscillation anomalies. Different anomaly types correspond to different offset evolution rules. Parameter parsing and sequence iteration calculations can be completed by referring to preset pseudocode logic. Throughout the offset generation process, the temporal gradient changes are constrained to avoid instantaneous step jumps, ensuring the continuity of the transition between the generated state offset sequence and the original steady-state trend.

[0064] Generating anomaly patterns based on state offset sequences specifically includes the following steps:

[0065] The continuity of adjacent state nodes in the state offset sequence is checked to obtain the morphological inflection point where the offset direction changes sharply.

[0066] The state offset sequence is divided into continuously connected offset segments based on the morphological inflection point. Morphological constraints are applied to each offset segment. The offset segments that have undergone morphological constraint processing are then reassembled according to the original connection order to obtain an abnormal pattern with a smooth morphological transition.

[0067] The continuity of adjacent state nodes in the state offset sequence is checked one by one. By comparing the magnitude and direction of the numerical changes between each pair of adjacent state nodes, the positions where the offset trend changes and the slope of change becomes steep are identified and marked as morphological inflection points. Morphological inflection points represent the boundary nodes where the offset evolution characteristics in the state offset sequence change significantly. Using all morphological inflection points as the dividing boundary, the state offset sequence is divided into several offset segments that are continuously connected end to end. The state offset trend within each offset segment is relatively gentle and has consistent change characteristics. Corresponding morphological constraints are applied to each offset segment. These morphological constraints are used to regulate the upper limit of the amplitude and rate of change of the state within the segment and suppress possible local violent fluctuations within the segment. All offset segments that have undergone morphological constraint processing are reassembled according to their sequential connection order in the original state offset sequence, so that the state values ​​of adjacent offset segments maintain a continuous transition at the connection position. Finally, an anomaly pattern with a smooth overall transition and no abrupt jumps is obtained, thereby ensuring the natural and coherent evolution of the time series data after the anomaly is implanted.

[0068] The abnormal pattern is overlaid or replaced onto the original time-series data of the target window to generate the target constructed window after the insertion of the abnormal pattern. The specific steps include:

[0069] Based on the state boundaries of the abnormal pattern and the original time series data of the target window, determine the implantation method of superposition or replacement;

[0070] If the method is superimposed, the state variables of the abnormal mode will be fused into the original time series data at the corresponding positions segment by segment;

[0071] If the implantation method is to be replaced, the corresponding segment of the original time series data will be overwritten using the abnormal mode.

[0072] After an insertion error, restore the non-overlapping windows to the time series in their original order.

[0073] By comparing the data range of the abnormal pattern with the state boundary parameters of the original time series data within the target window, and considering the differences in data value range, time series start and end boundaries, and operating condition characteristics between the two, the appropriate overlay or replacement implantation method is determined and selected. When the overlay implantation method is selected, each state variable contained in the abnormal pattern is sequentially fused to the original time series data at the same time position in the target window, and the abnormal offset is overlaid onto the original data value, preserving the basic trend of the original time series data. When the replacement implantation method is selected, the abnormal pattern data is directly used to overwrite the corresponding original time series data within the time segment of the target window, and the original time series value of the covered segment is no longer preserved. After the abnormal pattern data implantation is completed, the window boundary position after implantation is verified to check the degree of data state connection between the target window and adjacent time series segments, and to evaluate whether there are abrupt breaks in the data curve after the abnormality is implanted. After the verification is passed and the window time series state connection meets the preset requirements, the target constructed window after the abnormality is inserted is generated.

[0074] The target construction window after the insertion anomaly is restored to its corresponding position in the original time series based on the position index. This includes the following steps:

[0075] Locate the window region to be replaced in the original time series based on the location index;

[0076] After aligning the target construction window of the implanted anomaly to the starting boundary of the window region, place it into the position corresponding to the original time series.

[0077] First, the pre-stored location index information is retrieved. This information records the time sequence number and boundary range of the segment to be modified within the entire time series. Based on this information, the original time series is precisely located, and the window region requiring content replacement is locked. This ensures that the selected segment to be replaced perfectly matches the time series segment extracted when generating the target construction window. The target construction window is then time-aligned with the locked window region, ensuring that the first time sequence node of the target construction window coincides with the starting boundary node of the window region. This completes the time-dimensional location matching. After successful alignment verification, the target construction window carrying the abnormal pattern is placed into the corresponding position in the original time series, replacing the original normal time series segment. Finally, the complete time series after the anomaly is implanted is obtained.

[0078] Locating the window region to be replaced in the original time series based on the location index includes the following steps:

[0079] Backtrack the corresponding time series segment within the original time series based on the location index;

[0080] Extract the time-series boundary markers of the time-series segments, and determine the window region to be replaced based on the boundary markers.

[0081] Based on the target window's location index, a backtracking search is performed within the original time series to locate the corresponding time segment. This time segment is a continuous data interval in the original time series that was originally divided into the target window. The unique mapping relationship between the location index and the time segment ensures the accuracy of the backtracking location results. The time segment obtained from the backtracking location is then analyzed by extracting its two ends' time boundary markers. These markers identify the start and end points of the time segment on the time axis, clearly defining the time range covered by the segment. Based on the start and end boundary markers, the window region that needs to be replaced within the original time series is determined.

[0082] The process involves constructing a time-continuous enhanced time series based on the target window and other non-overlapping time windows, specifically including the following steps:

[0083] The target construction window is docked with other non-overlapping time windows that are not selected. The temporal state of the docking position of the adjacent windows is read. The state trend at the end of the unselected window is used as a reference to smoothly connect the abnormal state at the edge of the target construction window after adjustment, so as to form a time-continuous enhanced time series.

[0084] First, locate the docking boundary between the target constructed window and the adjacent unselected window. Read the time series status data corresponding to the end of the adjacent unselected window at the docking location, and obtain the change amplitude and trend of the time series value at the location. Use the state trend of the end of the unselected window as the reference benchmark for connection adjustment. Based on this trend benchmark, perform smooth transition processing on the abnormal state of the target constructed window edge after adjustment, eliminate the abrupt change of value and trend jump at the docking boundary between the target constructed window and the adjacent window, so that the time series data of the two windows can achieve a natural transition, and finally splice them to generate a complete time series.

[0085] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for inserting abnormal sequences based on state consistency, characterized in that, Includes the following steps: The original time series is divided into multiple non-overlapping time windows, and at least one target window is selected from the multiple non-overlapping time windows. Generate anomaly patterns within the time range of the target window, and overlay or replace the original time series data of the target window with the anomaly patterns to generate the target constructed window after inserting the anomaly. Based on the position index, the target constructed window after the insertion anomaly is restored to its corresponding position in the original time series. The target constructed window and other non-overlapping time windows that were not selected are used to form a time-continuous enhanced time series.

2. The abnormal sequence insertion method based on state consistency according to claim 1, characterized in that, It also includes the following steps: Initial state labels are marked for multiple non-overlapping time windows. The initial state labels represent the normal state of the corresponding time window on the time axis. When an anomaly is constructed, the anomaly label of the corresponding time point is updated. Finally, the enhanced time series and its corresponding label sequence are output. Based on the initial state label, the state label of each time point on the time axis is determined to be unique and continuous.

3. The abnormal sequence insertion method based on state consistency according to claim 2, characterized in that, Select at least one target window from multiple non-overlapping time windows, including: Determine the position index of at least one target window within multiple non-overlapping time windows; Locate the corresponding target window based on the location index.

4. The abnormal sequence insertion method based on state consistency according to claim 3, characterized in that, Generating an abnormal pattern within the target window's time frame involves the following steps: Extract the steady-state operating trend corresponding to the original time series data within the target window, and delineate the continuous state baseline within the window based on the steady-state operating trend; The evolution of the temporal state is adjusted along the direction of change of the state baseline to obtain a continuous transition state offset sequence; Anomaly patterns are generated based on the state offset sequence.

5. The abnormal sequence insertion method based on state consistency according to claim 4, characterized in that, Generating anomaly patterns based on state offset sequences specifically includes the following steps: The continuity of adjacent state nodes in the state offset sequence is checked to obtain the morphological inflection point where the offset direction changes sharply. The state offset sequence is divided into continuously connected offset segments based on the morphological inflection point. Morphological constraints are applied to each offset segment. The offset segments that have undergone morphological constraint processing are then reassembled according to the original connection order to obtain an abnormal pattern with a smooth morphological transition.

6. The abnormal sequence insertion method based on state consistency according to claim 5, characterized in that, The abnormal pattern is overlaid or replaced onto the original time-series data of the target window to generate the target constructed window after the insertion of the abnormal pattern. The specific steps include: Based on the state boundaries of the abnormal pattern and the original time series data of the target window, determine the implantation method of superposition or replacement; If the method is superimposed, the state variables of the abnormal mode will be fused into the original time series data at the corresponding positions segment by segment; If the implantation method is to be replaced, the corresponding segment of the original time series data will be overwritten using the abnormal mode. After an insertion error, restore the non-overlapping windows to the time series in their original order.

7. The abnormal sequence insertion method based on state consistency according to claim 6, characterized in that, The target construction window after the insertion anomaly is restored to its corresponding position in the original time series based on the position index, specifically including the following steps: Locate the window region to be replaced in the original time series based on the location index; After aligning the target construction window of the implanted anomaly to the starting boundary of the window region, place it into the position corresponding to the original time series.

8. The method for inserting abnormal sequences based on state consistency according to claim 7, characterized in that, Locating the window region to be replaced in the original time series based on the location index includes the following steps: Backtrack the corresponding time series segment within the original time series based on the location index; Extract the time-series boundary markers of the time-series segments, and determine the window region to be replaced based on the boundary markers.

9. The abnormal sequence insertion method based on state consistency according to claim 8, characterized in that, The process involves constructing a time-continuous enhanced time series based on the target window and other non-overlapping time windows not selected, specifically including the following steps: The target construction window is docked with other non-overlapping time windows that are not selected. The temporal state of the docking position of the adjacent windows is read. The state trend at the end of the unselected window is used as a reference to smoothly connect the abnormal state at the edge of the target construction window after adjustment, so as to form a time-continuous enhanced time series.