A time series forecasting method and system based on co-modeling of micro-dynamics and macro-state
By performing scale normalization and time-series segmentation on multivariate time-series data streams of advertising metrics, inertial momentum, random impact, and periodic pattern features are extracted to generate structured micro-dynamic prior tensors. Combined with spatiotemporal location information and cross-attention calculation, this solves the problems of lack of local dynamic cognition at the micro level and lack of market perception at the macro level in existing technologies, and achieves high-precision advertising metric prediction.
Patent Information
- Application Number
- CN202511861364.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2045-12-11
AI Technical Summary
Existing advertising metric prediction technologies lack a refined understanding of local dynamics at the micro level, making it difficult to distinguish between different intrinsic driving forces such as inertia, shocks, and cyclicality. At the macro level, they lack a dynamic perception of the overall market state and cannot flexibly adjust the prediction focus according to different market stages. As a result, the models struggle to balance the characterization of local details and the grasp of global trends in complex and non-stationary scenarios, limiting the accuracy and robustness of advertising time-series predictions.
By acquiring multi-dimensional time-series data streams of advertising metrics, scaling and time-series segmentation are performed. Inertial momentum, random impact, and periodic pattern features are extracted to generate structured micro-dynamic prior tensors. Combined with spatiotemporal location information, historical state tensors are constructed. Cross-attention is used to calculate and generate hidden representations of future time segments. Finally, decoding is performed to generate high-precision prediction values.
It significantly improves the accuracy and robustness of advertising metric prediction, and can maintain training stability by taking into account both the detailed depiction of local details and the accurate grasp of global trends in complex and non-stationary environments.
Smart Images

Figure CN121278322B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of time series forecasting technology, and in particular to a time series forecasting method and system based on collaborative modeling of micro-dynamics and macro-state. Background Technology
[0002] In the field of modern computational advertising, accurate prediction of ad performance is crucial for advertisers and platforms. Key performance indicators (KPIs), such as click-through rate (CTR) and conversion rate (CVR), directly impact budget allocation, smart bidding strategies, and overall marketing effectiveness. To achieve automated and refined ad management, time-series modeling of historical ad metrics is typically required to predict future trends, providing a scientific basis for strategy adjustments. In this context, time-series forecasting methods become a vital technology connecting historical data with future decisions; their accuracy and robustness directly affect the optimization effect and economic benefits of the advertising system.
[0003] Existing technologies for predicting advertising metrics time series mainly fall into two categories. The first category is based on classical statistical time series models, such as the vector autoregressive moving average model and its variants. These methods capture the dependence of metrics on immediately adjacent historical values through autoregressive properties and handle historical random disturbances through moving average properties, thus characterizing linear, local statistical regularities. However, these methods are limited by linear assumptions and finite-order historical dependencies, making it difficult to effectively model complex nonlinear relationships and long-term dependencies in the advertising ecosystem caused by seasonal promotions, market competition, or changes in user behavior. This results in models that often only reflect local regularities and lack a global perspective in long-term prediction tasks. The second category is end-to-end prediction models based on deep learning. These methods typically employ self-attention mechanisms to learn nonlinear dependencies and global patterns from long-term historical data, extracting features from the entire time series as a whole to capture complex long-term trends. However, this holistic feature processing approach often neglects the fine-grained dynamic features within the sequence and lacks the ability to structurally identify micro-local changes such as short-term fluctuations and abrupt changes. At the same time, the permutation invariance of the self-attention mechanism is inconsistent with the strict order constraints of time series, which can easily lead to the loss of temporal information, thereby affecting the accuracy and stability of prediction.
[0004] In summary, existing advertising metric prediction technologies have significant shortcomings at both the micro and macro levels. On the one hand, at the micro level, the models lack a refined understanding of local dynamics and struggle to distinguish between different intrinsic driving forces such as inertia, shocks, and cyclicality. On the other hand, at the macro level, they lack a dynamic perception of the overall market state, generally employing static fusion strategies that cannot flexibly adjust the prediction focus according to different market stages. Consequently, the models struggle to simultaneously capture both local details and grasp global trends in complex, non-stationary scenarios, limiting the accuracy and robustness of advertising time-series predictions. Summary of the Invention
[0005] This application provides a time series forecasting method and system based on collaborative modeling of micro-dynamics and macro-state. This collaborative modeling mechanism can simultaneously and explicitly quantify micro-driving forces and dynamically adjust the focus of attention according to the macro-context, thereby significantly improving the accuracy and robustness of forecasts. The technical solution provided in this application is as follows:
[0006] In a first aspect, this application provides a time series prediction method based on the collaborative modeling of micro-dynamics and macro-state, the method comprising:
[0007] The multi-dimensional time-series data stream of advertising metrics is obtained and subjected to scale normalization and time-series segmentation to construct a set of time segments;
[0008] The set of time segments is subjected to a structured extraction operation of micro-dynamic patterns, which extracts inertial momentum features, random impact features and periodic pattern features respectively. The extracted features are then fused in the feature dimension to generate a structured micro-dynamic prior tensor.
[0009] The obtained time segment set is feature-mapped and fused with the micro-dynamic prior tensor in a nonlinear space, while spatiotemporal location information is superimposed to generate a historical state tensor that contains both deep semantic features and time series perception capabilities.
[0010] Based on the historical state tensor, macroscopic sequence features are extracted and the contextualized query matrix is dynamically reconstructed. Hidden representations of future time segments are generated through cross-attention calculation.
[0011] The hidden representation of the future time segment is decoded to obtain the correction amount, and the advertising metric prediction value is generated based on the correction amount and the pre-generated baseline prediction.
[0012] In a specific feasible implementation, the step of acquiring a multivariate time-series data stream of advertising metrics, performing scale normalization and time-series segmentation on it, and constructing a set of time segments includes:
[0013] Receive historical multi-dimensional time-series data streams containing multiple advertising metrics Its dimensions are ,in, Indicates the number of advertising metrics. This indicates the total number of time points in the history review window;
[0014] After receiving the data, process the input data stream. Perform channel-independent scale normalization, applying a linear transformation to the time series of each advertising metric to map its numerical range to a uniform scale, and then segmenting the normalized data stream along the time dimension. There are three consecutive, non-overlapping time segments, each with a length of [length missing]. Forming a set of time segments .
[0015] In one specific implementation, the structured extraction operation of micro-dynamic patterns on the set of time segments, extracting inertial momentum features, random impact features, and periodic pattern features respectively, includes:
[0016] For the current time segment in the set of time segments , To what extent its evolution trend has continued that of the adjacent [landform]? A historical moment Inertial characteristics;
[0017] Using a small attention network The feature distribution of each historical time segment is analyzed, and a corresponding scalar weight is generated for each historical time segment. ;
[0018] The feature vectors of each historical time segment are multiplied by their weights and then summed. ,in, Indicates the first The scalar weights corresponding to each historical time segment form an inertial vector representing the current direction and intensity of motion;
[0019] Inertial vector through nonlinear transformation layer High-dimensional mapping and feature recombination are performed to obtain inertial momentum features. .
[0020] In one specific implementation, the structured extraction operation of micro-dynamic patterns on the set of time segments, extracting inertial momentum features, random impact features, and periodic pattern features respectively, includes:
[0021] Perform random shock feature extraction, a process used to characterize the current time segment. Influenced by the past The extent of the impact of unpredictable random disturbance events; using the second-order difference between adjacent time segments. As a proxy for impact strength, it is quantified through another set of dynamic weights. The difference results are then summed using a weighted method. ,in, Indicates the first Dynamic weights corresponding to each historical time segment Then through the transformation layer Perform nonlinear feature mapping to obtain random shock features. ;
[0022] Perform periodic pattern feature extraction operations for each time segment. By applying a set of one-dimensional depthwise separable convolutions and discrete Fourier transforms, periodic signal components are identified simultaneously in both the time and frequency domains, and significant periodic features are extracted to generate periodic pattern features. .
[0023] In a specific implementation scheme, the step of performing feature mapping on the obtained time segment set and fusing it with the micro-dynamic prior tensor in a nonlinear space, while simultaneously superimposing spatiotemporal location information, to generate a historical state tensor that contains both deep semantic features and time series perception capabilities includes:
[0024] Collection of time segments Organization for the original time segment tensor ,right Perform basic representation embedding operations, inputting them into the convolutional embedding network to generate basic deep representations. ;
[0025] Will With the obtained structured microscopic dynamic prior tensor The input is fused using a gated fusion unit. After fusion, a learnable spatiotemporal location code is superimposed on the resulting representation. The intra-segment position code identifies the relative order of each data point within the current time segment, while the inter-segment global position code identifies the absolute position of the current time segment in the entire historical sequence.
[0026] Spatiotemporal location coding The historical state tensor is formed by adding the output of the gating fusion unit element by element. .
[0027] In a specific implementation scheme, the step of extracting macroscopic sequence features based on the historical state tensor and dynamically reconstructing the contextualized query matrix includes:
[0028] tensor of historical state Perform global pooling along the time dimension to calculate higher-order statistics and form a statistical feature vector. At the same time The input is fed into a one-dimensional convolutional network, where a large receptive field convolutional kernel is used to extract the overall evolution trend of the sequence, and global max pooling is used to generate a trend feature vector. ; then, and The data is concatenated and then fused and compressed through a fully connected layer to obtain the macroscopic state vector. ;
[0029] A set of learnable benchmark query matrices is preset in the system. , the macroscopic state vector The input query is used to reconstruct the network. This network contains two parallel fully connected sublayers, each used to generate a specific query. scaling factor vector and bias factor vector ,Right now , ,in, and These are all weight matrices for fully connected layers. and These are all bias vectors of the fully connected layer;
[0030] Using the generated scaling factor vector and bias factor vector The reference query matrix is modulated channel by channel through a feature affine transformation, thus transforming the reference matrix... Each row with scaling factor Perform element-wise multiplication, then add the bias factor. Resulting in a contextualized query matrix .
[0031] In one specific implementation, decoding the hidden representation of the future time segment to obtain a correction amount, and generating an advertising metric prediction value based on the correction amount and a pre-generated baseline prediction, includes:
[0032] The hidden representation of future time segments generated by cross-attention is input into the standard decoder stack to generate a feature representation of the trend of future segments;
[0033] Perform baseline prediction operations to generate baseline predictions based on historical time segment sequences. ;
[0034] Treat the decoder output as a correction to the baseline prediction. , will correct amount Compared with baseline prediction The sum is used to form the final prediction result. ,Right now ;
[0035] Prediction results The ad metrics are converted from fragment-level format to point-level format and then denormalized using normalization parameters to restore the original dimensions of the ad metrics.
[0036] Secondly, this application provides a time series prediction system based on collaborative modeling of micro-dynamics and macro-state, employing the following technical solution:
[0037] A time series prediction system based on collaborative modeling of micro-dynamics and macro-state includes:
[0038] The time-series data structuring module is used to acquire multi-dimensional time-series data streams of advertising metrics, perform scale normalization and time-series segmentation on them, and construct a set of time segments.
[0039] The micro-dynamic pattern extraction module is used to perform a structured extraction operation of micro-dynamic patterns on the time segment set, extracting inertial momentum features, random impact features and periodic pattern features respectively, and fusing the extracted features in the feature dimension to generate a structured micro-dynamic prior tensor.
[0040] The hierarchical information embedding module is used to perform feature mapping on the obtained time segment set and fuse it with the micro-dynamic prior tensor in nonlinear space, while superimposing spatiotemporal location information to generate a historical state tensor that contains both deep semantic features and time series perception capabilities.
[0041] The macro-state adaptive attention module is used to extract macro-sequence features based on the historical state tensor and dynamically reconstruct the contextualized query matrix, and generate hidden representations of future time segments through cross-attention calculation.
[0042] The residual correction and output module is used to decode the hidden representation of the future time segment to obtain the correction amount, and generate the advertising indicator prediction value based on the correction amount and the pre-generated baseline prediction.
[0043] Thirdly, this application provides an electronic device, the device including a processor and a memory; the memory stores a program, the program being loaded and executed by the processor to implement a time-series prediction method based on co-modeling of micro-dynamics and macro-state as described in the first aspect.
[0044] Fourthly, this application provides a computer-readable storage medium storing a program that, when executed by a processor, is used to implement a time-series prediction method based on co-modeling of micro-dynamics and macro-state as described in the first aspect.
[0045] This application achieves high-precision prediction of non-stationary, multi-driven time series by systematically integrating micro-dynamic information with macro-state perception. At the micro level, the multi-dimensional time-series data stream of advertising indicators is first scaled and segmented to form a structured set of time segments. Subsequently, micro-dynamic features such as inertial momentum, random impacts, and periodic patterns are extracted from each time segment, and a structured micro-dynamic prior tensor is generated by fusing these features along the feature dimension. This enables a refined representation of local dynamics, overcoming the shortcomings of existing technologies in distinguishing different intrinsic driving forces. At the information fusion level, the time segment set is feature-mapped and fused with the micro-dynamic prior tensor in a nonlinear space. Simultaneously, spatiotemporal position encoding is introduced to construct a historical state tensor, ensuring that each segment retains the spatial relationships between internal variables, carries micro-dynamic priors, and clearly marks its relative and absolute position in the entire historical sequence. At the macro level, statistical and trend features are extracted using historical state tensors to generate a macro state vector. This vector is then used to dynamically reconstruct the attention query matrix, enabling adaptive retrieval and aggregation of global information. This addresses the problem of existing methods being unable to flexibly adjust the prediction focus in different market stages. Finally, the hidden representations of future time segments generated by the cross-attention module undergo deep decoding and are combined with baseline predictions for residual correction, outputting high-precision advertising metric predictions. This approach maintains training stability while simultaneously capturing detailed local features and accurately grasping global trends, significantly improving the accuracy and robustness of the prediction model in complex, non-stationary environments.
[0046] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, the preferred embodiments of this application are described in detail below with reference to the accompanying drawings. Attached Figure Description
[0047] Figure 1 This is a flowchart illustrating the time series prediction method based on collaborative modeling of micro-dynamics and macro-state in the embodiments of this application.
[0048] Figure 2 This is a schematic diagram of the overall process of the time series prediction method based on the collaborative modeling of micro-dynamics and macro-state in the embodiments of this application.
[0049] Figure 3 This is a structural block diagram of the time series prediction system based on the collaborative modeling of micro-dynamics and macro-state in the embodiments of this application.
[0050] Figure 4 This is a block diagram of an electronic device based on time-series prediction using collaborative modeling of micro-dynamics and macro-state in an embodiment of this application. Detailed Implementation
[0051] The specific embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate this application, but are not intended to limit the scope of this application.
[0052] Optionally, this application uses the time series prediction method based on the collaborative modeling of micro-dynamics and macro-state provided in various embodiments in an electronic device as an example for illustration. The electronic device is a terminal or a server. The terminal can be a computer, tablet computer, etc. This embodiment does not limit the type of electronic device.
[0053] Reference Figure 1 This is a flowchart illustrating a time series prediction method based on co-modeling of micro-dynamics and macro-state provided in an embodiment of this application. The method includes at least the following steps:
[0054] Step S101: Obtain the multivariate time-series data stream of advertising metrics and perform scale normalization and time-series segmentation on it to construct a set of time segments.
[0055] In step S101, a multivariate time-series data stream of advertising metrics is acquired, the data stream is scale-normalized, and segmented along the time dimension to form a hierarchical set of time segments. The purpose of this step is to prepare and normalize the input multivariate series of advertising metrics, so that different metrics are in a comparable numerical space, and to divide the continuous time series into a structured set of time segments to construct a data structure suitable for multi-scale modeling and analysis.
[0056] Specifically, it first receives a historical multi-dimensional time-series data stream containing multiple advertising metrics. Its dimensions are ,in, This indicates the quantity of advertising metrics, such as click-through rate (CTR) and conversion rate (CVR). This represents the total number of time points in the historical review window, for example, 336 past data points. After receiving the data, the input data stream is processed... Perform independent scaling normalization operations on each channel (i.e., the metric dimension), applying a linear transformation to the time series of each advertising metric to map its numerical range to a uniform scale. This eliminates orders-of-magnitude differences between different metrics, and the normalization parameters are cached to maintain consistency. Finally, the normalized data stream is segmented along the time dimension into... There are three consecutive, non-overlapping time segments, each with a length of [length missing]. After this segmentation operation, the original point-level time series data is reorganized into a segment-level structure, forming a set of time segments. Each time segment contains a fixed-length historical observation sequence, which can be used independently as the basic unit for time series analysis to establish a structured representation of different time periods.
[0057] Step S102: Perform a structured extraction operation on the micro-dynamic patterns of the time segment set, extracting inertial momentum features, random impact features, and periodic pattern features respectively, and fuse the extracted features in the feature dimension to generate a structured micro-dynamic prior tensor.
[0058] In step S102, a structured extraction operation of micro-dynamic patterns is performed on the set of time segments obtained in step S101, aiming to explicitly and structurally represent the intrinsic dynamic processes driving the local evolution of time segments. Using the Micro-Dynamic Pattern Extractor (MDPE), three core dynamic components—inertial momentum features, random impact features, and periodic pattern features—are extracted and fused along the feature dimension to construct a structured prior tensor that comprehensively reflects the local dynamic mechanism, thereby achieving a refined expression and distinction of temporal patterns within each time segment.
[0059] Specifically, the inertial momentum feature extraction operation is performed first. This is for the current time segment in the set of time segments. , To what extent its evolution trend has continued that of the adjacent [landform]? A historical moment The inertial characteristics. To achieve this calculation, a small attention network is used. The feature distribution of each historical time segment is analyzed, and a corresponding scalar weight is generated for each historical time segment. The weight value reflects the contribution of that segment to the current inertial trend; a larger weight value indicates a greater contribution of that historical segment to the current inertia. Then, the feature vectors of each historical time segment are multiplied by their weights and summed, i.e. ,in, Indicates the first Scalar weights corresponding to each historical time segment are used to achieve weighted aggregation of multi-step historical trajectory information, forming an inertial vector representing the current direction and intensity of motion. This inertial vector is then processed by a nonlinear transformation layer. (Constructed from a multilayer perceptron (MLP) or fully connected layers containing ReLU and GELU activation functions) high-dimensional mapping and feature recombination are performed to obtain inertial momentum features. .
[0060] Secondly, a random impact feature extraction operation is performed. This process is used to characterize the current time segment. Influenced by the past The extent of the impact of unpredictable random disturbance events is assessed using second-order differences between adjacent time segments. As a proxy for impact strength, it is quantified through another set of dynamic weights. These difference results are then summed using a weighted method. ,in, Indicates the first Dynamic weights corresponding to each historical time segment Then through the transformation layer Perform nonlinear feature mapping to obtain random shock features. This feature reflects the transient fluctuation pattern caused by external disturbances in a time segment.
[0061] Subsequently, a periodic pattern feature extraction operation is performed. To capture short-period patterns (such as hourly or intraday fluctuation patterns) within time segments, each time segment... A set of one-dimensional depthwise separable convolutions and Discrete Fourier Transform (DFT) is applied to simultaneously identify periodic signal components in both the time and frequency domains, extract significant periodic features, and generate periodic pattern features. .
[0062] Finally, a micro-feature integration operation is performed. This integrates the inertial momentum features. Random shock characteristics and periodic pattern characteristics The features are concatenated along the feature dimension and then fed into a fusion sub-network for structured integration. The fusion sub-network can employ a lightweight structure containing gated recurrent units (GRUs) to capture the correlations between different features along the time dimension, generating a structured microscopic dynamic prior tensor. This allows for a complete reflection of the multidimensional dynamic structure of local temporal changes within a set of time segments.
[0063] In the feature extraction stage, a micro-dynamic pattern extractor performs a structured decomposition operation on the time segment set, explicitly separating the local dynamics of each time segment into three core components with clear physical meanings: inertial momentum, random impacts, and periodic patterns. Inertial momentum reflects historical continuity, i.e., the extent to which the evolution trend of the current time segment follows the dynamic direction and amplitude of previous segments; random impacts characterize transient fluctuation patterns caused by unpredictable external disturbances in the time segment; and periodic patterns capture short-cycle cyclical patterns, such as hourly or intraday fluctuations. This decomposition method differs from traditional approaches that treat local dynamics as indiscriminate noise or simple linear superposition. It can quantify the different intrinsic forces driving local evolution in parallel and explicitly at the time segment level, providing a structured and interpretable characterization of micro-dynamics and thus offering a clear understanding of the local time-series mechanisms for subsequent analysis.
[0064] In the feature fusion stage, the three types of micro-dynamic features mentioned above are integrated along the feature dimension. However, this is not a simple linear concatenation; instead, a learnable gated fusion unit is used to nonlinearly weight different features and the original data, dynamically adjusting the retention ratio of each component to achieve complementarity and deep fusion between features. This fusion method can take into account the diversity and nonlinear correlation of micro-dynamics, enabling inertial momentum, random shocks, and periodic patterns to be coordinatingly expressed in a unified representation space, thus forming a structured micro-dynamic prior tensor. Through this explicit decomposition and adaptive fusion process, the model can systematically understand and quantitatively represent the intrinsic mechanism of local temporal evolution. This not only provides interpretable fine-grained input but also lays the foundation for capturing complex local fluctuations, identifying key short-term signals, and making dynamic comparisons between different segments.
[0065] Step S103: Perform feature mapping on the obtained time segment set and fuse it with the micro-dynamic prior tensor in the nonlinear space. At the same time, superimpose spatiotemporal location information to generate a historical state tensor that contains both deep semantic features and time series perception capabilities.
[0066] In step S103, the time segment set obtained in step S101 and the micro-dynamic prior tensor extracted in step S102 are subjected to hierarchical embedding processing. The original time segment information and the micro-dynamic prior are fused in a nonlinear space, and spatiotemporal position encoding is introduced into the fused representation, thereby forming a historical state tensor that contains both deep semantic features within the segments and retains the temporal sequence information. The purpose of this step is to integrate multi-source time series information through a unified hierarchical embedding mechanism, so that each time segment not only reflects the spatial relationship between the original variables, but also carries the structured prior of micro-dynamics, and clearly marks the relative and absolute position in the entire historical sequence, providing a highly condensed input representation for macro-state analysis.
[0067] Specifically, the time segment set obtained in step S101 is first... Organization for the original time segment tensor . By stacking each time segment along the segment dimension to form a three-dimensional tensor, its dimension is... . The construction of this structure allows for a clear representation of the time sequence and relationships between variables within each segment, thus providing standardized input for subsequent embedding operations. Subsequently, [the following is discussed]... Perform basic representation embedding operations, inputting them into the convolutional embedding network to generate basic deep representations. This network captures the spatial correlation between variables within a segment through convolution operations, mapping the original low-dimensional information to a high-dimensional feature space, thereby achieving an abstract representation of the internal patterns of the segment.
[0068] Next, The structured microscopic dynamic prior tensor obtained in step S102 The input gated fusion unit (GFU) contains update and reset gates. Through a learnable gating mechanism, it adaptively adjusts the ratio of original to prior information retained in each feature dimension, achieving non-linear deep fusion and enhancing the discriminative power and information integrity of the features. After fusion, a learnable spatiotemporal location code is superimposed on the resulting representation. The intra-segment positional encoding identifies the relative order of each data point within the current time segment, while the inter-segment global positional encoding identifies the absolute position of the current time segment within the entire historical sequence. After element-wise addition with the GFU output, the final history state tensor is formed. This tensor not only contains deep semantic information after the fusion of multi-source features, but also has accurate time series perception capabilities, providing core input for macro-state analysis.
[0069] Step S104: Extract macroscopic sequence features based on historical state tensors and dynamically reconstruct the contextualized query matrix, and generate hidden representations of future time segments through cross-attention calculation.
[0070] In step S104, the historical state tensor obtained in step S103 is processed. The process involves extracting a macro-state vector and dynamically reconstructing the attention query matrix using this macro-state vector, enabling adaptive retrieval and aggregation of global information within the historical sequence. The goal of this step is to contextualize the attention query through the macro-state vector, allowing the attention mechanism to focus on important patterns relevant to the overall environment of the current sequence and generate hidden representations of future time segments.
[0071] Specifically, the macroscopic state vector extraction operation is performed first. This involves processing the historical state tensor. Global pooling is performed along the time dimension to calculate higher-order statistics such as mean, variance, skewness, and kurtosis, forming a statistical feature vector. At the same time, The input is fed into a small one-dimensional convolutional network (1D-CNN), which uses large receptive field convolutional kernels to extract the overall evolution trend of the sequence, such as long-term upward or downward trends, and generates trend feature vectors through global max pooling. Subsequently, and The data is concatenated and then fused and compressed through a fully connected layer to obtain the macroscopic state vector. This vector numerically represents the macroeconomic environment of the current sequence, such as a period of high volatility or a period of steady growth.
[0072] Next, based on the macroscopic state vector Perform dynamic reconstruction of the query matrix. First, a set of learnable baseline query matrices is preset in the system. This represents a common basic query pattern. The matrix contains a set of learnable vectors, each representing a common query pattern. The macroscopic state vector... The input query reconstruction network (QRN) consists of two parallel fully connected sublayers, each used to generate a response to a query. scaling factor vector and bias factor vector ,Right now , ,in, This is the transformation matrix corresponding to the fully connected layer. and These are all weight matrices for fully connected layers. and These are all bias vectors for fully connected layers. The generated transformation parameters, i.e., scaling factor vectors, are then used. and bias factor vector The reference query matrix is modulated channel by channel through a feature affine transformation. Specifically, the reference matrix... Each row (or channel) with scaling factor Perform element-wise multiplication, then add the bias factor. Finally, the contextualized query matrix is obtained. Through this operation, the length and direction of each baseline query vector are adjusted according to the macroscopic state vector. Dynamic adjustments are made to change the search focus and weight of queries in historical information, enabling them to extract the most relevant global sequence features for the current macro environment.
[0073] Finally, the contextualized query matrix As Historical state tensor As the key and value, the input is a standard multi-head cross-attention layer to perform attention computation. The query matrix is then used for attention computation. Guided by an understanding of the macro-state, it is possible to efficiently and accurately retrieve the most critical patterns for future predictions in the current context from historical information and generate hidden representations of future time segments.
[0074] In implementation, by analyzing high-order statistics and trend characteristics of the historical state tensor, the overall macroscopic state of the sequence is explicitly characterized. Complex historical information is condensed into a macroscopic state vector, enabling the model to retrieve information based on an understanding of global evolution trends, rather than relying solely on local patterns. This operation achieves a quantitative representation of the macroscopic features of the time series, providing clear reference signals for subsequent dynamic adjustments. Based on this macroscopic state vector, a contextualized query matrix is generated through a query reconstruction network, achieving adaptive control of the multi-head cross-attention mechanism. Traditional attention mechanisms typically use fixed query matrices, making it difficult to flexibly adjust the focus of attention for different historical environments. This approach, by extracting the macroscopic state first and then reconstructing the query, allows the direction and weight of each query vector to dynamically adjust with the macroscopic environment, thereby more accurately capturing global patterns highly correlated with the current sequence state. This mechanism not only enhances the model's ability to perceive long-range dependencies but also significantly improves its adaptability to non-stationary and variable sequences. Furthermore, by combining contextualized queries with the historical state tensor to perform multi-head cross-attention computation, it is possible to selectively integrate microscopic dynamics and macroscopic pattern information while capturing global dependencies, generating hidden representations of future time segments. By combining residual learning paradigms, these hidden representations focus on the nonlinear residuals that are difficult to fit by the baseline model, enabling the model to retain the overall trend and enhance its sensitivity to local anomalies in complex and variable environments, thereby comprehensively improving the accuracy and robustness of predictions.
[0075] Step S105: Decode the hidden representation of the future time segment to obtain the correction amount, and generate the advertising metric prediction value based on the correction amount and the pre-generated baseline prediction.
[0076] In step S105, the hidden representation of future time segments generated by the macroscopic state adaptive attention module in step S104 is deeply decoded, and based on this, combined with the baseline prediction, the residual correction amount is calculated to obtain the final high-precision prediction value. The purpose of this step is to transform the high-level semantic information extracted by the deep network into specific numerical predictions through residual learning, while maintaining training stability and sensitivity to nonlinear changes, and restoring the prediction results to the original index scale to form an advertising index output that can be directly applied.
[0077] Specifically, the hidden representations of future time segments generated by cross-attention are first input into a standard decoder stack. This stack includes standard components such as multi-layer feedforward neural networks (FFNs) and layer normalization (LayerNorm) to extract deep information from the hidden representations, generating feature representations of future segment trends. Then, a baseline prediction operation is performed, generating a preliminary baseline prediction based on the historical time segment sequence. The baseline prediction can be obtained through linear extrapolation of the last few time segments, and this baseline prediction provides a reference for the overall trend of the sequence. The decoder output is then considered as a correction to this baseline prediction. , will correct amount Compared with baseline prediction The sum is used to form the final prediction result. ,Right now This residual learning paradigm allows deep models to focus on the nonlinear fluctuations in the learning sequence while maintaining the stability of the training process and improving prediction accuracy.
[0078] Finally, the prediction results The data is converted from fragment-level format to point-level format, and then denormalized using the normalization parameters cached in step S101 to restore the advertising metric values to their original dimensions. After this operation, the output prediction results have clear business significance and can be directly used by downstream systems.
[0079] In summary, combining Figure 2 This application achieves high-precision prediction of non-stationary, multi-driven time series by systematically integrating micro-dynamic information with macro-state perception. At the micro level, the multi-dimensional time series data stream of advertising indicators is first scaled and segmented to form a structured set of time segments. Subsequently, micro-dynamic features such as inertial momentum, random impacts, and periodic patterns are extracted from each time segment, and a structured micro-dynamic prior tensor is generated by fusing these features along the feature dimension. This achieves a refined representation of local dynamics, overcoming the shortcomings of existing technologies in distinguishing different intrinsic driving forces. At the information fusion level, the time segment set is feature-mapped and fused with the micro-dynamic prior tensor in a nonlinear space. Simultaneously, spatiotemporal position encoding is introduced to construct a historical state tensor, ensuring that each segment retains the spatial relationships between internal variables, carries micro-dynamic priors, and clearly marks its relative and absolute position in the entire historical sequence. At the macro level, statistical and trend features are extracted using historical state tensors to generate a macro state vector. This vector is then used to dynamically reconstruct the attention query matrix, enabling adaptive retrieval and aggregation of global information. This addresses the problem of existing methods being unable to flexibly adjust the prediction focus in different market stages. Finally, the hidden representations of future time segments generated by the cross-attention module undergo deep decoding and are combined with baseline predictions for residual correction, outputting high-precision advertising metric predictions. This approach maintains training stability while simultaneously capturing detailed local features and accurately grasping global trends, significantly improving the accuracy and robustness of the prediction model in complex, non-stationary environments.
[0080] Figure 3This is a structural block diagram of a time series prediction system based on collaborative modeling of micro-dynamics and macro-state, provided in one embodiment of this application. The system includes at least the following modules:
[0081] The time-series data structuring module is used to acquire multi-dimensional time-series data streams of advertising metrics, perform scale normalization and time-series segmentation on them, and construct a set of time segments.
[0082] The micro-dynamic pattern extraction module is used to perform structured extraction of micro-dynamic patterns on a set of time segments. It extracts inertial momentum features, random impact features, and periodic pattern features respectively, and fuses the extracted features in the feature dimension to generate a structured micro-dynamic prior tensor.
[0083] The hierarchical information embedding module is used to perform feature mapping on the obtained time segment set and fuse it with the micro-dynamic prior tensor in nonlinear space, while superimposing spatiotemporal location information to generate a historical state tensor that contains both deep semantic features and time series perception capabilities.
[0084] The macro-state adaptive attention module is used to extract macro-sequence features based on historical state tensors and dynamically reconstruct contextual query matrices, and generate hidden representations of future time segments through cross-attention calculation.
[0085] The residual correction and output module is used to decode the hidden representation of future time segments to obtain the correction amount, and generate the advertising metric prediction value based on the correction amount and the pre-generated baseline prediction.
[0086] For relevant details, please refer to the above method implementation examples.
[0087] Figure 4 This is a block diagram of an electronic device provided in one embodiment of this application. The device includes at least a processor 401 and a memory 402.
[0088] Processor 401 may include one or more processing cores, such as a quad-core processor or an octa-core processor. Processor 401 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 401 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 401 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 401 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0089] Memory 402 may include one or more computer-readable storage media, which may be non-transitory. Memory 402 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in memory 402 is used to store at least one instruction, which is executed by processor 401 to implement the timing prediction method based on co-modeling of micro-dynamics and macro-state provided in the method embodiments of this application.
[0090] In some embodiments, the electronic device may also optionally include: a peripheral device interface and at least one peripheral device. The processor 401, memory 402, and peripheral device interface can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface via a bus, signal line, or circuit board. Indicatively, peripheral devices include, but are not limited to: radio frequency circuits, touch displays, audio circuits, and power supplies.
[0091] Of course, electronic devices may also include fewer or more components, and this embodiment does not limit this.
[0092] Optionally, this application also provides a computer-readable storage medium storing a program that is loaded and executed by a processor to implement the time-series prediction method based on co-modeling of micro-dynamics and macro-state as described in the above method embodiments.
[0093] Optionally, this application also provides a computer product including a computer-readable storage medium storing a program, which is loaded and executed by a processor to implement the time-series prediction method based on co-modeling of micro-dynamics and macro-state as described in the above method embodiments.
[0094] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0095] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A time series forecasting method based on micro-dynamics and macro-state collaborative modeling, characterized in that, The method comprises: acquiring a multivariate time series data stream of an advertising index and performing scale normalization processing and time series segmentation thereon to construct a time segment set; performing structured extraction of micro-dynamic patterns on the time segment set to respectively extract inertial momentum features, random impact features, and periodic pattern features, and fusing the extracted features in the feature dimension to generate a structured micro-dynamic prior tensor; performing feature mapping on the obtained time segment set and fusing it with the micro-dynamic prior tensor in a nonlinear space while superimposing spatiotemporal position information to generate a historical state tensor that contains deep semantic features and has time series perception capability; extracting macro sequence features based on the historical state tensor and dynamically reconstructing a contextual query matrix to generate hidden representations of future time segments through cross-attention calculation; decoding the hidden representations of the future time segments to obtain a correction amount, and generating an advertising index prediction value based on the correction amount and a pre-generated baseline prediction.
2. The time series forecasting method based on the synergy modeling of microcosmic dynamics and macroscopic states according to claim 1, characterized in that, The acquiring a multivariate time series data stream of an advertising index and performing scale normalization processing and time series segmentation thereon to construct a time segment set comprises: Receiving a historical multivariate time series data stream containing a plurality of advertising metrics with dimensions wherein denotes the number of advertising metrics, denotes the total number of time points of the historical lookback window; After receiving is completed, the input data stream Perform channel-independent scale normalization operation, respectively linearly transform each advertising index time series, make its numerical range map to uniform scale, cut the normalized data stream into Continuous and non-overlapping time segments along the time dimension, the length of each segment is , form a time segment set .
3. The time series forecasting method based on the synergy modeling of microcosmic dynamics and macroscopic states according to claim 1, characterized in that, The performing structured extraction of micro-dynamic patterns on the time segment set to respectively extract inertial momentum features, random impact features, and periodic pattern features comprises: for a current time slice of the set of time slices , , compute to what extent its evolution trend continues the inertia features of the immediately preceding historical time slices ; a small attention network is employed to analyze the feature distribution of a historical time segment and generate a corresponding scalar weight for each historical time segment ; The feature vectors of each historical time slice are multiplied by their weights and accumulated, that is wherein, denotes the scalar weight corresponding to the th historical time slice, forming an inertia vector representing the current motion direction and intensity. Inertial vector through a non-linear transformation layer High-dimensional mapping and feature reorganization are performed to obtain inertial momentum features .
4. The time series forecasting method based on the synergy modeling of microcosmic dynamics and macroscopic states according to claim 1, characterized in that, The performing structured extraction of micro-dynamic patterns on the time segment set to respectively extract inertial momentum features, random impact features, and periodic pattern features comprises: performing random shock feature extraction operation, which is used to characterize the current time segment affected by past unpredictable random disturbance events; using second-order difference between adjacent time segments as a proxy for shock intensity, through another set of dynamic weights weighted sum of the difference results, namely , where represents the dynamic weight corresponding to the historical time segment , and then through the transformation layer performing nonlinear feature mapping to obtain random shock features ; performing a periodic pattern feature extraction operation on each time slice applying a set of one-dimensional depthwise separable convolutions with discrete Fourier transforms, while identifying periodic signal components in both time and frequency domains, and extracting significant periodic features therefrom, to generate periodic pattern features .
5. The time series forecasting method based on the synergy modeling of microcosmic dynamics and macroscopic states according to claim 1, characterized in that, The performing feature mapping on the obtained time segment set and fusing it with the micro-dynamic prior tensor in a nonlinear space while superimposing spatiotemporal position information to generate a historical state tensor that contains deep semantic features and has time series perception capability comprises: Collecting time segments Organizing as raw time segment tensor , the Performing a base representation embedding operation, inputting a convolutional embedding network, generating a base deep representation ; Will with the structured micro-dynamic prior tensor obtained The input gate fusion unit is fused, and after the fusion is completed, the obtained representation is superimposed with learnable spatiotemporal position encoding Wherein the intra-fragment position encoding identifies the relative order of each data point within the current time segment, and the inter-fragment global position encoding identifies the absolute position of the current time segment in the entire historical sequence. Space-time position encoding The history state tensor is formed after element-wise addition to the output of the gating fusion unit .
6. The time series forecasting method based on the synergy modeling of microcosmic dynamics and macroscopic states according to claim 1, characterized in that, The extracting macro sequence features based on the historical state tensor and dynamically reconstructing a contextual query matrix comprises: the historical state tensor a global pooling operation along the time dimension, calculate high-order statistics, form a statistical feature vector ; at the same time input into a one-dimensional convolution network, using large receptive field convolution kernel to extract the overall evolution trend of the sequence, and through the global maximum pooling to generate trend feature vector ; then and splicing, and through a fully connected layer to get macro state vector ; A set of learnable benchmark query matrices are preset in the system The macro state vector is input into a query reconstruction network, which includes two parallel fully connected sub-layers for generating a scaling factor vector and a bias factor vector for the query vector , i.e. , wherein and are weight matrices of the fully connected layers, and are bias vectors of the fully connected layers. using the generated scaling factor vector and bias factor vector , each row of the reference matrix is multiplied element-wise by the scaling factor and then added to the bias factor to obtain the contextualized query matrix .
7. The time series forecasting method based on the synergy modeling of microcosmic dynamics and macroscopic states according to claim 1, characterized in that, The decoding the hidden representations of the future time segments to obtain a correction amount, and generating an advertising index prediction value based on the correction amount and a pre-generated baseline prediction comprises: inputting the hidden representations of the future time segments generated by the cross-attention into a standard decoder stack to generate feature representations of future segment trends; performing a baseline prediction operation to generate a baseline prediction from the sequence of historical time slices ; Treat the decoder output as a correction to the baseline prediction. , will correct amount Compared with baseline prediction The sum is used to form the final prediction result. ,Right now ; The predicted results The segment-level format is converted into the point-level format, and the normalized parameters are used for denormalization to restore the advertising index values to the original dimension.
8. A time series forecasting system based on micro-dynamics and macro-state collaborative modeling, characterized in that, comprises: a time series data structuring module configured to acquire a multivariate time series data stream of an advertising index and perform scale normalization processing and time series segmentation thereon to construct a time segment set; a micro-dynamic pattern extraction module configured to perform structured extraction of micro-dynamic patterns on the time segment set to respectively extract inertial momentum features, random impact features, and periodic pattern features, and fuse the extracted features in the feature dimension to generate a structured micro-dynamic prior tensor; a hierarchical information embedding module configured to perform feature mapping on the obtained time segment set and fuse it with the micro-dynamic prior tensor in a nonlinear space while superimposing spatiotemporal position information to generate a historical state tensor that contains deep semantic features and has time series perception capability; a macro state self-adaptive attention module, configured to extract macro sequence features based on the historical state tensor and dynamically reconstruct a contextualized query matrix, and to generate hidden representations of future time slices through cross-attention computation; a residual correction and output module, configured to decode the hidden representations of the future time slices to obtain correction amounts, and to generate an advertising index prediction value based on the correction amounts and a pre-generated baseline prediction.
9. An electronic device, comprising: The device comprises a processor and a memory; the memory stores a program which is loaded and executed by the processor to implement the time series prediction method based on micro-dynamics and macro state collaborative modeling according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a program which, when executed by a processor, is configured to implement the time series prediction method based on micro-dynamics and macro state collaborative modeling according to any one of claims 1 to 7. The storage medium stores a program which, when executed by a processor, is configured to implement the time series prediction method based on micro-dynamics and macro state collaborative modeling according to any one of claims 1 to 7.
Citation Information
Patent Citations
Service prediction method and device based on time sequence model, equipment and storage medium
CN120105102A
Deep geologic body occurrence characteristic quantitative representation modeling method and system
CN120217898A