A data prediction method and related apparatus

CN123013029APending Publication Date: 2026-10-30ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510505290.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0003]现有的数据预测大多采用一种预测模型进行预测,因模型自身的局限,导致预测的准确性不高

Benefits of technology

[0029]与现有技术相比,本申请提供了一种数据预测方法,先通过获取具有时间序列特征的连续型变量,能够充分考虑数据在时间维度上的变化规律,为后续的预测提供更符合实际动态变化的数据基础,确定表征连续型变量差异化的差值,可以挖掘出连续型变量在不同时间点之间的变化细节,这些差值信息能够为预测模型提供额外的有价值的特征,有助于提高预测的准确性,然后通过两个机器学习预测模型分别对连续变量和连续变量的差值进行预测,后续通过初始预测值和预测差值,确定最终预测值。相较于现有技术,本申请采用一个机器学习预测模型学习连续变量的变化趋势,获得在目标时间的预测值,一个机器学习预测模型学习连续变量的差值变化趋势,从而获得在目标时间的预测差值。利用复杂度相对较高的机器学习预测模型进行连续变量的预测,利用复杂度相对较低的机器学习预测模型进行连续变量的差值的预测,不同复杂度的模型处理不同的预测,通过第一机器学习预测模型和第二机器学习预测模型的组合方式具有互补性,突破模型本身的局限,第一模型的初始预测值提供了对目标时间连续型变量的一个基础估计,而第二模型的预测差值可以对初始预测值进行修正,利用一个模型的预测结果修正另一个模型的预测结果,从而提高预测的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123013029A_ABST
    Figure CN123013029A_ABST
Patent Text Reader

Abstract

The application discloses a data prediction method and related device, and belongs to the technical field of data prediction. The method comprises the following steps: obtaining a continuous variable which presents time sequence characteristics under the influence of an influencing factor; determining a difference value which represents the difference of the continuous variable and has time sequence characteristics by the continuous variable; training a first machine learning prediction model based on the continuous variable and the influencing factor, and obtaining an initial prediction value of the continuous variable at a target time based on the trained first machine learning prediction model; training a second machine learning prediction model based on the difference value, and obtaining a prediction difference value at the target time based on the trained second machine learning prediction model; the complexity of the first machine learning prediction model is greater than that of the second machine learning prediction model. Based on the initial prediction value and the prediction difference value, a final prediction value of the continuous variable at the target time is obtained. According to the embodiment of the application, the accuracy of prediction can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of prediction technology, and in particular to a data prediction method and related apparatus. Background Technology

[0002] Time-series data forecasting uses time-series data of an object over a past period to predict the value of a specific indicator or multiple characteristics of that object over a future period. Time-series data records the process of an observed object changing over time, and these changes often contain patterns. Understanding these patterns can help people in various fields to avoid risks, optimize decision-making, optimize resource allocation, and even improve productivity. Therefore, time-series data forecasting has become an important component of big data analytics and is widely used in fields such as meteorology, transportation, finance, and internet traffic, as well as in economics, engineering, and natural sciences. For example, meteorological departments can use data from a typhoon to predict its future path and issue warnings; traffic management departments can use traffic flow time-series data to predict traffic conditions and plan road arrangements; financial analysts can use time-series data to predict future stock price trends; and in industrial production, engineers use time-series data to monitor product quality and analyze and predict resource usage.

[0003] Most existing data prediction methods use a single prediction model, but due to the limitations of the model itself, the accuracy of the prediction is not high. Summary of the Invention

[0004] The purpose of this application is to provide a data prediction method and related apparatus, which aims to improve the accuracy of prediction.

[0005] One embodiment of this application provides a data prediction method, the method comprising:

[0006] Obtain continuous variables whose influence from the affected factors exhibits time-series characteristics;

[0007] Identify time-series differences that characterize the variability of continuous variables using continuous variables;

[0008] The first machine learning prediction model is trained based on continuous variables and influencing factors, and the initial predicted values ​​of continuous variables at the target time are obtained based on the trained first machine learning prediction model.

[0009] A second machine learning prediction model is trained based on the difference, and the prediction difference for the target time is obtained based on the trained second machine learning prediction model; the complexity of the first machine learning prediction model is greater than that of the second machine learning prediction model.

[0010] Based on the initial predicted value and the predicted difference, the final predicted value of the continuous variable for the target time is obtained.

[0011] Optionally, the final predicted value is obtained by performing an arithmetic operation using the initial predicted value and the prediction difference.

[0012] Optionally, the final predicted value is the sum of the initial predicted value and the prediction difference.

[0013] Optionally, the first machine learning prediction model is a machine learning model based on a kernel matrix; the second machine learning prediction model is a machine learning model based on a gating mechanism.

[0014] Optionally, at least one of the first machine learning prediction model and the second machine learning prediction model is a quantum machine learning model.

[0015] Optionally, the first machine learning prediction model is a quantum support vector machine regression prediction model;

[0016] The second machine learning prediction model is a quantum long short-term memory network.

[0017] Optionally, the continuous variable whose influence exhibits time-series characteristics is one of the following:

[0018] Click-through rate of advertisements in different time periods; number of patients received in different time periods; temperature records in different time periods; website visits or click-through rates in different time periods; electricity consumption in different time periods.

[0019] Optionally, the time series feature is one or a combination of the following:

[0020] The changing trend and residuals of continuous variables.

[0021] Another embodiment of this application provides a data prediction apparatus, the apparatus comprising:

[0022] The first acquisition module is used to acquire continuous variables whose influence on the affected factors exhibits time-series characteristics;

[0023] The determination module is used to determine time-series differences that characterize the variability of continuous variables.

[0024] The second acquisition module is used to train the first machine learning prediction model based on continuous variables and influencing factors, and to obtain the initial predicted values ​​of continuous variables at the target time based on the trained first machine learning prediction model.

[0025] The third acquisition module is used to train a second machine learning prediction model based on the difference, and to obtain the prediction difference for the target time based on the trained second machine learning prediction model; the complexity of the first machine learning prediction model is greater than that of the second machine learning prediction model.

[0026] The fourth acquisition module is used to obtain the final predicted value of the continuous variable of the target time based on the initial predicted value and the prediction difference.

[0027] Another embodiment of this application provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, is capable of implementing the methods described in any of the above embodiments.

[0028] Another embodiment of this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in any of the above embodiments.

[0029] Compared with existing technologies, this application provides a data prediction method. First, by acquiring continuous variables with time-series characteristics, it can fully consider the changing patterns of data over time, providing a data foundation more consistent with actual dynamic changes for subsequent predictions. Determining the differences representing the variations of continuous variables allows for the uncovering of detailed changes in continuous variables at different time points. This difference information provides additional valuable features to the prediction model, helping to improve prediction accuracy. Then, two machine learning prediction models are used to predict the continuous variables and their differences, respectively. Finally, the final predicted value is determined using the initial predicted value and the predicted difference. Compared with existing technologies, this application employs one machine learning prediction model to learn the changing trend of the continuous variable to obtain the predicted value at the target time, and another machine learning prediction model to learn the changing trend of the difference between the continuous variables to obtain the predicted difference at the target time. This method utilizes a relatively complex machine learning prediction model to predict continuous variables, while a relatively simpler model is used to predict the difference between continuous variables. Different models handle different predictions, and the combination of the first and second models is complementary, overcoming the limitations of the models themselves. The initial prediction from the first model provides a basic estimate of the target time-continuous variable, while the difference in predictions from the second model can correct the initial prediction. By using the prediction results of one model to correct the prediction results of the other, the accuracy of the predictions is improved. Attached Figure Description

[0030] Figure 1 An example system block diagram for a data prediction method provided in this application embodiment;

[0031] Figure 2 A flowchart illustrating a data prediction method provided in an embodiment of this application;

[0032] Figure 3 A schematic diagram of a quantum circuit used to calculate a quantum core matrix, provided as an embodiment of this application;

[0033] Figure 4 A structural diagram of a data prediction device provided in an embodiment of this application;

[0034] Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0035] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0036] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0037] Classical computers use transistors to encode information in binary data, such as bits, where each bit can represent a value of 1 or 0. These 1s and 0s act as switches to drive the functions of a classical computer. If there are n bits of data, there are 2^n possible classical states, and one state is represented at a time.

[0038] Quantum computers use quantum processors that operate on data represented by qubits, also known as quantum bits. A qubit can represent the classical binary states "0" or "1", or a superposition of "0" and "1". Because it can represent a superposition of "0" and "1", a qubit can represent both "0" and "1" states simultaneously. For example, if there are n bits of data, n quantum states can be represented simultaneously. Furthermore, qubits in a superposition can be correlated with each other, a phenomenon known as entanglement. The state of one qubit (whether it's 1, 0, or both) can depend on the state of another qubit, and more information can be encoded within two entangled qubits. Based on the principles of superposition and entanglement, qubits enable quantum computers to perform functions that might be relatively complex and time-consuming for classical computers.

[0039] Please refer to Figure 1This illustrates an example system block diagram for a data prediction method provided in one embodiment of this application. System 100 may be a hybrid computing system comprising a combination of one or more quantum computers, quantum systems, and / or classical computers. Figure 1 In the example shown, system 100 may include a quantum system 110 and a classical computer 120. In one implementation, the quantum system 110 and the classical computer 120 may be configured to communicate via one or more wired and / or wireless connections (e.g., wireless networks). The quantum system 110 may include a quantum chipset consisting of one or more quantum chips, comprising various hardware components for processing data encoded in qubits. The quantum chipset may be a quantum computing core surrounded by infrastructure to protect the quantum chips from electromagnetic noise sources, mechanical vibration sources, heat sources, and other noise sources that can degrade the performance of the quantum chips. The classical computer 120 may be electronically integrated with the quantum system 110 via any suitable wired and / or wireless electronic connection.

[0040] exist Figure 1 In the example shown, quantum system 110 can be any suitable set of components capable of performing quantum operations on a physical system. Quantum operations, for example, can be quantum logic gate operations that manipulate the quantum states of qubits to evolve and / or become entangled. Figure 1 In the illustrated example embodiment, the quantum system 110 may include a measurement and control unit 111, an interface 112, and a quantum chip 113. In some embodiments, all or part of each of the measurement and control unit 111, interface 112, and quantum chip 113 may be located in a cryogenic environment to facilitate the performance of quantum operations. The quantum chip 113 may be any hardware capable of processing information using quantum states. This hardware may include multiple qubits and means for coupling or entanglement of the qubits to process information using quantum states. Qubits may include, but are not limited to, charge qubits, flux qubits, phase qubits, spin qubits, and ion qubits. The quantum chip may include a set of quantum logic gates configured to perform quantum logic operations on the qubits stored in a quantum register. The quantum gates may include one or more single-qubit gates, two-qubit gates, and / or other multi-qubit gates.

[0041] The measurement and control unit 111 can be any combination of digital computing devices capable of performing quantum computing (e.g., executing quantum circuits) in conjunction with interface 112. This digital computing device may include a digital processor and memory for storing and executing quantum instructions using interface 112. The digital computing device may also include a communication protocol device for receiving instructions and sending the results of the performed quantum computing to a classical computer. Additionally, the digital computing device may include a communication interface having interface 112. In one embodiment, the measurement and control unit 111 may be configured to receive classical instructions (e.g., from classical computer 120) and convert these classical instructions into measurement and control instructions for interface 112. The measurement and control instructions provided by the measurement and control unit 111 to interface 112 may be, for example, digital signals indicating which quantum gates in a quantum gate array need to be applied to the qubits to perform a specific function. Interface 112 may be configured to convert these digital signals into analog signals (e.g., analog pulses of microwave pulses), which can be used to apply quantum gates to the qubits to manipulate the interactions between the qubits.

[0042] Interface 112 may be a classical-quantum interface, comprising a combination of devices capable of receiving instructions from the integrated measurement and control unit 111 and converting those instructions into a means for implementing quantum operations. In one embodiment, interface 112 may convert instructions from the integrated measurement and control unit 111 into drive signals capable of driving or manipulating qubits, and / or applying quantum gates to qubits. Additionally, interface 112 may be configured to convert signals received from the quantum chip 113 into digital signals capable of being processed and transmitted by the integrated measurement and control unit 111. Devices included in interface 112 may include, but are not limited to, digital-to-analog converters, analog-to-digital converters, waveform generators, attenuators, amplifiers, optical fibers, lasers, and filters. Interface 112 may further include circuitry configured to measure multiple qubits after the application of quantum gates, wherein the measurements may produce results represented in classical bits. Each measurement performed by interface 112 may be read out to a device connected to the quantum system 110, such as a classical computer 120. The multiple measurement results provided by interface 112 may represent probabilistic results.

[0043] The classical computer 120 can include hardware components such as a processor and storage devices (e.g., including memory devices and classical registers) for processing data encoded in classical bits. In one embodiment, the classical computer 120 can be configured to provide the quantum system 110 with various control signals, instructions, and data encoded in classical bits. Further, quantum states measured by the quantum system 110 can be read out by the classical computer 120, and the classical computer 120 can store the measured quantum states as classical bits in classical registers. In one embodiment, the classical computer 120 can be any suitable combination of computer-executable hardware and / or computer-executable software capable of executing the preparation module 121 to perform quantum computation using data stored in the data storage module 122 as part of the construction and computation. The data storage module 122 can be a repository for data to be analyzed using quantum computing algorithms and the results of that analysis. The preparation module 121 can be a program or module capable of preparing classical data from the data storage module 122 as part of a quantum circuit implementation. Preparation module 121 can be instantiated as part of a larger algorithm, such as an application programming interface (API) function call, or by resolving hybrid classical-quantum computing into aspects of quantum and classical computing. For example, preparation module 121 can generate instructions for creating quantum circuits using quantum gates. In an embodiment, such instructions can be stored by the measurement and control unit 111 and can be instantiated by components of interface 112 to execute, enabling quantum operations of quantum gates to be performed on quantum chip 113.

[0044] The classic computer 120 may be a laptop computer, desktop computer, vehicle-integrated computer, smart mobile device, tablet device, and / or any other suitable classic computing device. Additionally or alternatively, the classic computer 120 may also operate as part of a cloud computing service model, such as Software as a Service (SaaS), Platform as a Service (PaaS), or Infrastructure as a Service (IaaS). The classic computer 120 may also reside in a cloud computing deployment model, such as a private cloud, community cloud, public cloud, or hybrid cloud.

[0045] See Figure 2 , Figure 2 A data prediction method provided in this application includes the following steps:

[0046] S201: Obtain continuous variables whose effects on the influencing factors exhibit time-series characteristics.

[0047] Continuous variables can take values ​​continuously within a certain range (for example, temperature can be 20.1℃, 20.11℃, etc., not just integers). Furthermore, continuous variables are influenced by certain factors, and over time, their values ​​exhibit certain regularities or trends in chronological order, thus presenting the characteristics of a time series. For example, the monthly average temperature of a certain region is a continuous variable. It is affected by factors such as seasonal changes and global warming. Using months as the time unit, arranging the monthly average temperature data in chronological order forms a data sequence with time series characteristics.

[0048] Influencing factors are those factors that affect the changes of continuous variables. For example, for temperature, influencing factors could be latitude information, meteorological conditions, etc. For photovoltaic power prediction, influencing factors could be irradiance, temperature, etc.

[0049] Feature data can include the values ​​of influencing factors at historical time points; in some scenarios, it can include the values ​​of continuous variables at historical time points. Specifically, the target object can be determined by the trained first machine learning model.

[0050] S202: Determine the time-series differences that characterize the differences in continuous variables using continuous variables.

[0051] Processing the historical values ​​of continuous variables yields a difference used to predict trends in continuous differential changes. It's important to note that the historical timeframe here is the same as the historical timeframe corresponding to the target object. For example, the historical timeframe for the target object is January 1, 2024 to January 10, 2024. That is, the first machine learning prediction model uses data generated between January 1, 2024 and January 10, 2024 to predict and obtain initial predicted values. The difference is the value of the continuous variable on the next day between January 1, 2024 and January 10, 2024, minus the value of the continuous variable on the previous day. For example, the difference between the value on January 2 and the value on January 1 is a fixed difference. The data from these 10 days yields 9 differences, forming a difference sequence. In practical applications, the difference between the value of the continuous variable on January 1, 2024, and the value of the continuous variable on December 31, 2023, can also be used as the first difference in the difference sequence. Of course, other methods exist for determining the first difference. In the embodiments of this application, when determining the difference, the values ​​of the continuous variables can first be normalized, and the difference can be determined based on the normalized values ​​of the continuous variables.

[0052] Of course, there are other ways to calculate the difference. For example, it can be determined using second-order differencing, or by using the difference with lag of n steps, or by using sliding window statistics. Specifically, the difference can be determined using the mean within the window. This can be done by sliding a fixed-size window on the time series, calculating the mean of the continuous variable within the window, and subtracting it from the current value to obtain the difference. Alternatively, the maximum or minimum value of the continuous variable can be taken within the sliding window and subtracted from the current value to obtain the difference. The rate of change at adjacent time points can also be used as the difference, or the rate of change at a fixed time interval can be used as the difference.

[0053] S203: Train a first machine learning prediction model based on continuous variables and influencing factors, and obtain the initial predicted values ​​of continuous variables at the target time based on the trained first machine learning prediction model.

[0054] After obtaining historical data on continuous variables and influencing factors, this data can be used as raw data. After obtaining the raw data, data preprocessing can be performed, including handling missing values ​​and data transformation operations. Time series features can also be extracted from the processed data. Furthermore, the processed data can be further processed to obtain statistical features, which can be one or a combination of standard deviation, mean, coefficient of variation, and difference. Time series features and statistical features can also be included in the target object. Using the processed raw data and extracted features, a first machine learning model is trained.

[0055] Time series features can be trends, residuals, or a combination thereof for continuous variables. Trends describe the direction of a continuous variable over time. For example, the trend of temperature over time can be gradually increasing (e.g., the rising temperature trend caused by global warming), gradually decreasing (e.g., the decreasing temperature trend at night in winter), or exhibiting some periodic fluctuation (e.g., the periodic temperature changes caused by the alternation of day and night). Residuals are the differences between the actual values ​​and predicted values ​​of continuous variables. For example, when using a prediction model to predict temperature, the difference between the actual observed temperature value and the model's predicted temperature value is the residual. Residuals can reflect the model's fit to the data and random fluctuations or noise in the data that were not captured by the model. Residuals contain information in the original data that was not captured by the initial model. By using residuals as additional input, the model can learn these previously missed details, thus fitting the data more comprehensively, reducing prediction errors, and improving the model's accuracy and precision. Time series data often have complex patterns and structures, and may contain fluctuations or nonlinear relationships of various frequencies. Residuals can help the model better separate and handle these different components. By learning from the information in the residuals, models can more accurately capture complex patterns in the data, such as seasonality, periodicity, and other features that are difficult to describe directly with simple models. This allows the model to adapt to a wider range of data variations and improves its generalization ability. Residuals exhibit significant fluctuations when outliers or points of change appear in the data. By inputting residuals into model training, the model can learn from and analyze these anomalous residuals, making it easier to identify anomalies and points of change in the data. When noise or uncertainty exists in the data, residuals can serve as a measure of noise and uncertainty. By learning from the residuals, the model can better adapt to noise and uncertainty in the data, avoiding overfitting to the random fluctuations in the training data, thus improving the model's stability and robustness. This means that when faced with new and unseen data, the model can make more reliable predictions and inferences, reducing prediction bias caused by data fluctuations.

[0056] The target time is a future point in time that needs to be predicted. The target time can include multiple points in time, and there can be more than one continuous variable. That is, it can predict the values ​​of multiple different continuous variables at one future point in time, or the value of one continuous variable at multiple future points in time, or the values ​​of multiple different continuous variables at multiple future points in time.

[0057] The first machine learning prediction model can learn the changing trends of continuous variables, thereby predicting the value of continuous time variables at the target time and thus obtaining the initial prediction value.

[0058] In some cases, training samples can be constructed using historical feature data to train a first machine learning prediction model. In this embodiment, the training samples used to train the first machine learning prediction model include training samples of sample feature data formed for continuous variables within a sample time period. Specifically, for example, the sample data includes data generated in the past 300 days. For each day from the 61st to the 300th day, 240 training samples can be constructed based on each day. The sample time period for each training sample can be the previous 60 days of that day. The target time can be the corresponding current day. It should be noted that the time within the sample time period is earlier than the target time.

[0059] By acquiring continuous variables with time-series characteristics, it is possible to fully consider the changing patterns of data over time. For example, in meteorology, temperature is a typical continuous variable with time-series characteristics. This approach can effectively capture the fluctuation trend of temperature over time, providing a data foundation that is more consistent with actual dynamic changes for subsequent forecasts.

[0060] S204: Train a second machine learning prediction model based on the difference, and obtain the prediction difference for the target time based on the trained second machine learning prediction model; the complexity of the first machine learning prediction model is greater than that of the second machine learning prediction model.

[0061] Identifying the differences that characterize the variations of continuous variables can reveal the details of their changes across different points in time. Taking meteorological data as an example, temperature is a continuous variable. By calculating temperature differences (such as daily or monthly temperature ranges), we can gain a more precise understanding of the magnitude and frequency of temperature changes. This difference information can provide additional valuable features for predictive models, helping to improve the accuracy of predictions.

[0062] The first and second machine learning prediction models differ in the objects they predict and their complexity. The first machine learning prediction model has higher complexity, can handle more data dimensions, and possesses stronger representational power, better fitting ability, and a better ability to capture the inherent relationships within the data. Therefore, it can learn the changing trends of continuous variables based on the input data. The second machine learning prediction model is used to predict the changing trends of differences in continuous variables. Its predictions utilize fewer data dimensions and are relatively simpler. The lower-complexity machine learning prediction model has faster training speed, better interpretability, higher generalization ability, and lower inference latency, while consuming relatively fewer resources and incurring relatively lower costs.

[0063] The more complex first-order machine learning prediction model is used to handle the prediction task of original continuous variables. Since the original continuous variables may contain complex nonlinear relationships, long-term dependencies, and other features, the more complex model (such as deep neural networks) can better fit these complex patterns and thus predict the initial values ​​more accurately.

[0064] A simple second machine learning prediction model is used to predict the difference. The difference data may have a simpler pattern of change or a more obvious linear characteristic compared to the original continuous variable. Using a simple model (such as linear regression) to predict the difference can avoid overfitting and also improve the model's training efficiency and prediction speed.

[0065] The combination of the first and second machine learning prediction models is complementary. The initial predictions from the first model provide a basic estimate of the target continuous-time variable, while the difference in predictions from the second model can refine the initial predictions. This combination is similar to the multi-model fusion strategy in ensemble learning, which combines the advantages of both models to improve the robustness and accuracy of the prediction results.

[0066] S205: Based on the initial predicted value and the predicted difference, obtain the final predicted value of the continuous variable for the target time.

[0067] After obtaining the initial predicted value and the prediction difference, the obtained values ​​can be calculated to obtain the final predicted value. The final predicted value can be obtained using the initial predicted value and the prediction difference, which can be based on the relationship between continuous variables and the difference.

[0068] By combining initial predicted values ​​and prediction differences to obtain the final predicted value, prediction errors can be reduced to some extent. For example, in energy consumption prediction, the first model might predict a rough initial energy consumption value based on historical energy consumption data (a continuous variable). The second model adjusts the prediction based on energy consumption differences (such as increases or decreases in energy consumption over different time periods), making the final predicted value closer to the actual energy consumption situation. This approach is more adaptable to changes in data. When continuous variables are affected by multiple factors, both models can learn and predict separately, whether the changes are in the original variable or the difference. For example, in traffic flow prediction, traffic flow (a continuous variable) is affected by multiple factors such as time (peak and off-peak hours) and weather. When weather changes cause abnormal fluctuations in traffic flow (changes in the difference), the second model can better capture these changes, allowing the final predicted value to adapt to such complex and ever-changing realities.

[0069] In one embodiment of this application, the final predicted value is obtained by performing an arithmetic operation on the initial predicted value and the prediction difference. Specifically, the final predicted value can be the sum of the initial predicted value and the prediction difference.

[0070] As one implementation of this application, the first machine learning prediction model is a machine learning model based on a kernel matrix; the second machine learning prediction model is a machine learning model based on a gating mechanism.

[0071] Machine learning models based on kernel matrices primarily refer to machine learning algorithms that use kernel tricks to process data. Kernel tricks are a powerful technique that allows algorithms to perform operations in high-dimensional spaces without explicitly calculating coordinates within that space. The choice of kernel function significantly impacts model performance. Common kernel functions include linear kernels, polynomial kernels, Gaussian kernels (radial basis function kernels), and sigmoid kernels. Each kernel function has its specific application scenarios and advantages. In practical applications, it is usually necessary to select an appropriate kernel function based on the characteristics of the data and the requirements of the problem.

[0072] Gated machine learning models refer to a class of models that use special structures in neural networks to control the flow of information, mainly including Long Short-Term Memory (LSTM) networks and Gated Recurrent Units (GRUs). These models, through their internal gating mechanisms, can solve the gradient vanishing or exploding problems encountered by traditional Recurrent Neural Networks (RNNs) when processing long sequence data, thus more effectively capturing long-term dependencies.

[0073] Gating-based machine learning models introduce a special structure into the model to control the flow of information, enabling the model to better handle long-term dependencies in sequential data. These models are typically used to process time-series data, natural language text, or other forms of serialized data. The core idea of ​​gating mechanisms is to use "gates" to determine which information should be remembered or forgotten, and how to update the model's state.

[0074] Kernel matrix-based models excel at handling nonlinear relationships. By using kernel tricks to map data to a high-dimensional space, they can effectively capture complex patterns and nonlinear features in the data. Meanwhile, gating mechanism-based models have excellent processing capabilities for sequential data. They can dynamically control the flow of information, selectively retaining or forgetting information, thereby better capturing time-series features and long-term dependencies in the data.

[0075] For continuous variable data with time-series characteristics, kernel matrix models can first perform nonlinear transformations on the original data to extract the latent structure and patterns, providing richer feature information for subsequent predictions. Gating mechanism models, building on this, further model the changes of these features over time, thereby more accurately grasping the dynamic trends of the data.

[0076] Kernel matrix models can map data to a high-dimensional space during training, making the data easier to classify or regress in that space. This can reduce the model's dependence on large amounts of training data to some extent and improve training efficiency. Gating mechanism models can quickly adapt to data changes by selectively updating and resetting gating units, reducing redundant computations during training and thus accelerating the training speed.

[0077] Kernel matrix models, through the selection and optimization of kernel functions, can effectively avoid overfitting and improve the model's generalization ability. Gating mechanism models, by controlling the flow of information, prevent gradient vanishing and gradient exploding problems, making the model more stable during training and able to converge better.

[0078] Kernel matrix models can perform non-linear modeling of data, providing more accurate initial predictions. Gated mechanism models can further refine and optimize the initial predictions by learning the prediction difference to capture the deviation between the initial prediction and the true value, thereby improving the accuracy of the final prediction.

[0079] Kernel matrix models, by mapping data to a high-dimensional space, can better capture the underlying structure and patterns in the data, making the model more adaptable to new data. Gated mechanism models, through dynamic modeling of sequence data, can better handle noise and outliers in the data, improve the robustness of the model, and thus enhance the model's generalization ability in different scenarios.

[0080] As one embodiment of this application, at least one of the first machine learning prediction model and the second machine learning prediction model can be a quantum machine learning model.

[0081] Quantum machine learning models combine the advantages of quantum computing and machine learning, aiming to solve complex problems that traditional machine learning methods struggle with. By utilizing superposition states and quantum entanglement, quantum machine learning models improve the efficiency and accuracy of machine learning tasks. In this embodiment, the first and second machine learning prediction models can each be either a quantum machine learning model. Since the complexity of the first machine learning prediction model is greater than that of the second, the first model can be a quantum machine learning model, and the second model a classical machine learning model. This utilizes quantum computing for relatively complex predictions and classical computing for relatively simpler operations, making efficient use of both quantum and classical computing resources while balancing efficiency and cost. Alternatively, the first model can be a classical machine learning model, and the second a quantum machine learning model. This allows for rapid acquisition of prediction differences using the quantum machine learning model, improving the accuracy of these differences. Based on these differences, the initial predictions can be corrected, further enhancing accuracy. Both models can also be quantum machine learning models, fully utilizing quantum computing resources to accelerate predictions while simultaneously improving accuracy.

[0082] As one embodiment of this application, the first machine learning prediction model is a quantum support vector machine regression prediction model;

[0083] The second machine learning prediction model is a quantum long short-term memory network.

[0084] During training, sample feature data is input into the quantum support vector machine (SVM) regression prediction model, causing the model to call the quantum kernel matrix to obtain initial predicted values. Based on the difference between the initial predicted values ​​and the actual values ​​of the continuous variables corresponding to the target time, the parameters of the quantum SVM regression prediction model are adjusted until the difference meets specified conditions, resulting in a fully trained quantum SVM regression prediction model. Methods for adjusting the parameters of the quantum vector machine model include, but are not limited to, gradient descent, stochastic gradient descent, and the Adam optimizer.

[0085] In some cases, quantum support vector machine regression prediction models require the use of quantum kernel methods during training. Specifically, quantum kernel methods require the use of quantum kernel functions. The output value of the quantum kernel function is the quantum kernel matrix. Training data, after undergoing max-min normalization, is encoded into a quantum circuit for evolution. The value of each qubit is measured at the end of the quantum circuit, and the measured values ​​are post-processed to form the quantum kernel matrix. For example, the quantum circuit for calculating the quantum kernel matrix can be as follows: Figure 3 As shown, U2 represents the U2 gate, and its corresponding matrix form is... U1 represents the U1 gate, and its corresponding matrix form is: 1-39 represent different time sequences. The quantum circuit executes related operations according to the time sequence. θ in gate U1 is the optimization parameter, with its initial value assigned. The parameters λ and φ in gate U2 are determined by the training data after max-min normalization. After obtaining the quantum kernel matrix, the kernel function of classical support vector regression is replaced with the quantum kernel matrix to optimize the algorithm. The support vectors are found to obtain the regression curve, and the optimal regression model is obtained as the trained quantum support vector machine regression prediction model.

[0086] Quantum kernel functions can make quantum support vector machine regression prediction models potentially more efficient when handling high-dimensional data. Furthermore, quantum computing, in some cases, can leverage quantum parallelism to process multiple datasets simultaneously, accelerating kernel function computation and quantum vector machine model training. Kernel methods can be used to handle nonlinear problems and high-dimensional data. In kernel methods, the original data is mapped to a high-dimensional feature space, making the data linearly or approximately linearly separable in this space. This allows the use of linear classifiers or regressors to address nonlinear problems in the original data. The core of kernel methods is the use of kernel functions, which are functions that measure the similarity between two samples. By calculating the inner product of samples in the feature space, the similarity between samples in the original space can be obtained, thus achieving linearization of nonlinear data. Kernel functions can map low-dimensional data to high-dimensional spaces without explicitly calculating high-dimensional feature vectors, thereby avoiding the complexity of high-dimensional computation. Compared to classical kernel methods, quantum kernel methods can leverage the properties of quantum computing to map input data to a high-dimensional Hilbert space for better separation of data points of different categories. In this embodiment, the quantum support vector machine regression prediction model can be a model built based on the kernel method of support vector machines. During training, the quantum support vector machine regression prediction model can be optimized using a constructed objective function, which may include a kernel function. Based on the output value of the kernel function, the output value of the objective function can be calculated, thereby adjusting the parameters of the quantum support vector machine regression prediction model.

[0087] The combination of quantum support vector machine regression prediction models and quantum long short-term memory networks fully leverages the advantages of quantum computing in processing high-dimensional data, nonlinear problems, and time series data. This complementary approach significantly improves the accuracy of continuous variable prediction, the model's generalization ability, and computational efficiency, providing a more powerful tool for solving complex time series prediction problems. Specific advantages include:

[0088] Quantum support vector machine (SVM) regression prediction models excel at handling nonlinear relationships, providing initial values ​​for predictions. Quantum long short-term memory (LSTM) networks focus on learning time-series features, correcting initial predictions, and predicting the difference. The combination of these two approaches considers both the nonlinear characteristics of the data and fully leverages time-series information, making the final predictions closer to the true values, thus significantly improving the accuracy of continuous variable predictions. The quantum SVM regression prediction model maps data to a high-dimensional space through quantum kernel functions, avoiding overfitting; the quantum LSM network optimizes the parameter update process through quantum gating mechanisms and variable quantum circuits, preventing overfitting as well. This synergy gives the model better stability and adaptability across different datasets and application scenarios, significantly enhancing its generalization ability.

[0089] The quantum support vector machine regression prediction model leverages quantum parallelism to accelerate computation, while the quantum long short-term memory network improves parameter update efficiency during training through algorithms such as quantum natural gradient optimization. The combination of these two approaches reduces the computational load and training time of the model to some extent, thereby improving the overall computational efficiency.

[0090] As one embodiment of this application, the influence of the affected factors on continuous variables exhibiting time-series characteristics can be one of the following:

[0091] Click-through rate of advertisements in different time periods; number of patients received in different time periods; temperature records in different time periods; website visits or click-through rates in different time periods; electricity consumption in different time periods.

[0092] The embodiments of this application can be applied to predicting advertising click-through rates, predicting the number of patients received, predicting weather conditions, predicting website traffic or click-through rates, predicting electricity consumption, and of course, predicting photovoltaic power generation, traffic flow, and so on.

[0093] See Figure 4 , Figure 4 A data prediction apparatus provided in this application embodiment may include:

[0094] The first acquisition module 401 is used to acquire a target object, the target object including a continuous variable whose influence of the affected factors exhibits time series characteristics;

[0095] The determination module 402 is used to determine the time-series differences that characterize the differences of continuous variables through continuous variables;

[0096] The second acquisition module 403 is used to train a first machine learning prediction model based on continuous variables, and to obtain the initial predicted value of the continuous variables at the target time based on the trained first machine learning prediction model.

[0097] The third acquisition module 404 is used to train a second machine learning prediction model based on the difference, and to obtain the prediction difference of the target time based on the trained second machine learning prediction model; the complexity of the first machine learning prediction model is greater than that of the second machine learning prediction model.

[0098] The fourth obtaining module 405 is used to obtain the final predicted value of the continuous variable of the target time based on the initial predicted value and the predicted difference.

[0099] The specific functions and effects of the aforementioned data prediction device can be explained by referring to other embodiments of this application, and will not be repeated here. Each module in the data prediction device can be implemented entirely or partially through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0100] Please see Figure 5 This application also provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the data prediction method described in any of the above embodiments. Please refer to [link to relevant documentation]. Figure 5 The computer device can be a classical computer or a quantum computer.

[0101] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, can implement the data prediction method in any of the above embodiments.

[0102] This application also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the data prediction method described in any of the above embodiments.

[0103] It is understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not limit the implementation process of the embodiments of this application in any way.

[0104] It is understood that the various implementation methods described in this application can be implemented individually or in combination, and the implementation methods in this application are not limited in this respect.

[0105] Unless otherwise stated, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The term "and / or" as used in this application includes any and all combinations of one or more of the associated listed items. The singular forms "a," "the," and "the" as used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0106] It is understood that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by the integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0107] It is understood that the memory in the embodiments of this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Specifically, non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM). It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0108] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0109] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the aforementioned method implementations, and will not be repeated here.

[0110] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0111] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0112] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0113] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, 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 personal computer, server, or network device, etc.) to execute all or part of the steps 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), random access memory (RAM), magnetic disks, or optical disks.

[0114] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for data prediction, characterized in that, The method includes: Obtain continuous variables whose influence from the affected factors exhibits time-series characteristics; Identify time-series differences that characterize the variability of continuous variables using continuous variables; The first machine learning prediction model is trained based on continuous variables, and the initial predicted values ​​of continuous variables at the target time are obtained based on the trained first machine learning prediction model. A second machine learning prediction model is trained based on the difference, and the predicted difference for the target time is obtained based on the trained second machine learning prediction model; the complexity of the first machine learning prediction model is greater than that of the second machine learning prediction model. Based on the initial predicted value and the predicted difference, the final predicted value of the continuous variable for the target time is obtained.

2. The method as described in claim 1, characterized in that, The final predicted value is obtained by performing arithmetic operations on the initial predicted value and the prediction difference.

3. The method as described in claim 2, characterized in that, The final predicted value is the sum of the initial predicted value and the predicted difference.

4. The method as described in claim 1, characterized in that, The first machine learning prediction model is a kernel matrix-based machine learning model; the second machine learning prediction model is a gating mechanism-based machine learning model.

5. The method as described in claim 4, characterized in that, At least one of the first and second machine learning prediction models is a quantum machine learning model.

6. The method as described in claim 5, characterized in that, The first machine learning prediction model is a quantum support vector machine regression prediction model; The second machine learning prediction model is a quantum long short-term memory network.

7. The method according to any one of claims 1-6, characterized in that, The continuous variable whose influence exhibits time-series characteristics is one of the following: Click-through rate of advertisements in different time periods; number of patients received in different time periods; temperature records in different time periods; website visits or click-through rates in different time periods; electricity consumption in different time periods.

8. The method according to any one of claims 1-6, characterized in that, The time series feature is one or a combination of the following: The changing trend and residuals of continuous variables.

9. A data prediction device, characterized in that, The device includes: The first acquisition module is used to acquire continuous variables whose influence on the affected factors exhibits time-series characteristics; The determination module is used to determine time-series differences that characterize the variability of continuous variables. The second acquisition module is used to train the first machine learning prediction model based on continuous variables and influencing factors, and to obtain the initial predicted values ​​of continuous variables at the target time based on the trained first machine learning prediction model. The third acquisition module is used to train a second machine learning prediction model based on the difference, and to obtain the prediction difference for the target time based on the trained second machine learning prediction model; the complexity of the first machine learning prediction model is greater than that of the second machine learning prediction model. The fourth acquisition module is used to obtain the final predicted value of the continuous variable of the target time based on the initial predicted value and the prediction difference.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, is capable of implementing the method described in any one of claims 1-8.

11. A computer device, comprising a memory and a processor, characterized in that, The memory stores a computer program, and when the processor executes the computer program, it implements the method described in any one of claims 1-8.