Time series data synthesis method and device and storage medium
By segmenting the input data into patch sequences and applying conditional semi-Markov rules, the accuracy problem of existing time series data synthesis methods under complex input data is solved, and time series data synthesis with higher accuracy is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA UNITED NETWORK COMM GRP CO LTD
- Filing Date
- 2026-01-23
- Publication Date
- 2026-05-12
AI Technical Summary
Existing time-series data synthesis methods produce inaccurate results when the input data exhibits significant nonlinearity, structural abruptness, long-range dependence, or multi-scale dynamic characteristics.
By dividing the large amount of input data into multiple patch sequences, and using a preset window and class-conditional semi-Markov rules, the state parameters of each data sequence under each category label are determined, including the initial state distribution, transition probability matrix and state duration distribution, to generate a synthetic data sequence.
It improves the accuracy of time series data synthesis results, reduces data interference from different category labels, and can accurately synthesize time series data without requiring the input data to have a specific distribution.
Smart Images

Figure CN122020529A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus and storage medium for time-series data synthesis. Background Technology
[0002] With the rapid development of artificial intelligence, an increasing number of business scenarios rely on large amounts of data to support model training, testing, and validation. The data primarily originates from real-world scenarios or is artificially synthesized. However, data acquired from real-world scenarios often suffers from issues such as limited volume, inconsistent distribution, or privacy leaks. Therefore, utilizing appropriate data synthesis methods to provide synthetic data for model training, testing, and validation is of great significance.
[0003] Currently, existing time series data synthesis methods mainly rely on statistical and mathematical modeling methods. These methods require the input data to have strong stationarity, linear relationships, or specific distribution characteristics. When the input data exhibits significant nonlinearity, structural abrupt changes, long-range dependence, or multi-scale dynamic characteristics, existing time series data synthesis methods suffer from inaccurate synthesis results. Summary of the Invention
[0004] This application provides a time-series data synthesis method, apparatus, and storage medium, which can improve the accuracy of time-series data synthesis results.
[0005] To achieve the above objectives, this application adopts the following technical solution: In a first aspect, this application provides a method for synthesizing time-series data. The method includes: determining multiple patch sequences based on a preset window and input data; the input data includes multiple data sequences and a category label for each data sequence, wherein the multiple patch sequences are obtained by truncating each data sequence through the preset window; determining state parameters for each data sequence under each category label based on each patch sequence and a class-conditional semi-Markov rule, wherein the state parameters include at least one of the following: initial state distribution, transition probability matrix, and state duration distribution; and determining a synthesized data sequence based on the state parameters and the input data.
[0006] The above technical solution offers at least the following advantages: By segmenting large amounts of input data into multiple patch sequences and analyzing the characteristics of these sequences, the global features of the input data are determined. This allows for a relatively accurate determination of the feature distribution of the input data without requiring a specific distribution, thus synthesizing more accurate time-series data. Furthermore, by separately determining the feature distribution of data sequences under different category labels, interference from data with different category labels can be reduced, further improving the accuracy of the time-series data synthesis results.
[0007] In one possible implementation, based on each patch sequence and class-conditional semi-Markov rules, the state parameters of each data sequence under each category label are determined, including: inputting each patch sequence into an embedding extraction model to determine the embedding features of each patch sequence; clustering the embedding features of each patch sequence to determine the state label of each patch sequence; the state label is used to indicate the state of the data in the corresponding patch sequence; and based on the state label of each patch sequence and class-conditional semi-Markov rules, the state parameters of each data sequence under each category label are determined.
[0008] In one possible implementation, clustering the embedding features of each patch sequence to determine the state label of each patch sequence includes: clustering the embedding features of each patch sequence to determine the membership degree between each patch sequence and each of the at least two cluster centers; and determining the cluster center with the largest membership degree between the at least two cluster centers and each patch sequence as the state label of each patch sequence.
[0009] In one possible implementation, the state parameters of each data sequence under each category label are determined based on the state label of each patch sequence and the class-conditional semi-Markov rule. This includes: determining the state label sequence under the first category label based on the state label of each patch sequence under the first category label and the position of each patch sequence in the corresponding data sequence; the first category label is one of multiple category labels, and the state label sequence is a sequence composed of state labels; inputting the first patch sequence and the state label of the first patch sequence of each data sequence under the first category label into the initial state distribution equation to determine the initial state distribution under the first category label; and / or, determining the transition probability matrix under the first category label based on adjacent state labels in the state label sequence under the first category label; and / or, determining the state duration distribution under the first category label based on the run length of each state label in the state label sequence; the run length is used to indicate the number of patch sequences in which each state label appears consecutively.
[0010] In one possible implementation, the process of determining the synthetic data sequence of the input data based on state parameters and input data includes: determining the initial state label of the synthetic data sequence based on the initial state distribution and input data, and generating the first patch sequence of the synthetic data sequence based on the initial state label; determining the number of consecutive patch sequences of the initial state label based on the state duration distribution and input data, and generating multiple patch sequences based on the number of consecutive patch sequences and the initial state label; determining the state label of the next patch sequence of the multiple patch sequences based on the transition probability matrix and input data, and determining the next patch sequence of the multiple patch sequences based on the state label of the next patch sequence, until the number of generated patch sequences reaches a preset number; and merging the preset number of patch sequences to determine the synthetic data sequence of the input data.
[0011] In one possible implementation, the method further includes: obtaining initial input data; standardizing the initial input data based on the mean and standard deviation of the initial input data to determine the standardized initial input data; and determining the standardized initial input data as the input data.
[0012] In one possible implementation, the standardized initial input data satisfies the following formula:
[0013] in, The t-th data point in the n-th data sequence of the standardized initial input data. For the initial input data, the nth data sequence contains the tth data. Let be the mean of the nth data sequence of the initial input data. Let t be the standard deviation of the nth data sequence in the initial input data, where t and n are positive integers. It is a non-zero constant.
[0014] Secondly, this application provides a time-series data synthesis apparatus, comprising: a determining unit; the determining unit being configured to determine multiple patch sequences based on a preset window and input data; the input data including multiple data sequences and a category label for each data sequence in the multiple data sequences, the multiple patch sequences being obtained by truncating each data sequence through the preset window; the determining unit being further configured to determine state parameters of each data sequence under each category label based on each patch sequence and a class-conditional semi-Markov rule, the state parameters including at least one of the following: initial state distribution, transition probability matrix, and state duration distribution; the determining unit being further configured to determine a synthesized data sequence of the input data based on the state parameters and the input data.
[0015] In one possible implementation, the determining unit is specifically used for: inputting each patch sequence into the embedding extraction model to determine the embedding features of each patch sequence; clustering the embedding features of each patch sequence to determine the state label of each patch sequence; the state label is used to indicate the state of the data in the corresponding patch sequence; and determining the state parameters of each data sequence under each category label based on the state label of each patch sequence and the class-conditional semi-Markov rule.
[0016] In one possible implementation, the unit is specifically used to: cluster the embedding features of each patch sequence, determine the membership degree between each patch sequence and each of the at least two cluster centers; and determine the cluster center with the largest membership degree between the at least two cluster centers and each patch sequence as the state label of each patch sequence.
[0017] In one possible implementation, the determining unit is specifically used for: determining a state label sequence under the first category label based on the state label of each patch sequence under the first category label and the position of each patch sequence in the corresponding data sequence; the first category label is one of multiple category labels, and the state label sequence is a sequence composed of state labels; inputting the first patch sequence and the state label of the first patch sequence of each data sequence under the first category label into the initial state distribution equation to determine the initial state distribution under the first category label; and / or, determining the transition probability matrix under the first category label based on adjacent state labels in the state label sequence under the first category label; and / or, determining the state duration distribution under the first category label based on the run length of each state label in the state label sequence; the run length is used to indicate the number of patch sequences in which each state label appears consecutively.
[0018] In one possible implementation, the determining unit is specifically used for: determining the initial state label of the synthetic data sequence based on the initial state distribution and input data, and generating the first patch sequence of the synthetic data sequence based on the initial state label; determining the number of consecutive patch sequences of the initial state label based on the state duration distribution and input data, and generating multiple patch sequences based on the number of consecutive patch sequences and the initial state label; determining the state label of the next patch sequence of the multiple patch sequences based on the transition probability matrix and input data, and determining the next patch sequence of the multiple patch sequences based on the state label of the next patch sequence, until the number of generated patch sequences reaches a preset number; merging the preset number of patch sequences to determine the synthetic data sequence of the input data.
[0019] In one possible implementation, the time-series data synthesis apparatus further includes: an acquisition unit for acquiring initial input data; a determination unit for standardizing the initial input data based on the mean and standard deviation of the initial input data to determine the standardized initial input data; and a determination unit for determining the standardized initial input data as input data.
[0020] In one possible implementation, the standardized initial input data satisfies the following formula:
[0021] in, The t-th data point in the n-th data sequence of the standardized initial input data. For the initial input data, the nth data sequence contains the tth data. Let be the mean of the nth data sequence of the initial input data. Let t be the standard deviation of the nth data sequence in the initial input data, where t and n are positive integers. It is a non-zero constant.
[0022] Thirdly, this application provides a timing data synthesis apparatus, which includes: a processor and a communication interface; the communication interface and the processor are coupled, and the processor is used to run computer programs or instructions to implement the timing data synthesis method as described in the first aspect and any possible implementation of the first aspect.
[0023] Fourthly, this application provides a computer-readable storage medium storing instructions that, when executed on a terminal, cause the terminal to perform the timing data synthesis method as described in the first aspect and any possible implementation thereof.
[0024] Fifthly, this application provides a computer program product containing instructions that, when run on a timing data synthesis apparatus, causes the timing data synthesis apparatus to perform the timing data synthesis method as described in the first aspect and any possible implementation thereof.
[0025] In a sixth aspect, this application provides a chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run computer programs or instructions to implement the timing data synthesis method as described in the first aspect and any possible implementation thereof.
[0026] Specifically, the chip provided in this application also includes a memory for storing computer programs or instructions. Attached Figure Description
[0027] Figure 1This is a schematic diagram of the structure of a time-series data synthesis system provided in an embodiment of this application; Figure 2 This is a schematic diagram of the composition of a time-series data synthesis apparatus provided in an embodiment of this application; Figure 3 A flowchart of a time-series data synthesis method provided in an embodiment of this application; Figure 4 This is a schematic diagram of a time-series data synthesis device provided in an embodiment of this application. Detailed Implementation
[0028] The timing data synthesis method, apparatus, and storage medium provided in the embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0029] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0030] The terms "first" and "second," etc., used in the specification and drawings of this application are used to distinguish different objects or to distinguish different treatments of the same object, rather than to describe a specific order of objects.
[0031] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.
[0032] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0033] In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0034] With the rapid development of technologies such as artificial intelligence, machine learning, and big data processing, an increasing number of business scenarios rely on high-quality data to support model training, testing, and validation. However, in practical applications, data acquisition and use face numerous challenges, including increasingly stringent data privacy and compliance requirements, scarcity or imbalanced distribution of real data samples, widespread data gaps, and high costs associated with data collection, labeling, and cross-system transfer. Simultaneously, the requirements for data security are constantly increasing during system testing, simulation verification, and technological innovation, while the demands of artificial intelligence and machine learning models for training effectiveness, generalization ability, and iteration efficiency are also continuously growing. Against this backdrop, data synthesis technology has gradually become an important means of addressing these issues. Through data synthesis technology, synthetic data with consistent statistical and structural characteristics can be constructed without directly relying on or exposing real sensitive data. This data can then be used for model training, testing, and evaluation, effectively alleviating the problems of insufficient and imbalanced data, reducing the cost of data acquisition and use, and improving the overall efficiency of model development and iteration.
[0035] Among numerous data types, time-series data is of significant value due to its ability to depict the dynamic processes of objects changing over time. Typical applications such as network traffic analysis, medical monitoring, weather forecasting, and energy load management all describe the evolution of system states in time-series form, serving as crucial bases for decision-making and control. Time-series data is virtually ubiquitous; for example, prediction, alarm, and control functions in different systems rely not on static data at a single moment, but on continuous time trajectories reflecting system behavior. Compared to the synthesis of other data types, time-series data synthesis is more complex. It not only needs to maintain the consistency of numerical distribution at individual time points but also must simultaneously depict dynamic characteristics such as trend changes, periodic and seasonal features, sudden events, and long-term dependencies, thereby maintaining rationality and consistency at both the local time segment and global time structure levels. Therefore, high-quality time-series synthesis methods and strategies are crucial for constructing reliable training data, supporting model evaluation, and system simulation, and have broad application value and practical significance in multiple fields such as intelligent analysis, predictive decision-making, and system optimization.
[0036] Early time series data synthesis primarily relied on statistical and mathematical modeling methods. These methods typically assume that the time series exhibits certain stationarity or linear structure characteristics. They construct classic time series models, such as autoregressive integral moving average models, by estimating parameters from historical data and then randomly sampling based on the statistical distribution of the model residuals to generate new time series samples. For multivariate time series scenarios, joint distribution modeling methods such as the Copula dependency function are often employed. These methods, while characterizing the marginal distribution characteristics of each variable, introduce dependency structure functions to model the correlations between variables, simulating complex collaborative change patterns in multidimensional time series. Furthermore, when the data structure is relatively simple or the dependencies are weak, there are synthesis strategies based on resampling, such as block bootstrapping. This involves dividing the original time series into several continuous segments, recombining the segments while maintaining the temporal order within each segment, thereby preserving local temporal characteristics to some extent and generating new sequence samples.
[0037] With the development of deep learning technology, time series synthesis methods based on neural networks have gradually become a research hotspot. These methods automatically learn complex nonlinear time dependencies through data-driven approaches, reducing reliance on prior assumptions. Among them, generative adversarial methods guide the generative model to gradually approximate the distribution characteristics of real time series by constructing an adversarial training mechanism between the generative and discriminative models; diffusion-based models, from the perspective of random perturbation, achieve the reconstruction of structured time series from noise by gradually injecting noise into real data and learning the corresponding reverse denoising process; variational autoencoder frameworks map time series to a continuous latent space and then decode new sequence samples from the latent representation to achieve distribution-level modeling and sampling; while models based on the encoder Transformer architecture utilize self-attention mechanisms to model the dependencies between different time positions in the sequence, demonstrating strong capabilities in handling long time spans and complex dynamic patterns.
[0038] As described above regarding time series data synthesis methods in related technologies, existing time series data synthesis methods mainly use statistical and mathematical modeling methods to synthesize time series data. These methods require the input data to have strong stationarity, linear relationships, or specific distribution characteristics. When the input data has significant nonlinearity, structural abrupt changes, long-range dependence, or multi-scale dynamic characteristics, existing time series data synthesis methods suffer from inaccurate time series data synthesis results.
[0039] Therefore, this application divides large amounts of input data into multiple patch sequences and analyzes the characteristics of these sequences to determine the global features of the input data. This allows for a relatively accurate determination of the feature distribution of the input data without requiring a specific distribution, thus synthesizing more accurate time-series data. Furthermore, by separately determining the feature distribution of data sequences under different category labels, interference from data with different category labels can be reduced, further improving the accuracy of the time-series data synthesis results.
[0040] The technical solutions provided in this application can be applied to various communication systems, such as New Radio (NR) communication systems using 5G, future evolution systems, or multiple communication convergence systems.
[0041] For example, such as Figure 1 The diagram shown is a structural schematic of a time-series data synthesis system provided in an embodiment of this application. The time-series data synthesis system may include a data acquisition device 101 and a time-series data synthesis device 102. The data acquisition device 101 and the time-series data synthesis device 102 are communicatively connected. Figure 1 Only one data acquisition device 101 and one time-series data synthesis device 102 are shown in the illustration. This application embodiment does not impose any limitation on the number of data acquisition devices 101 and time-series data synthesis devices 102.
[0042] In one possible implementation, the data acquisition device 101 can be a device with wireless transceiver capabilities, and this application does not impose any restrictions on this. For example, the data acquisition device 101 can be a mobile device (such as a mobile phone, tablet computer, or VR glasses).
[0043] In one possible implementation, a data acquisition device 101 is used to acquire input data, which includes multiple data sequences and a category label for each data sequence.
[0044] In one possible implementation, the time-series data synthesis device 102 can be an electronic device such as a personal computer (PC), laptop computer, mobile device, tablet computer, or laptop computer. This application embodiment does not limit the specific form of the electronic device. Alternatively, the time-series data synthesis device 102 can also be a server, or a server cluster consisting of multiple servers. In some implementations, the server cluster can be a distributed cluster server. This application embodiment does not impose any limitations in this regard.
[0045] In one possible implementation, a time-series data synthesis device 102 receives input data from a data acquisition device 101. Based on a preset window and the input data, multiple patch sequences are determined. The input data includes multiple data sequences and a category label for each data sequence. The multiple patch sequences are obtained by truncating each data sequence through the preset window. Based on each patch sequence and a class-conditional semi-Markov rule, state parameters for each data sequence under each category label are determined. The state parameters include at least one of the following: initial state distribution, transition probability matrix, and state duration distribution. Based on the state parameters and the input data, a synthesized data sequence of the input data is determined.
[0046] It should be noted that, Figure 1 This is just an example framework diagram. Figure 1 The number of nodes included and the names of each device are unlimited, except for... Figure 1 In addition to the functional nodes shown, the time-series data synthesis system may also include other nodes, such as core network equipment, and this application does not impose any restrictions on this.
[0047] The application scenarios of the embodiments in this application are not limited. The system architecture and business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems. For example, the data acquisition device 101 and the time-series data synthesis device 102 can be separate devices or different functional modules on the same device.
[0048] In practical implementation, Figure 1 All the equipment in the middle can be adopted Figure 2 The shown composition structure, or including Figure 2 The components shown. Figure 2 This is a schematic diagram illustrating the composition of a timing data synthesis apparatus 20 provided in an embodiment of this application. The timing data synthesis apparatus 20 can be a timing data synthesis device 102 or a chip or system-on-a-chip within the timing data synthesis device 102. For example... Figure 2 As shown, the timing data synthesis device 20 may include a processor 201, a bus 202, a communication interface 203, and a memory 204.
[0049] The processor 201, memory 204 and communication interface 203 can be connected via bus 202.
[0050] The processor 201 can be a central processing unit (CPU), a general-purpose processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof. The processor 201 can also be other devices with processing capabilities, such as circuits, devices, or software modules, without limitation.
[0051] Bus 202 is used to transmit information between the components included in the timing data synthesis device 20.
[0052] Communication interface 203 is used to communicate with other devices or other communication networks. These other communication networks can be Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc. Communication interface 203 can be a module, circuit, communication interface, or any device capable of enabling communication.
[0053] Memory 204 is used to store instructions. These instructions can be computer programs.
[0054] The memory 204 can be a read-only memory (ROM) or other type of static storage device that can store static information and / or instructions; it can also be a random access memory (RAM) or other type of dynamic storage device that can store information and / or instructions; it can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, etc., without limitation.
[0055] It should be noted that the memory 204 can exist independently of the processor 201 or be integrated with the processor 201. The memory 204 can be used to store instructions, program code, or some data. The memory 204 can be located inside or outside the timing data synthesis device 20, without limitation.
[0056] In one example, processor 201 may include one or more CPUs.
[0057] As an optional implementation, the timing data synthesis apparatus 20 includes multiple processors.
[0058] As an optional implementation, the timing data synthesis apparatus 20 may also include output devices and input devices. For example, input devices are devices such as keyboards, mice, microphones, or joysticks, and output devices are devices such as displays or speakers.
[0059] It should be noted that the timing data synthesis device 20 can be a desktop computer, laptop computer, network server, mobile phone, tablet computer, wireless terminal, embedded device, chip system, or other device. Figure 1 Equipment with a similar structure. Furthermore... Figure 2 The composition shown does not constitute a basis for the interpretation of this invention. Figure 1 as well as Figure 2 The limitations of each device in the process, except Figure 2 In addition to the components shown, Figure 1 as well as Figure 2 The various devices may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0060] In this embodiment of the application, the chip system may be composed of chips or may include chips and other discrete devices.
[0061] Furthermore, the actions, terms, etc., involved in the various embodiments of this application can be referenced interchangeably without limitation. The message names or parameter names in the messages exchanged between the various devices in the embodiments of this application are merely examples, and other names may be used in specific implementations without limitation.
[0062] The following is combined Figure 1 The time-series data synthesis system shown describes the time-series data synthesis method provided in the embodiments of this application. The actions, terminology, etc., involved in the various embodiments of this application can be referred to mutually without limitation. The message names or parameter names in the messages exchanged between various devices in the embodiments of this application are merely examples; other names can be used in specific implementations without limitation. The actions involved in the various embodiments of this application are merely examples; other names can be used in specific implementations. For example, "included in" in the embodiments of this application can be replaced with "carried in" or "carried in," etc.
[0063] In order to solve the problems existing in the above-mentioned prior art, such as Figure 3The diagram shows a flowchart of a time-series data synthesis method provided in an embodiment of this application. This time-series data synthesis method can improve the accuracy of the time-series data synthesis results. The method includes: S301. Based on the preset window and input data, determine multiple patch sequences.
[0064] The input data includes multiple data sequences and category labels for each data sequence. The multiple patch sequences are obtained by extracting each data sequence through a preset window.
[0065] The preset window is a sliding window with a preset window length, which truncates the data sequence by setting a step size. The preset window length and step size can be set according to requirements.
[0066] For example, if the window length of the preset window is L and the step size is S, then the data sequence is truncated through the preset window, and each patch sequence contains L data points, and the first data point of two adjacent patch sequences differs by S data points.
[0067] The input data consists of real-world time-series data collected in actual scenarios. By analyzing the distribution characteristics of the input data, synthetic data with similar distribution characteristics is synthesized. The input data includes multiple data sequences.
[0068] For example, input data for .in, For the nth data sequence, Let C be the category label of the nth data sequence. The category label is represented by consecutive integers, where N is the total number of data sequences, n is an integer, and C is the number of category labels.
[0069] Category labels are category identifiers for input data, representing discrete values that indicate the category to which the input data belongs. For example, different category labels can indicate different acquisition methods for different data sequences; for instance, a manually collected boiler room temperature sequence might be represented by the number 0, while a sensor-collected boiler room temperature sequence might be represented by the number 1. They can also be used to indicate data from different objects within the same scene; for example, a boiler room temperature sequence might be represented by the number 0, while a boiler room humidity sequence might be represented by the number 1.
[0070] After obtaining the initial input data, since the original labels of the initial input data may not be represented by consecutive integers and the units of measurement of different data may be different, it is necessary to process the initial input data to determine the input data. Specifically, if the original class label set of the data sequence is not a consecutive integer, the original class label set can be mapped to consecutive integer labels by numerical conversion. If the units of measurement of different data are different, the input data can be processed by Z-score standardization.
[0071] In one possible implementation, before S301 above, the following process is also included: obtaining initial input data; standardizing the initial input data based on the mean and standard deviation of each data sequence in the initial input data to determine the standardized initial input data; and determining the standardized initial input data as the input data.
[0072] In one possible implementation, the mean of the data sequence satisfies the following formula 1: Formula 1.
[0073] in, Let be the mean of the nth data sequence. Let t be the t-th data in the n-th data sequence of the initial input data, where T is the total number of data sequences, and t and n are positive integers.
[0074] In one possible implementation, the standard deviation of the data series satisfies the following formula 2: Formula 2.
[0075] in, Let n be the standard deviation of the nth data sequence. Let be the mean of the nth data sequence. Let t be the t-th data in the n-th data sequence of the initial input data, where T is the total number of data sequences, and t and n are positive integers.
[0076] In one possible implementation, the standardized initial input data satisfies the following formula 3: Formula 3 in, The t-th data point in the n-th data sequence of the standardized initial input data. For the initial input data, the nth data sequence contains the tth data. Let be the mean of the nth data sequence of the initial input data. Let t be the standard deviation of the nth data sequence in the initial input data, where t and n are positive integers. It is a non-zero constant.
[0077] In one possible implementation, given the mean and standard deviation of the input data, the input data can be directly standardized using Formula 3 above.
[0078] By standardizing the input data, different scales can be unified to a standard normal distribution, reducing the impact of large differences in numerical range on data feature analysis and providing accurate data support for subsequent determination of the characteristics of the input data.
[0079] Since the input data may not exhibit strong stationarity, linearity, or a specific distribution, after determining the input data, it is necessary to analyze the local and global distribution of the input data through patch sequence analysis to determine its distribution characteristics. Specifically, multiple patch sequences can be extracted from the data sequence using a preset window.
[0080] In one possible implementation, S301 can be implemented as follows: A sliding window of a preset length is used to extract the first patch sequence from the data sequence. The sliding window is then moved based on a preset step size to extract the next patch sequence from the data sequence. This process continues until the sliding window reaches the last data point in the data sequence, thus determining multiple patch sequences.
[0081] For example, for a data sequence x with a total number of data points of T, the data sequence x is truncated by a preset window with a preset length of L and a step size of S to determine the set of starting points for multiple patch sequences. for To ensure tail coverage of the patch sequence, calculation Is it less than T? If it is less than T, then in the starting point set append in As the final starting point. (To be obtained) A patch sequence, Represents the set of starting points The number of elements. The patch sequence can be represented as: ,in, This represents the i-th patch sequence. This indicates that the starting point of the data sequence x is... End point is The data. If the number of data items in the patch sequence is less than L, it is padded with zeros.
[0082] It should be noted that the embodiments of this application do not limit the length and step size of the preset window. In practical applications, these can be set according to requirements to cover different application scenarios. For example, in scenarios where data changes frequently, such as time-series data of electrocardiograms, the characteristics of the acquired input data may also change frequently. In such cases, a smaller preset window length and step size can be set to obtain a denser patch sequence. Conversely, in scenarios where data changes infrequently, such as time-series data of daily temperature, a larger preset window length and step size can be set to reduce the number of patch sequences and improve computational efficiency.
[0083] S302. Based on each patch sequence and class-conditional semi-Markov rules, determine the state parameters of each data sequence under each category label.
[0084] The state parameters include at least one of the following: initial state distribution, transition probability matrix, and state duration distribution.
[0085] The initial state distribution represents the probability distribution of the data sequence under the corresponding category label in each state at the initial time. It is used to determine the initial state of the synthesized time series data sequence. For example, the probability that the initial data of the daily temperature sequence in the boiler room is abnormal data with a value greater than a preset value is 0.01, and the probability that the initial data is normal data with a value less than or equal to the preset value is 0.99.
[0086] A transition probability matrix represents the probability that data in a data sequence under a corresponding category label will transition from one state to another. It is used to generate subsequent data based on previously generated data. For example, the transition probability matrix A representing the temperature transition between abnormal and normal states in a boiler room could be... In the transition probability matrix A, the first row indicates that if the boiler room temperature is in a normal state, the probability of it remaining normal at the next moment is 0.9, and the probability of it becoming abnormal at the next moment is 0.1. The second row indicates that if the boiler room temperature is in an abnormal state, the probability of it returning to normal at the next moment is 0.4, and the probability of it remaining abnormal at the next moment is 0.6.
[0087] The state duration distribution represents the probability distribution of the duration (number of consecutive time steps) of data in a certain state within a data sequence under a corresponding category label. It is used to determine the duration of a certain state of data in a synthesized time series data sequence. For example, for a temperature time series data sequence of a boiler room, the state transition probability of the normal state data is 0.9, so the duration of the normal state data is 10 time steps.
[0088] Class-conditional semi-Markov rules are a method for extracting state parameters of a data sequence for a given class. By extracting the state parameters in the semi-Markov rules within a class, interference between data sequences of different class labels can be avoided, thereby extracting accurate state parameters of the data sequence.
[0089] After determining multiple patch sequences, it is necessary to determine the state parameters of each data sequence under each category label based on the multiple patch sequences. Specifically, the state parameters of each data sequence under each category label can be determined through class-conditional semi-Markov rules.
[0090] In one possible implementation, S302 above can be implemented as follows: Each patch sequence is input into the embedding extraction model to determine the embedding features of each patch sequence. The embedding features of each patch sequence are clustered to determine the state label of each patch sequence. The state label is used to indicate the state of the data in the corresponding patch sequence. Based on the state label of each patch sequence and the class-conditional semi-Markov rule, the state parameters of each data sequence under each class label are determined.
[0091] Before determining the embedding features of each patch sequence, an embedding extraction model can be trained, and the embedding features of each patch sequence can be extracted using the embedding extraction model.
[0092] In one possible implementation, training the embedding extraction model can be achieved as follows: Each patch sequence is input into the initial encoder to determine the initial embedding features of each patch sequence. Each initial embedding feature is input into the initial decoder to determine each reconstructed patch sequence. The initial encoder is trained by minimizing the loss between each reconstructed patch sequence and each patch sequence. When the loss between each reconstructed patch sequence and each patch sequence meets a preset condition, the initial encoder is determined as the embedding extraction model.
[0093] For example, for a set consisting of patch sequences ,in, The total number of patch sequences. Let m be the m-th patch sequence, where m is a positive integer. Input one of the patch sequences p into the initial encoder to determine the initial embedding features of patch sequence p. , initial embedded features Input the initial decoder to determine the reconstruction patch sequence. Minimize the patch sequence p and the reconstructed patch sequence using the mean squared error loss function. The loss between them determines the embedding extraction model. .
[0094] By performing self-supervised representation learning on patch sequences, the model can learn the features of patch sequences even when there are few or no patch sequences labeled, thus reducing the model training cost.
[0095] In one possible implementation, the mean squared error loss function satisfies the following formula 4: Formula 4.
[0096] in, Indicates the initial encoder. Indicates the initial decoder, This indicates a patch sequence.
[0097] By performing self-supervised representation learning on patch sequences, the model can learn the features of patch sequences even when there are few or no patch sequences labeled, thus reducing the model training cost.
[0098] After training the embedding extraction model, the patch sequences can be input into the trained model to determine the embedding features of each patch sequence. To determine the state distribution of each data sequence, the state of each patch sequence needs to be determined through the embedding features. Specifically, the state of each patch sequence can be determined by clustering the embedding features of each patch sequence.
[0099] In one possible implementation, the process of clustering the embedding features of each patch sequence to determine the state label of each patch sequence can be implemented as follows: Cluster the embedding features of each patch sequence, determine the membership degree between each patch sequence and each of the at least two cluster centers. The cluster center with the highest membership degree between the at least two cluster centers and each patch sequence is determined as the state label of each patch sequence.
[0100] For example, when clustering a patch sequence with category label y, let the number of clusters be... Initial membership matrix Cluster center is The patch sequences are clustered using a fuzzy C-means clustering algorithm, updating the membership degree of each patch sequence to its cluster centers and the cluster centers themselves. A stopping condition for cluster iteration is determined based on the membership matrix and the objective function. Cluster iteration stops when the objective function reaches its minimum value, and the membership matrix is then determined. The membership matrix indicates the membership degree of each patch sequence to m cluster centers, where m is a fuzzy coefficient with a value greater than 1.
[0101] In one possible implementation, the iterative update of cluster centers satisfies the following formula 5: Formula 5 in, The cluster center is m, and the fuzzy coefficient is m. For the i-th patch sequence, Let be the element in the k-th row and i-th column of the membership matrix, where k and i are positive integers.
[0102] In one possible implementation, the iterative update of the membership matrix satisfies the following formula 6: Formula 6 in, The element in the k-th row and i-th column of the membership matrix. The cluster center is m, and the fuzzy coefficient is m. For the i-th patch sequence, Let j be the number of clusters, and j, k, and i be positive integers.
[0103] In one possible implementation, the objective function satisfies the following formula 7: Formula 7 in, This indicates the number of patch sequences with category label y. The element in the k-th row and i-th column of the membership matrix. The cluster center is m, and the fuzzy coefficient is m. For the i-th patch sequence, Let k be the number of clusters, and i be positive integers. The value is the objective function value.
[0104] After determining the membership matrix, it is necessary to determine the state of each patch sequence using the membership matrix. The membership matrix indicates the membership degree of each patch sequence to the cluster center, and the cluster center represents different preset state labels. Therefore, the cluster center corresponding to each patch sequence can be determined by the membership degree of each patch sequence to the cluster center, thereby determining the state corresponding to the cluster center as the state of the corresponding patch sequence.
[0105] In one possible implementation, determining the state label of each patch sequence based on the membership matrix can be achieved by determining the cluster center with the highest membership degree between the cluster center and each patch sequence as the state label of each patch sequence.
[0106] In one possible implementation, the status label satisfies the following formula 8: Formula 8 in, For status labels, Let be the element in the k-th row and i-th column of the membership matrix, where k is a positive integer.
[0107] Fuzzy clustering provides soft assignment for time-series segments with unclear state boundaries and continuous morphological transitions, reducing the over-discretization problem caused by hard clustering. By clustering separately according to category labels, the state labels of the patch sequence can be determined, which can reduce the mutual interference between data of different category labels, improve the accuracy of determining the state labels of the patch sequence, and provide data support for the subsequent determination of the state parameters of the data sequence.
[0108] After determining the status label of each patch sequence, it is necessary to determine the status parameters of the data sequence. Specifically, the distribution of status labels in the data sequence can be determined by the position of the status label of the patch sequence in the corresponding data sequence, and the status parameters of the data sequence can be determined based on the distribution of status labels.
[0109] In one possible implementation, the state parameters of each data sequence under each category label are determined based on the state label of each patch sequence and the class-conditional semi-Markov rule. This can be achieved as follows: Based on the state label of each patch sequence under the first category label and the position of each patch sequence in the corresponding data sequence, the state label sequence under the first category label is determined; the first category label is one of multiple category labels, and the state label sequence is a sequence composed of state labels. The first patch sequence and its state label are input into the initial state distribution equation for each data sequence under the first category label to determine the initial state distribution under the first category label. And / or, based on adjacent state labels in the state label sequence under the first category label, the transition probability matrix under the first category label is determined. And / or, based on the run length of each state label in the state label sequence, the state duration distribution under the first category label is determined; the run length indicates the number of consecutive patch sequences for each state label.
[0110] For example, under the first category label y, for the data sequence The state label sequence is Substituting the state label sequence into the initial state distribution equation, the initial state distribution is determined as follows: Substitute the state label sequence into the transition probability equation to determine the transition probability matrix. Substituting the state label sequence into the state duration distribution equation, the state duration distribution is determined. .
[0111] In one possible implementation, the initial state distribution satisfies the following formula 9: Formula 9 in, Let k be the state label corresponding to the first patch sequence in the nth data sequence, and k be the state label. For status labels, Cluster number, For concentration parameters, This represents the probability that the state label of the first patch sequence in the data sequence is k.
[0112] In one possible implementation, the transition probability matrix satisfies the following formula 10: Formula 10 in, This represents the status label corresponding to the t-th patch sequence in the data sequence. This represents the status label corresponding to the (t+1)th patch sequence in the data sequence. For concentration parameters, and For status labels, Cluster number, This indicates that the state of data in the data sequence is determined by... Change to The probability matrix.
[0113] In one possible implementation, the state duration distribution satisfies the following formula 11: Formula 11 in, Here, 'b' represents the discretization bucket number, and 'B' is the maximum number of buckets that can be discretized. For concentration parameters, status label The probability that the duration is b.
[0114] It should be noted that the above example is only one possible implementation method. In actual application, it can be set according to the requirements to cover different application scenarios.
[0115] S303. Based on the state parameters and input data, determine the synthetic data sequence of the input data.
[0116] After determining the state parameters, the state parameters can accurately reflect the states of the data sequence. By synthesizing data sequences with similar state distributions, the synthetic data sequence of the input data can be determined.
[0117] Before determining the synthetic data sequence of the input data, a variational autoencoder (VAE) can be trained to improve the stability and distribution coverage of parameter estimation under conditions of small samples and class imbalance. Specifically, class labels and state labels can be mapped to continuous vectors using embedding matrices, for example, in neural network layers. The VAE encoder determines the mean and log-variance of the patch sequence and achieves differentiable sampling through reparameterization. The decoder combines latent variables and conditional embeddings to generate reconstructed data. The VAE model is determined by jointly optimizing the model using a β-VAE objective function.
[0118] In one possible implementation, the continuous vector of category labels satisfies the following formula 12: Formula 12 in, For category labels, Let y be the vector of category labels. This is the embedding matrix.
[0119] In one possible implementation, the continuous vector of state labels satisfies the following formula 13: Formula 13 Where k is the status label. Let k be the vector of state labels. This is the embedding matrix.
[0120] In one possible implementation, the mean and logarithmic variance of the encoder output satisfy the following formula 14: Formula 14 in, For variance, The mean, Let z be the patch sequence, and z be the latent variable. For encoder networks, It follows a multivariate Gaussian distribution.
[0121] In one possible implementation, reparameterized sampling satisfies the following formula 15: Formula 15 in, For variance, Let z be the mean, ⊙ denotes element-wise multiplication, and z be a latent variable.
[0122] In one possible implementation, the reconstructed data satisfies the following formula 16: Formula 16 in, For decoder networks, To reconstruct the data, z is a latent variable. Let k be the vector of state labels. Let y be the vector of the category label.
[0123] In one possible implementation, the β-VAE objective function satisfies the following formula 17: Formula 17 in, For reconstruction error, For KL regular expressions, The weight of the KL term.
[0124] In one possible implementation, KL regular expressions The following formula 18 is satisfied: Formula 18 in, Let j be the average value of the reconstructed data sequence. Reconstruct the total number of data sequences. Let be the standard deviation of the j-th reconstructed data sequence.
[0125] In one possible implementation, S303 above can be implemented as follows: Based on the initial state distribution and input data, determine the initial state label of the synthesized data sequence, and generate the first patch sequence of the synthesized data sequence based on the initial state label. Based on the state duration distribution and input data, determine the number of consecutive patch sequences with the initial state label, and generate multiple patch sequences based on the number of consecutive patch sequences and the initial state label. Based on the transition probability matrix and input data, determine the state label of the next patch sequence of the multiple patch sequences, and determine the next patch sequence of the multiple patch sequences based on the state label of the next patch sequence, until the number of generated patch sequences reaches a preset number. Merge the preset number of patch sequences to determine the synthesized data sequence of the input data.
[0126] For example, for synthetic time-series data with a synthetic category label of y, the initial state distribution is used... Determine the initial value of the sampling state for synthesizing time-series data. Based on state duration distribution Determine the duration of the current state k, the duration is determined by the number of patch sequences. Calculation. Generation After a patch sequence, based on the transition probability matrix Determine the next state of the current state k. Until the number of patch sequences reaches a preset value. .
[0127] For example, for each patch sequence that needs to be generated, in the current category With state Below, in terms of probability Select a patch sequence from the real patch library (prototype library) as the output, and use probability... Generated from a conditional VAE model.
[0128] In one possible implementation, the generated patch sequence satisfies the following formula 19: Formula 19 in, It is a patch sequence in a real patch library. A function to generate patch sequences for VAE models. It is a real patch prototype library obtained by aggregating hard states. Parameters are used to control the magnitude and diversity of the generated disturbances.
[0129] To suppress boundary abrupt changes and artifacts at patch splicing points and improve temporal continuity and boundary consistency, a weighted average of overlapping regions between patch sequences is performed using the Hanning window, and multiple synthesized patch sequences are fused.
[0130] In one possible implementation, the Hanning window satisfies the following formula 20: Formula 20 Where L is the length of the patch sequence, w[ [Length is] Hanning window, It is an integer.
[0131] In one possible implementation, the weighted averaged patch sequence satisfies the following formula 21: Formula 21 in, For the i-th synthesized patch sequence, To avoid stable terms with a denominator of 0, K is the total number of synthetic patch sequences.
[0132] Since the input data includes multiple category labels, it is necessary to determine the total number of synthesized time-series data sequences and the number of data sequences synthesized for each category label.
[0133] In one possible implementation, the total number of synthesized time-series data sequences is determined based on the total number of samples in the input data. The number of data sequences synthesized for each category label is allocated based on the frequency of the category labels in the input data.
[0134] For example, when the amount of data to be synthesized is r times the amount of input data, where r is greater than 1, the input data multiple and the amount of input data are multiplied together and rounded up to determine the target data amount. If the target data amount is greater than the amount of input data, the difference between the target data amount and the amount of input data is generated.
[0135] In one possible implementation, the total number of synthesized time-series data sequences satisfies the following formula 22: Formula 22 in, For the target data volume, The amount of input data. This is the amount of data that still needs to be synthesized.
[0136] In one possible implementation, the amount of data to be synthesized for each category label satisfies the following formula 23: Formula 23 in, The amount of data that still needs to be synthesized, The amount of data with category label c in the input data. This represents the total amount of data for all category labels in the input data. A function for rounding to the nearest integer.
[0137] Before synthesizing time series data, two types of quantifiable constraints can be introduced into the synthesized time series data sequence: robust statistical constraints and optional task consistency constraints. Threshold relaxation rounds and a safety net strategy are provided to ensure that the output set is controllable between "satisfying quality constraints" and "not being excessively reduced in quantity".
[0138] In one possible implementation, the robust statistical constraints are implemented as follows: The data sequence is input into a preset formula to determine a robust eigenvector, which is composed of the mean absolute magnitude, standard deviation, energy, and first-order autocorrelation. Based on the robust eigenvector, the Z-score of the synthesized data sequence is determined, and the Z-score with the largest dimension is used as the deviation.
[0139] In one possible implementation, the average absolute magnitude satisfies the following formula 24: Formula 24 in, The average absolute amplitude, Let t be the t-th data sequence, and T be the total number of data sequences.
[0140] In one possible implementation, the standard deviation satisfies the following formula 25: Formula 25 in, Standard deviation Let t be the t-th data sequence, and T be the total number of data sequences. This is the average value.
[0141] In one possible implementation, the energy satisfies the following formula 26: Formula 26 in, For energy, Let t be the t-th data sequence, and T be the total number of data sequences.
[0142] In one possible implementation, the first-order autocorrelation satisfies the following formula 27: Formula 27 in, It is a first-order autocorrelation. Let t be the t-th data sequence, and T be the total number of data sequences. It is a constant.
[0143] For example, for robust feature vectors For each category The mean of this type of sample is calculated using the real training set. with standard deviation (For each feature dimension). To avoid over-elimination due to excessively small standard deviations, the standard deviation is... and lower limit of standard deviation The larger of the two values is determined as the standard deviation. .
[0144] In one possible implementation, the Z-score satisfies the following formula 28: Formula 28 in, The Z-score, For robust feature vectors, The mean, The standard deviation is denoted as .
[0145] For example, the implementation process of the optional task consistency constraint is as follows: train a lightweight temporal classifier. Output class probability Define prediction categories With confidence level ,in, ,in, This is the minimum confidence threshold (min_conf). This constraint is used to reduce the probability of "target class mismatched samples" entering the output set. If the number of samples retained under the strict threshold is lower than the minimum retention target... Then in the first wheel relaxation ,in The relaxation coefficient is [value], and the maximum number of rounds is [value]. This mechanism achieves a controllable trade-off between "quality and quantity," preventing the filter from causing empty outputs in scenarios with small samples or high noise. If multiple rounds of relaxation are still insufficient... Then, for each category, according to the degree of deviation Select the top-k samples that best approximate the true distribution from smallest to largest to supplement the remaining samples, so that the final number of retained samples reaches [a certain number]. (or no more than the total number of synthesized samples). This strategy guarantees a lower bound on the output size and prioritizes retaining the statistically most "realistic" sample.
[0146] For example, after screening by quality constraints, the synthetic dataset is determined: Optional: Merge datasets It is used for testing, simulation, or model training.
[0147] To address the problems existing in the prior art, this application divides large amounts of input data into multiple patch sequences. By analyzing the characteristics of these multiple patch sequences, the global features of the input data are determined. This allows for a relatively accurate determination of the feature distribution of the input data without requiring a specific distribution, thus synthesizing more accurate time-series data. Furthermore, by separately determining the feature distribution of data sequences under different category labels, interference from data with different category labels can be reduced, further improving the accuracy of the time-series data synthesis results.
[0148] It is understood that the aforementioned time-series data synthesis method can be implemented by a time-series data synthesis apparatus. To achieve the above functions, the time-series data synthesis apparatus includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, the embodiments disclosed in this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments disclosed in this application.
[0149] The embodiments disclosed in this application can divide the time-series data synthesis apparatus generated according to the above method examples into functional modules. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware or as software functional modules. It should be noted that the module division in the embodiments disclosed in this application is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0150] Figure 4 This is a schematic diagram of a time-series data synthesis device provided in an embodiment of the present invention. Figure 4 As shown, the timing data synthesis device 40 can be used to perform... Figure 3 The time-series data synthesis method is shown. The time-series data synthesis apparatus 40 includes: an acquisition unit 401 and a determination unit 402; the determination unit 402 is used to determine multiple patch sequences based on a preset window and input data; the input data includes multiple data sequences and a category label for each data sequence in the multiple data sequences, and the multiple patch sequences are obtained by truncating each data sequence through the preset window; the determination unit 402 is also used to determine the state parameters of each data sequence under each category label based on each patch sequence and a class-conditional semi-Markov rule, the state parameters including at least one of the following: initial state distribution, transition probability matrix, and state duration distribution; the determination unit 402 is also used to determine the synthesized data sequence of the input data based on the state parameters and the input data.
[0151] In one possible implementation, the determining unit 402 is specifically used to: input each patch sequence into the embedding extraction model to determine the embedding features of each patch sequence; cluster the embedding features of each patch sequence to determine the state label of each patch sequence; the state label is used to indicate the state of the data in the corresponding patch sequence; and based on the state label of each patch sequence and the class-conditional semi-Markov rule, determine the state parameters of each data sequence under each class label.
[0152] In one possible implementation, the determining unit 402 is specifically used to: cluster the embedding features of each patch sequence, determine the membership degree between each patch sequence and each of the at least two cluster centers; and determine the cluster center with the largest membership degree between the at least two cluster centers and each patch sequence as the state label of each patch sequence.
[0153] In one possible implementation, the determining unit 402 is specifically used to: determine the state label sequence under the first category label based on the state label of each patch sequence under the first category label and the position of each patch sequence in the corresponding data sequence; the first category label is one of multiple category labels, and the state label sequence is a sequence composed of state labels; input the first patch sequence and the state label of the first patch sequence of each data sequence under the first category label into the initial state distribution equation to determine the initial state distribution under the first category label; and / or, determine the transition probability matrix under the first category label based on adjacent state labels in the state label sequence under the first category label; and / or, determine the state duration distribution under the first category label based on the run length of each state label in the state label sequence; the run length is used to indicate the number of patch sequences in which each state label appears consecutively.
[0154] In one possible implementation, the determining unit 402 is specifically used for: determining the initial state label of the synthetic data sequence based on the initial state distribution and input data, and generating the first patch sequence of the synthetic data sequence based on the initial state label; determining the number of consecutive patch sequences of the initial state label based on the state duration distribution and input data, and generating multiple patch sequences based on the number of consecutive patch sequences and the initial state label; determining the state label of the next patch sequence of the multiple patch sequences based on the transition probability matrix and input data, and determining the next patch sequence of the multiple patch sequences based on the state label of the next patch sequence, until the number of generated patch sequences reaches a preset number; merging the preset number of patch sequences to determine the synthetic data sequence of the input data.
[0155] In one possible implementation, the acquisition unit 401 is used to acquire initial input data; the determination unit 402 is further used to standardize the initial input data based on the mean and standard deviation of the initial input data, and determine the standardized initial input data; the determination unit 402 is further used to determine the standardized initial input data as input data.
[0156] In one possible implementation, the standardized initial input data satisfies the following formula:
[0157] in, The t-th data point in the n-th data sequence of the standardized initial input data. For the initial input data, the nth data sequence contains the tth data. Let be the mean of the nth data sequence of the initial input data. Let t be the standard deviation of the nth data sequence in the initial input data, where t and n are positive integers. It is a non-zero constant.
[0158] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0159] This disclosure also provides a computer-readable storage medium storing instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the timing data synthesis method provided in the embodiments of this disclosure described above.
[0160] This disclosure also provides a computer program product containing instructions that, when run on an electronic device, cause the electronic device to execute the timing data synthesis method provided in the above-described embodiments of this disclosure.
[0161] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires; a portable computer disk drive; a hard disk drive; a random access memory (RAM); a read-only memory (ROM); an erasable programmable read-only memory (EPROM); a register; a hard disk drive; an optical fiber; a portable compact disc read-only memory (CD-ROM); an optical storage device; a magnetic storage device; or any suitable combination thereof; or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in an application-specific integrated circuit (ASIC). In the embodiments of this application, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0162] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for synthesizing time-series data, characterized in that, The method includes: Based on a preset window and input data, multiple patch sequences are determined; the input data includes multiple data sequences and a category label for each data sequence, and the multiple patch sequences are obtained by extracting each data sequence through the preset window; Based on each patch sequence and the class-conditional semi-Markov rule, determine the state parameters of each data sequence under each category label. The state parameters include at least one of the following: initial state distribution, transition probability matrix, and state duration distribution. Based on the state parameters and the input data, a synthetic data sequence of the input data is determined.
2. The method according to claim 1, characterized in that, The process of determining the state parameters of each data sequence under each category label based on each patch sequence and the class-conditional semi-Markov rule includes: Each patch sequence is input into the embedding extraction model to determine the embedding features of each patch sequence; Clustering is performed on the embedding features of each patch sequence to determine the state label of each patch sequence; the state label is used to indicate the state of the data in the corresponding patch sequence. Based on the state label and class-conditional semi-Markov rule of each patch sequence, determine the state parameters of each data sequence under each class label.
3. The method according to claim 2, characterized in that, The step of clustering the embedded features of each patch sequence to determine the state label of each patch sequence includes: Cluster the embedding features of each patch sequence to determine the membership degree between each patch sequence and each of the at least two cluster centers; The cluster center with the highest membership degree among the at least two cluster centers and each patch sequence is determined as the status label of each patch sequence.
4. The method according to claim 2, characterized in that, The determination of state parameters for each data sequence under each category label based on the state label and class-conditional semi-Markov rule of each patch sequence includes: Based on the status label of each patch sequence under the first category label and the position of each patch sequence in the corresponding data sequence, the status label sequence under the first category label is determined; the first category label is one of the multiple category labels, and the status label sequence is a sequence composed of status labels; Input the first patch sequence and the state label of the first patch sequence into the initial state distribution equation for each data sequence under the first category label to determine the initial state distribution under the first category label; and / or, Based on adjacent state labels in the state label sequence under the first category label, determine the transition probability matrix under the first category label; and / or, Based on the run length of each state label in the state label sequence, the distribution of state duration under the first category of labels is determined; the run length is used to indicate the number of consecutive patch sequences for each state label.
5. The method according to claim 1, characterized in that, The step of determining the synthetic data sequence of the input data based on the state parameters and the input data includes: Based on the initial state distribution and the input data, the initial state label of the synthesized data sequence is determined, and the first patch sequence of the synthesized data sequence is generated based on the initial state label; Based on the state duration distribution and the input data, determine the number of consecutive patch sequences of the starting state label, and generate multiple patch sequences based on the number of consecutive patch sequences and the starting state label; Based on the transition probability matrix and the input data, the state label of the next patch sequence of the plurality of patch sequences is determined, and the next patch sequence of the plurality of patch sequences is determined based on the state label of the next patch sequence, until the number of generated patch sequences reaches a preset number; The preset number of patch sequences are merged to determine the synthetic data sequence of the input data.
6. The method according to claim 1, characterized in that, The method further includes: Obtain initial input data; Based on the mean and standard deviation of each data sequence in the initial input data, the initial input data is standardized to determine the standardized initial input data; The standardized initial input data is determined as the input data.
7. The method according to claim 6, characterized in that, The standardized initial input data satisfies the following formula: in, The t-th data point in the n-th data sequence of the standardized initial input data. For the nth data sequence of the initial input data, the tth data is... The mean of the nth data sequence of the initial input data. The standard deviation of the nth data sequence in the initial input data is t, where t and n are positive integers. It is a non-zero constant.
8. A time-series data synthesis apparatus, characterized in that, The time-series data synthesis device includes: a determination unit; The determining unit is used to determine multiple patch sequences based on a preset window and input data; the input data includes multiple data sequences and a category label for each data sequence, and the multiple patch sequences are obtained by extracting each data sequence through the preset window; The determining unit is further configured to determine the state parameters of each data sequence under each category label based on each patch sequence and the class conditional semi-Markov rule. The state parameters include at least one of the following: initial state distribution, transition probability matrix, and state duration distribution. The determining unit is further configured to determine a synthetic data sequence of the input data based on the state parameters and the input data.
9. A time-series data synthesis apparatus, characterized in that, include: A processor and a communication interface; the communication interface is coupled to the processor, the processor being configured to run computer programs or instructions to implement the method as described in any one of claims 1-7.
10. A computer-readable storage medium storing instructions, characterized in that, When the computer executes the instruction, the computer performs the method described in any one of claims 1-7.