Data processing method and device, computer device, and storage medium
By performing consistency transformation and fusion on time series data and feature data, and combining it with a time series prediction network, the problem of low accuracy in traditional time series prediction is solved, achieving more efficient and accurate time series prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-19
- Publication Date
- 2026-07-24
AI Technical Summary
Traditional time series forecasting techniques only use historical time series data, resulting in low accuracy of forecast results.
By combining the temporal and feature data of the target object with consistency transformation and fusion, and using a temporal prediction network for prediction, the accuracy of prediction is improved.
By fusing time series data and feature data, the accuracy and efficiency of time series prediction are improved, network complexity is reduced, and the gradual and periodic characteristics of time series are fitted.
Smart Images

Figure CN117648665B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet technology, specifically to the field of computer technology, and in particular to a data processing method, apparatus, computer equipment, and storage medium. Background Technology
[0002] With the development of computer technology, time series prediction technology has been proposed. Time series prediction technology is a technique used to analyze and predict time series data. Time series data refers to a sequence of data points arranged in chronological order (e.g., every minute, hour, day, week, etc.); and data points can be understood as object data (e.g., specific values of precipitation, specific values of flow, etc.) of a certain object (e.g., precipitation, flow).
[0003] Currently, traditional time series forecasting techniques typically predict future time series values (i.e., future object data) by processing historical time series data. Typical algorithms include SMA (Simple Moving Average) and ARIMA (Autoreg Ressive Integrated Moving Average), among others. When performing time series forecasting on object data (such as precipitation, flow, etc.), these algorithms only use historical time series data as a parameter, which leads to relatively low accuracy in the time series forecasting results. Summary of the Invention
[0004] This application provides a data processing method, apparatus, computer equipment, and storage medium that can improve the accuracy of time series prediction results while ensuring the efficiency of time series prediction.
[0005] On one hand, embodiments of this application provide a data processing method, the method comprising:
[0006] The system acquires time-series data and feature data of a target object in a business scenario within a historical time period. The time-series data includes object data of the target object at each historical time point within the historical time period. The feature data includes object features associated with the target object at each historical time point, where object features refer to features that have an impact on the object data of the target object.
[0007] The data structure of the time series data and the data structure of the feature data are subjected to a consistency transformation. The transformed time series data and the transformed feature data both include multiple rows of sub-data. Each row of sub-data includes object data or object features corresponding to at least one historical time point. Furthermore, in the transformed time series data and the transformed feature data, the historical time points involved in each sub-data in the same row are the same.
[0008] The sub-data in the same row of the transformed time-series data and the transformed feature data are fused to obtain multi-row fused data;
[0009] The timing prediction network is invoked to perform timing prediction on the object data of the target object based on the multi-line fused data, and the timing prediction result is obtained. The timing prediction result is used as the basis for performing business processing in the business scenario.
[0010] On the other hand, embodiments of this application provide a data processing apparatus, the apparatus comprising:
[0011] The acquisition unit is used to acquire time-series data and feature data of a target object in a business scenario within a historical time period. The time-series data includes: object data of the target object at each historical time point in the historical time period; the feature data includes: object features associated with the target object at each historical time point, where object features refer to features that have an impact on the object data of the target object.
[0012] The processing unit is used to perform a consistency transformation on the data structure of the time series data and the data structure of the feature data. The transformed time series data and the transformed feature data both include multiple rows of sub-data. Each row of sub-data includes object data or object features corresponding to at least one historical time point. In the transformed time series data and the transformed feature data, the historical time points involved in each sub-data in the same row are the same.
[0013] The processing unit is further configured to fuse the sub-data located in the same row in the transformed time-series data and the transformed feature data to obtain multi-row fused data;
[0014] The processing unit is further configured to invoke a time-series prediction network to perform time-series prediction on the object data of the target object based on the multi-line fused data, and obtain a time-series prediction result, which is used as the basis for performing business processing in the business scenario.
[0015] In one implementation, when the processing unit performs consistency transformation on the data structure of the time-series data and the data structure of the feature data, it may specifically be used to:
[0016] Obtain the backtracking step size, which indicates that the number of historical time points involved in predicting the object data of the target object is M, where M is a positive integer;
[0017] The data structure of the time series data is transformed according to the backtracking step size to obtain the transformed time series data; each row of sub-data in the transformed time series data includes: object data corresponding to M consecutive historical time points selected from the time series data;
[0018] The data structure of the feature data is transformed according to the backtracking step size to obtain the transformed feature data; each row of sub-data in the transformed feature data includes: object features corresponding to M consecutive historical time points selected from the feature data.
[0019] In another implementation, the object data in the time series data are arranged sequentially, and the historical time point corresponding to the previous object data is earlier than the historical time point corresponding to the next object data; accordingly, when the processing unit transforms the data structure of the time series data according to the backtracking step size to obtain the transformed time series data, it can specifically be used to:
[0020] The Mth object data in the time series data, and the object data located after the Mth object data, are all taken as object data to be traversed;
[0021] Iterate through each object data to be iterated in the order of arrangement, and determine the currently iterated object data as the base object data.
[0022] Based on the backtracking step size and the position of the reference object data in the time series data, M object data are selected continuously from the time series data in a selection order from back to front, and the last object data among the selected M object data is the reference object data.
[0023] A row of sub-data is constructed using the selected M object data, and the process continues to traverse each object data to be traversed. After all the object data to be traversed has been traversed, the constructed sub-data is arranged vertically according to the construction order of the constructed sub-data, resulting in the transformed time series data.
[0024] In another embodiment, the processing unit may also be used for:
[0025] Obtain the prediction step size, which is used to indicate: predict the object data of the target object at Q time points, where Q is a positive integer;
[0026] For any row of sub-data in the transformed time series data and the transformed feature data, the prediction target of any row of sub-data is determined according to the prediction step size and the latest historical time point involved in any row of sub-data;
[0027] The prediction target of any row of sub-data is used to indicate: predicting the object data of the target object within a target time period; the target time period is the time period obtained by extrapolating Q time points based on the latest historical time point involved in the corresponding row of sub-data.
[0028] In another implementation, a row of fused data corresponds to a target time period. The target time period corresponding to any row of fused data is obtained by extrapolating Q time points based on the latest historical time point involved in the corresponding row of data, where Q is a positive integer.
[0029] Accordingly, when the processing unit invokes the temporal prediction network to perform temporal prediction on the object data of the target object based on the multi-line fused data, it can specifically be used to:
[0030] Select the last row of fused data from the multiple rows of fused data;
[0031] The time-series prediction network is invoked to predict the object data of the target object at each time point in the corresponding target time period based on the last row of fused data, and the time-series prediction result is obtained.
[0032] In another implementation, a row of fused data corresponds to a target time period. The target time period corresponding to any row of fused data is obtained by extrapolating Q time points based on the latest historical time point involved in the corresponding row of data, where Q is a positive integer.
[0033] Accordingly, when the processing unit invokes the temporal prediction network to perform temporal prediction on the object data of the target object based on the multi-line fused data, it can specifically be used to:
[0034] Traverse the multi-row fused data and determine the target row of fused data for the current traversal;
[0035] The time-series prediction network is invoked to predict the object data of the target object at each time point in the corresponding target time period based on the target row fusion data;
[0036] If the target row fused data is the last row fused data, then stop traversing the multi-row fused data and output the time series prediction result, which includes the currently predicted data of each object;
[0037] If the target row fused data is not the last row fused data, then select object data whose historical time points are located within the corresponding target time period from the time series data; and update the network parameters of the time series prediction network according to the currently predicted object data and the selected object data, and continue to traverse the multi-row fused data.
[0038] In another implementation, when the processing unit fuses the sub-data located in the same row of the transformed time-series data and the transformed feature data to obtain multi-row fused data, it can specifically be used for:
[0039] The i-th row of sub-data in the transformed time series data is summed with the i-th row of sub-data in the transformed feature data to obtain the i-th row of fused data.
[0040] Alternatively, the i-th row of sub-data in the transformed time series data can be concatenated with the i-th row of sub-data in the transformed feature data to obtain the i-th row of fused data.
[0041] Alternatively, the i-th row of sub-data in the transformed time series data and the i-th row of sub-data in the transformed feature data are averaged to obtain the i-th row of fused data.
[0042] Where i is greater than zero and less than or equal to the total number of rows of sub-data in the transformed time series data.
[0043] In another implementation, when the acquisition unit is used to acquire time-series data and feature data of the target object within a historical time period, it may specifically be used for:
[0044] Obtain the historical data sequence of the target object within a historical time period. The historical data sequence includes the following data values: object data of the target object at each historical time point within the historical time period.
[0045] Obtain the historical feature sequence of the target object within the historical time period. The historical feature sequence includes the following data values: the object features associated with the target object at each historical time point.
[0046] The historical data sequence is standardized to obtain time-series data, and the historical feature sequence is standardized to obtain feature data;
[0047] The standardization process for any one of the historical data sequences and the historical feature sequences includes: performing mean and standard deviation calculations on each data value in the sequence, and adjusting each data value in the sequence using the calculated mean and standard deviation.
[0048] In another implementation, when the acquisition unit is used to acquire the historical data sequence of the target object within a historical time period, it may specifically be used for:
[0049] In the aforementioned business scenario, object data of the target object at various historical time points within a historical time period is collected to obtain an object dataset;
[0050] If no anomalies are detected in the object dataset, the data of each object in the object dataset is arranged in chronological order according to historical time points to obtain the historical data sequence of the target object within the historical time period.
[0051] If an anomaly is detected in the object dataset, the object dataset is corrected, and the data of each object in the corrected object dataset is arranged in chronological order according to historical time points to obtain the historical data sequence of the target object within the historical time period.
[0052] The existence of anomalies in the object dataset includes at least one of the following: the object dataset is missing object data corresponding to at least one historical time point, and the object dataset contains abnormal object data, wherein the abnormal object data refers to object data whose difference from the reference object data is greater than a data difference threshold; the correction processing of the object dataset includes at least one of the following: filling the object dataset with missing object data, and adjusting the abnormal object data in the object dataset.
[0053] In another embodiment, when the acquisition unit is used to fill missing object data in the object dataset, it may specifically be used to: fill the object dataset with the mean of the various object data currently included in the object dataset as missing object data;
[0054] In another implementation, when the acquisition unit is used to adjust the abnormal object data in the object dataset, it may specifically be used to replace the abnormal object data in the object dataset with the mean of all object data in the object dataset excluding the abnormal object data.
[0055] In another embodiment, the time-series prediction network is obtained by training and updating the target neural network; correspondingly, the acquisition unit can also be used to: acquire first data and second data of the target object within a reference time period when the target neural network needs to be trained; the first data includes: object data of the target object at each reference time point in the reference time period; the second data includes: object features associated with the target object at each reference time point;
[0056] The processing unit can also be used to: construct multi-row sample data for training the target neural network based on the first data and the second data, wherein each row of sample data corresponds to a prediction time period; wherein each row of sample data is obtained by fusing object data and object features corresponding to at least one reference time point, the reference time points corresponding to different rows of sample data are different, and the prediction time period corresponding to any row of sample data is obtained by extrapolating at least one time point backward from the corresponding latest reference time point.
[0057] The processing unit can also be used to: call the target neural network to predict the object data of the target object in the corresponding prediction time period based on each row of sample data, and obtain the prediction result corresponding to each row of sample data;
[0058] The processing unit can also be used to update the network parameters of the target neural network based on the prediction result corresponding to each row of sample data and the first data, so as to obtain a temporal prediction network.
[0059] In another embodiment, the target neural network includes multiple neurons; correspondingly, when the processing unit calls the target neural network to predict the object data of the target object in the corresponding prediction time period based on each row of sample data, and obtains the prediction result corresponding to each row of sample data, it can be specifically used for:
[0060] For the j-th row of sample data, one or more neurons are dropped in the target neural network according to the neuron drop-off strategy; wherein, the value of j is greater than zero and not greater than the number of rows of sample data;
[0061] The remaining neurons in the target neural network are invoked to predict the object data of the target object at each time point in the corresponding prediction time period based on the sample data in the j-th row, thereby obtaining the prediction result corresponding to the sample data in the j-th row.
[0062] In another implementation, when the processing unit updates the network parameters of the target neural network based on the prediction result corresponding to each row of sample data and the first data, it may specifically be used to:
[0063] Based on the predicted time period corresponding to each row of sample data, at least one object data is selected from the first data to construct a label for each row of sample data; wherein, the reference time point corresponding to each object data in any label must be located within the predicted time period corresponding to the corresponding row of sample data.
[0064] For each row of sample data whose prediction result is obtained, the network parameters of the target neural network are updated based on the current prediction result and the corresponding label; or, after obtaining the prediction result for each row of sample data, the network parameters of the target neural network are updated based on the label of each row of sample data and the corresponding prediction result.
[0065] In another aspect, embodiments of this application provide a computer device, the computer device including an input interface and an output interface, the computer device further including:
[0066] A processor, adapted to implement one or more instructions; and,
[0067] A computer storage medium storing one or more instructions adapted for loading by the processor and executing the following steps:
[0068] The system acquires time-series data and feature data of a target object in a business scenario within a historical time period. The time-series data includes object data of the target object at each historical time point within the historical time period. The feature data includes object features associated with the target object at each historical time point, where object features refer to features that have an impact on the object data of the target object.
[0069] The data structure of the time series data and the data structure of the feature data are subjected to a consistency transformation. The transformed time series data and the transformed feature data both include multiple rows of sub-data. Each row of sub-data includes object data or object features corresponding to at least one historical time point. Furthermore, in the transformed time series data and the transformed feature data, the historical time points involved in each sub-data in the same row are the same.
[0070] The sub-data in the same row of the transformed time-series data and the transformed feature data are fused to obtain multi-row fused data;
[0071] The timing prediction network is invoked to perform timing prediction on the object data of the target object based on the multi-line fused data, and the timing prediction result is obtained. The timing prediction result is used as the basis for performing business processing in the business scenario.
[0072] In another aspect, embodiments of this application provide a computer storage medium storing one or more instructions, which are adapted to be loaded by a processor and executed by the aforementioned data processing method.
[0073] In another aspect, embodiments of this application provide a computer program product, which includes a computer program; when the computer program is executed by a processor, it implements the data processing method mentioned above.
[0074] When performing time-series prediction on object data of a target object in a business scenario, this application embodiment uses not only the time-series data of the target object within a historical time period (object data of the target object at each historical time point within the historical time period), but also the feature data of the target object within the historical time period. Since the feature data contains the object features associated with the target object at each historical time point, and object features can affect the object data of the target object, by combining feature data and time-series data for time-series prediction, it is possible to fit the gradual and periodic characteristics of the time series, thereby improving the accuracy of the time-series prediction results. Furthermore, this embodiment of the application performs a consistency transformation on the data structure of the time series data and the data structure of the feature data, and fuses the sub-data in the same row of the transformed time series data and the transformed feature data. This allows a time series prediction network to perform time series prediction on the object data of the target object based on the fused data from multiple rows. On the one hand, this enables the time series prediction network to learn the object data and object features corresponding to the same historical time point simultaneously by learning the fused data. This improves learning efficiency and avoids misinterpreting the correspondence between object data and object features, thereby improving the efficiency and accuracy of time series prediction results. On the other hand, it allows the time series data and feature data of the target object to share the same time series prediction network. This not only enables collaborative learning between the time series data and feature data, improving the accuracy of time series prediction results, but also reduces the network complexity of the time series prediction network. This allows the time series prediction network to quickly complete time series prediction work in an end-to-end manner with a relatively simple network structure, further improving the efficiency of time series prediction. Attached Figure Description
[0075] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0076] Figure 1a This is a schematic diagram of the structure of a time-series prediction network provided in an embodiment of this application;
[0077] Figure 1b This is a schematic diagram illustrating a data processing scheme jointly performed by a terminal and a server, as provided in an embodiment of this application.
[0078] Figure 2 This is a flowchart illustrating a data processing method provided in an embodiment of this application;
[0079] Figure 3a This is a schematic diagram of a data set for filling objects, provided in an embodiment of this application;
[0080] Figure 3b This is a schematic diagram illustrating the transformation of the data structure of time-series data according to an embodiment of this application;
[0081] Figure 3c This is a schematic diagram of data fusion provided in an embodiment of this application;
[0082] Figure 4 This is a schematic diagram of a process for training a target neural network to obtain a time-series prediction network, provided in an embodiment of this application.
[0083] Figure 5 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;
[0084] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0085] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0086] This application proposes a data processing scheme based on Artificial Intelligence (AI) technology. This scheme performs time-series prediction on object data of target objects in a business scenario, ensuring prediction efficiency while fitting the gradual and periodic characteristics of the time series, thus improving the accuracy of the prediction results. AI technology refers to the theories, methods, techniques, and application systems that utilize digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. In other words, artificial intelligence is a comprehensive technology within computer science; it primarily aims to understand the essence of intelligence and produce new intelligent machines that can react in a way similar to human intelligence, enabling these machines to possess multiple functions such as perception, reasoning, and decision-making. Accordingly, AI technology is a comprehensive discipline, mainly encompassing computer vision (CV), speech processing, natural language processing, and machine learning (ML) / deep learning.
[0087] Machine learning is the core of AI, serving as the fundamental means to endow computer devices with intelligence. Machine learning is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory, among others. It specifically studies how computer devices can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Therefore, machine learning is a science that allows computer devices to learn and act like humans. It uses neural network models to learn the knowledge implicit in large amounts of data and optimizes these models (i.e., updates the parameters of the neural network model) using optimal algorithms. Deep learning, on the other hand, is a technique that utilizes deep neural network systems for machine learning. Machine learning / deep learning typically includes various techniques such as Artificial Neural Networks (ANNs), supervised learning, and Reinforcement Learning (RL). An artificial neural network is a mathematical or computational model that mimics the structure and function of biological neural networks (the central nervous system of animals, especially the brain). It consists of a large number of artificial neurons connected together to perform calculations and is used to estimate or approximate functions. Currently, machine learning / deep learning has been widely applied in various fields such as shopping recommendations, search ranking, ad clicks, credit risk assessment, image recognition, and autonomous driving.
[0088] The data processing scheme proposed in this application mainly involves machine learning / deep learning technology in AI. Its general principle is as follows: First, a time-series prediction network can be constructed based on machine learning / deep learning. When it is necessary to predict the object data of a target object in a business scenario, the time-series data of the target object within a historical time period and feature data under at least one feature dimension can be obtained. Then, the obtained time-series data and each feature data are input into the time-series prediction network, so that the time-series prediction network combines the time-series data and each feature data, and performs time-series prediction on the object data of the target object according to the prediction step size (information that indicates how many future time points of object data need to be predicted), to obtain the time-series prediction result. The time-series data may include: object data of the target object at each historical time point within a historical time period; the feature data may include: object features associated with the target object at each historical time point, where object features refer to features that have an impact on the object data of the target object.
[0089] See Figure 1aAs shown, the aforementioned temporal prediction network may include the following network layers: an input layer, a hidden layer, and an output layer. Each network layer may include one or more layers of neurons, and the number of neurons in each layer can be set according to actual needs. The input layer receives the temporal data and feature data of the target object and passes them to the hidden layer. Correspondingly, the hidden layer can perform consistency transformations on the data structure of the temporal data and the data structure of each feature data, ensuring that both the transformed temporal data and each transformed feature data include multiple rows of sub-data. Each row of sub-data includes object data or object features corresponding to at least one historical time point, and the historical time points involved in the sub-data within the same row of the transformed temporal data and each transformed feature data are the same. Furthermore, the hidden layer can fuse the sub-data within the same row of the transformed temporal data and each transformed feature data to obtain multi-row fused data, which is then passed to the output layer. The output layer performs temporal prediction on the object data of the target object based on the multi-row fused data and the prediction step size, obtaining the temporal prediction result.
[0090] It should be understood that the above merely illustrates the roles of each network layer in a time-series prediction network and does not constitute a limitation. For example, in other embodiments, the input layer may be responsible for receiving the time-series data and various feature data of the target object, as well as performing data structure consistency transformation operations and data fusion operations; the hidden layer may be responsible for performing time-series prediction operations based on multi-line fused data; and the output layer may be responsible for outputting the time-series prediction results. As another example, in other embodiments, the input layer may also be responsible for receiving the time-series data and various feature data of the target object, as well as performing data structure consistency transformation operations; the hidden layer may be responsible for performing data fusion operations; and the output layer may be responsible for performing time-series prediction operations and outputting the time-series prediction results. For example, in other embodiments, the input layer can be responsible for receiving multi-line fused data, the hidden layer can be responsible for performing time series prediction operations based on the multi-line fused data, and the output layer can be responsible for performing the output operation of the time series prediction results. That is, in this case, multi-line fused data can be obtained by performing data structure consistency transformation operations and fusion operations of each row of sub-data on the time series data and each feature data outside the time series prediction network. The multi-line fused data is then input into the time series prediction network, so that the time series prediction network can perform time series prediction based on the multi-line fused data.
[0091] As can be seen from the above description, the time series prediction network constructed in this application embodiment provides an efficient modeling method that combines time series data (or time series information) and feature data (or feature information), allowing these two types of data to share the same time series prediction network. This not only enables collaborative learning between time series data and feature data, reducing the prediction error of the time series prediction network and improving the accuracy of the time series prediction results, but also reduces the network complexity of the time series prediction network. This allows the time series prediction network to quickly complete time series prediction work in an end-to-end manner with a relatively simple network structure, further improving the efficiency of time series prediction. Furthermore, the data processing scheme proposed in this application embodiment, by combining feature data and time series data for time series prediction, enables the time series prediction network to fit the asymptotic and periodic characteristics of time series, thereby further improving the accuracy of the time series prediction results. Furthermore, when combining feature data and time series data, data structure transformation and data fusion operations enable the time series prediction network to learn the object data and object features corresponding to the same historical time point simultaneously by learning the fused data. This can improve learning efficiency and avoid misinterpreting the correspondence between object data and object features, thereby further improving the efficiency and accuracy of time series prediction results.
[0092] In specific implementations, the data processing scheme proposed in this application embodiment can be executed by a computer device, which can be a terminal or a server; alternatively, the data processing scheme can be executed jointly by a terminal and a server. For example, the server can be responsible for constructing the time series prediction network, while the terminal is responsible for acquiring time series data and feature data, and sending the time series data and feature data to the server. This allows the server to invoke the time series prediction network to perform time series prediction based on the received time series data and feature data. Figure 1b As shown; for example, the server can be responsible for building the time series prediction network and distributing it to the terminal, so that the terminal can call the time series prediction network to perform time series prediction after obtaining the time series data and feature data, and so on. The terminals mentioned here can include, but are not limited to: smartphones, tablets, laptops, desktop computers, smartwatches, smart TVs, smart vehicle terminals, etc.; the server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, etc.
[0093] Based on the above description of the data processing scheme, this application proposes a data processing method. This data processing method can be executed by the aforementioned computer device (i.e., a terminal or a server), or by both a terminal and a server. For ease of explanation, this application primarily uses the execution of the data processing method by a computer device as an example. Please refer to... Figure 2 As shown, the data processing method may include the following steps S201-S204:
[0094] S201, Obtain the time-series data and feature data of the target object in the business scenario within a historical time period.
[0095] The business scenario can be any type of time-series forecasting scenario, such as precipitation forecasting, carbon emission forecasting, traffic flow forecasting, weather forecasting, electronic resource flow (i.e., the direction of electronic resources) forecasting, or the quantity of goods sold forecasting, etc. The target object refers to the target variable involved in the business scenario. For example, when the business scenario is precipitation forecasting, the target object can be the variable of precipitation; when the business scenario is carbon emission forecasting, the target object can be the variable of carbon emissions; when the business scenario is traffic flow forecasting, the target object can be the variable of traffic (such as the customer flow in a shopping mall or the network traffic of an application); when the business scenario is weather forecasting, the target object can be the variable of weather temperature; when the business scenario is electronic resource flow forecasting, the target object can be the variable of electronic resource flow, and so on.
[0096] The time-series data of the target object within the historical time period may include: the object data of the target object at each historical time point within the historical time period, where object data refers to the value of the target object; while the feature data of the target object within the historical time period may include: the object features associated with the target object at each historical time point, where object features refer to features that have an impact on the object data of the target object. For example, when the target object is precipitation, the object data refers to the value of precipitation. Since the value of precipitation is usually affected by features such as geographical location and terrain structure, the object feature can be geographical location or terrain structure. When the target object is carbon emissions, the object data refers to the value of carbon emissions. Since the value of carbon emissions is usually affected by the feature of oil burning, the object feature can be oil burning. When the target object is traffic flow (such as the customer flow in a shopping mall), the object data refers to the value of traffic flow. Since the value of customer flow is usually affected by features such as weather and whether the time is a holiday, the object feature can be weather or information indicating whether the corresponding time is a holiday. When the target object is the variable of weather temperature, the object data can refer to the value of weather temperature. Since the value of weather temperature is usually affected by features such as cloud thickness and light intensity, the object feature can be cloud thickness or light intensity, and so on.
[0097] It should be noted that the object data in the aforementioned time-series data can be collected from business scenarios through data acquisition; and the object data in the time-series data are arranged sequentially, with the historical time point corresponding to the previous object data being earlier than the historical time point corresponding to the next object data. The object features in the aforementioned feature data can be collected from business scenarios through data mining or feature engineering. Feature engineering refers to the process of using domain knowledge of data to create features that enable machine learning algorithms to function; and the object features in the feature data are arranged sequentially, with the historical time point corresponding to the previous object feature being earlier than the historical time point corresponding to the next object feature. Furthermore, the number of feature data obtained through step S201 can be one or more, without limitation. When there are multiple feature data, different feature data can correspond to different feature dimensions, and the object features within the same feature data belong to the same feature dimension. For example, when the target object is weather temperature, it can involve two feature dimensions: cloud thickness and light intensity. In this case, the number of feature data for the target object in the historical time period can be two: one feature data includes the cloud thickness at each historical time point in the historical time period, and the other feature data includes the light intensity at each historical time point in the historical time period.
[0098] The historical time period mentioned above refers to the time period preceding the current moment, where the current moment is the moment the timing prediction instruction for the target object is detected. For example, the historical time period can be a time period determined by counting n time points backward from the current moment. These time points can be set according to actual needs, such as one hour or one day, and n is a positive integer whose specific value can be set according to actual needs. For instance, if one time point is one day, n equals 10, and the current time is August 12th, then the historical time period can be a time period determined by counting 10 time points backward from August 12th, that is, the historical time period can be the period from August 2nd to August 11th, in which case the historical time period includes 10 time points. As another example, if one time point is one day, n equals 1, and the current time is August 12th, then the historical time period can be a time period determined by counting one time point backward from August 12th, that is, the historical time period can be the period from August 11th to August 11th, in which case the historical time period includes one time point. As can be seen, the historical time period mentioned in the embodiments of this application may include n time points; for ease of explanation, the time points included in the historical time period are referred to as historical time points in the embodiments of this application.
[0099] In a specific implementation of step S201, the computer device can first acquire a historical data sequence of the target object within a historical time period. This historical data sequence includes the following data values: object data of the target object at each historical time point within the historical time period; and acquire a historical feature sequence of the target object within the historical time period. This historical feature sequence includes the following data values: object features associated with the target object at each historical time point. Then, the computer device directly uses the historical data sequence as time-series data and the historical feature sequence as time-series data. Alternatively, considering that the numerical units involved in the object data in the historical data sequence may differ from those involved in the object features in the historical feature sequence—for example, the numerical unit involved in the object data might be 1000, while the numerical unit involved in the object features might be 10—the computer device can further standardize the historical data sequence to obtain time-series data and standardize the historical feature sequence to obtain feature data. This ensures that the object data in the final time-series data and the object features in the feature data are on the same numerical unit. This can improve the subsequent data fusion effect, reduce the data complexity when the time-series prediction network learns and fuses data, thereby accelerating the processing speed of the time-series prediction network and improving prediction efficiency.
[0100] The standardization process for any sequence in the historical data sequence and historical feature sequence includes: calculating the mean and standard deviation of each data value in the sequence, and then adjusting the data values in the sequence using the calculated mean and standard deviation. Specifically, for any data value in any sequence, the difference between that data value and the mean can be calculated. Then, the ratio between that difference and the standard deviation is used to update that data value, making the updated data value equal to that ratio, as shown in the following formula:
[0101] r=(r-μ) / σ
[0102] Where μ represents the mean, σ represents the standard deviation, and r represents any data value in any sequence (such as any object data in a historical data sequence, or any object feature in a historical feature sequence); through this standardization process, any sequence can be transformed into data with a mean and standard deviation of 0. It should be understood that since time series data is obtained by standardizing historical data sequences, object data in time series data can be understood as data values obtained by adjusting object data in historical data sequences; similarly, object features in feature data can be understood as data values obtained by adjusting object features in historical feature sequences.
[0103] It should be noted that the historical data sequences and historical feature sequences mentioned above are obtained in the same way. Taking historical data sequences as an example, the computer device can obtain the historical data sequence of a target object within a historical time period in the following ways: In a business scenario, object data of the target object at each historical time point within the historical time period is collected to obtain an object dataset, and it is determined whether the object dataset has any anomalies. If no anomalies are detected in the object dataset, the object data in the object dataset can be arranged in chronological order according to the historical time points to obtain the historical data sequence of the target object within the historical time period. If anomalies are detected in the object dataset, the object dataset can be corrected, and the object data in the corrected object dataset can be arranged in chronological order according to the historical time points to obtain the historical data sequence of the target object within the historical time period. Anomalies in the object dataset include at least one of the following: the object dataset is missing object data corresponding to at least one historical time point, and the object dataset contains abnormal object data. Abnormal object data refers to object data whose difference from the reference object data is greater than a data difference threshold. The reference data mentioned here can be an empirical value or the mean of the various object data currently included in the object dataset, without limitation; in addition, the data difference threshold can be an empirical value or the standard deviation of the various object data currently included in the object dataset, or the value obtained by amplifying the standard deviation using an amplification parameter (such as 3), without limitation.
[0104] Accordingly, the correction process for the object dataset includes at least one of the following: filling in missing object data into the object dataset, and adjusting abnormal object data in the object dataset. Specifically, when filling in missing object data into the object dataset, preset default object data can be obtained as the missing object data to fill in the object dataset; or, the average value among the currently included object data in the object dataset can be used as the missing object data to fill in the object dataset, without limitation. For example, see [link to example]. Figure 3a As shown, suppose the historical time period includes 5 historical time points, and the object data corresponding to the 4th historical time point (y4) is missing in the object dataset. Then, the mean (represented by y0) of the object data corresponding to the other historical time points included in the object dataset can be calculated and filled into the object dataset as the missing object data.
[0105] When adjusting abnormal object data in an object dataset, the average value among all object data currently included in the object dataset can be used to replace the abnormal object data; alternatively, the average value among all object data in the object dataset excluding the abnormal object data can be used to replace the abnormal object data; or, a historical time point adjacent to the historical time point corresponding to the abnormal object data can be determined, and the object data corresponding to that adjacent historical time point can be used to replace the abnormal object data, and so on.
[0106] S202 performs a consistency transformation on the data structure of time-series data and the data structure of feature data.
[0107] Based on the foregoing description, a time series data can be represented as: Let j represent the j-th object data in the time series data (i.e., the object data of the target object at the j-th historical time point), j∈[1,n]; a feature data can be represented as This represents the j-th object feature in the feature data (i.e., the object feature associated with the target object at the j-th historical time point). Therefore, both the time-series data and the feature data have a 1*n dimensional structure. Step S202 performs a consistency transformation on the data structures of the time-series data and the feature data to ensure that both the transformed time-series data and the transformed feature data include multiple rows of sub-data. Each row of sub-data includes object data or object features corresponding to at least one historical time point, and the historical time points involved in the sub-data within the same row are the same in both the transformed time-series data and the transformed feature data.
[0108] In the specific implementation of step S202, the computer device can obtain a backtracking step size, which indicates that the number of historical time points involved in predicting the object data of the target object is M, where M is a positive integer; that is, the backtracking step size indicates that object data and object features from the past M historical time points need to be used to predict future object data. Then, the data structure of the time series data can be transformed according to the backtracking step size to obtain the transformed time series data; and the data structure of the feature data can be transformed according to the backtracking step size to obtain the transformed feature data. Each row of sub-data in the transformed time series data includes: object data corresponding to M consecutively selected historical time points from the time series data; each row of sub-data in the transformed feature data includes: object features corresponding to M consecutively selected historical time points from the feature data.
[0109] In this process, since the backtracking step size indicates that object data and object features from the past M historical time points need to be used to predict future object data, and one object data point in the time series data corresponds to one historical time point, when transforming the data structure of the time series data according to the backtracking step size, the computer device can treat the Mth object data in the time series data, as well as the object data following the Mth object data, as the object data to be traversed. Then, it traverses each object data to be traversed sequentially according to the order of arrangement, and determines the currently traversed object data as the baseline object data. Next, based on the backtracking step size and the position of the baseline object data in the time series data, M object data points are continuously selected from the time series data in a backward selection order. The last (i.e., the last) object data point among the selected M object data points is the baseline object data. Then, a row of sub-data can be constructed using the selected M object data points, and the traversal of each object data to be traversed continues. After all the object data to be traversed has been traversed, the constructed rows of sub-data are arranged vertically according to the construction order of the currently constructed rows of sub-data to obtain the transformed time series data.
[0110] For example, suppose the time series data is The time series data includes 10 object data points. The backtracking step size indicates whether object data and object features from the past three historical time points need to be used to predict future object data. The computer device can then... as well as As the object data to be traversed, and traversed sequentially. as well as When traversing to When, you can select as well as Build a row of sub-data When traversing to When, you can select as well as Build a row of sub-data When traversing to When, you can select as well as Build a row of sub-data Following this pattern, the following rows of sub-data can also be constructed: as well as Then, the currently constructed sub-data can be arranged vertically according to the construction order to obtain the transformed time series data, such as... Figure 3b As shown.
[0111] Alternatively, when transforming the data structure of time-series data according to the backtracking step size, the computer device can sequentially traverse the object data in the time-series data and determine the currently traversed object data as the target object data. Then, based on the backtracking step size and the position of the target object data in the time-series data, M object data are continuously selected from the time-series data in a forward selection order, with the first object data among the selected M object data being the target object data. If M object data are successfully selected, a row of sub-data can be constructed using the M object data, and the traversal of the time-series data continues; if the M object data are not successfully selected, the traversal of the time-series data ends, and the constructed rows of sub-data are arranged vertically according to the construction order of the currently constructed rows of sub-data to obtain the transformed time-series data.
[0112] It should be understood that the specific method of transforming the data structure of feature data according to the backtracking step size is similar to the specific method of transforming the data structure of time series data according to the backtracking step size mentioned above, and will not be repeated here. Furthermore, the computer device can also obtain a prediction step size, which is used to indicate: the object data of the target object at Q time points, where Q is a positive integer; for any row of sub-data in the transformed time series data and transformed feature data, the computer device can determine the prediction target of any row of sub-data based on the prediction step size and the latest historical time point involved in that row of sub-data. The prediction target of any row of sub-data is used to indicate: the object data of the target object within a target time period; this target time period is the time period obtained by extrapolating Q time points based on the latest historical time point involved in the corresponding row of sub-data. For example, continuing... Figure 3b In the example shown, the first row of sub-data in the transformed time series data is The latest historical time point involved in this row of sub-data is August 4th (i.e., the corresponding historical time point). If Q equals 2, then by counting 2 days from August 4th, we can obtain the target time point as the period from August 5th to August 6th. Therefore, the prediction target of the first row of sub-data in the transformed time series data can be used to indicate: the object data of the predicted target object within the period from August 5th to August 6th.
[0113] Based on the above description, the embodiments of this application transform the data structure according to the backtracking step size, which can transform the data structure of both time series data and feature data from a 1*n dimensional structure to a (n-M+1)*M dimensional structure. Furthermore, in the transformed time series data, one row of sub-data corresponds to a prediction target and its historical object data (i.e., the object data corresponding to the historical time point, which can be called historical values), and in the transformed feature data, one row of sub-data corresponds to a prediction target and its historical object features (i.e., the object features corresponding to the historical time point). Since the historical time points involved in each sub-data in the same row are the same in the transformed feature data and the transformed time series data, and the prediction target of any row of sub-data is determined based on the historical time points involved in any row of sub-data, it can be seen that the logic of the structural transformation involved in step S202 is to unify the data dimensions of the object data (historical values) and feature data involved in each prediction target, so that the data structure of the object data and feature data involved in the time series prediction network is consistent when processing each prediction target, thereby improving the processing efficiency and accuracy of the time series prediction network.
[0114] S203, merge the sub-data in the same row of the transformed time series data and the transformed feature data to obtain multi-row fused data.
[0115] Since the historical time points involved in the sub-data within the same row of the transformed time-series data and the transformed feature data are the same, these sub-data within the same row can be used to predict the object data of the target object within the same target time period. Based on this, a computer device can fuse the sub-data within the same row of the transformed time-series data and the transformed feature data to obtain multi-row fused data, which allows for efficient and accurate prediction of the target object's data based on the subsequent fused data.
[0116] In one embodiment of step S203, the computer device can sum the i-th row of sub-data in the transformed time-series data with the i-th row of sub-data in the transformed feature data to obtain the i-th row of fused data. The summation process mentioned here can be direct summation or weighted summation, and is not limited thereto. Here, the value of i is greater than zero and less than or equal to the total number of rows of sub-data in the transformed time-series data. Specifically, as mentioned above, the data structure of any row of sub-data is a 1*M dimensional structure. Data in different dimensions corresponds to different historical time points. Therefore, when summing the i-th row of sub-data in the transformed time-series data with the i-th row of sub-data in the transformed feature data, the i-th row of sub-data in the transformed time-series data can be summed with the object data and object features in the same dimension of the i-th row of sub-data in the transformed feature data to obtain the i-th row of fused data. This achieves the fusion of object data and object features corresponding to the same historical time point, and the data structure of the i-th row of fused data obtained in this case is still a 1*M dimensional structure, such as... Figure 3c As shown. Alternatively, the computer device can sum the individual object data in the i-th row of the transformed time-series data to obtain a first summation result; and sum the individual object features in the i-th row of the transformed feature data to obtain a second summation result. Then, the first summation result and the second summation result are concatenated to obtain the i-th row of fused data; or the first summation result and the second summation result are summed to obtain the i-th row of fused data.
[0117] In another embodiment of step S203, the computer device may concatenate the i-th row of sub-data in the transformed time-series data with the i-th row of sub-data in the transformed feature data to obtain the i-th row of fused data. Alternatively, the computer device may perform a mean operation on the i-th row of sub-data in the transformed time-series data and the i-th row of sub-data in the transformed feature data to obtain the i-th row of fused data. The mean operation mentioned here can be a direct mean operation or a weighted mean operation, and there is no limitation on this. Similar to the summation operation mentioned above, the computer device may perform a mean operation on the i-th row of sub-data in the transformed time-series data and the object data and object features in the same dimension in the i-th row of sub-data in the transformed feature data to obtain the i-th row of fused data. Alternatively, the computer device may perform a mean operation on each object data in the i-th row of sub-data in the transformed time-series data to obtain a first mean result; and perform a mean operation on each object feature in the i-th row of sub-data in the transformed feature data to obtain a second mean result. Then, the first mean result and the second mean result are concatenated to obtain the fused data in the i-th row; or, the first mean result and the second mean result are averaged to obtain the fused data in the i-th row.
[0118] It should be noted that during the execution of the above steps S201-S203, if the number of feature data obtained through step S201 is multiple, the computer device can transform the data structure of each feature data when executing step S202 to obtain multiple transformed feature data; then, correspondingly, when executing step S203, the computer device can fuse the transformed time series data and the sub-data located in the same row of each transformed feature data to obtain multi-row fused data.
[0119] S204, the time series prediction network is invoked to perform time series prediction on the object data of the target object based on the multi-line fused data, and the time series prediction result is obtained.
[0120] In one implementation, as described above, each row of fused data corresponds to a target time period. The target time period corresponding to any row of fused data is obtained by extrapolating Q time points based on the latest historical time point involved in the corresponding row of data. Based on this, when the computer device executes step S204, it can call the time series prediction network to predict the object data of the target object at each time point in the corresponding target time period based on each row of fused data, and obtain the time series prediction result.
[0121] In another implementation, considering that in actual time series prediction, it is usually desired to know the object data of the target object at a future time point (a time point after the historical time period), and as can be seen from the aforementioned description of the target time period, each time point in the target time period corresponding to the last row of fused data is located after the historical time period, the computer device can select the last row of fused data from the multiple rows of fused data when executing step S204; then, it can call the time series prediction network to predict the object data of the target object at each time point in the corresponding target time period based on the last row of fused data, and obtain the time series prediction result.
[0122] In another implementation, considering that each row of fused data (excluding the last row) corresponds to a target time period in the multi-row fused data, there are one or more time points within the historical time period, then these time points all have corresponding object data (i.e., historical values) in the time series data; based on this, the computer device can first predict the object data based on the first few rows of fused data, optimize the time series prediction network based on the predicted object data and the corresponding object data in the time series data, and then call the optimized time series prediction network to predict the object data based on the last row of fused data, thereby improving the accuracy of the time series prediction results. That is, when executing step S204, the computer device can perform the following steps:
[0123] The process involves iterating through multiple rows of fused data and determining the target row of fused data for the current iteration. Next, a time-series prediction network can be invoked to predict the object data of the target object at each time point within the corresponding target time period based on the target row of fused data. If the target row of fused data is the last row of fused data, the iteration through the multiple rows of fused data can be stopped, and the time-series prediction result can be output, including the currently predicted object data. If the target row of fused data is not the last row of fused data, object data with historical time points within the corresponding target time period can be selected from the time-series data. The network parameters of the time-series prediction network are then updated based on the currently predicted object data and the selected object data, and the iteration through the multiple rows of fused data continues.
[0124] In this implementation, when updating the network parameters of the time series prediction network based on the currently predicted object data and the selected object data, the network parameters of the currently predicted object data and the selected object data can be correlated according to the time points corresponding to the currently predicted object data and the selected object data, resulting in at least one correlated data set. Each correlated data set includes one predicted object data and one selected object data, and the two object data in each correlated data set correspond to the same time point. Then, a network optimization algorithm can be used to update the network parameters of the time series prediction network based on the differences between the two object data in each correlated data set. It should be understood that in this implementation, the time series prediction network used for any prediction of object data other than the first one is the time series prediction network obtained after updating the network parameters based on the previously predicted object data.
[0125] For example, suppose the historical period is from August 1st to August 5th, with one point in time representing one day. The time-series data of the target object within this historical period is: With a backtracking step size of 3 and a prediction step size of 2, three rows of fused data can be obtained through the above steps S201-S203. The historical time points and target time periods involved in each row of fused data are shown in Table 1 below.
[0126] Table 1
[0127] The first row of merged data August 1st, August 2nd, August 3rd August 4th to August 5th 2nd row of merged data August 2nd, August 3rd, August 4th August 5th to August 6th 3rd row of merged data August 3rd, August 4th, August 5th August 6 to August 7
[0128] First, the computer device can invoke a pre-trained time-series prediction network to predict the target object's data on August 4th (represented as...) based on the first row of fused data. ) and predicted object data for the target object on August 5th (represented as ); due to the time series data The corresponding historical time point (August 4th) and The corresponding historical time point (August 5th) all fall within the target time period of August 4th to August 5th, therefore it can be selected from the time series data. and These two object data, and based on the selected and the predicted The differences between them, and the selected and the predicted The differences between the data are used to update the network parameters of the time series prediction network, and the updated network parameters are parameter A. Next, the computer device can call the time series prediction network with parameter A to predict the object data (represented as) of the target object on August 5th based on the fused data in the second row. ) and predicted object data for the target object on August 6 (represented as ); due to the time series data The corresponding historical time point (August 5th) falls within the target time period of August 5th to August 6th, therefore it can be selected from the time series data. This is a single object of data, and based on the selected... and the predicted The differences between the data are used to update the network parameters of the time series prediction network, and the updated network parameters are parameter B. Then, the computer device can call the time series prediction network with parameter B to predict the object data of the target object on August 6th (represented as...) based on the fused data in the third row. ) and predicted object data for the target object on August 7 (represented as ), thus obtaining the time series prediction results.
[0129] In another implementation, when it is desired to obtain object data of a target object at a future time point (a time point after the historical time period), considering that one or more time points in the target time period corresponding to the fused data of rows other than the last row of fused data may be located after the historical time period, the computer device can also combine the object data corresponding to these time points predicted based on the other row of fused data with the object data predicted based on the last row of fused data to obtain the final time series prediction result, thereby improving the accuracy of the time series prediction result. Based on this, when executing step S204, the computer device can perform the following steps:
[0130] First, the computer device can determine reference row fusion data related to the last row fusion data from the fusion data of multiple rows excluding the last row fusion data. The target time period corresponding to the reference row fusion data and the target time period corresponding to the last row fusion data share at least one common time point. Second, the computer device can invoke a time-series prediction network to predict object data of the target object at each time point within the corresponding target time period based on the reference row fusion data, obtaining a reference prediction result; and in addition, it can invoke the time-series prediction network to predict object data of the target object at each time point within the corresponding target time period based on the last row fusion data, obtaining a target prediction result. Then, the computer device can use at least one object data point from the reference prediction result to adjust the corresponding object data in the target prediction result, and use the adjusted target prediction result as the time-series prediction result; wherein, in the reference prediction result and the target prediction result, there is a correspondence between the two object data points at the same time point.
[0131] For example, continuing from the example shown in Table 1 above, since August 6th is a common time point between the target time periods corresponding to the second row of fused data and the third row of fused data, the second row of fused data can be used as the reference row for the third row of fused data. Secondly, the computer device can invoke the time-series prediction network to predict the object data (represented as...) of the target object on August 5th based on the second row of fused data. ) and predicted object data for the target object on August 6 (represented as ),Should and This constitutes a reference prediction result; and, the computer device can invoke the time-series prediction network to predict the object data of the target object on August 6th (represented as...) based on the fused data in row 3. ) and predicted object data for the target object on August 7 (represented as ),Should and This constitutes the target prediction result. Then, due to the reference prediction result... In the target prediction results All of these correspond to the time point of August 6th, therefore computer equipment can use the reference forecast results. In the target prediction results Make adjustments to obtain The adjusted target prediction results (by and (Constituted) as the result of time series prediction.
[0132] After obtaining the time-series prediction result through any of the above implementation methods, the time-series prediction result can be used as the basis for performing business processing in a business scenario. The business processing mentioned here can be set according to the corresponding business scenario and actual needs. For example, when the business scenario is a precipitation prediction scenario, the time-series prediction result includes: the predicted precipitation value at at least one time point (referred to as the precipitation value); then the business processing can include: drought and flood prevention processing, generating weather forecast information, etc. For example, if at least one precipitation value in the time-series prediction result is greater than a preset upper limit of precipitation, flood prevention measures can be implemented; if all precipitation values in the time-series prediction result are less than a preset lower limit of precipitation, drought prevention measures can be implemented. As another example, when the business scenario is a carbon emission prediction scenario, the time-series prediction result includes: the predicted carbon emission value at at least one time point (referred to as the carbon emission value); then the business processing can include: carbon emission alarm processing, energy conservation and emission reduction processing (such as reducing electricity consumption, reducing the use of fuel vehicles), etc. For example, if at least one carbon emission value in the time-series forecast results is greater than a preset carbon emission value, then carbon emission alarm processing or energy conservation and emission reduction processing can be performed. As another example, when the business scenario is weather forecasting, the time-series forecast results include the predicted weather temperature value at at least one time point; then the business processing can include weather temperature alarm processing, generating weather forecast information, and so on.
[0133] When performing time-series prediction on object data of a target object in a business scenario, this application embodiment uses not only the time-series data of the target object within a historical time period (object data of the target object at each historical time point within the historical time period), but also the feature data of the target object within the historical time period. Since the feature data contains the object features associated with the target object at each historical time point, and object features can affect the object data of the target object, by combining feature data and time-series data for time-series prediction, it is possible to fit the gradual and periodic characteristics of the time series, thereby improving the accuracy of the time-series prediction results. Furthermore, this embodiment of the application performs a consistency transformation on the data structure of the time series data and the data structure of the feature data, and fuses the sub-data in the same row of the transformed time series data and the transformed feature data. This allows a time series prediction network to perform time series prediction on the object data of the target object based on the fused data from multiple rows. On the one hand, this enables the time series prediction network to learn the object data and object features corresponding to the same historical time point simultaneously by learning the fused data. This improves learning efficiency and avoids misinterpreting the correspondence between object data and object features, thereby improving the efficiency and accuracy of time series prediction results. On the other hand, it allows the time series data and feature data of the target object to share the same time series prediction network. This not only enables collaborative learning between the time series data and feature data, improving the accuracy of time series prediction results, but also reduces the network complexity of the time series prediction network. This allows the time series prediction network to quickly complete time series prediction work in an end-to-end manner with a relatively simple network structure, further improving the efficiency of time series prediction.
[0134] In the above Figure 2 In the data processing method shown, the time-series prediction network can be obtained by training and updating the target neural network; the target neural network can be a pre-constructed neural network with time-series prediction capabilities, and its network structure is similar to that described above. Figure 1aThe network structure shown is consistent and may include multiple network layers such as input layer, hidden layer, and output layer, with each layer containing multiple neurons. Before training and updating the target neural network, it can be initialized according to the configuration. Key initialization operations may include, but are not limited to: ① Randomly initializing network parameters; ② Data fusion methods corresponding to different backtracking steps (such as data concatenation without transformation, (weighted) processing, summation, etc.); ③ Setting activation functions, which are functions that run on neurons in an artificial neural network and are responsible for mapping the neuron's input to its output; ④ Setting whether dropout (the operation of discarding neurons) is needed; ⑤ Setting network optimization algorithms (such as stochastic gradient descent, Adagrad (adaptive learning rate optimization algorithm), Adam (Adaptive Momentum, a stochastic optimization algorithm for adaptive momentum)), etc.
[0135] See Figure 4 As shown, the process of training a target neural network to obtain a time-series prediction network may include the following steps S401-S404:
[0136] S401, when training the target neural network, obtain the first and second data of the target object within the reference time period.
[0137] The first data includes object data of the target object at each reference time point within the reference time period; the second data includes object features associated with the target object at each reference time point. Similar to the aforementioned feature data, the number of second data points obtained by the computer device through step S401 can be one or more, and this is not limited. When there are multiple second data points, different second data points correspond to different feature dimensions, and the object features in the same second data point belong to the same feature dimension.
[0138] The reference time period mentioned here refers to the time period preceding the target time, where the target time is the moment when the target neural network needs to be trained. For example, the reference time period can be a time period determined by counting n time points backward from the target time. For instance, if one time point is one day, n equals 10, and the target neural network needs to be trained on July 12th, then the reference time period can be a time period determined by counting 10 time points backward from July 12th, i.e., the reference time period can be the time period from July 2nd to July 11th. Alternatively, the reference time period can also be a time period determined by counting n time points backward from the reference time (a time preceding the target time), without limitation. Therefore, the reference time period mentioned in the embodiments of this application can include n time points; for ease of explanation, the time points included in the reference time period are referred to as reference time points in the embodiments of this application.
[0139] In a specific implementation of step S401, the computer device can acquire a reference data sequence of the target object within a reference time period. This reference data sequence includes the following data values: object data of the target object at each reference time point within the reference time period; and acquire a reference feature sequence of the target object within the reference time period. This reference feature sequence includes the following data values: object features associated with the target object at each reference time point. The acquisition methods for the reference data sequence and reference feature sequence are the same as those for the historical data sequence mentioned above, and will not be repeated here. After acquiring the reference data sequence and reference feature sequence, the computer device directly uses the reference data sequence as the first data and the reference feature sequence as the second data. Alternatively, the computer device can also perform standardization processing on the reference data sequence to obtain the first data and on the reference feature sequence to obtain the second data; the specific method of standardization mentioned here can be found in [reference needed]. Figure 2 The relevant descriptions in the method embodiments shown will not be repeated here. The reason for standardizing the reference data sequence and reference feature sequence is that the target neural network is optimized through error, and standardization can convert the reference data sequence and reference feature sequence into first data and second data with 0 mean and 0 standard deviation, respectively. This makes the object data in the first data and the object features in the second data have the same numerical dimension, which can improve the subsequent data fusion effect, reduce the learning complexity of the target neural network during the training process, and thus enable the target neural network to converge faster.
[0140] S402, Based on the first data and the second data, construct multi-row sample data for training the target neural network.
[0141] In this system, each row of sample data corresponds to a prediction time period. Furthermore, each row of sample data is obtained by fusing object data and object features of the target object at at least one reference time point. The reference time points differ between different rows of sample data. The prediction time period corresponding to any row of sample data is obtained by extrapolating at least one time point backward from the latest reference time point. The method for determining the prediction time period mentioned here can be found in the previously mentioned method for determining the target time period, and will not be repeated here.
[0142] In the specific implementation of step S402, the computer device can perform a consistency transformation on the data structure of the first data and the data structure of the second data. The specific implementation method is the same as that of the aforementioned step S202, and will not be repeated here. Both the transformed first data and the transformed second data include multiple rows of sub-data. Each row of sub-data includes object data or object features corresponding to at least one reference time point. Furthermore, the reference time points involved in the sub-data within the same row in both the transformed first data and the transformed second data are the same. Then, the sub-data within the same row in the transformed first data and the transformed second data can be fused to obtain multiple rows of sample data for training the target neural network. The specific fusion method is the same as that of the aforementioned step S203, and will not be repeated here. It can be seen that the j-th row of sample data is obtained by fusing the j-th row of sub-data in the transformed first data and the j-th row of sub-data in the transformed second data. The value of j is greater than zero and not greater than the number of rows of sample data.
[0143] It should be noted that, during the execution of the above steps S401-S402, if the number of second data obtained through step S401 is multiple, the computer device can transform the data structure of each second data when executing step S402 to obtain multiple transformed second data, and fuse the transformed first data and the sub-data in the same row of each transformed second data to obtain multiple rows of sample data for training the target neural network.
[0144] S403, the target neural network is invoked to predict the object data of the target object in the corresponding prediction time period based on each row of sample data, and the prediction result corresponding to each row of sample data is obtained.
[0145] As mentioned above, the target neural network may include multiple neurons. If dropout is configured during the initialization of the target neural network, the computer device, when executing step S403, can discard one or more neurons in the target neural network based on the neuron discarding strategy for the j-th row of sample data. This neuron discarding strategy can be set according to actual needs; for example, it could be a strategy of randomly selecting multiple neurons to discard, or a strategy of discarding specific neurons, etc. Then, the computer device can call upon the remaining neurons in the target neural network to predict the object data of the target object at each time point within the corresponding prediction time period based on the j-th row of sample data, thus obtaining the prediction result corresponding to the j-th row of sample data.
[0146] In the process of predicting object data based on the j-th row of sample data, discarding some neurons not only improves the prediction efficiency of the target neural network but also prevents mutual interference between neurons in the target neural network, thus avoiding instability in the prediction results and overfitting. This effectively improves the training effect of the target neural network, making the final time-series prediction network more stable. It should be understood that if dropout is not required during the initialization of the target neural network, the computer device can directly call each neuron in the target neural network during step S403 to predict the object data of the target object at each time point in the corresponding prediction time period based on the j-th row of sample data, obtaining the prediction result corresponding to the j-th row of sample data.
[0147] S404. Based on the prediction results corresponding to each row of sample data and the first data, update the network parameters of the target neural network to obtain the time-series prediction network.
[0148] In one specific implementation, the computer device can first select at least one object data from the first data to construct a label for each row of sample data based on the predicted time period corresponding to each row of sample data. The reference time point corresponding to each object data in any label must be within the predicted time period corresponding to the corresponding row of sample data. For example, if the predicted time period for the j-th row of sample data is July 4th to July 5th, the reference time point for object data a in the first data is July 4th, and the reference time point for object data b in the first data is July 5th, then object data a and object data b can be selected to construct the label for the j-th row of sample data.
[0149] For each row of sample data whose prediction result is obtained, the computer device can update the network parameters of the target neural network based on the current prediction result and the corresponding label. Specifically, a loss function (such as the L2 norm loss function, cross-entropy loss function, etc.) can be used to calculate the loss value based on each object data and the corresponding label in the current prediction result. Then, a network optimization algorithm is used to update the network parameters of the target neural network based on the calculated loss value. In this implementation, the number of times the target neural network is updated can be the same as the number of rows of sample data, and the temporal prediction network can be the target neural network obtained after the last update of the target neural network parameters.
[0150] Alternatively, after obtaining the prediction results for each row of sample data, the computer device can update the network parameters of the target neural network based on the label of each row of sample data and the corresponding prediction results. Specifically, a loss function (such as the L2 norm loss function, cross-entropy loss function, etc.) can be used to calculate the loss value corresponding to each row of sample data based on the prediction results and corresponding label of each row of sample data. Next, the loss values corresponding to each row of sample data can be summed to obtain the network loss value of the target neural network. Then, a network optimization algorithm can be used to update the network parameters of the target neural network based on the network loss value. After updating the network parameters, it can be determined whether the updated target neural network has converged. If it has not converged, the process jumps to step S403 to update the network parameters of the target neural network again through steps S403-S404 until the target neural network converges. The converged target neural network is then used as the time-series prediction network. Convergence of the target neural network can mean that the number of updates to the target neural network reaches a specified number, or the network loss value of the target neural network tends to stabilize (e.g., the network loss value no longer decreases, or the decrease in the network loss value is less than a threshold), etc.
[0151] In another specific implementation, the computer device does not initially construct the labels. Instead, after obtaining the prediction result for each row of sample data, it selects at least one object data from the first data to construct the label for the target row of sample data based on the prediction time period corresponding to the target row of sample data. The specific implementation method is the same as the label construction method mentioned above, and will not be repeated here. After constructing the label for the target row of sample data, the computer device can update the network parameters of the target neural network based on the currently obtained prediction results and the label for the target row of sample data.
[0152] As can be seen from the above description, the embodiments of this application can combine the temporal information (such as first data composed of at least one object data) and feature information (such as second data composed of at least one object feature) of the target object through the target neural network to achieve collaborative learning between temporal information and feature information, rather than learning these two types of information separately. This can not only improve the accuracy of temporal prediction, but also reduce network complexity, control the network parameter space, prevent the overfitting tendency of the target neural network, make the finally trained temporal prediction network more stable, and improve the network training efficiency.
[0153] Based on the above Figure 2 and Figure 4 The method embodiment shown in this application also proposes a data processing algorithm. In this data processing algorithm, the dataset can be initially set as (y, Y, X1, X2, ..., X...). DWhere y represents the target object (or target variable); Y represents the set (y1, y2, ..., y...) consisting of object data (i.e., historical values) of the target object at at least one reference time point within the reference time period. n ), the set of y k This represents the object data (i.e., historical value) of the target object at the k-th reference time point within the reference time period, k∈[1,n]; (X1,X2,…,X…) D ) represents the set of features (covariates), where X is a feature set. d This represents the set (x1, x2, ..., xn) of object features of the target object collected within the reference time period under the d-th feature dimension (d∈[1, D], where D is a positive integer). n ), x in this set k This represents the object features of the collected target object at the k-th reference time point within the reference time period. Accordingly, the processing logic of the algorithm is as follows:
[0154] 1. Preprocessing: For (Y, X1, X2, ..., X...) D The various sets in the dataset are preprocessed to obtain a reference data sequence (the preprocessed result corresponding to Y) and D reference feature sequences (each reference feature sequence is a different X). d (The corresponding preprocessing results). The preprocessing here may include, but is not limited to, missing value imputation and outlier replacement.
[0155] a) Missing value imputation refers to filling in missing values using the historical average (i.e., the average of all data values currently included in the set); where missing values refer to missing data values. It should be understood that: for Y, the data values in the set refer to object data, meaning that in this case, missing values refer to missing object data in the set; for X... d In this context, the data values in a set refer to object characteristics; that is, missing values in this case refer to missing object characteristics in the set.
[0156] b) Outlier replacement refers to replacing outliers with the historical periodic mean (i.e., the mean among all data values currently included in the set). An outlier is an abnormal data value, defined as a data value that exceeds the mean by S standard deviations (S is a positive integer, for example, 3). In other words, if a data value's difference from the mean is greater than S standard deviations, then that data value is an outlier. It should be understood that, for Y, outliers refer to abnormal data objects in the set; for X... d In this context, outliers refer to the unusual characteristics of objects within a set;
[0157] 2. Standardization: Standardize the data sequences (i.e., reference data sequences and reference feature sequences) obtained in step 1 to obtain a first data (the standardization result corresponding to the reference data sequence) and D second data (each second data is the standardization result corresponding to a reference feature sequence).
[0158] 3. Structure Transformation: Based on the backtracking step size (how many past time points' y-values (i.e., object data) and object features are needed to predict future y-values), the data structure of each piece of data obtained in step 2 (i.e., the first data and each piece of second data) is transformed. The transformation process can be as follows:
[0159] a) Transform the first data from 1*n dimensions to (n-M+1)*M dimensions according to the backtracking step size to obtain the transformed first data; where n is the number of reference time points in the reference time period (since one reference time point corresponds to one object data, n can also be understood as the number of object data in the first data), M is the backtracking step size, each row in the transformed first data corresponds to a prediction target and its historical y-value (object data), and the prediction target corresponding to any row is determined according to the prediction step size (how many future time points of y-value need to be predicted) and the latest reference time point involved in any row;
[0160] b) Similarly, based on the backtracking step size, each second data is transformed from 1*n dimensions to (n-M+1)*M dimensions to obtain multiple transformed second data; where n is the number of reference time points in the reference time period (since one reference time point corresponds to one object data, n can also be understood as the number of object features in the second data), and each row in any transformed second data corresponds to a prediction target and the object features used.
[0161] As can be seen from the above, the logic of structural transformation lies in unifying the data dimensions of the object data (historical values) and feature data involved in each prediction target, so that the data structure of the object data and feature data involved in the network when processing each prediction target is consistent, thereby improving the processing efficiency and accuracy of the network.
[0162] 4. Data fusion: Merge the sub-data in the same row from the transformed first data obtained in step 3 and the D transformed second data.
[0163] 5. Network Initialization: Initialize the target neural network according to the configuration. The key points of network initialization are as follows:
[0164] a. Randomly initialize network parameters;
[0165] b. Data fusion methods corresponding to different backtracking step sizes (no transformation, (weighted) mean, summation, etc.);
[0166] c. Activation function;
[0167] d. Is dropout required?
[0168] e. Network optimization algorithms (stochastic gradient descent, Adagrad, Adam, etc.);
[0169] 6. Network Training: Based on the configuration conditions (such as data fusion method, network optimization algorithm, etc.) and the fusion results obtained in step 4, train the target neural network to obtain the time series prediction network, and save the time series prediction network. It should be noted that the specific training method can be found in the preceding text. Figure 4 The relevant descriptions of the method embodiments shown will not be repeated here.
[0170] 7. Network Prediction: When time-series prediction of object data for a target object is required, object data of the target object at various historical time points within a historical time period is collected to obtain an object dataset; and, under each of the D feature dimensions, object features of the target object at various historical time points within a historical time period are collected to obtain D object feature sets. Preprocessing, standardization, structural transformation, and data fusion are sequentially performed on the collected object dataset and the D object feature sets to obtain multi-line fused data. Then, the time-series prediction network saved in step 6 is used to predict the object data of the target object based on the multi-line fused data.
[0171] Based on the above description, the data processing algorithm proposed in this application embodiment can process temporal information and feature information through a single neural network. That is, object features and object data under different feature dimensions are input into the same network, rather than constructing separate networks for object features and object data under each feature dimension. This not only enables collaborative learning between temporal information and feature information, improving the accuracy of temporal prediction, but also reduces network complexity, controls the network parameter space, prevents overfitting tendencies in the target neural network, makes the final trained temporal prediction network more stable, and improves network training efficiency. Furthermore, when the aforementioned value of n is equal to 1, it indicates that the data processing algorithm supports single-dimensional input of object data and object features (such as taking the most recent historical value); when the aforementioned value of n is greater than 1, it indicates that the data processing algorithm supports multi-dimensional input of object data and object features.
[0172] Based on the description of the above data processing method embodiments, this application also discloses a data processing apparatus, which may be a computer program (including program code) running on a computer device. This data processing apparatus can execute... Figure 2 or Figure 4 The steps in the illustrated method flow are shown below. Please refer to [link / reference]. Figure 5 The data processing device can operate the following units:
[0173] The acquisition unit 501 is used to acquire time-series data and feature data of a target object in a business scenario within a historical time period. The time-series data includes: object data of the target object at each historical time point in the historical time period; the feature data includes: object features associated with the target object at each historical time point, where object features refer to features that have an impact on the object data of the target object.
[0174] Processing unit 502 is used to perform consistency transformation on the data structure of the time series data and the data structure of the feature data. The transformed time series data and the transformed feature data both include multiple rows of sub-data. Each row of sub-data includes object data or object features corresponding to at least one historical time point. In the transformed time series data and the transformed feature data, the historical time points involved in each sub-data in the same row are the same.
[0175] The processing unit 502 is further configured to fuse the sub-data located in the same row in the transformed time series data and the transformed feature data to obtain multi-row fused data;
[0176] The processing unit 502 is further configured to invoke the time-series prediction network to perform time-series prediction on the object data of the target object based on the multi-line fused data, and obtain the time-series prediction result, which is used as the basis for performing business processing in the business scenario.
[0177] In one embodiment, when processing unit 502 performs consistency transformation on the data structure of the time-series data and the data structure of the feature data, it may specifically be used for:
[0178] Obtain the backtracking step size, which indicates that the number of historical time points involved in predicting the object data of the target object is M, where M is a positive integer;
[0179] The data structure of the time series data is transformed according to the backtracking step size to obtain the transformed time series data; each row of sub-data in the transformed time series data includes: object data corresponding to M consecutive historical time points selected from the time series data;
[0180] The data structure of the feature data is transformed according to the backtracking step size to obtain the transformed feature data; each row of sub-data in the transformed feature data includes: object features corresponding to M consecutive historical time points selected from the feature data.
[0181] In another implementation, the object data in the time series data are arranged sequentially, and the historical time point corresponding to the previous object data is earlier than the historical time point corresponding to the next object data; accordingly, when the processing unit 502 transforms the data structure of the time series data according to the backtracking step size to obtain the transformed time series data, it can specifically be used to:
[0182] The Mth object data in the time series data, and the object data located after the Mth object data, are all taken as object data to be traversed;
[0183] Iterate through each object data to be iterated in the order of arrangement, and determine the currently iterated object data as the base object data.
[0184] Based on the backtracking step size and the position of the reference object data in the time series data, M object data are selected continuously from the time series data in a selection order from back to front, and the last object data among the selected M object data is the reference object data.
[0185] A row of sub-data is constructed using the selected M object data, and the process continues to traverse each object data to be traversed. After all the object data to be traversed has been traversed, the constructed sub-data is arranged vertically according to the construction order of the constructed sub-data, resulting in the transformed time series data.
[0186] In another embodiment, the processing unit 502 may also be used for:
[0187] Obtain the prediction step size, which is used to indicate: predict the object data of the target object at Q time points, where Q is a positive integer;
[0188] For any row of sub-data in the transformed time series data and the transformed feature data, the prediction target of any row of sub-data is determined according to the prediction step size and the latest historical time point involved in any row of sub-data;
[0189] The prediction target of any row of sub-data is used to indicate: predicting the object data of the target object within a target time period; the target time period is the time period obtained by extrapolating Q time points based on the latest historical time point involved in the corresponding row of sub-data.
[0190] In another implementation, a row of fused data corresponds to a target time period. The target time period corresponding to any row of fused data is obtained by extrapolating Q time points based on the latest historical time point involved in the corresponding row of data, where Q is a positive integer.
[0191] Accordingly, when the processing unit 502 invokes the time-series prediction network to perform time-series prediction on the object data of the target object based on the multi-line fused data, it can specifically be used to:
[0192] Select the last row of fused data from the multiple rows of fused data;
[0193] The time-series prediction network is invoked to predict the object data of the target object at each time point in the corresponding target time period based on the last row of fused data, and the time-series prediction result is obtained.
[0194] In another implementation, a row of fused data corresponds to a target time period. The target time period corresponding to any row of fused data is obtained by extrapolating Q time points based on the latest historical time point involved in the corresponding row of data, where Q is a positive integer.
[0195] Accordingly, when the processing unit 502 invokes the time-series prediction network to perform time-series prediction on the object data of the target object based on the multi-line fused data, it can specifically be used to:
[0196] Traverse the multi-row fused data and determine the target row of fused data for the current traversal;
[0197] The time-series prediction network is invoked to predict the object data of the target object at each time point in the corresponding target time period based on the target row fusion data;
[0198] If the target row fused data is the last row fused data, then stop traversing the multi-row fused data and output the time series prediction result, which includes the currently predicted data of each object;
[0199] If the target row fused data is not the last row fused data, then select object data whose historical time points are located within the corresponding target time period from the time series data; and update the network parameters of the time series prediction network according to the currently predicted object data and the selected object data, and continue to traverse the multi-row fused data.
[0200] In another embodiment, when processing unit 502 fuses the sub-data located in the same row of the transformed time-series data and the transformed feature data to obtain multi-row fused data, it can specifically be used for:
[0201] The i-th row of sub-data in the transformed time series data is summed with the i-th row of sub-data in the transformed feature data to obtain the i-th row of fused data.
[0202] Alternatively, the i-th row of sub-data in the transformed time series data can be concatenated with the i-th row of sub-data in the transformed feature data to obtain the i-th row of fused data.
[0203] Alternatively, the i-th row of sub-data in the transformed time series data and the i-th row of sub-data in the transformed feature data are averaged to obtain the i-th row of fused data.
[0204] Where i is greater than zero and less than or equal to the total number of rows of sub-data in the transformed time series data.
[0205] In another implementation, when acquiring time-series data and feature data of the target object within a historical time period, the acquisition unit 501 may specifically be used for:
[0206] Obtain the historical data sequence of the target object within a historical time period. The historical data sequence includes the following data values: object data of the target object at each historical time point within the historical time period.
[0207] Obtain the historical feature sequence of the target object within the historical time period. The historical feature sequence includes the following data values: the object features associated with the target object at each historical time point.
[0208] The historical data sequence is standardized to obtain time-series data, and the historical feature sequence is standardized to obtain feature data;
[0209] The standardization process for any one of the historical data sequences and the historical feature sequences includes: performing mean and standard deviation calculations on each data value in the sequence, and adjusting each data value in the sequence using the calculated mean and standard deviation.
[0210] In another implementation, when acquiring historical data sequences of a target object within a historical time period, the acquisition unit 501 may specifically be used for:
[0211] In the aforementioned business scenario, object data of the target object at various historical time points within a historical time period is collected to obtain an object dataset;
[0212] If no anomalies are detected in the object dataset, the data of each object in the object dataset is arranged in chronological order according to historical time points to obtain the historical data sequence of the target object within the historical time period.
[0213] If an anomaly is detected in the object dataset, the object dataset is corrected, and the data of each object in the corrected object dataset is arranged in chronological order according to historical time points to obtain the historical data sequence of the target object within the historical time period.
[0214] The existence of anomalies in the object dataset includes at least one of the following: the object dataset is missing object data corresponding to at least one historical time point, and the object dataset contains abnormal object data, wherein the abnormal object data refers to object data whose difference from the reference object data is greater than a data difference threshold; the correction processing of the object dataset includes at least one of the following: filling the object dataset with missing object data, and adjusting the abnormal object data in the object dataset.
[0215] In another embodiment, when the acquisition unit 501 is used to fill missing object data in the object dataset, it may be specifically used to: fill the object dataset with the mean value between the various object data currently included in the object dataset as missing object data;
[0216] In another embodiment, when the acquisition unit 501 is used to adjust the abnormal object data in the object dataset, it may specifically be used to replace the abnormal object data in the object dataset with the mean of all object data in the object dataset other than the abnormal object data.
[0217] In another embodiment, the time-series prediction network is obtained by training and updating the target neural network; correspondingly, the acquisition unit 501 can also be used to: acquire first data and second data of the target object within a reference time period when the target neural network needs to be trained; the first data includes: object data of the target object at each reference time point in the reference time period; the second data includes: object features associated with the target object at each reference time point;
[0218] The processing unit 502 can also be used to: construct multi-row sample data for training the target neural network based on the first data and the second data, wherein each row of sample data corresponds to a prediction time period; wherein each row of sample data is obtained by fusing object data and object features corresponding to at least one reference time point, the reference time points corresponding to different rows of sample data are different, and the prediction time period corresponding to any row of sample data is obtained by extrapolating at least one time point from the corresponding latest reference time point.
[0219] The processing unit 502 can also be used to: call the target neural network to predict the object data of the target object in the corresponding prediction time period based on each row of sample data, and obtain the prediction result corresponding to each row of sample data;
[0220] The processing unit 502 can also be used to update the network parameters of the target neural network based on the prediction result corresponding to each row of sample data and the first data, so as to obtain a time-series prediction network.
[0221] In another embodiment, the target neural network includes multiple neurons; correspondingly, when the processing unit 502 calls the target neural network to predict the object data of the target object in the corresponding prediction time period based on each row of sample data, and obtains the prediction result corresponding to each row of sample data, it can be specifically used for:
[0222] For the j-th row of sample data, one or more neurons are dropped in the target neural network according to the neuron drop-off strategy; wherein, the value of j is greater than zero and not greater than the number of rows of sample data;
[0223] The remaining neurons in the target neural network are invoked to predict the object data of the target object at each time point in the corresponding prediction time period based on the sample data in the j-th row, thereby obtaining the prediction result corresponding to the sample data in the j-th row.
[0224] In another embodiment, when processing unit 502 updates the network parameters of the target neural network based on the prediction result corresponding to each row of sample data and the first data, it may specifically be used to:
[0225] Based on the predicted time period corresponding to each row of sample data, at least one object data is selected from the first data to construct a label for each row of sample data; wherein, the reference time point corresponding to each object data in any label must be located within the predicted time period corresponding to the corresponding row of sample data.
[0226] For each row of sample data whose prediction result is obtained, the network parameters of the target neural network are updated based on the current prediction result and the corresponding label; or, after obtaining the prediction result for each row of sample data, the network parameters of the target neural network are updated based on the label of each row of sample data and the corresponding prediction result.
[0227] According to another embodiment of this application, Figure 5The data processing apparatus shown can be composed of individual or combined units into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The above-mentioned units are based on logical function division. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the data processing apparatus may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.
[0228] According to another embodiment of this application, the following can be achieved by running on a general-purpose computing device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM), a device capable of performing operations such as... Figure 2 or Figure 4 The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 5 The data processing apparatus shown herein, and the data processing method for implementing the embodiments of this application, are described. The computer program may be recorded on, for example, a computer-readable recording medium, loaded onto the aforementioned computing device via the same medium, and run therein.
[0229] When performing time-series prediction on object data of a target object in a business scenario, this application embodiment uses not only the time-series data of the target object within a historical time period (object data of the target object at each historical time point within the historical time period), but also the feature data of the target object within the historical time period. Since the feature data contains the object features associated with the target object at each historical time point, and object features can affect the object data of the target object, by combining feature data and time-series data for time-series prediction, it is possible to fit the gradual and periodic characteristics of the time series, thereby improving the accuracy of the time-series prediction results. Furthermore, this embodiment of the application performs a consistency transformation on the data structure of the time series data and the data structure of the feature data, and fuses the sub-data in the same row of the transformed time series data and the transformed feature data. This allows a time series prediction network to perform time series prediction on the object data of the target object based on the fused data from multiple rows. On the one hand, this enables the time series prediction network to learn the object data and object features corresponding to the same historical time point simultaneously by learning the fused data. This improves learning efficiency and avoids misinterpreting the correspondence between object data and object features, thereby improving the efficiency and accuracy of time series prediction results. On the other hand, it allows the time series data and feature data of the target object to share the same time series prediction network. This not only enables collaborative learning between the time series data and feature data, improving the accuracy of time series prediction results, but also reduces the network complexity of the time series prediction network. This allows the time series prediction network to quickly complete time series prediction work in an end-to-end manner with a relatively simple network structure, further improving the efficiency of time series prediction.
[0230] Based on the description of the above method and apparatus embodiments, this application also provides a computer device. Please refer to... Figure 6 The computer device includes at least a processor 601, an input interface 602, an output interface 603, and a computer storage medium 604. The processor 601, input interface 602, output interface 603, and computer storage medium 604 within the computer device can be connected via a bus or other means. The computer storage medium 604 can be stored in the computer device's memory. The computer storage medium 604 is used to store computer programs, which include program instructions. The processor 601 is used to execute the program instructions stored in the computer storage medium 604. The processor 601 (or CPU (Central Processing Unit)) is the computing and control core of the computer device, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve a corresponding method flow or function.
[0231] In one embodiment, the processor 601 described in this application embodiment can be used to perform a series of data processing operations, specifically including: acquiring time-series data and feature data of a target object in a business scenario within a historical time period, wherein the time-series data includes: object data of the target object at each historical time point in the historical time period; the feature data includes: object features associated with the target object at each historical time point, wherein object features refer to features that have an impact on the object data of the target object; performing a consistency transformation on the data structure of the time-series data and the data structure of the feature data, and the transformed time-series data and the transformed... The feature data includes multiple rows of sub-data. Each row of sub-data includes object data or object features corresponding to at least one historical time point. Furthermore, the historical time points involved in the sub-data within the same row of the transformed time-series data and the transformed feature data are the same. The sub-data within the same row of the transformed time-series data and the transformed feature data are fused to obtain multi-row fused data. A time-series prediction network is invoked to perform time-series prediction on the object data of the target object based on the multi-row fused data, obtaining a time-series prediction result. This time-series prediction result is used as the basis for performing business processing in the business scenario, and so on. It should be noted that the specific implementation methods of each step when the processor 601 executes the above steps can be further referred to the foregoing. Figure 2 or Figure 4 The relevant descriptions of the method embodiments shown will not be repeated here.
[0232] This application embodiment also provides a computer storage medium (memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer storage medium provides storage space that stores the operating system of the computer device. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by the processor 601. These instructions can be one or more computer programs (including program code). It should be noted that the computer storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device; optionally, it can also be at least one computer storage medium located remotely from the aforementioned processor.
[0233] In one embodiment, a processor may load and execute one or more instructions stored in a computer storage medium to achieve the aforementioned... Figure 2 or Figure 4The corresponding steps in the method embodiment shown; in specific implementation, one or more instructions in the computer storage medium can be loaded and executed by the processor as follows:
[0234] The system acquires time-series data and feature data of a target object in a business scenario within a historical time period. The time-series data includes object data of the target object at each historical time point within the historical time period. The feature data includes object features associated with the target object at each historical time point, where object features refer to features that have an impact on the object data of the target object.
[0235] The data structure of the time series data and the data structure of the feature data are subjected to a consistency transformation. The transformed time series data and the transformed feature data both include multiple rows of sub-data. Each row of sub-data includes object data or object features corresponding to at least one historical time point. Furthermore, in the transformed time series data and the transformed feature data, the historical time points involved in each sub-data in the same row are the same.
[0236] The sub-data in the same row of the transformed time-series data and the transformed feature data are fused to obtain multi-row fused data;
[0237] The timing prediction network is invoked to perform timing prediction on the object data of the target object based on the multi-line fused data, and the timing prediction result is obtained. The timing prediction result is used as the basis for performing business processing in the business scenario.
[0238] In one implementation, when performing a consistency transformation on the data structure of the time-series data and the data structure of the feature data, the one or more instructions can be loaded and executed by the processor:
[0239] Obtain the backtracking step size, which indicates that the number of historical time points involved in predicting the object data of the target object is M, where M is a positive integer;
[0240] The data structure of the time series data is transformed according to the backtracking step size to obtain the transformed time series data; each row of sub-data in the transformed time series data includes: object data corresponding to M consecutive historical time points selected from the time series data;
[0241] The data structure of the feature data is transformed according to the backtracking step size to obtain the transformed feature data; each row of sub-data in the transformed feature data includes: object features corresponding to M consecutive historical time points selected from the feature data.
[0242] In another implementation, the object data in the time series data are arranged sequentially, and the historical time point corresponding to the previous object data is earlier than the historical time point corresponding to the next object data; accordingly, when transforming the data structure of the time series data according to the backtracking step size to obtain the transformed time series data, the one or more instructions can be loaded and executed by the processor:
[0243] The Mth object data in the time series data, and the object data located after the Mth object data, are all taken as object data to be traversed;
[0244] Iterate through each object data to be iterated in the order of arrangement, and determine the currently iterated object data as the base object data.
[0245] Based on the backtracking step size and the position of the reference object data in the time series data, M object data are selected continuously from the time series data in a selection order from back to front, and the last object data among the selected M object data is the reference object data.
[0246] A row of sub-data is constructed using the selected M object data, and the process continues to traverse each object data to be traversed. After all the object data to be traversed has been traversed, the constructed sub-data is arranged vertically according to the construction order of the constructed sub-data, resulting in the transformed time series data.
[0247] In another implementation, the one or more instructions may be loaded and executed by the processor:
[0248] Obtain the prediction step size, which is used to indicate: predict the object data of the target object at Q time points, where Q is a positive integer;
[0249] For any row of sub-data in the transformed time series data and the transformed feature data, the prediction target of any row of sub-data is determined according to the prediction step size and the latest historical time point involved in any row of sub-data;
[0250] The prediction target of any row of sub-data is used to indicate: predicting the object data of the target object within a target time period; the target time period is the time period obtained by extrapolating Q time points based on the latest historical time point involved in the corresponding row of sub-data.
[0251] In another implementation, a row of fused data corresponds to a target time period. The target time period corresponding to any row of fused data is obtained by extrapolating Q time points based on the latest historical time point involved in the corresponding row of data, where Q is a positive integer.
[0252] Accordingly, when the timing prediction network is invoked to perform timing prediction on the object data of the target object based on the multi-line fused data, the one or more instructions can be loaded and executed by the processor:
[0253] Select the last row of fused data from the multiple rows of fused data;
[0254] The time-series prediction network is invoked to predict the object data of the target object at each time point in the corresponding target time period based on the last row of fused data, and the time-series prediction result is obtained.
[0255] In another implementation, a row of fused data corresponds to a target time period. The target time period corresponding to any row of fused data is obtained by extrapolating Q time points based on the latest historical time point involved in the corresponding row of data, where Q is a positive integer.
[0256] Accordingly, when the timing prediction network is invoked to perform timing prediction on the object data of the target object based on the multi-line fused data, the one or more instructions can be loaded and executed by the processor:
[0257] Traverse the multi-row fused data and determine the target row of fused data for the current traversal;
[0258] The time-series prediction network is invoked to predict the object data of the target object at each time point in the corresponding target time period based on the target row fusion data;
[0259] If the target row fused data is the last row fused data, then stop traversing the multi-row fused data and output the time series prediction result, which includes the currently predicted data of each object;
[0260] If the target row fused data is not the last row fused data, then select object data whose historical time points are located within the corresponding target time period from the time series data; and update the network parameters of the time series prediction network according to the currently predicted object data and the selected object data, and continue to traverse the multi-row fused data.
[0261] In another implementation, when fusing the sub-data in the same row of the transformed time-series data and the transformed feature data to obtain multi-row fused data, the one or more instructions can be loaded and executed by the processor:
[0262] The i-th row of sub-data in the transformed time series data is summed with the i-th row of sub-data in the transformed feature data to obtain the i-th row of fused data.
[0263] Alternatively, the i-th row of sub-data in the transformed time series data can be concatenated with the i-th row of sub-data in the transformed feature data to obtain the i-th row of fused data.
[0264] Alternatively, the i-th row of sub-data in the transformed time series data and the i-th row of sub-data in the transformed feature data are averaged to obtain the i-th row of fused data.
[0265] Where i is greater than zero and less than or equal to the total number of rows of sub-data in the transformed time series data.
[0266] In another implementation, when acquiring the time-series data and feature data of the target object within a historical time period, the one or more instructions can be loaded and executed by the processor:
[0267] Obtain the historical data sequence of the target object within a historical time period. The historical data sequence includes the following data values: object data of the target object at each historical time point within the historical time period.
[0268] Obtain the historical feature sequence of the target object within the historical time period. The historical feature sequence includes the following data values: the object features associated with the target object at each historical time point.
[0269] The historical data sequence is standardized to obtain time-series data, and the historical feature sequence is standardized to obtain feature data;
[0270] The standardization process for any one of the historical data sequences and the historical feature sequences includes: performing mean and standard deviation calculations on each data value in the sequence, and adjusting each data value in the sequence using the calculated mean and standard deviation.
[0271] In another implementation, when acquiring the historical data sequence of the target object within a historical time period, the one or more instructions can be loaded and executed by the processor:
[0272] In the aforementioned business scenario, object data of the target object at various historical time points within a historical time period is collected to obtain an object dataset;
[0273] If no anomalies are detected in the object dataset, the data of each object in the object dataset is arranged in chronological order according to historical time points to obtain the historical data sequence of the target object within the historical time period.
[0274] If an anomaly is detected in the object dataset, the object dataset is corrected, and the data of each object in the corrected object dataset is arranged in chronological order according to historical time points to obtain the historical data sequence of the target object within the historical time period.
[0275] The existence of anomalies in the object dataset includes at least one of the following: the object dataset is missing object data corresponding to at least one historical time point, and the object dataset contains abnormal object data, wherein the abnormal object data refers to object data whose difference from the reference object data is greater than a data difference threshold; the correction processing of the object dataset includes at least one of the following: filling the object dataset with missing object data, and adjusting the abnormal object data in the object dataset.
[0276] In another implementation, when filling missing object data into the object dataset, the one or more instructions can be loaded and specifically executed by the processor: the average value between the various object data currently contained in the object dataset is used as the missing object data to fill the object dataset;
[0277] When adjusting abnormal object data in the object dataset, one or more instructions may be loaded and executed by the processor: replace the abnormal object data in the object dataset with the mean of all object data except the abnormal object data.
[0278] In another implementation, the time-series prediction network is obtained by training and updating the target neural network; correspondingly, the one or more instructions can be loaded and executed by the processor:
[0279] When training a target neural network, first data and second data of the target object within a reference time period are obtained; the first data includes: object data of the target object at each reference time point in the reference time period; the second data includes: object features associated with the target object at each reference time point.
[0280] Based on the first data and the second data, a multi-row sample data for training the target neural network is constructed, with each row of sample data corresponding to a prediction time period. Each row of sample data is obtained by fusing object data and object features corresponding to at least one reference time point. The reference time points corresponding to different rows of sample data are different. The prediction time period corresponding to any row of sample data is obtained by extrapolating at least one time point backward from the corresponding latest reference time point.
[0281] The target neural network is invoked to predict the object data of the target object in the corresponding prediction time period based on each row of sample data, so as to obtain the prediction result corresponding to each row of sample data.
[0282] Based on the prediction results corresponding to each row of sample data and the first data, the network parameters of the target neural network are updated to obtain a time-series prediction network.
[0283] In another implementation, the target neural network includes multiple neurons; correspondingly, when the target neural network is invoked to predict the object data of the target object in the corresponding prediction time period based on each row of sample data, and to obtain the prediction result corresponding to each row of sample data, the one or more instructions can be loaded and executed by the processor:
[0284] For the j-th row of sample data, one or more neurons are dropped in the target neural network according to the neuron drop-off strategy; wherein, the value of j is greater than zero and not greater than the number of rows of sample data;
[0285] The remaining neurons in the target neural network are invoked to predict the object data of the target object at each time point in the corresponding prediction time period based on the sample data in the j-th row, thereby obtaining the prediction result corresponding to the sample data in the j-th row.
[0286] In another implementation, when updating the network parameters of the target neural network based on the prediction results corresponding to each row of sample data and the first data, the one or more instructions can be loaded and executed by the processor:
[0287] Based on the predicted time period corresponding to each row of sample data, at least one object data is selected from the first data to construct a label for each row of sample data; wherein, the reference time point corresponding to each object data in any label must be located within the predicted time period corresponding to the corresponding row of sample data.
[0288] For each row of sample data whose prediction result is obtained, the network parameters of the target neural network are updated based on the current prediction result and the corresponding label; or, after obtaining the prediction result for each row of sample data, the network parameters of the target neural network are updated based on the label of each row of sample data and the corresponding prediction result.
[0289] When performing time-series prediction on object data of a target object in a business scenario, this application embodiment uses not only the time-series data of the target object within a historical time period (object data of the target object at each historical time point within the historical time period), but also the feature data of the target object within the historical time period. Since the feature data contains the object features associated with the target object at each historical time point, and object features can affect the object data of the target object, by combining feature data and time-series data for time-series prediction, it is possible to fit the gradual and periodic characteristics of the time series, thereby improving the accuracy of the time-series prediction results. Furthermore, this embodiment of the application performs a consistency transformation on the data structure of the time series data and the data structure of the feature data, and fuses the sub-data in the same row of the transformed time series data and the transformed feature data. This allows a time series prediction network to perform time series prediction on the object data of the target object based on the fused data from multiple rows. On the one hand, this enables the time series prediction network to learn the object data and object features corresponding to the same historical time point simultaneously by learning the fused data. This improves learning efficiency and avoids misinterpreting the correspondence between object data and object features, thereby improving the efficiency and accuracy of time series prediction results. On the other hand, it allows the time series data and feature data of the target object to share the same time series prediction network. This not only enables collaborative learning between the time series data and feature data, improving the accuracy of time series prediction results, but also reduces the network complexity of the time series prediction network. This allows the time series prediction network to quickly complete time series prediction work in an end-to-end manner with a relatively simple network structure, further improving the efficiency of time series prediction.
[0290] It should be noted that, according to one aspect of this application, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the computer device to perform the aforementioned... Figure 2 or Figure 4 The methods are provided in various alternative ways in the illustrated method embodiments.
[0291] In addition, it should be understood that the above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application are still within the scope of this application.
Claims
1. A data processing method, characterized in that, include: Acquire time-series data and feature data of target objects in a business scenario within a historical time period, wherein the target objects are precipitation, carbon emissions, flow, weather temperature, or electron resource flow; The time-series data includes: object data of the target object at each historical time point in the historical time period; the feature data includes: object features associated with the target object at each historical time point, where object features refer to features that have an impact on the object data of the target object; Obtain the backtracking step size, which indicates that the number of historical time points involved in predicting the object data of the target object is M, where M is a positive integer; The data structure of the time series data is transformed according to the backtracking step size to obtain the transformed time series data; the data structure of the feature data is transformed according to the backtracking step size to obtain the transformed feature data; both the transformed time series data and the transformed feature data include multiple rows of sub-data, each row of sub-data in the transformed time series data includes: object data corresponding to M consecutively selected historical time points from the time series data, each row of sub-data in the transformed feature data includes: object features corresponding to M consecutively selected historical time points from the feature data, and the historical time points involved in each sub-data in the same row in the transformed time series data and the transformed feature data are the same; The sub-data in the same row of the transformed time series data and the transformed feature data are fused to obtain multi-row fused data; The timing prediction network is invoked to perform timing prediction on the object data of the target object based on the multi-line fused data, and the timing prediction result is obtained. The timing prediction result is used as the basis for performing business processing in the business scenario.
2. The method as described in claim 1, characterized in that, The object data in the time series data are arranged sequentially, and the historical time point corresponding to the previous object data is earlier than the historical time point corresponding to the next object data; the step of transforming the data structure of the time series data according to the backtracking step size to obtain the transformed time series data includes: The Mth object data in the time series data, and the object data located after the Mth object data, are all taken as object data to be traversed; Iterate through each object data to be iterated in the order of arrangement, and determine the currently iterated object data as the base object data. Based on the backtracking step size and the position of the reference object data in the time series data, M object data are selected continuously from the time series data in a selection order from back to front, and the last object data among the selected M object data is the reference object data. A row of sub-data is constructed using the selected M object data, and the process continues to traverse each object data to be traversed. After all the object data to be traversed has been traversed, the constructed sub-data is arranged vertically according to the construction order of the constructed sub-data, resulting in the transformed time series data.
3. The method as described in claim 1 or 2, characterized in that, The method further includes: Obtain the prediction step size, which is used to indicate: predict the object data of the target object at Q time points, where Q is a positive integer; For any row of sub-data in the transformed time series data and the transformed feature data, the prediction target of any row of sub-data is determined according to the prediction step size and the latest historical time point involved in any row of sub-data; The prediction target of any row of sub-data is used to indicate: predicting the object data of the target object within a target time period; the target time period is the time period obtained by extrapolating Q time points based on the latest historical time point involved in the corresponding row of sub-data.
4. The method as described in claim 1 or 2, characterized in that, Each row of fused data corresponds to a target time period. The target time period corresponding to any row of fused data is obtained by extrapolating Q time points based on the latest historical time point involved in the corresponding row of data, where Q is a positive integer. The invocation timing prediction network performs timing prediction on the object data of the target object based on the multi-line fused data, including: Select the last row of fused data from the multiple rows of fused data; The time-series prediction network is invoked to predict the object data of the target object at each time point in the corresponding target time period based on the last row of fused data, and the time-series prediction result is obtained.
5. The method as described in claim 1 or 2, characterized in that, Each row of fused data corresponds to a target time period. The target time period corresponding to any row of fused data is obtained by extrapolating Q time points based on the latest historical time point involved in the corresponding row of data, where Q is a positive integer. The invocation timing prediction network performs timing prediction on the object data of the target object based on the multi-line fused data, including: Traverse the multi-row fused data and determine the target row of fused data for the current traversal; The time-series prediction network is invoked to predict the object data of the target object at each time point in the corresponding target time period based on the target row fusion data; If the target row fused data is the last row fused data, then stop traversing the multi-row fused data and output the time series prediction result, which includes the currently predicted data of each object; If the target row fused data is not the last row fused data, then select object data whose historical time points are located within the corresponding target time period from the time series data; and update the network parameters of the time series prediction network according to the currently predicted object data and the selected object data, and continue to traverse the multi-row fused data.
6. The method as described in claim 1 or 2, characterized in that, The step of fusing the sub-data in the same row of the transformed time-series data and the transformed feature data to obtain multi-row fused data includes: The i-th row of sub-data in the transformed time series data is summed with the i-th row of sub-data in the transformed feature data to obtain the i-th row of fused data. Alternatively, the i-th row of sub-data in the transformed time series data can be concatenated with the i-th row of sub-data in the transformed feature data to obtain the i-th row of fused data. Alternatively, the i-th row of sub-data in the transformed time series data and the i-th row of sub-data in the transformed feature data are averaged to obtain the i-th row of fused data. Where i is greater than zero and less than or equal to the total number of rows of sub-data in the transformed time series data.
7. The method as described in claim 1 or 2, characterized in that, The acquisition of time-series data and feature data of the target object in the business scenario within a historical time period includes: Obtain the historical data sequence of the target object in the business scenario within a historical time period. The historical data sequence includes the following data values: the object data of the target object at each historical time point within the historical time period. Obtain the historical feature sequence of the target object within the historical time period. The historical feature sequence includes the following data values: the object features associated with the target object at each historical time point. The historical data sequence is standardized to obtain time-series data, and the historical feature sequence is standardized to obtain feature data; The standardization process for any one of the historical data sequences and the historical feature sequences includes: performing mean and standard deviation calculations on each data value in the sequence, and adjusting each data value in the sequence using the calculated mean and standard deviation.
8. The method as described in claim 7, characterized in that, The acquisition of historical data sequences of target objects within a historical time period in the business scenario includes: In business scenarios, object data of the target object is collected at various historical time points within a historical time period to obtain an object dataset; If no anomalies are detected in the object dataset, the data of each object in the object dataset is arranged in chronological order according to historical time points to obtain the historical data sequence of the target object within the historical time period. If an anomaly is detected in the object dataset, the object dataset is corrected, and the data of each object in the corrected object dataset is arranged in chronological order according to historical time points to obtain the historical data sequence of the target object within the historical time period. The existence of anomalies in the object dataset includes at least one of the following: the object dataset is missing object data corresponding to at least one historical time point, and the object dataset contains abnormal object data, wherein the abnormal object data refers to object data whose difference from the reference object data is greater than a data difference threshold; the correction processing of the object dataset includes at least one of the following: filling the object dataset with missing object data, and adjusting the abnormal object data in the object dataset.
9. The method as described in claim 8, characterized in that, The step of filling missing object data in the object dataset includes: filling the object dataset with the mean value among all the object data currently contained in the object dataset as missing object data; The step of adjusting the abnormal object data in the object dataset includes: replacing the abnormal object data in the object dataset with the mean of all object data in the object dataset excluding the abnormal object data.
10. The method as described in claim 1 or 2, characterized in that, The time-series prediction network is obtained by training and updating the target neural network, and the method further includes: When training a target neural network, first data and second data of the target object within a reference time period are obtained; the first data includes: object data of the target object at each reference time point in the reference time period; the second data includes: object features associated with the target object at each reference time point. Based on the first data and the second data, a multi-row sample data for training the target neural network is constructed, with each row of sample data corresponding to a prediction time period. Each row of sample data is obtained by fusing object data and object features corresponding to at least one reference time point. The reference time points corresponding to different rows of sample data are different. The prediction time period corresponding to any row of sample data is obtained by extrapolating at least one time point backward from the corresponding latest reference time point. The target neural network is invoked to predict the object data of the target object in the corresponding prediction time period based on each row of sample data, so as to obtain the prediction result corresponding to each row of sample data. Based on the prediction results corresponding to each row of sample data and the first data, the network parameters of the target neural network are updated to obtain a time-series prediction network.
11. The method as described in claim 10, characterized in that, The target neural network includes multiple neurons; the step of calling the target neural network to predict the object data of the target object in the corresponding prediction time period based on each row of sample data, and obtaining the prediction result corresponding to each row of sample data, includes: For the j-th row of sample data, one or more neurons are dropped in the target neural network according to the neuron drop-off strategy; wherein, the value of j is greater than zero and not greater than the number of rows of sample data; The remaining neurons in the target neural network are invoked to predict the object data of the target object at each time point in the corresponding prediction time period based on the sample data in the j-th row, thereby obtaining the prediction result corresponding to the sample data in the j-th row.
12. The method as described in claim 10, characterized in that, The step of updating the network parameters of the target neural network based on the prediction result corresponding to each row of sample data and the first data includes: Based on the predicted time period corresponding to each row of sample data, at least one object data is selected from the first data to construct a label for each row of sample data; wherein, the reference time point corresponding to each object data in any label must be located within the predicted time period corresponding to the corresponding row of sample data. For each row of sample data whose prediction result is obtained, the network parameters of the target neural network are updated based on the current prediction result and the corresponding label; or, after obtaining the prediction result for each row of sample data, the network parameters of the target neural network are updated based on the label of each row of sample data and the corresponding prediction result.
13. A data processing apparatus, characterized in that, include: The acquisition unit is used to acquire time-series data and feature data of target objects in the business scenario within a historical time period. The target objects are precipitation, carbon emissions, flow, weather temperature, or electron resource flow. The time-series data includes: object data of the target object at each historical time point in the historical time period; the feature data includes: object features associated with the target object at each historical time point, where object features refer to features that have an impact on the object data of the target object; A processing unit is configured to obtain a backtracking step size, which indicates that the number of historical time points involved in predicting the object data of the target object is M, where M is a positive integer; transform the data structure of the time series data according to the backtracking step size to obtain transformed time series data; transform the data structure of the feature data according to the backtracking step size to obtain transformed feature data; both the transformed time series data and the transformed feature data include multiple rows of sub-data, each row of sub-data in the transformed time series data includes: object data corresponding to M consecutively selected historical time points from the time series data, and each row of sub-data in the transformed feature data includes: object features corresponding to M consecutively selected historical time points from the feature data, and the historical time points involved in each sub-data in the same row of the transformed time series data and the transformed feature data are the same; The processing unit is further configured to fuse the sub-data located in the same row in the transformed time-series data and the transformed feature data to obtain multi-row fused data; The processing unit is further configured to invoke a time-series prediction network to perform time-series prediction on the object data of the target object based on the multi-line fused data, and obtain a time-series prediction result, which is used as the basis for performing business processing in the business scenario.
14. A computer device, comprising an input interface and an output interface, characterized in that, Also includes: A processor, adapted to implement one or more instructions; as well as, A computer storage medium storing one or more instructions adapted to be loaded by the processor and executed as described in any one of claims 1-12.
15. A computer storage medium, characterized in that, The computer storage medium stores one or more instructions, which are adapted to be loaded by a processor and executed by the data processing method as described in any one of claims 1-12.
16. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the data processing method as described in any one of claims 1-12.
Citation Information
Patent Citations
Business data prediction method and device, electronic equipment and storage medium
CN114202123A
Flow sequence analysis and prediction method, equipment and medium
CN114282658A