Time sequence generation method and device, equipment and medium
By identifying domain categories, extracting semantic features, calculating similarity, and generating time series using a conditional diffusion model, this technology addresses the issues of weak semantic control and poor cross-domain generalization in existing technologies, achieving high-precision time series generation applicable to fields such as fintech and healthcare.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PING AN TECH (SHENZHEN) CO LTD
- Filing Date
- 2026-01-14
- Publication Date
- 2026-05-01
AI Technical Summary
Existing time series generation methods lack semantic controllability and have poor cross-domain generalization, making it difficult to generate high-accuracy time series that meet specific needs, especially in the fields of fintech and healthcare, where they fail to meet the interpretability requirements of regulation and decision-making.
By identifying the domain category input by the user, semantic features are extracted using a domain matrix, the similarity between the semantic vector and the preset semantic prototype library is calculated, an initial time series is generated using a conditional diffusion model, and then corrected according to a domain constraint strategy to ensure that the generated results conform to the numerical rules and temporal patterns of a specific domain.
It achieves semantically controllable and cross-domain adaptable high-fidelity time series generation. The generated results strictly match the core features of the user's text description, conform to the numerical rules and temporal patterns of specific domains, and meet the practical application needs of multiple domains.
Smart Images

Figure CN121960488A_ABST
Abstract
Description
Time series generation methods, apparatus, equipment and media Technical Field
[0001] This invention relates to the field of intelligent decision-making technology, and in particular to a time series generation method, apparatus, device, and medium. Background Technology
[0002] Time series generation refers to the technology of synthesizing continuous data sequences with temporal correlation and statistical similarity based on existing data or specific constraints through algorithmic models. Its goal is not only to reproduce the statistical patterns of historical data, but also to generate new sequences that meet specific needs based on semantics, scenarios, or control signals.
[0003] In the fintech field, time series generation technology can be used to synthesize stock price sequences that conform to textual descriptions such as "slow bull market rise" and "narrowing volatility" to enhance the coverage of backtesting of trading strategies.
[0004] In the field of healthcare, it can generate time-series data of physiological indicators such as blood glucose, blood pressure, and heart rate based on patients' symptom descriptions and treatment plans, which can help with clinical monitoring, disease prognosis analysis, and optimization of medical plans.
[0005] However, most existing time series generation methods rely on unconditional generation models, which can only learn statistical features based on historical data. They are difficult to achieve semantically controllable generation. They not only lack the semantic control ability to generate corresponding pattern time series based on text descriptions, but also have weak cross-domain generalization and are difficult to adapt to multiple scenarios. Furthermore, the scarcity of real text-time series alignment data makes it difficult for models to learn high-quality semantic-to-numerical mapping relationships. Moreover, the generated results lack semantically understandable control mechanisms, making it difficult to meet the interpretability requirements of scenarios such as supervision and medical decision-making. As a result, time series generation suffers from a lack of semantic control and insufficient cross-domain adaptability, which in turn leads to low accuracy in time series generation. Summary of the Invention
[0006] This invention provides a time series generation method, apparatus, device, and medium to solve the technical problem of low accuracy in time series generation.
[0007] In a first aspect, a time series generation method is provided, comprising: acquiring sequence description information input by a target user, identifying the domain category of the sequence description information, and acquiring a domain matrix corresponding to the domain category; extracting semantic features of the sequence description information, and using the domain matrix to perform feature mapping on the semantic features to obtain a semantic vector of the domain category; calculating the similarity between the semantic vector and each semantic tag vector in a preset semantic prototype library, and calculating a weighting coefficient of the semantic tag vector based on the similarity; generating an initial time series of the sequence description information by reverse denoising using a preset conditional diffusion model based on the semantic vector and the weighting coefficient; and correcting the initial time series according to a preset constraint strategy corresponding to the domain category to obtain the time series of the sequence description information.
[0008] Secondly, a time series generation apparatus is provided, comprising: a domain category identification module, used to acquire sequence description information input by a target user, identify the domain category of the sequence description information, and acquire a domain matrix corresponding to the domain category; a semantic vector mapping module, used to extract semantic features of the sequence description information, and use the domain matrix to perform feature mapping on the semantic features to obtain a semantic vector of the domain category; a similarity calculation module, used to calculate the similarity between the semantic vector and each semantic tag vector in a preset semantic prototype library, and calculate the weighting coefficient of the semantic tag vector based on the similarity; an initial time series generation module, used to generate an initial time series of the sequence description information based on the semantic vector and the weighting coefficient, using a preset conditional diffusion model for reverse denoising; and a time series correction module, used to correct the initial time series according to a preset constraint strategy corresponding to the domain category to obtain the time series of the sequence description information.
[0009] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the time series generation method described above.
[0010] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the time series generation method described above.
[0011] In the above-mentioned time series generation method, apparatus, device, and medium, the user-input natural language sequence description information can be obtained through the client. The domain category is determined by identifying domain keywords and matching a preset thesaurus, and a dedicated domain matrix is retrieved. Core semantic features such as text trends, amplitudes, and time spans are extracted and mapped to obtain semantic vectors that fit the target domain through domain matrix adaptation. The similarity between this vector and the label vectors in the preset semantic prototype library is calculated and normalized to obtain a weighting coefficient. Using the two as joint conditions, an initial time series is generated through a conditional diffusion model with forward noise addition and reverse noise removal. Finally, semantic deviations and outliers are corrected according to the domain constraint strategy to obtain the target time series. By feeding the target time series back to the client, this invention addresses the problems of weak semantic control, poor cross-domain generalization, and low accuracy of existing time series generation methods. Through a full-link design of domain adaptation, precise semantic mapping, weighted prototype-guided generation, and domain constraint correction, it achieves high-fidelity time series generation that is semantically controllable, cross-domain adaptable, and interpretable. This ensures that the generated results strictly match the core features of the user's text description and conform to the numerical rules and temporal patterns of specific domains, thus meeting the practical application needs of multiple domains. Attached Figure Description
[0012] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 is a schematic diagram of an application environment for a time series generation method according to an embodiment of the present invention; Figure 2 is a schematic flowchart of a time series generation method according to an embodiment of the present invention; Figure 3 is a schematic flowchart of a specific implementation of step S1 in Figure 2; Figure 4 is a schematic flowchart of a specific implementation of step S2 in Figure 2; Figure 5 is a schematic structural diagram of a time series generation device according to an embodiment of the present invention; Figure 6 is a schematic structural diagram of a computer device according to an embodiment of the present invention; Figure 7 is another schematic structural diagram of a computer device according to an embodiment of the present invention. Detailed Implementation
[0014] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0015] The time series generation method provided in this invention can be applied in the application environment shown in Figure 1, where the client communicates with the server via a network. The server can obtain the natural language sequence description information input by the user through the client, determine the domain category by identifying domain keywords and matching a preset thesaurus, and retrieve a dedicated domain matrix; extract core semantic features such as text trends, amplitudes, and time spans, and obtain semantic vectors that fit the target domain through domain matrix adaptation mapping; calculate the similarity between this vector and the label vectors in the preset semantic prototype library, and normalize to obtain a weighted coefficient; use the two as joint conditions, generate an initial time series through a conditional diffusion model of forward noise addition and reverse noise removal; finally, correct semantic deviations and outliers according to the domain constraint strategy to obtain the target time series. The target time series is fed back to the client. In this invention, the above steps solve the problems of weak semantic control, poor cross-domain generalization, and low accuracy of generated results in existing time series generation methods. Through a full-link design of domain adaptation, precise semantic mapping, weighted prototype-guided generation, and domain constraint correction, high-fidelity time series generation that is semantically controllable, cross-domain adaptable, and interpretable is achieved. This ensures that the generated results strictly match the core features of the user's text description and conform to the numerical rules and temporal patterns of specific domains, meeting the practical application needs of multiple fields. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will be described in detail below through specific embodiments.
[0016] Please refer to Figure 2, which is a flowchart of a time series generation method provided by an embodiment of the present invention, including the following steps: S1, obtaining sequence description information input by the target user, identifying the domain category of the sequence description information, and obtaining the domain matrix corresponding to the domain category.
[0017] In this embodiment of the invention, the sequence description information is textual information input by the target user in natural language, used to describe the future trend, magnitude of change, time span, and multivariate linkage relationships of a time series. For example, a patient's blood pressure may gradually increase over the next week, and stock prices may fluctuate upwards in the short term. The domain category is a classification based on the professional scenario attributes of the sequence description information, precisely defining the application scenario to which the text semantics belong, including fields such as medicine, finance, meteorology, and industrial control. The domain matrix refers to a learnable domain-adaptive parameter matrix customized for each domain category, serving as a key carrier connecting the general semantic space and the specific domain semantic space.
[0018] In detail, to avoid the disconnect between temporal generation and domain rules caused by conventional semantic mapping, and to improve the accuracy and controllability of semantic-to-numerical mapping, the domain category is identified first, and then a dedicated domain matrix is called to achieve domain adaptation of semantic features.
[0019] In this embodiment of the invention, referring to Figure 3, the identification of the domain category of the sequence description information includes: S31, identifying domain keywords in the sequence description information; S32, calculating the similarity between the domain keywords and domain tag words in a preset domain thesaurus; S33, determining the domain tag word with the highest similarity as the domain category of the sequence description information.
[0020] In detail, the input sequence description information is preprocessed to remove irrelevant information such as punctuation marks and redundant modifiers. Then, built-in large language models (such as ChatGPT, GLM, and Qwen) are invoked. Through domain-adaptive prompts, the model focuses on core words in the text that are strongly related to the professional domain (e.g., blood sugar and blood pressure correspond to medicine, stock price and trading volume correspond to finance). These core words are extracted and output as domain keywords. This method avoids the problems of poor generalization and easy mixing of non-domain words in keyword extraction in conventional methods, while ensuring that the extracted keywords are highly relevant to the target domain.
[0021] Specifically, the extracted domain keywords and the domain tag words in the preset domain thesaurus are converted into fixed-dimensional vector representations by a text encoder. Then, the cosine similarity algorithm is used to calculate the similarity value between the domain keyword vector and the vector of each domain tag word, and a set of similarity results are obtained.
[0022] Furthermore, all calculated similarity values are sorted in descending order to select the domain tag with the highest similarity. Simultaneously, it is verified whether this highest similarity value is higher than a preset information threshold. If it is higher, the tag is determined as the domain category of the sequence description information; if it is lower, a message is displayed indicating that the text domain is ambiguous and additional information is needed. This method avoids the domain misclassification problem caused by directly selecting the highest similarity tag and ignoring matching reliability, as is common in conventional methods, while ensuring the accuracy and reliability of the domain category determination results.
[0023] In this embodiment of the invention, by accurately identifying the domain category and retrieving the exclusive domain matrix, domain adaptation preprocessing of semantic features is achieved, which solves the problem of weak cross-domain generalization of traditional methods, ensures that the subsequent semantic mapping and temporal generation process conforms to the domain rules, and improves the cross-domain adaptability and semantic controllability of the entire system.
[0024] In the fintech field, if a user inputs "a certain stock will fluctuate first and then rise slightly in the next month, with trading volume gradually increasing", the system can identify the domain keywords "stock" and "trading volume", match them with financial domain tags, and retrieve the financial domain matrix to lay the foundation for generating stock price time series data that conforms to the rules of financial market fluctuations.
[0025] In the healthcare field, if a user inputs "a diabetic patient's blood sugar will fluctuate slightly and then continue to decrease over the next two weeks, with insulin dosage gradually reduced," the system can identify the domain keywords "blood sugar" and "insulin," match them with medical domain tags, and retrieve the medical domain matrix to ensure that the subsequently generated blood sugar time series data conforms to the reasonable range of physiological indicators.
[0026] S2. Extract the semantic features of the sequence description information, and use the domain matrix to perform feature mapping on the semantic features to obtain the semantic vector of the domain category.
[0027] In this embodiment of the invention, the semantic features refer to the structured representation of core semantic elements directly related to time series generation extracted from sequence description information. Specifically, these include trend information (such as rising, falling, fluctuating), amplitude information (such as slight, drastic, small), and time information (such as short-term, long-term, periodic frequency). The semantic vector refers to the numerical vector obtained by mapping the extracted semantic features through a domain matrix. It is a semantic representation that integrates domain adaptability, containing both the core semantic information of the text and conforming to the time series pattern features of the target domain, providing precise control signals for subsequent semantic prototype matching and time series generation.
[0028] In this embodiment of the invention, referring to Figure 4, the step of extracting the semantic features of the sequence description information includes: S41, extracting trend information, amplitude information, and time information from the sequence description information; S42, performing vector transformation on the trend information, amplitude information, and time information respectively to obtain trend information vector, amplitude information vector, and time information vector; S43, weighting and concatenating the trend information vector, amplitude information vector, and time information vector to generate the semantic features of the sequence description information.
[0029] In detail, a large language model trained on sequence data from a historical time series dataset is invoked. Domain-adaptive prompts guide the model to parse sequence description information, accurately locating and extracting trend information reflecting the direction of sequence change, magnitude information describing the intensity of change, and time information specifying the time span or period. Simultaneously, the extracted information is deduplicated and standardized (e.g., unifying "upward" as "rising"). This method avoids the problems of messy semantic feature extraction, omission of core elements, or inclusion of irrelevant information found in conventional methods, while ensuring that the extracted information is strongly correlated with the generated time series.
[0030] Specifically, trend information (such as rise, fall, flat, oscillation) is mapped to a one-hot vector or converted into a dense vector through a lightweight embedding layer. Amplitude information (such as low, medium, high) and time information (such as short, medium, long) are also encoded in a similar way to obtain low-dimensional feature vectors.
[0031] Furthermore, the weight coefficients of three types of information—trend, magnitude, and time—are obtained (e.g., trend information weight 0.4, magnitude information weight 0.3, and time information weight 0.3). The three types of vectors are multiplied by their corresponding weight coefficients and then concatenated in dimensional order to form a semantic vector of complete semantic features whose dimension is the sum of the dimensions of the three types of vectors.
[0032] In this embodiment of the invention, high-quality semantic features are generated by extracting core semantic elements in a structured manner, transforming domain-adaptive vectors, and weighted concatenation. Then, the semantic vectors of domain categories are obtained through domain matrix mapping, which effectively solves the problems of weak semantic control and cross-domain semantic distortion in conventional methods.
[0033] In the fintech field, for the description of "a stock will first fluctuate and then rise slightly in the next month", the trend information "fluctuation and slight rise", the amplitude information "slight", and the time information "one month" are extracted, converted into corresponding vectors, and then concatenated according to the dynamic weights of the financial field. The semantic vector is obtained by mapping through the financial field matrix, ensuring that the subsequent stock price time series conforms to the characteristics of financial fluctuations.
[0034] In the field of healthcare, for the description of "the patient's blood pressure fluctuates slightly and then gradually increases over the next week", the trend information "slight fluctuation, gradual increase", the amplitude information "slight", and the time information "one week" are extracted, converted into vectors, and then concatenated according to medical domain weights. After mapping through a medical domain matrix, a semantic vector is obtained, which provides support for the subsequent generation of blood pressure time series that conforms to the physiological index pattern.
[0035] S3. Calculate the similarity between the semantic vector and each semantic tag vector in the preset semantic prototype library, and calculate the weighting coefficient of the semantic tag vector based on the similarity.
[0036] In this embodiment of the invention, the semantic prototype library refers to a vector set constructed based on historical time series data, containing multiple typical time series patterns and their corresponding semantic labels. Each semantic prototype vector consists of a typical time series pattern (such as linear increase, oscillating decay, and periodic fluctuation) and a semantic label vector (such as continuous increase and sudden fluctuation). The weighting coefficient is a coefficient obtained after normalizing the similarity.
[0037] In this embodiment of the invention, calculating the similarity between the semantic vector and each semantic tag vector in the preset semantic prototype library includes: converting each sequence in the pre-acquired historical time series dataset into a sequence feature vector; calculating multiple cluster center vectors of the sequence feature vectors using a preset clustering algorithm; labeling the cluster center vectors with semantic tags to obtain multiple semantic tag vectors; summarizing all semantic tag vectors to construct a semantic prototype library; and calculating the similarity between the semantic vector and each semantic tag vector in the semantic prototype library.
[0038] In detail, the pre-acquired historical time series dataset is preprocessed to remove outliers and missing values. The time series feature extractor extracts numerical features such as trend, period, and fluctuation amplitude of each series. After standardizing these numerical features, they are converted into fixed-dimensional series feature vectors to ensure that the feature representation of each series is consistent.
[0039] Specifically, a preset clustering algorithm (such as K-means or spectral clustering) is used to perform cluster analysis on all sequence feature vectors. The optimal number of clusters is determined according to the elbow rule or silhouette coefficient. Sequence feature vectors that are close in distance in the feature space are divided into the same class. The mean vector of each class is calculated as the cluster center vector of that class. Each cluster center vector represents a typical time series pattern.
[0040] Next, the typical temporal pattern corresponding to each cluster center vector is described in a language, generating semantic tags for the appropriate domain (such as "continuously rising" for the linear rising pattern). The consistency between the semantic tags and the temporal pattern represented by the cluster center vector is then verified. After removing inconsistent tags, the cluster center vector is bound to the corresponding semantic tag vector, and all binding pairs are summarized to build a semantic prototype library.
[0041] Furthermore, the similarity value between the semantic vector of the domain category and each semantic tag vector in the semantic prototype library is calculated. After traversing all semantic tag vectors, a set of similarity results corresponding to each prototype is obtained.
[0042] Next, all the calculated similarity values are substituted into the softmax function formula for normalization calculation to obtain the weighting coefficient corresponding to each semantic label vector, ensuring that the sum of all weighting coefficients is 1. The semantic label vector with higher similarity has a larger corresponding weighting coefficient.
[0043] In this embodiment of the invention, by constructing a semantic prototype library and calculating the similarity and weighting coefficient between semantic vectors and prototypes, an interpretable mapping from text semantics to typical temporal patterns is established, which effectively solves the problems of uninterpretable semantic-to-numerical mapping and poor generation controllability in traditional methods.
[0044] In the fintech field, for the semantic vector of "short-term stock price fluctuation followed by a slight increase", the similarity between it and the "oscillation pattern" and "slight increase pattern" in the semantic prototype library is calculated to obtain the corresponding weighting coefficient. When generating stock price time series, the features of the two types of patterns can be integrated to ensure that the time series conforms to the typical pattern of oscillating upward movement in the financial market.
[0045] In the field of healthcare, for the semantic vector of "blood sugar fluctuates slightly first and then continues to decrease", the prototypes of "slight fluctuation" and "continued decrease" in the prototype library are matched. The fusion ratio of the two types of patterns is controlled by the weighting coefficient to generate blood sugar time series data that fits the change pattern of physiological indicators.
[0046] S4. Based on the semantic vector and the weighting coefficient, the initial time series of the sequence description information is generated by reverse denoising using a preset conditional diffusion model.
[0047] In this embodiment of the invention, the conditional diffusion model refers to a generative model that generates time series data by using semantic vectors and weighted prototypes as joint conditions, and by progressively adding controllable noise in the forward direction and progressively predicting and removing noise in the reverse direction. The initial time series refers to time series data that initially fits the semantics of the text, generated by the conditional diffusion model through a reverse denoising and inversion process.
[0048] In this embodiment of the invention, the step of generating the initial time series of the sequence description information by reverse denoising using a preset conditional diffusion model based on the semantic vector and the weighting coefficient includes: obtaining the semantic prototype vector corresponding to the semantic tag vector; multiplying each semantic prototype vector by the weighting coefficient corresponding to the semantic prototype vector and summing the results to obtain a semantic weighting vector; sampling a noise sequence from a preset standard normal distribution to obtain an initial noise sequence; using the semantic vector and the semantic weighting vector as joint conditions, using a preset conditional diffusion model to predict the noise distribution of the initial noise sequence at a preset time step; and removing noise from the initial noise sequence according to the noise distribution to obtain the initial time series of the sequence description information.
[0049] In detail, each semantic prototype vector is multiplied element-wise with its corresponding weighting coefficient, and then all the results are summed along the vector dimension to obtain a semantic weighted vector that integrates the features of each typical temporal pattern.
[0050] Next, based on the preset time series length and numerical dimension, a set of dimension-matched noise sequences is randomly sampled from the standard normal distribution (N(0,I)). The length of the noise sequence is consistent with the time span of the text description, and the numerical dimension is matched with the number of time series indicators generated (e.g., 1-dimensional for a single indicator and multi-dimensional for multiple indicators).
[0051] Specifically, the semantic vector and the semantic weighted vector are input into the semantic conditional decoder of the conditional diffusion model. Based on the preset diffusion time step and combined with the forward diffusion formula, the decoder learns the noise distribution pattern of the initial noise sequence at each time step and outputs the noise distribution prediction results corresponding to each time step.
[0052] Next, the process iterates backward from the last diffusion time step to the initial time step. In each time step, based on the noise distribution predicted by the semantic conditional decoder, the gradient descent method is used to gradually remove noise from the initial noise sequence while retaining the temporal features that match the semantic vector and the semantic weighted vector. After the iteration is completed, the preliminary time series data is output.
[0053] In this embodiment of the invention, the above method solves the problems of poor semantic controllability and low generation quality of traditional generative models, improves the temporal coherence and naturalness of the initial sequence, and provides a high-quality foundation for the generation of the final high-fidelity time series.
[0054] In the fintech field, for the description of "a certain stock will first fluctuate and then rise slightly in the next 30 days", the initial stock price time series is generated by the joint conditional guided diffusion model. The first half of the series shows the characteristics of fluctuation, and the second half shows the trend of slight upward movement, which fits the text description.
[0055] In the field of healthcare, the initial blood glucose timeline generated can accurately reproduce the trend and amplitude characteristics of the description that "the patient's blood glucose fluctuates slightly (7.0-8.5 mmol / L) and then continues to decrease (8.0→6.0 mmol / L) in the next 14 days, providing a basis for subsequent correction processing.
[0056] S5. Correct the initial time series according to the preset constraint strategy corresponding to the domain category to obtain the time series of the sequence description information.
[0057] In this embodiment of the invention, the constraint strategy refers to a set of rules customized for each domain category to standardize the numerical characteristics of time series data. These rules include reasonable numerical ranges (e.g., blood glucose levels of 3.9-11.1 mmol / L in the medical field), rate of change thresholds (e.g., daily stock price fluctuations not exceeding 10% in the financial field), and periodic rules (e.g., seasonal temperature change cycles in the meteorological field). The time series refers to the high-fidelity time series data output after constraint strategy correction. This data not only strictly matches the semantic features of the sequence description information input by the user but also fully conforms to the numerical rules and temporal patterns of the target domain, possessing semantic consistency, domain adaptability, and numerical reliability.
[0058] In this embodiment of the invention, the step of correcting the initial time series according to the preset constraint strategy corresponding to the domain category to obtain the time series of the sequence description information includes: calculating the alignment loss between the sequence feature vector corresponding to the initial time series and the semantic vector; updating the sequence values corresponding to the data points of the initial time series according to the alignment loss to obtain the updated time series; traversing each data point in the updated time series and determining whether the sequence value corresponding to the data point exceeds the sequence value range in the preset constraint strategy; if it exceeds, calling a smoothing filter function to correct the sequence value of the data point to obtain the updated sequence value, and adjusting the updated time series according to the updated sequence to obtain the time series of the sequence description information; if it does not exceed, using the updated time series as the time series of the sequence description information.
[0059] In detail, a time series feature extractor extracts numerical features such as trend, magnitude, and time from the initial time series, converting them into a sequence feature vector. Then, the squared Euclidean distance between this sequence feature vector and the semantic vector of the domain category is calculated to obtain the alignment loss. This loss value quantifies the degree of deviation between the initial sequence and the text semantics. This method avoids the misjudgment problem caused by inconsistent feature spaces in the alignment loss calculation of conventional methods, while ensuring that the loss value accurately reflects the degree of semantic and temporal matching.
[0060] Specifically, the alignment loss is a quantified scalar value used to measure the degree of difference between the global statistical features of the initial time series generated by the diffusion model and the semantic vector extracted from the input text.
[0061] In this embodiment of the invention, the step of updating the sequence values corresponding to the data points of the initial time series according to the alignment loss to obtain the updated time series includes: determining whether the alignment loss is less than a preset loss threshold; if it is less than the preset loss threshold, then using the initial time series as the final updated time series; if it is greater than or equal to the preset loss threshold, then calculating the gradient of the initial time series according to the alignment loss, and determining the update direction and magnitude of each data point in the initial time series according to the gradient; updating the sequence values corresponding to each data point according to the update direction and the magnitude to obtain the initial updated time series; calculating the update alignment loss between the sequence feature vector and the semantic vector corresponding to the initial updated time series, and returning to the step of determining whether the alignment loss is less than the preset loss threshold.
[0062] In detail, a preset loss threshold is obtained (determined based on training with multi-domain adaptation data to define the acceptable range of semantic bias). The currently calculated alignment loss is then compared with this preset threshold. If the comparison shows that the alignment loss is less than the preset loss threshold, the initial time series is determined as the final update time series. If the alignment loss is greater than or equal to the preset loss threshold, the gradient of the initial time series is calculated by automatic differentiation based on the correlation logic between the trend information, magnitude information, temporal information, and alignment loss of the initial time series. Subsequently, the update direction of each data point is determined based on the positive or negative attribute of the gradient, and the update magnitude of each data point is determined based on the magnitude of the gradient (the larger the gradient value, the more obvious the semantic bias caused by the data point, and the larger the corresponding update magnitude).
[0063] Next, according to the determined update direction and magnitude, each data point in the initial time series is numerically adjusted one by one to obtain the initial update time series. Feature information of the initial update time series is extracted using a feature extraction tool, and the update alignment loss between these feature information and the text semantic information is calculated. The update alignment loss is then compared with a preset loss threshold. If the update alignment loss is greater than or equal to the preset loss threshold, the current initial update time series is used as the new initial time series, and the iteration is repeated from the step of calculating the gradient based on the alignment loss. If the update alignment loss is less than the preset loss threshold, the iteration is terminated, and the current initial update time series is used as the final update time series.
[0064] Specifically, each data point in the time series is updated in chronological order. The preset constraint strategy corresponding to the target domain is retrieved to obtain the reasonable range of the sequence indicator (e.g., stock price in the financial field should not be lower than 0, and systolic blood pressure in the medical field should not exceed 200 mmHg). The sequence value of each data point is judged one by one to see if it is within the range, and abnormal data points that exceed the range are recorded.
[0065] Furthermore, for outlier data points that exceed the numerical range, a smoothing filter function (such as a moving average filter) is invoked. Based on the sequence values of the normal data points adjacent to the data point, an updated sequence value that conforms to the range of the domain and maintains temporal continuity is calculated. This updated value replaces the original outlier value. At the same time, the rate of change of the adjusted data point and its adjacent points is re-verified to ensure that no new outliers are generated.
[0066] Next, when the sequence values of all data points in the updated time series are within the numerical range of the preset constraint strategy, and the rate of change conforms to the domain rules, and there are no abnormal data points, the updated time series is directly determined as the time series corresponding to the final sequence description information.
[0067] In this embodiment of the invention, the initial time series is optimized by adjusting the semantic alignment loss and verifying and correcting the domain constraint strategy. This not only solves the semantic bias problem that may exist in the initial series, but also corrects the outliers that do not conform to the domain numerical rules, effectively improving the semantic consistency, domain adaptability and numerical reliability of the time series.
[0068] In the fintech field, when a data point in the initially generated stock price time series exceeds the reasonable fluctuation range, outliers are corrected through smoothing filtering to ensure that the stock price always stays within the compliant range and the fluctuation trend conforms to the description of "slight rise after fluctuation", thus providing reliable data for investment strategy formulation.
[0069] In the field of healthcare, when a data point in the initial blood glucose time series exceeds the physiologically reasonable range, the corrected data not only conforms to the normal blood glucose range but also maintains the core trend of "fluctuation first and then decrease," providing accurate reference for clinical monitoring and treatment plan optimization.
[0070] As can be seen, the above scheme accurately transforms general text semantics into specialized representations for specific domains by introducing domain-adaptive matrix mapping, thus solving the problem of cross-domain semantic misalignment. By leveraging the weighted fusion of semantic prototype libraries, the system gains interpretability and controllability, improving the matching degree between the generated results and user intent. By combining conditional diffusion models and domain constraint correction, the system ensures both high fidelity and diversity of sequences while avoiding invalid erroneous outputs that violate domain knowledge, significantly improving the accuracy of time series generation results.
[0071] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0072] In one embodiment, a time series generation device is provided, which corresponds one-to-one with the time series generation method in the above embodiments. As shown in FIG5, the time series generation device 100 includes a domain category identification module 101, a semantic vector mapping module 102, a similarity calculation module 103, an initial time series generation module 104, and a time series correction module 105. The functional modules are described in detail below: Domain category identification module 101 is used to acquire sequence description information input by the target user, identify the domain category of the sequence description information, and acquire the domain matrix corresponding to the domain category; Semantic vector mapping module 102 is used to extract the semantic features of the sequence description information, and use the domain matrix to perform feature mapping on the semantic features to obtain the semantic vector of the domain category; Similarity calculation module 103 is used to calculate the similarity between the semantic vector and each semantic tag vector in the preset semantic prototype library, and calculate the weighting coefficient of the semantic tag vector based on the similarity; Initial time series generation module 104 is used to generate the initial time series of the sequence description information by reverse denoising using a preset conditional diffusion model based on the semantic vector and the weighting coefficient; Time series correction module 105 is used to correct the initial time series according to the preset constraint strategy corresponding to the domain category to obtain the time series of the sequence description information.
[0073] In one embodiment, the domain category identification module 101, when performing the identification of the domain category of the sequence description information, is used to: identify domain keywords in the sequence description information; calculate the similarity between the domain keywords and domain tag words in a preset domain thesaurus; and determine the domain tag word with the highest similarity as the domain category of the sequence description information.
[0074] In one embodiment, the semantic vector mapping module 102, when extracting semantic features from the sequence description information, is configured to: extract trend information, amplitude information, and time information from the sequence description information; perform vector transformations on the trend information, amplitude information, and time information respectively to obtain trend information vector, amplitude information vector, and time information vector; and perform weighted concatenation of the trend information vector, amplitude information vector, and time information vector to generate the semantic features of the sequence description information.
[0075] In one embodiment, the similarity calculation module 103, when performing the calculation of the similarity between the semantic vector and each semantic tag vector in the preset semantic prototype library, is configured to: convert each sequence in the pre-acquired historical time series dataset into a sequence feature vector; calculate multiple cluster center vectors of the sequence feature vectors using a preset clustering algorithm; label the cluster center vectors with semantic tags to obtain multiple semantic tag vectors; summarize all semantic tag vectors to construct a semantic prototype library; and calculate the similarity between the semantic vector and each semantic tag vector in the semantic prototype library.
[0076] In one embodiment, the initial time series generation module 104, when generating the initial time series of the sequence description information based on the semantic vector and the weighting coefficients using a preset conditional diffusion model for reverse denoising, is configured to: obtain the semantic prototype vector corresponding to the semantic tag vector; multiply each semantic prototype vector by the weighting coefficient corresponding to the semantic prototype vector and sum them to obtain a semantic weighted vector; sample the noise sequence from a preset standard normal distribution to obtain an initial noise sequence; use the semantic vector and the semantic weighted vector as joint conditions to predict the noise distribution of the initial noise sequence at a preset time step using a preset conditional diffusion model; and remove noise from the initial noise sequence according to the noise distribution to obtain the initial time series of the sequence description information.
[0077] In one embodiment, the time series correction module 105, when performing correction processing on the initial time series according to the preset constraint strategy corresponding to the domain category to obtain the time series of the sequence description information, is configured to: calculate the alignment loss between the sequence feature vector corresponding to the initial time series and the semantic vector; update the sequence values corresponding to the data points of the initial time series according to the alignment loss to obtain the updated time series; traverse each data point in the updated time series and determine whether the sequence value corresponding to the data point exceeds the sequence value range in the preset constraint strategy; if it exceeds, call the smoothing filter function to correct the sequence value of the data point to obtain the updated sequence value, and adjust the updated time series according to the updated sequence to obtain the time series of the sequence description information; if it does not exceed, use the updated time series as the time series of the sequence description information.
[0078] In one embodiment, the time series correction module 105, when updating the sequence values corresponding to the data points of the initial time series according to the alignment loss to obtain an updated time series, is configured to: determine whether the alignment loss is less than a preset loss threshold; if it is less than the preset loss threshold, then use the initial time series as the final updated time series; if it is greater than or equal to the preset loss threshold, then calculate the gradient of the initial time series according to the alignment loss, and determine the update direction and magnitude of each data point in the initial time series according to the gradient; update the sequence values corresponding to each data point according to the update direction and the magnitude to obtain an initial updated time series; calculate the update alignment loss between the sequence feature vector and the semantic vector corresponding to the initial updated time series, and return to the step of determining whether the alignment loss is less than the preset loss threshold.
[0079] This invention provides a time series generation device that accurately transforms general text semantics into specialized representations for a specific domain by introducing domain-adaptive matrix mapping, thus solving the problem of cross-domain semantic misalignment. By leveraging weighted fusion with a semantic prototype library, the system gains interpretability and controllability, improving the matching degree between the generated results and user intent. Combining a conditional diffusion model and domain constraint correction, it ensures both high fidelity and diversity of sequences while avoiding invalid erroneous outputs that violate domain knowledge, significantly improving the accuracy of time series generation results.
[0080] Specific limitations regarding the time series generation device can be found in the limitations of the time series generation method described above, and will not be repeated here. Each module in the aforementioned time series generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in a computer device, or stored in software in the memory of a computer device, so that the processor can call and execute the operations corresponding to each module.
[0081] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram is shown in Figure 6. The computer device includes a processor, memory, a network interface, and a database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a time series generation method on the server side.
[0082] In one embodiment, a computer device is provided, which can be a client, and its internal structure diagram is shown in Figure 7. The computer device includes a processor, memory, network interface, display screen, and input device connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a time series generation method on the client side.
[0083] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps: acquiring sequence description information input by a target user, identifying the domain category of the sequence description information, and acquiring a domain matrix corresponding to the domain category; extracting semantic features of the sequence description information, and using the domain matrix to perform feature mapping on the semantic features to obtain a semantic vector of the domain category; calculating the similarity between the semantic vector and each semantic tag vector in a preset semantic prototype library, and calculating a weighting coefficient of the semantic tag vector based on the similarity; generating an initial time series of the sequence description information using a preset conditional diffusion model for reverse denoising based on the semantic vector and the weighting coefficient; and correcting the initial time series according to a preset constraint strategy corresponding to the domain category to obtain the time series of the sequence description information.
[0084] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps: acquiring sequence description information input by a target user, identifying the domain category of the sequence description information, and acquiring a domain matrix corresponding to the domain category; extracting semantic features of the sequence description information, and using the domain matrix to perform feature mapping on the semantic features to obtain a semantic vector of the domain category; calculating the similarity between the semantic vector and each semantic tag vector in a preset semantic prototype library, and calculating a weighting coefficient of the semantic tag vector based on the similarity; generating an initial time series of the sequence description information by reverse denoising using a preset conditional diffusion model based on the semantic vector and the weighting coefficient; and correcting the initial time series according to a preset constraint strategy corresponding to the domain category to obtain the time series of the sequence description information.
[0085] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0086] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0087] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0088] It should be noted that if any software tools or components not belonging to our company appear in the embodiments of this application, they are merely for illustrative purposes and do not represent actual use.
[0089] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. 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. Such 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, and should all be included within the protection scope of the present invention.
Claims
1. A time series generation method, characterized in that, include: The system acquires sequence description information input by a target user, identifies the domain category of the sequence description information, and obtains the domain matrix corresponding to the domain category; extracts semantic features from the sequence description information, and uses the domain matrix to perform feature mapping on the semantic features to obtain the semantic vector of the domain category; calculates the similarity between the semantic vector and each semantic tag vector in a preset semantic prototype library, and calculates the weighting coefficient of the semantic tag vector based on the similarity; based on the semantic vector and the weighting coefficient, it uses a preset conditional diffusion model to reverse denoise and generate the initial time series of the sequence description information. The initial time series is corrected according to the preset constraint strategy corresponding to the domain category to obtain the time series of the sequence description information.
2. The time series generation method as described in claim 1, characterized in that, The process of identifying the domain category of the sequence description information includes: identifying domain keywords in the sequence description information; calculating the similarity between the domain keywords and domain tag words in a preset domain thesaurus; and determining the domain tag word with the highest similarity as the domain category of the sequence description information.
3. The time series generation method as described in claim 1, characterized in that, The step of extracting the semantic features of the sequence description information includes: extracting trend information, amplitude information, and time information from the sequence description information; performing vector transformations on the trend information, amplitude information, and time information respectively to obtain trend information vector, amplitude information vector, and time information vector; and weightedly concatenating the trend information vector, amplitude information vector, and time information vector to generate the semantic features of the sequence description information.
4. The time series generation method as described in claim 1, characterized in that, The calculation of the similarity between the semantic vector and each semantic tag vector in the preset semantic prototype library includes: converting each sequence in the pre-acquired historical time series dataset into a sequence feature vector; calculating multiple cluster center vectors of the sequence feature vector using a preset clustering algorithm; semantically labeling the cluster center vectors to obtain multiple semantic tag vectors; summarizing all semantic tag vectors to construct a semantic prototype library; and calculating the similarity between the semantic vector and each semantic tag vector in the semantic prototype library.
5. The time series generation method as described in claim 1, characterized in that, The step of generating the initial time series of the sequence description information by reverse denoising using a preset conditional diffusion model based on the semantic vector and the weighting coefficient includes: obtaining the semantic prototype vector corresponding to the semantic tag vector; multiplying each semantic prototype vector by the weighting coefficient corresponding to the semantic prototype vector and summing them to obtain a semantic weighting vector; sampling the noise sequence from a preset standard normal distribution to obtain an initial noise sequence; using the semantic vector and the semantic weighting vector as joint conditions, using a preset conditional diffusion model to predict the noise distribution of the initial noise sequence at a preset time step; and removing noise from the initial noise sequence according to the noise distribution to obtain the initial time series of the sequence description information.
6. The time series generation method as described in claim 1, characterized in that, The step of correcting the initial time series according to the preset constraint strategy corresponding to the domain category to obtain the time series of the sequence description information includes: calculating the alignment loss between the sequence feature vector corresponding to the initial time series and the semantic vector; updating the sequence values corresponding to the data points of the initial time series according to the alignment loss to obtain the updated time series; traversing each data point in the updated time series and determining whether the sequence value corresponding to the data point exceeds the sequence value range in the preset constraint strategy; if it exceeds, calling a smoothing filter function to correct the sequence value of the data point to obtain the updated sequence value, and adjusting the updated time series according to the updated sequence to obtain the time series of the sequence description information; if it does not exceed, using the updated time series as the time series of the sequence description information.
7. The time series generation method as described in claim 6, characterized in that, The step of updating the sequence values corresponding to the data points of the initial time series according to the alignment loss to obtain the updated time series includes: determining whether the alignment loss is less than a preset loss threshold; if it is less than the preset loss threshold, then using the initial time series as the final updated time series; if it is greater than or equal to the preset loss threshold, then calculating the gradient of the initial time series according to the alignment loss, and determining the update direction and magnitude of each data point in the initial time series according to the gradient; updating the sequence values corresponding to each data point according to the update direction and the magnitude to obtain the initial updated time series; calculating the update alignment loss between the sequence feature vector and the semantic vector corresponding to the initial updated time series, and returning to the step of determining whether the alignment loss is less than the preset loss threshold.
8. A time series generation device, characterized in that, include: The domain category identification module is used to obtain sequence description information input by the target user, identify the domain category of the sequence description information, and obtain the domain matrix corresponding to the domain category; A semantic vector mapping module is used to extract semantic features of the sequence description information and perform feature mapping on the semantic features using the domain matrix to obtain the semantic vector of the domain category; a similarity calculation module is used to calculate the similarity between the semantic vector and each semantic tag vector in the preset semantic prototype library, and calculate the weighting coefficient of the semantic tag vector based on the similarity; an initial time series generation module is used to generate the initial time series of the sequence description information based on the semantic vector and the weighting coefficient, using a preset conditional diffusion model for reverse denoising. The time series correction module is used to correct the initial time series according to the preset constraint strategy corresponding to the domain category, so as to obtain the time series of the sequence description information.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the time series generation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the time series generation method as described in any one of claims 1 to 7.