Prediction method, electronic device, medium and computer program product
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MIGU CO LTD
- Filing Date
- 2025-09-01
- Publication Date
- 2026-08-07
AI Technical Summary
这种方法可能会忽略不同特征之间随时间演变的动态交互,降低在处理复杂时序任务中的准确性
[0020] This application provides an electronic device, which includes a processor and a memory for storing computer programs capable of running on the processor; wherein,
Smart Images

Figure CN121328624B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of artificial intelligence technology, and specifically relates to a prediction method, electronic device, medium, and computer program product. Background Technology
[0002] Temporal Convolutional Network (TCN) models, by borrowing the concept of Convolutional Neural Networks (CNNs) from image processing, apply it to temporal data, revolutionizing traditional temporal processing methods. When processing multi-feature temporal series, TCN models typically employ dilated convolutional kernels. While this structure can expand the receptive field and retain deeper historical information, it essentially still analyzes the features of each time point independently, without directly modeling the interactions between features. This approach may ignore the dynamic interactions between different features over time, reducing accuracy in handling complex temporal tasks. Summary of the Invention
[0003] This application provides a prediction method, an electronic device, a medium, and a computer program product.
[0004] This application provides a prediction method, the method comprising:
[0005] The first dataset is processed by the first model to obtain the first intermediate feature corresponding to the first dataset; wherein, the first dataset includes time series data corresponding to the data to be processed;
[0006] The second dataset is processed by the second model to obtain the second intermediate feature corresponding to the second dataset; wherein, the second dataset includes the structured data corresponding to the data to be processed;
[0007] Based on the first intermediate feature and the second intermediate feature, the prediction result of the data to be processed is determined.
[0008] In some embodiments, determining the prediction result of the data to be processed based on the first intermediate feature and the second intermediate feature includes: determining a first weight of the first intermediate feature and a second weight of the second intermediate feature; and determining the prediction result of the data to be processed based on the first intermediate feature, the first weight, the second intermediate feature, and the second weight.
[0009] It can be seen that by determining the first and second weights, it is helpful to dynamically adjust the degree of attention to the first and second intermediate features, improve the ability to capture key information, and facilitate accurate prediction results.
[0010] In some embodiments, the first model includes at least two causal convolutional layers; each of the at least two causal convolutional layers has a different kernel size; the step of processing the first dataset through the first model to obtain the first intermediate feature corresponding to the first dataset includes: processing the time series data through each causal convolutional layer to obtain the first result of each causal convolutional layer; and determining the first intermediate feature corresponding to the first dataset based on the first result.
[0011] It can be seen that by setting different convolution kernel sizes, the first model can capture not only the relationships between fine-grained features, but also the dependencies between features over a wider range, which is beneficial to improving the accuracy of the first intermediate features.
[0012] In some embodiments, the first model further includes a pooling layer; before determining the first intermediate feature corresponding to the first dataset based on the first result, the method further includes: processing the time series data through the pooling layer to obtain a second result; determining the first intermediate feature corresponding to the first dataset based on the first result includes: determining the first intermediate feature corresponding to the first dataset based on the first result and the second result.
[0013] It can be seen that by adding a pooling layer to the first model to process the data to be processed, it is beneficial to filter out unimportant features in the data to be processed. By combining the first result and the second result output by the pooling layer to determine the first intermediate feature, it is beneficial to improve the accuracy of the first intermediate feature.
[0014] In some embodiments, before determining the first intermediate feature corresponding to the first dataset based on the first result, the method further includes: grouping the time series data using the first model to obtain at least two data groups; any one of the at least two data groups corresponds to one or more convolutional kernels; performing causal convolution processing on each data group using one or more convolutional kernels corresponding to each of the at least two data groups to obtain a third result; determining the first intermediate feature corresponding to the first dataset based on the first result includes: determining the first intermediate feature corresponding to the first dataset based on the first result and the third result.
[0015] It can be seen that grouping time-series data and performing causal convolution on each group is beneficial for extracting features at different time scales. Applying causal convolution to data groups using multiple convolution kernels improves feature representation and yields accurate first intermediate features.
[0016] In some embodiments, before processing the first dataset using the first model, the method further includes: processing the first training dataset using the first model to obtain a third intermediate feature corresponding to the first training dataset; the first training dataset includes time series data corresponding to the training data; processing the second training dataset using a second model to obtain a fourth intermediate feature corresponding to the second training dataset; wherein the second training dataset includes structured data corresponding to the training data; training a prediction model based on the third intermediate feature and the fourth intermediate feature, so that the prediction model can output a model processing result according to the third intermediate feature and the fourth intermediate feature; the prediction model includes the first model and the second model.
[0017] It can be seen that by training the prediction model, the prediction model can accurately identify local and global features, thereby improving the prediction accuracy of the prediction model.
[0018] In some embodiments, the prediction model further includes an attention layer; training the prediction model based on the third intermediate feature and the fourth intermediate feature includes: determining the third weight of the third intermediate feature and the fourth weight of the fourth intermediate feature based on the attention layer; determining the model processing result of the prediction model according to the third intermediate feature, the third weight, the fourth intermediate feature and the fourth weight; determining a loss value through the model processing result; and adjusting the model parameters of the prediction model with the goal of minimizing the loss value.
[0019] It can be seen that training the attention layer in the prediction model helps the prediction model to accurately identify the importance of different features, select the features most important to the current task objective, highlight the role of important features, and improve the accuracy of the prediction model.
[0020] This application provides an electronic device, which includes a processor and a memory for storing computer programs capable of running on the processor; wherein,
[0021] The processor is used to run the computer program to perform any of the above prediction methods.
[0022] This application provides a computer storage medium storing a computer program that, when executed by a processor, implements any of the prediction methods described above.
[0023] This application provides a computer program product, including a computer program that, when executed by a processor, implements any of the above-described prediction methods.
[0024] This application provides a prediction method, electronic device, medium, and computer program product. By processing time-series data and structured data of the data to be processed during the prediction process, and combining the first intermediate feature corresponding to the time-series data and the second intermediate feature corresponding to the structured data to obtain the prediction result, it is beneficial to obtain the local features of the data to be processed by processing the time-series data, obtain the global features of the data to be processed by processing the structured data, and capture the dynamic interaction between features, thereby improving the accuracy of processing complex time-series tasks and improving the accuracy of prediction results. Attached Figure Description
[0025] Figure 1 A flowchart of a prediction method provided in an embodiment of this application;
[0026] Figure 2 A schematic diagram of a prediction model framework provided in an embodiment of this application;
[0027] Figure 3 A schematic diagram of the TCN convolution kernel computation region provided in an embodiment of this application;
[0028] Figure 4 A schematic diagram of a Causal Inception structure provided in an embodiment of this application;
[0029] Figure 5 An example diagram of a Group Causal Block processing method provided in this application embodiment;
[0030] Figure 6 A schematic diagram of a novel residual block provided in an embodiment of this application;
[0031] Figure 7 This is a schematic diagram of the structure of a prediction device provided in an embodiment of this application;
[0032] Figure 8 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0033] Different business scenarios have different requirements for network resources. For example, payment scenarios have high requirements for low latency, while live streaming scenarios have high requirements for bandwidth capacity. In order to cope with the network resource requirements of different functional scenarios, during the business development and iteration process, it is usually abstracted into a multi-feature time series (time series) prediction problem, and the corresponding network resources are evaluated based on the relevant functional scenario data.
[0034] In the field of time series forecasting, one class of methods relies on statistical approaches based on strict data assumptions, such as Autoregressive Moving Average (ARMA) models and Autoregressive Integrated Moving Average (ARIMA) models. These methods typically require the data source to have a stable state distribution. They construct complex forecasting models by subdividing the forecast target into multiple components and using strategies such as addition or multiplication to model and fit each component separately.
[0035] Another category is traditional machine learning modeling methods, such as linear regression models, support vector machines (SVM), extreme gradient boosting (Xgboost), and lightweight gradient boosting machines (LightGBM). Because these methods are more suitable for tabular data, the process often relies on the subjective judgment of the modeler or industry expert, and this subjectivity may mean that the feature processing method may not be optimal.
[0036] Another type of deep learning method is represented by Recurrent Neural Networks (RNNs). These models excel at handling long-term dependency problems, recursively moving along the evolution direction of sequence data, with all nodes (recurrent units) connected in a chain-like manner. This structure allows information to circulate within the network, preserving information from previous time steps, which is crucial for understanding patterns and trends in sequences.
[0037] Based on the methods described above, when using statistical and traditional machine learning methods for prediction processing, there are limitations in utilizing the full potential information of the data, especially when dealing with datasets with numerous attributes. They often fail to fully uncover and identify features that have a critical impact on the prediction results. This limitation affects the model's performance in handling complex data patterns and identifying implicit relationships. Moreover, even with the help of expert manual feature engineering, the effectiveness of the selected features cannot be guaranteed, and this approach has limited scalability, heavily relies on specialized domain knowledge, making its application inflexible and costly.
[0038] In the field of deep learning, the TCN model revolutionized traditional time-series data processing by borrowing concepts from CNNs in image processing and applying them to time-series data processing. The TCN model effectively captures local dependencies in time-series data by utilizing stacked convolutional layers and enlarged receptive fields of the convolutional kernels. However, when processing multiple features, TCN typically uses dilated convolutional kernels. While this structure can expand the receptive field and retain deeper historical information, it essentially still analyzes features independently at each time point without directly modeling the interactions between features. This may overlook the dynamic interactions between different features over time, potentially leading to limitations in some complex time-series analysis tasks.
[0039] To overcome the problems existing in related technologies and obtain accurate prediction results, embodiments of this application provide a prediction method, electronic device, medium, and computer program product. The prediction method provided in this application can combine the processing of time series data and structured data to improve the accuracy of model predictions.
[0040] The embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the embodiments provided herein are merely illustrative of the embodiments of this application and are not intended to limit the embodiments of this application. Furthermore, the embodiments provided below are some embodiments for implementing this application, and not all embodiments for implementing this application. Unless otherwise specified, the technical solutions described in the embodiments of this application can be implemented in any combination.
[0041] It should be noted that, in the embodiments of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a method or apparatus that includes a list of elements includes not only the elements expressly described, but also other elements not expressly listed, or elements inherent to implementing the method or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of other related elements in the method or apparatus that includes that element (e.g., steps in the method or units / modules in the apparatus; for example, units / modules in the apparatus may be portions of circuitry, processors, programs, or software, etc.).
[0042] The prediction method provided in this application includes a series of steps, but the prediction method provided in this application is not limited to the steps described. Similarly, the prediction device provided in this application includes a series of modules, but the device provided in this application is not limited to the modules explicitly described, and may also include modules that need to be set up for obtaining relevant information or processing based on information.
[0043] This application provides a prediction method, such as... Figure 1As shown, Figure 1 A flowchart of a prediction method is shown. Figure 1 The prediction methods shown include:
[0044] Step 101: Process the first dataset using the first model to obtain the first intermediate feature corresponding to the first dataset.
[0045] The first dataset includes time series data corresponding to the data to be processed.
[0046] In this step, the first model can be a model that processes time series data. The first model can extract features from the time series data and determine the first intermediate feature corresponding to the time series data.
[0047] The first model can specifically be a TCN model, a WaveNet model, a Temporal Convolutional Network-Long Short-Term Memory Network (TCN-LSTM) hybrid model, etc. This application does not specifically limit the first model.
[0048] Here, the first intermediate feature refers to the feature output by each layer during the processing of time series data by the first model. Taking the first model as a TCN model as an example, the first intermediate feature of the TCN model can be the feature output by each convolutional layer in the hidden layers. Since the hidden layers of the TCN model can be composed of multiple stacked causal convolutional layers, the TCN model can obtain the first intermediate feature corresponding to each causal convolutional layer by processing the first dataset. That is, the first model can obtain one or more first intermediate features by processing the first dataset.
[0049] Taking a specific cloud gaming service scenario as an example, network performance is a key factor in ensuring high-quality cloud gaming services. Cloud gaming generates a large amount of network performance data, which is rich, real-time, and accurate. This data can be used to build effective network quality prediction models to support the high-quality operation of cloud gaming services. When predicting the network quality of cloud gaming services, the data to be processed shown in Table 1 below can be obtained.
[0050] Table 1
[0051] Delay CPU utilization Connection stability Game type Bandwidth utilization Memory usage Equipment type Page refresh rate Data packet loss rate Network routing status Network card type Encoding format Signal quality Routing stability resolution Encoding rate Network jitter Route hop count Uplink / Downlink Bandwidth Frame rate ... ... ... ...
[0052] In the prediction of network quality for cloud gaming services, directly relevant indicators such as latency and packet loss rate in Table 1 can be time series data formed by data sampling at preset time intervals, such as 15 minutes, to obtain the first dataset, enabling the first model to capture the dynamic changes of the time series data.
[0053] Step 102: Process the second dataset using the second model to obtain the second intermediate features corresponding to the second dataset.
[0054] The second dataset includes structured data corresponding to the data to be processed.
[0055] In this step, the second model can be a model that processes structured data. The second model can extract features from the structured data and determine the second intermediate features corresponding to the structured data.
[0056] The second model can be the TabNet model, the Self-Attention and Intersample Attention Transform (SAINT) network for tabular data, etc. This application does not specifically limit the second model.
[0057] TabNet is a novel neural network architecture proposed by Google in 2019, specifically designed for processing tabular data. It employs a sequential attention mechanism, mimicking the process of a decision tree, where each decision step contributes its own outcome. The model then aggregates the weighted decisions of all steps to produce the final output. Because TabNet's input is in tabular form, it allows for the easy incorporation of additional information, such as holiday events or unexpected situations, helping the model better learn information within the sequence. Furthermore, new features, such as window features, can be built at the input based on expert experience to further enrich the data.
[0058] Here, the second intermediate feature refers to the feature output by each layer during the processing of structured data by the second model. Taking the TabNet model as an example, the TabNet model mainly includes an input layer, an Attention Transformer layer, a Feature Transformer layer, and an output layer. The Feature Transformer layer of the TabNet model processes the data and outputs the corresponding second intermediate features. When the TabNet model includes multiple Feature Transformer layers, the second dataset corresponds to multiple second intermediate features; that is, the second model can obtain one or more second intermediate features by processing the second dataset.
[0059] Taking a specific cloud gaming business scenario as an example, during the processing of the second model, other indicators in Table 1, such as user interaction indicators and content characteristic indicators, can be subjected to feature engineering to transform them into structured data suitable for the input of the second model. Through this process, the first and second models can be effectively combined for modeling, enabling accurate prediction of the network quality of cloud gaming services.
[0060] In order to construct the first dataset and the second dataset, in some embodiments, before processing the first dataset using the first model, the method further includes: obtaining a dataset to be processed; the dataset to be processed includes the first dataset; obtaining dynamic features of the dataset to be processed based on the time series data in the first dataset; and constructing the second dataset based on the dynamic features.
[0061] In practical applications, a second dataset can be constructed using the time-series data in the first dataset. Specifically, dynamic characteristics between time-series data can be obtained. These dynamic characteristics include, but are not limited to, one or more of the following: fluctuation values, periodic characteristics, lag characteristics, and sliding window statistical characteristics. To enrich the features in the second dataset, it can also include burst features and discrete features.
[0062] Taking Table 1 as an example, lag characteristics can be obtained based on the latency, bandwidth utilization, etc. in Table 1. For example, historical data of the previous 1, 3, 5, 7, and 15 seconds corresponding to the latency and bandwidth utilization data can be obtained; the difference between the current state of each time step and the corresponding data of the above historical time can be extracted.
[0063] It can acquire statistical features of sliding windows, such as calculating statistical data within a preset time window (e.g., 3, 5, 7, 14, 20, 30 seconds, etc.). The statistical data can be the average, sum, minimum, maximum, variance, median, etc., capturing the short-term fluctuations and long-term trends of time series data.
[0064] The periodicity of time series data can be captured by breaking down time into days, hours, minutes, etc., such as the day of the week or specific time periods of the day (e.g., early morning, morning). These derived features can be used to capture the seasonality and periodicity of time series data.
[0065] It can also capture outliers in time series data as sudden features. Taking cloud gaming as an example, outliers in time series data can be caused by sudden events, such as holidays, peak hours, server downtime, and promotional events. Constructing such information into structured data features can help explain some anomalies in time series data.
[0066] The method described above for constructing a second dataset can be applied to each feature of multi-feature time series data, concatenating all the obtained feature data to obtain a second dataset, and then processing the second dataset through a second model to obtain a second intermediate feature.
[0067] Based on the method in this step, when it is necessary to improve the second dataset, for example, when it is necessary to process the first dataset through a new feature engineering method, the newly constructed features can be quickly introduced into the second dataset corresponding to the second model, without the need to process the first dataset. This facilitates the supplementary interpretation of the data and does not require rebuilding the input end and adjusting the model structure as in deep learning. It helps to further and quickly improve the ability and efficiency of processing new features.
[0068] Step 103: Determine the prediction result of the data to be processed based on the first intermediate feature and the second intermediate feature.
[0069] The prediction result is determined by combining the first intermediate feature obtained from the first model and the second intermediate feature obtained from the second model. Specifically, the first and second intermediate features can be summed, and the prediction result is determined based on the summation result.
[0070] As can be seen, the embodiments of this application process the data to be processed through the first model and the second model together to obtain the prediction result. Therefore, the first model and the second model can be regarded as sub-models of the prediction model. In order to further improve the accuracy of the prediction result, the prediction model may also include an attention layer. Through the attention layer, corresponding weights can be dynamically assigned to the first intermediate feature and the second intermediate feature, and the data of intermediate features of the first model and the second model can be fused layer by layer through the attention mechanism.
[0071] In practical applications, in order to achieve accurate fusion of the first and second intermediate features, the number of the first and second intermediate features can be made the same, even if the structures of the first and second models are the same. For example, the number of causal convolutional layers in the first model is the same as the number of Feature Transformer layers in the second model.
[0072] This application provides a prediction method. The first model processes time series data, which helps to capture local features in the time series data. The second model processes structured data, which helps to obtain global features of the data to be processed through the structured data and capture the dynamic interaction between different features. The prediction result of the data to be processed is obtained by combining the local features and global features of the data to be processed, thereby improving the accuracy of the prediction result.
[0073] In practical applications, steps 101 to 103 can be implemented based on a processor, which can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), Controller, Microcontroller, and Microprocessor.
[0074] In order to further improve the accuracy of the fusion of intermediate features, based on the combination of the first intermediate feature and the second intermediate feature to determine the prediction result of the data to be processed, in some embodiments, the above-mentioned determination of the prediction result of the data to be processed based on the first intermediate feature and the second intermediate feature includes: determining the first weight of the first intermediate feature and the second weight of the second intermediate feature; and determining the prediction result of the data to be processed based on the first intermediate feature, the first weight, the second intermediate feature and the second weight.
[0075] In this embodiment, weights can be assigned to the first and second intermediate features according to actual business forecasting requirements. For example, when focusing on local feature recognition, the first weight can be set to be greater than the second weight. When focusing on global feature recognition, the second weight can be set to be greater than the first weight.
[0076] To sift through a large amount of data to extract the most important information for the current business process and highlight the role of key features, the first and second weights can be dynamically adjusted according to different business requirements. Based on the method given in the above embodiments, the first and second weights can be determined by calculating weights through the attention layer of the prediction model, and the first and second weights can be used to highlight intermediate features that have a significant impact on the prediction results.
[0077] Taking the first model as the TCN model and the second model as the TabNet model as examples, the TabNet model adopts a sequential multi-step framework to construct a neural network similar to an additive model, possessing an adjustable decision-making process. Deeper decision models will learn more abstract information; the key structures of the TabNet model are the Attentive Transformer layer and the Feature Transformer layer.
[0078] Given that both the TabNet and TCN models have multi-step structures, this embodiment fuses the intermediate features obtained from the feature extraction structures of the two models at each decision step. Through an attention mechanism, the prediction model can learn and fuse more data information at each level by leveraging the characteristics of the two models.
[0079] The attention mechanism in deep learning primarily functions to filter out the most important information from a large amount of data, highlighting key features. This application's embodiments calculate weights for intermediate features in the TabNet and TCN models, emphasizing features that have a greater impact on the prediction results in both models.
[0080] Formula (1) provides a method for calculating attention scores. Based on Formula (1), attention scores are calculated. Formula (2) provides a method for calculating weights.
[0081] e t =tanh(ω) t a t +b t (1)
[0082]
[0083] Among them, e t This represents the attention score of the t-th intermediate feature of the model. An intermediate feature can be either the first or second intermediate feature. T represents the total number of intermediate features, and ω... t b t Let a be the learnable parameter of the t-th intermediate feature. t Let α be the t-th piece of information input, i.e., the t-th intermediate feature. t Indicates e t The attention weights after normalization, i.e., the first weights or the second weights.
[0084] Formula (3) gives the method for calculating the output vector Y by using intermediate features and weights. The output vector Y can be the prediction result.
[0085]
[0086] As can be seen, after the model extracts features from the data to be processed, it is input into the attention layer to obtain the initial state vector, and then a weight α is assigned to it. t Finally, the output feature vector Y is obtained. Then, the intermediate features from the first and second models, after being weighted and filtered by the attention mechanism, are adjusted and weighted through the fully connected (FC) layer of the prediction model to output the prediction result.
[0087] Based on the prediction method given in the above embodiments, taking a prediction model including a first model, a second model, an attention layer, and a fully connected (FC) layer as an example, assuming the first model is a TCN model and the second model is a TabNet model, Figure 2 A schematic diagram of a prediction model framework is shown, such as Figure 2 As shown, the prediction model includes an input layer 201, a TCN model 202, a TabNet model 203, an attention layer 204, a fully connected (FC) layer 205, and an output layer 206. The original data in the input layer 201 can be time-series data. By processing the original data using the feature engineering methods described in the above embodiments, feature-derived data, i.e., structured data, can be obtained. Simultaneously, additional information can be used as feature-derived data for the TabNet model 203. The original data is processed by the TCN model 202. It can be seen that... Figure 2 The TCN model 202 shown includes a first residual block / first novel residual block 2021 and a second residual block / second novel residual block 2022. Each of the first residual block / first novel residual block 2021 and the second residual block / second novel residual block 2022 outputs a first intermediate feature. The first residual block / first novel residual block 2021 and the second residual block / second novel residual block 2022 can be residual blocks / novel residual blocks with the same structure but different parameters. The first novel residual block and the second novel residual block can be obtained based on the method described in the following embodiment; please refer to the method described in the following embodiment for details.
[0088] The TabNet model 203 processes the feature-derived data. First, it preprocesses the input feature-derived data, such as through standardization or normalization. This preprocessing ensures the data has a consistent format and scale, improving model stability and performance. Next, the TabNet model 203 uses a first attentional transformer module 2030 to assign weights to different features using an attention mechanism, identifying and emphasizing the features most important for the prediction task. A first masking module 2031 selects features based on the weights generated by the first attentional transformer module 2030, determining which features will be passed to the next layer. A first feature transformer module 2032 performs a non-linear transformation on the features selected by the first masking module 2031, extracting higher-level feature representations. A first splitting module 2033 divides the transformed features into two parts: one part is used for prediction in the current step, and the other part is passed to the second attentional transformer module 2035 for processing in step 2. Finally, the ReLU activation function is applied to the segmented features through the first Rectified Linear Unit (ReLU) 2034 to introduce nonlinearity, enabling the model to learn complex patterns. Figure 2 The processing flow of step 2 of the TabNet model 203 shown is the same as that of step 1, and will not be repeated here. In step 2, each module of the TabNet model 203 can be a module with the same structure but different parameters as each module in step 1.
[0089] The first attention module 2041 of the attention layer 204 processes the first intermediate features output by the first residual block / first novel residual block 2021 and the second intermediate features output by the first corrected linear unit 2034 to obtain a first processing result. The second attention module 2042 processes the first intermediate features output by the second residual block / second novel residual block 2022 and the second intermediate features output by the second corrected linear unit 2039 to obtain a second processing result. Finally, the FC layer 205 processes the first and second processing results, and the prediction result is output through the output layer 206. In practical applications, the TCN model 202 and the TabNet model 203 can obtain more intermediate features through more steps, such as steps 3 and 4 after step 2, to generate more accurate prediction results.
[0090] This application embodiment integrates two forms: multivariate time series prediction and multi-feature table prediction. The multivariate time series prediction can use the TCN model 202, which uses causal dilated convolution to capture temporal dependencies over very long distances, making it an ideal choice for prediction. Secondly, the TabNet model 203 is a relatively novel neural network structure specifically designed to process tabular data. The integration of the TCN model 202 and the TabNet model 203 makes it possible to process multiple forms of data input.
[0091] In order to obtain more local features in time series data, in some embodiments, the first model mentioned above includes at least two causal convolutional layers; the kernel size of each of the at least two causal convolutional layers is different; the above-mentioned processing of the first dataset by the first model to obtain the first intermediate feature corresponding to the first dataset includes: processing the time series data by each causal convolutional layer to obtain the first result of each causal convolutional layer; and determining the first intermediate feature corresponding to the first dataset based on the first result.
[0092] Traditional first-order models, such as the traditional TCN model, are designed to handle long sequence data, but the use of the same-sized convolutional kernel in each layer may limit their ability to capture dependencies in long-distance data.
[0093] Figure 3 A schematic diagram of the computation region of a TCN convolution kernel is shown. Figure 3 The rows corresponding to 1, 2, and 6 represent the features of time series data in different dimensions. Each solid parallelogram represents a data point, and the dashed quadrilateral represents the computational region of the convolution kernel. For example... Figure 3 As shown, suppose a data point 1 at a time step T Points and data points 2 T-3 There is a periodic information dependency, but the chosen one-dimensional convolutional kernel size of 2 prevents effective capture of the relationship between the two. Although traditional TCN models can achieve a long receptive field through multi-module stacking, using a single dilated convolution in the first layer of the basic module results in significant information loss. Furthermore, in the case of multi-feature sequences, the one-dimensional convolutional kernel merges sequence information from different feature dimensions, which may cause traditional TCN models to learn incorrect sequence relationships, making the dependencies between sequences less obvious. Figure 3 As shown, in practice, data point 1 T and data point 2 T-3 Related, but the one-dimensional convolution kernel will convert the data points 6 T-2 Information is also taken into consideration; this unreasonable convolution kernel setting prevents the traditional TCN model from learning data point 1. T and data point 6 T-2The relationship between the two data points is not actually a long-term dependency, which could mislead the model's subsequent predictions.
[0094] This embodiment presents an improved convolutional kernel method. The residual block of the first model includes at least two causal convolutional layers, each with a different kernel size. In practical applications, processing time series data using convolutional kernels of different sizes enables the first model to possess different receptive fields, allowing it to extract fine local features and long-term trend features from the time series data.
[0095] Based on the method given in this embodiment, in practical applications, the first model may include one-dimensional causal convolutional layers of 3×C and 5×C, where C represents the dimension of the input time series data, and 3 and 5 represent the kernel size, respectively. The first model may also include one-dimensional causal convolutional layers of 3×C, 5×C, and 7×C, etc.
[0096] In order to further improve the accuracy of the first model in obtaining the first intermediate feature based on the above embodiments, in some embodiments, the first model further includes a pooling layer; before determining the first intermediate feature corresponding to the first dataset based on the first result, the method further includes: processing the time series data through the pooling layer to obtain a second result; determining the first intermediate feature corresponding to the first dataset based on the first result includes: determining the first intermediate feature corresponding to the first dataset based on the first result and the second result.
[0097] In addition to multiple causal convolutional layers, the first model can also include pooling layers. Pooling layers expand the receptive field through progressive downsampling, indirectly helping the first model capture long-distance dependencies in multi-feature time series data. In practical applications, pooling layers can be either max pooling or average pooling. When the first model includes max pooling, it can extract the maximum value within a local time window, ignoring specific time positions, and capturing peak features. When the first model includes average pooling, it can calculate the average value of a local window, smoothing short-term fluctuations and capturing the trend features of the time series data.
[0098] Based on the method given in this embodiment, this application proposes a causal inception structure. The causal inception structure performs multi-scale feature extraction on time series data through parallel multi-scale one-dimensional causal convolution, allowing the first model to capture local details and broader contextual information at the same time, thereby improving the first model's ability to model long-distance dependencies.
[0099] Figure 4A schematic diagram of a Causal Inception structure is shown, as follows: Figure 4 As shown, the Causal Inception structure includes one-dimensional causal convolutional layers of 3×C, 5×C, and 7×C, and a one-dimensional average pooling layer of 5×C, based on... Figure 4 The Causal Inception structure shown assumes that the dimension of the time series data input from the previous layer is C×N, where N represents the length of the time series data, and the output dimension of each convolutional layer is set to M. Figure 4 The Causal Inception structure shown has a final output sequence size of 4M×N.
[0100] Based on the Causal Inception structure given in the above embodiments, in some embodiments, before determining the first intermediate feature corresponding to the first dataset based on the first result, the method further includes: grouping the time series data through the first model to obtain at least two data groups; any one of the at least two data groups corresponds to one or more convolutional kernels; performing causal convolution processing on each data group through one or more convolutional kernels corresponding to each of the at least two data groups to obtain a third result; the determination of the first intermediate feature corresponding to the first dataset based on the first result includes: determining the first intermediate feature corresponding to the first dataset based on the first result and the third result.
[0101] In practical applications, the data in the first dataset can be divided into at least two groups based on experience or the characteristics of time-series data. Each data group can then be processed using causal convolution with one or more convolutional kernels. When processing a data group using multiple convolutional kernels, the structure of each kernel can be the same, but the parameters can be different.
[0102] Applying causal convolution to a data group using multiple convolution kernels helps to form a multi-perspective understanding of the data group and helps to extract different patterns such as short-term fluctuations, medium-term trends and long-term dependencies in the data group at the same time.
[0103] By splitting time series data into multiple data groups, computational complexity can be reduced. Furthermore, processing these split data groups facilitates the acquisition of local features of the time series data using the first model. Moreover, splitting the time series data into multiple data groups of varying lengths helps the first model capture multi-scale data features.
[0104] By combining the processing results of each data group in multiple data groups, a third result corresponding to the time series data is determined. Further, by combining the first and third results, a first intermediate feature is obtained. In practical applications, the first intermediate feature can be obtained by directly summing the first and third results, or by determining the weights corresponding to the first and third results and performing a weighted summation to determine the first intermediate feature.
[0105] Based on the method given in this embodiment, this application proposes a Group Causal Block, which can split time series data and process each split data group through one or more convolutional kernels to obtain a third result.
[0106] Figure 5 An example diagram of a Group Causal Block processing method is shown. Figure 5 Group 1, group g-1, and group g represent data groups. Each solid parallelogram represents a data point, and the dashed quadrilateral represents the convolution calculation region. The Group Causal Block takes the input data, i.e., the multi-feature time series data C, as input. in The data is divided into g groups, and the number of sequences in each group can be... Then, causal convolution is performed on each data group. Each data group requires at least one convolution kernel, meaning the number of output channels for the convolution processing of each data group is at least g. If each data group has n convolution kernels, then the number of output channels C out = n × g, where n is an integer greater than or equal to 1, meaning the number of output channels is an integer multiple of the number of groups.
[0107] Based on the method given in the above embodiments, the first intermediate feature can also be obtained by combining the first result, the second result, and the third result. Figure 6 A schematic diagram of a novel residual block is shown. Figure 6 The novel residual block shown can be used as Figure 2 The novel residual block is shown. (As shown in the image) Figure 6 As shown, Figure 6 The left column uses the Causal Inception structure to extract features at multiple scales from time series data, the middle column retains the processing method of the traditional TCN model, and the right column uses Group CausalBlock to group time series data to accurately capture deep dependencies between sequences.
[0108] Specifically Figure 6After the left column outputs a 4M×N feature sequence through the Causal Inception structure, the feature sequence enters the WeightNorm layer to normalize the weights of the neural network layer. By reparameterizing the weights, the length and direction of the weights are separated, providing a more stable foundation for subsequent calculations. The weight-normalized data then enters the Corrected Linear Unit (CLU), where the ReLU activation function performs a non-linear transformation on the input data, outputting all negative values as 0 and leaving positive values unchanged. This step introduces a non-linear factor into the model, enabling it to learn and represent more complex functional relationships. Next, the data undergoes Dropout, randomly setting the output of some neurons to 0. This prevents overfitting, enhances the model's generalization ability, and prevents the model from becoming overly reliant on certain neurons. The data then enters the Dilated Causal Conv layer. Dilated causal convolution combines the features of dilated convolution and causal convolution. By inserting holes into the standard convolution kernel, it expands the receptive field of the convolution, enabling it to capture longer-term dependencies. Causal convolution ensures that in tasks such as time series forecasting, the output depends only on current and past information, avoiding data leakage and guaranteeing the reasonableness of the prediction.
[0109] After being processed by the dilated causal convolutional layer, the data enters the second weight normalization layer, where the weights are normalized again to further stabilize the model's training process and ensure that the weights vary within an appropriate range. The data then enters the second corrected linear unit, where it undergoes another non-linear transformation using the ReLU activation function to further extract and process the data's features. Finally, the data enters the top-level random deactivation process. Before data output, a final random deactivation operation is performed to minimize overfitting and improve the model's performance on new data.
[0110] Based on the above prediction method, a model training method is given below. In some embodiments, before processing the first dataset using the first model, the method further includes: processing the first training dataset using the first model to obtain a third intermediate feature corresponding to the first training dataset; the first training dataset includes time series data corresponding to the training data; processing the second training dataset using the second model to obtain a fourth intermediate feature corresponding to the second training dataset; wherein the second training dataset includes structured data corresponding to the training data; and training the prediction model based on the third and fourth intermediate features, so that the prediction model can output the model processing result according to the third and fourth intermediate features; the prediction model includes the first model and the second model.
[0111] In this embodiment, the training data can be time series data, and the structured data in the second training dataset can be obtained by performing feature engineering on the time series data in the first training dataset based on the method given in the above embodiment. Specifically, the first training dataset and the second training dataset can be constructed based on the data shown in Table 1.
[0112] In this embodiment, taking the first model as TCN model 202 as an example, the traditional TCN model can be improved by constructing a first training dataset with a time step length of 96. Simultaneously, feature engineering is performed on the data within this 96-time-step window to derive features, and the remaining static features are merged to obtain a second training dataset for training the second model. In this embodiment, the second model is TabNet model 203 as an example. Static features represent features that do not change over time. Static features can be data such as frame rate and encoding format listed in Table 1. Static features do not require feature derivation processing and can be directly added as column data according to their corresponding affiliation.
[0113] The model parameter settings for TCN model 202 can be shown in Table 2:
[0114] Table 2
[0115] Sliding window 96 Stacked structure 3 floors Layer-by-layer expansion rate 1、2、4 Learning rate 0.01 Optimizer Adam
[0116] As shown in Table 2, the TCN model 202 consists of a 3-layer structure, with dilation rates of 1, 2, and 4 set in the dilated causal convolution part of each layer, respectively. The results of each layer will be fed into the next stage and fused with the learning results of the same layer of the TabNet model 203.
[0117] The model parameters for constructing TabNet model 203 are shown in Table 3.
[0118] Table 3
[0119] <![CDATA[n d ]]> 10 <![CDATA[n a ]]> 10 <![CDATA[n steps ]]> 3 gamma 1.3 Lambda sparse 0.001 Learning_rate 0.01
[0120] Wherein, parameter n d n represents the number of output neurons. a n represents the number of neurons in the decision step. steps The number of decision steps is represented by gamma, the weight of historical features is represented by lambda sparse, and the learning rate is represented by the learning rate.
[0121] TabNet model 203 implements tree-like feature selection and its own unique instance-wise approach, enhancing the learning ability of the prediction model. The setting of the gamma parameter is crucial, as it determines the weight of historical features in the current decision step, achieving sparse feature selection. steps This refers to the stacking configuration of the model. In this embodiment, the number of intermediate features output by the first model and the second model is the same, which facilitates the subsequent synchronous fusion of the two models.
[0122] The model processing result of the prediction model is obtained by using the third intermediate feature predicted by the first model and the fourth intermediate feature predicted by the second model. The model parameters of the prediction model are adjusted by comparing the prediction model with the true labels, so that the difference between the model processing result of the prediction model and the true labels is less than a difference threshold. This adjustment of the model parameters includes adjusting the model parameters of the first model and / or adjusting the model parameters of the second model.
[0123] Based on the model training method given in the above embodiments, in order to further improve the model accuracy, in some embodiments, the above prediction model further includes an attention layer; the above model training based on the third intermediate feature and the fourth intermediate feature includes: determining the third weight of the third intermediate feature and the fourth weight of the fourth intermediate feature based on the attention layer; determining the model processing result of the prediction model according to the third intermediate feature, the third weight, the fourth intermediate feature and the fourth weight; determining the loss value through the model processing result; and adjusting the model parameters of the prediction model with the goal of minimizing the loss value.
[0124] For the third intermediate feature output by the first model and the fourth intermediate feature output by the second model, the third and fourth intermediate features are weighted and fused through the attention layer of the prediction model, and the model processing result is output through the FC layer.
[0125] When the first and second models include multiple intermediate processing layers, i.e., the first model outputs multiple third intermediate features and the second model outputs multiple fourth intermediate features, feature data fusion is performed layer by layer through the attention layer of the prediction model. Each intermediate processing layer generates an intermediate feature. The fused information of intermediate features containing information from different layers is added point by point, and the loss value of the prediction model is calculated using the model processing result output by the FC layer.
[0126] To improve prediction performance, two methods can be selected to determine the loss value of the prediction model: mean absolute error (MAE) and mean square error (MSE). The calculation methods for MAE and MSE can refer to formulas (4) and (5):
[0127]
[0128] Among them, y i Indicates the true label, This represents the model processing result of the prediction model, that is, the prediction result output during the training process of the prediction model. P represents the number of model processing results.
[0129] Based on the prediction method given in the embodiments of this application, as shown in Table 4, the model processing result obtained by the prediction model has the smallest error value between the model and the true label. Compared with the traditional TCN model, the MSE is reduced by 7.15% and the MAE is reduced by 3.21%. Compared with the traditional TabNet model, the MSE is reduced by 4.76% and the MAE is reduced by 8.12%.
[0130] Table 4
[0131] TCN 3.467 1.617 TabNet 3.380 1.704 This embodiment's prediction model 3.219 1.565
[0132] Based on the methods described in the above embodiments, taking the prediction of network quality for cloud gaming services as an example, another prediction model training method is given below:
[0133] First, data collection can be implemented through a data acquisition module, including data embedding, interface constraints, defining data dictionaries, and specifying reporting timing. Data can then be collected and reported from both the client-side and cloud-side modules. The client-side module collects user behavior data, terminal device data, and network environment data during service usage. The cloud-side module collects cloud gaming service characteristic data, distributed deployment data across nodes, node scheduling and interaction data, and characteristic data after node collaboration. The specific collected data can be as shown in Table 1.
[0134] The data collected and reported by the edge module and the cloud module are stored in the database respectively.
[0135] The data processing module integrates client-side and cloud-side data stored in the database by defining unique user identifiers and unified identifiers for each round of tasks to determine the relationship between tasks and users, thus achieving data fusion. Data is cleaned according to cloud gaming business rules to remove abnormal data from the original data. For the cleaned data, resource configuration strategies are modeled and trained based on the business characteristics and node scheduling of the cloud gaming scenario, and then visualized and displayed.
[0136] The improved TCN model 202 in this embodiment is constructed by modifying the first layer of its basic module, the residual block, into a Causal Inception module, which is a new module innovatively constructed based on the data. Furthermore, the Group Causal Block from the above embodiment is constructed.
[0137] Construct an attention layer that integrates TCN model 202 and TabNet model 203.
[0138] The data is processed to meet the input requirements of TCN model 202; through feature engineering methods, the data is further processed to obtain feature-derived data, which meets the input requirements of TabNet model 203.
[0139] The processed data is used to train the prediction model, and the network quality is monitored in real time based on the model's prediction results, thus achieving a closed loop for network usage experience in cloud gaming scenarios for users in different regions.
[0140] This application provides a prediction method that achieves efficient interaction between two models by connecting them. Specifically, a first model, such as the improved TCN model 202, is first used to extract features from time series data. Then, an attention mechanism is introduced to filter the information. Finally, the filtered information is fed into the decision structure of a second model, such as the TabNet model 203. This fusion strategy can build a more powerful and adaptive hybrid model to effectively handle complex time series data and improve prediction accuracy.
[0141] The prediction method presented in this application improves traditional time series prediction models by modifying the first layer of the original infrastructure into a Causal Inception structure and adding a Group Causal Block. This allows the model to acquire multi-scale information and strengthens the capture of dependencies between time series data. Furthermore, by combining it with a structured data processing model, it provides flexible additional information inputs to the prediction model. Based on actual conditions or expert experience, it facilitates supplementary interpretation of the data processed by the prediction model, without requiring the reconstruction of the input and adjustment of the model structure as in deep learning. By fusing the processing results of the first and second models and using an attention mechanism to integrate the data information extracted by both models at each decision step, the accuracy of the prediction model is improved.
[0142] For cloud gaming scenarios, an integrated design based on the fusion of TCN model 202 and TabNet model 203 is used to predict network quality for cloud gaming services. This model performs multi-timestep predictions of network quality metrics most directly perceived by users, such as latency. Long-range predictions can identify potential network conditions that could degrade service quality in advance, allowing for timely intervention, improved user gaming experience, and enhanced user satisfaction and loyalty.
[0143] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0144] Based on the prediction method proposed in the foregoing embodiments, this application also provides a prediction device. Figure 7 A schematic diagram of a prediction device is shown, such as Figure 7 As shown, the prediction device includes:
[0145] The first processing module 701 is used to process the first dataset through the first model to obtain the first intermediate feature corresponding to the first dataset; wherein, the first dataset includes time series data corresponding to the data to be processed.
[0146] The second processing module 702 is used to process the second dataset through the second model to obtain the second intermediate features corresponding to the second dataset; wherein the second dataset includes structured data corresponding to the data to be processed.
[0147] The prediction module 703 is used to determine the prediction result of the data to be processed based on the first intermediate feature and the second intermediate feature.
[0148] In practical applications, the first processing module 701, the second processing module 702, and the prediction module 703 can be implemented based on a processor and a communication device.
[0149] In some embodiments, the prediction module 703 is specifically used to determine the first weight of the first intermediate feature and the second weight of the second intermediate feature; and to determine the prediction result of the data to be processed based on the first intermediate feature, the first weight, the second intermediate feature and the second weight.
[0150] In some embodiments, the first model includes at least two causal convolutional layers; each of the at least two causal convolutional layers has a different kernel size; the first processing module 701 is specifically used to process the time series data through each causal convolutional layer to obtain a first result of each causal convolutional layer; and based on the first result, determine a first intermediate feature corresponding to the first dataset.
[0151] In some embodiments, the first model further includes a pooling layer; before determining the first intermediate feature corresponding to the first dataset based on the first result, the first processing module 701 is further configured to process the time series data through the pooling layer to obtain a second result; specifically, the first processing module 701 is configured to determine the first intermediate feature corresponding to the first dataset based on the first result and the second result.
[0152] In some embodiments, before determining the first intermediate feature corresponding to the first dataset based on the first result, the first processing module 701 is further configured to group the time series data using the first model to obtain at least two data groups; any one of the at least two data groups corresponds to one or more convolutional kernels; and perform causal convolution processing on each data group using one or more convolutional kernels corresponding to each of the at least two data groups to obtain a third result; specifically, the first processing module 701 is configured to determine the first intermediate feature corresponding to the first dataset based on the first result and the third result.
[0153] In some embodiments, the prediction device further includes a training module, which processes the first training dataset using the first model before processing the first dataset using the first model to obtain a third intermediate feature corresponding to the first training dataset; the first training dataset includes time series data corresponding to the training data; processes the second training dataset using the second model to obtain a fourth intermediate feature corresponding to the second training dataset; wherein the second training dataset includes structured data corresponding to the training data; and trains the prediction model based on the third and fourth intermediate features, so that the prediction model can output the model processing result according to the third and fourth intermediate features; the prediction model includes a first model and a second model.
[0154] In some embodiments, the prediction model further includes an attention layer, and the training module is specifically used to: determine the third weight of the third intermediate feature and the fourth weight of the fourth intermediate feature based on the attention layer; determine the model processing result of the prediction model based on the third intermediate feature, the third weight, the fourth intermediate feature and the fourth weight; determine the loss value through the model processing result; and adjust the model parameters of the prediction model with the goal of minimizing the loss value.
[0155] It should be noted that the descriptions of the above device embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0156] It should be noted that, in the embodiments of this application, if the above methods are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a terminal, server, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0157] This application also provides an electronic device. Figure 8 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of this application, as shown below. Figure 8 As shown, the electronic device 80 may include:
[0158] Memory 801 is used to store executable instructions.
[0159] The processor 802 is configured to implement any of the above prediction methods when executing executable instructions stored in the memory 801.
[0160] The processor 802 mentioned above can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.
[0161] The aforementioned computer-readable storage medium or memory 801 may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM), etc.; it may also be various terminals that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0162] This application embodiment further provides a computer storage medium storing computer-executable instructions for implementing any of the prediction methods provided in the above embodiments.
[0163] Correspondingly, this application embodiment further provides a computer program product, the computer program product including computer executable instructions, which are used to implement any of the prediction methods provided in the above embodiments.
[0164] In some embodiments, the functions or modules of the apparatus provided in this application can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0165] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0166] The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined to obtain new method embodiments without conflict.
[0167] The features disclosed in the various product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0168] The features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0169] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0170] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of protection of this application, and these forms are all within the protection scope of this application.
Claims
1. A prediction method, characterized in that, The method includes: Acquire the data to be processed; wherein, the data to be processed corresponds to the network quality data of the cloud gaming service; Multi-scale feature extraction is performed on time series data through each causal convolutional layer of the first model to obtain the first result of each causal convolutional layer; the first model includes at least two causal convolutional layers and grouped causal blocks; the kernel size of each causal convolutional layer in the at least two causal convolutional layers is different; the time series data is the data corresponding to the data to be processed included in the first dataset; The time series data is grouped using the grouped causal blocks of the first model to obtain at least two data groups; any one of the at least two data groups corresponds to one or more convolutional kernels. By using one or more convolution kernels corresponding to each of the at least two data groups, causal convolution processing is performed on each data group to obtain a third result; Based on the first result and the third result, the first intermediate feature corresponding to the first dataset is determined; The second dataset is processed by the second model to obtain the second intermediate feature corresponding to the second dataset; wherein, the second dataset includes the structured data corresponding to the data to be processed; The first intermediate feature and the second intermediate feature are fused layer by layer through the attention layer to obtain the intermediate features of each layer; the intermediate features of each layer are added point by point to obtain the prediction result of the data to be processed output by the fully connected layer.
2. The method according to claim 1, characterized in that, The first model further includes a pooling layer; before determining the first intermediate feature corresponding to the first dataset based on the first result and the third result, the method further includes: The time series data is processed through the pooling layer to obtain a second result; The step of determining the first intermediate feature corresponding to the first dataset based on the first result and the third result includes: Based on the first result, the third result, and the second result, the first intermediate feature corresponding to the first dataset is determined.
3. The method according to claim 1, characterized in that, Before determining the first intermediate feature corresponding to the first dataset based on the first result and the third result, the method further includes: The first training dataset is processed by the first model to obtain the third intermediate feature corresponding to the first training dataset; the first training dataset includes time series data corresponding to the training data. The second training dataset is processed by the second model to obtain the fourth intermediate feature corresponding to the second training dataset; wherein, the second training dataset includes the structured data corresponding to the training data; Based on the third intermediate feature and the fourth intermediate feature, the prediction model is trained so that the prediction model can output the model processing result according to the third intermediate feature and the fourth intermediate feature; the prediction model includes the first model and the second model.
4. The method according to claim 3, characterized in that, The prediction model further includes an attention layer; the training of the prediction model based on the third intermediate feature and the fourth intermediate feature includes: The third weight of the third intermediate feature and the fourth weight of the fourth intermediate feature are determined based on the attention layer; The model processing result of the prediction model is determined based on the third intermediate feature, the third weight, the fourth intermediate feature, and the fourth weight. The loss value is determined based on the model processing results; The model parameters of the prediction model are adjusted with the goal of minimizing the loss value.
5. An electronic device, characterized in that, The electronic device includes a processor and a memory for storing computer programs capable of running on the processor; wherein, The processor is used to run the computer program to perform the method according to any one of claims 1 to 4.
6. A computer storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 4.
7. A computer program product, comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the method of any one of claims 1 to 4.
Citation Information
Patent Citations
Data prediction method and system based on multi-scale TCN, terminal and storage medium
CN117371493A
Photovoltaic power generation prediction method and device based on TabNet-TCN-MHA model
CN120561496A