Business information prediction method and device, equipment and storage medium
By integrating external variable characteristics into the timing basic model for prediction, the problem of difficulty in using external variable information is solved, the accuracy and applicability of the model is improved, and the workload and cost are reduced.
Patent Information
- Application Number
- CN202510590754.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-08-15
AI Technical Summary
The existing timing basic models are difficult to effectively use external variable information for prediction in business scenarios such as rail transit and electricity, resulting in high retraining costs and affecting model performance.
Through independent training of the encoder, external variable information is encoded as features and fused with the target variable information, input the timing basic model for prediction, and keep the model weight unchanged.
It improves the accuracy and availability of the timing basic model in business scenarios, reduces workload and cost, has flexibility, and is suitable for a variety of business scenarios.
Smart Images

Figure CN120492928A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of deep learning, and in particular to a method, apparatus, device, and storage medium for predicting business information. Background Art
[0002] In business scenarios such as rail transit and electricity, time series basic models are used to predict future time series data in time series prediction-related tasks, such as passenger flow, electricity consumption, etc.
[0003] In order to maintain the versatility and wide applicability of the time series basic model, the time series basic model is usually trained using a single target variable information to capture the internal time dependencies and patterns of the time series data composed of the single target variable information.
[0004] In specific tasks, external variable information other than the target variable (such as weather, holidays / weekdays, etc.) will have a significant impact on the future trend of time series data. Therefore, in order to improve the performance of time series data, in some cases, the structure of the basic time series model will be modified, and the target variable and external variables will be used together to retrain the modified basic time series model.
[0005] However, retraining is labor-intensive and costly, and changes the weights of the time series base model, which may have a potential negative impact on the performance of the time series base model. Summary of the Invention
[0006] In view of this, the present invention provides a business information prediction method, device, equipment and storage medium for injecting external variables into a time series basic model without changing the weight of the time series basic model, thereby improving the performance of the time series basic model.
[0007] A first aspect of the present invention provides a method for predicting business information, comprising:
[0008] Determining a time series base model independently trained for a first variable type in multiple business scenarios, and an encoder independently trained for a second variable type in a current business scenario;
[0009] In the current business scenario, first target variable information belonging to the first variable type and first external variable information belonging to the second variable type generated in a first historical time period are collected;
[0010] collecting, in the current business scenario, second external variable information generated in a second future time period and belonging to the second variable type;
[0011] calling the encoder to encode the first external variable information into a first external variable feature and to encode the second external variable information into a second external variable feature;
[0012] Arranging the first target variable information, the first external variable feature, and the second external variable feature into a fused variable feature;
[0013] The fused variable feature is input into the time series basic model to predict the second target variable information of the first variable type generated in the second time period of the current business scenario.
[0014] A second aspect of the present invention provides a device for predicting business information, comprising:
[0015] A model determination module, configured to determine a time series base model independently trained for a first variable type in multiple business scenarios, and an encoder independently trained for a second variable type in a current business scenario;
[0016] a historical variable information collection module, configured to collect, in the current business scenario, first target variable information belonging to the first variable type and first external variable information belonging to the second variable type generated within a first historical time period;
[0017] a future variable information collection module, configured to collect, in the current business scenario, second external variable information of the second variable type generated within a second future time period;
[0018] an external variable encoding module, configured to call the encoder to encode the first external variable information into a first external variable feature and to encode the second external variable information into a second external variable feature;
[0019] a variable arrangement module, configured to arrange the first target variable information, the first external variable feature, and the second external variable feature into a fused variable feature;
[0020] The target variable prediction module is used to input the fused variable feature into the time series basic model to predict the second target variable information of the first variable type generated in the current business scenario within the second time period.
[0021] A third aspect of the present invention provides an electronic device, comprising:
[0022] at least one processor; and
[0023] a memory communicatively connected to the at least one processor; wherein,
[0024] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the business information prediction method as described in the first aspect above.
[0025] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method for predicting business information as described in the first aspect above.
[0026] A fifth aspect of the present invention provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the method for predicting business information as described in the first aspect.
[0027] In this embodiment, a time series base model independently trained for a first variable type in multiple business scenarios and an encoder independently trained for a second variable type in a current business scenario are determined; first target variable information belonging to the first variable type and first external variable information belonging to the second variable type generated in a first historical time period are collected in the current business scenario; second external variable information belonging to the second variable type generated in a second future time period are collected in the current business scenario; the encoder is called to encode the first external variable information into a first external variable feature and the second external variable information into a second external variable feature; the first target variable information, the first external variable feature, and the second external variable feature are arranged into a fused variable feature; and the fused variable feature is input into the time series base model to predict the second target variable information belonging to the first variable type generated in the second time period in the current business scenario. This embodiment uses external variable information to enhance the target variable information with external information prompts, and utilizes the contextual learning capability of the time series base model to inject the external variable information into the time series base model without changing the weight of the time series base model and maintaining the performance of the time series base model, thereby effectively improving the accuracy and usability of the time series base model in the business scenario.
[0028] Moreover, different external variable information can be introduced in different business scenarios, which has high flexibility. The work mainly involves encoders, which has less workload and low cost.
[0029] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0031] Figure 1 This is a flowchart of a method for predicting business information provided by Example 1 of the present invention.
[0032] Figure 2 This is an architectural diagram of a timing basic model and encoder provided in Example 1 of the present invention.
[0033] Figure 3 This is a schematic diagram of processing time series data using an autoregressive time series basic model provided in Example 1 of the present invention.
[0034] Figure 4 This is a schematic diagram of processing time series data using a time series basic model under the masking and completion type provided in the first embodiment of the present invention.
[0035] Figure 5 This is an example diagram of collecting target variable information and external variable information provided by the first embodiment of the present invention.
[0036] Figure 6 This is a schematic diagram of an orchestration operation provided in Example 1 of the present invention.
[0037] Figure 7 It is a structural diagram of a business information prediction device provided by the second embodiment of the present invention.
[0038] Figure 8 This is a structural diagram of an electronic device provided in Example 3 of the present invention. DETAILED DESCRIPTION
[0039] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0040] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can cover sequential implementations other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0041] Example 1
[0042] See also Figure 1 , shows a flow chart of a method for predicting business information provided by the first embodiment of the present invention. The method can be executed by a business information prediction device. The business information prediction device can be implemented in the form of hardware and / or software. The business information prediction device can be configured in an electronic device. Figure 1 As shown, the method includes:
[0043] Step 101: Determine a time series basic model independently trained for a first variable type in multiple business scenarios, and an encoder independently trained for a second variable type in a current business scenario.
[0044] In multiple business scenarios, one or more variable information (time series data) under the first variable type can be set as the prediction target. In this case, the variable information is recorded as the target variable information.
[0045] Among them, time series data, also known as time series data, is a collection of data points arranged in chronological order. It is usually collected at fixed time intervals (also known as time steps). Each data point is associated with a specific timestamp and can be applied to business scenarios such as transportation, finance, meteorology, and medical care.
[0046] For example, in rail transit (business scenario), the variable information under the first variable type is passenger flow, operating parameters of shield doors (such as vibration signals), etc. In substations (business scenarios), the variable information under the first variable type is the power of generator sets, user electricity consumption, etc.
[0047] like Figure 2 As shown, in an offline environment, the variable information as the target under the first variable type can be used as labels and samples to pre-train the time series basic model.
[0048] The so-called time series basic model refers to a deep learning model that is pre-trained on a large amount of time series data across business scenarios. It has strong in-context learning capabilities (ICL) and can perform analytical tasks such as predicting time series without additional training.
[0049] Among them, contextual learning ability refers to the ability of the time series base model to dynamically adjust its prediction behavior by analyzing the time series context information (such as historical sequences, prompts or examples) in the input data without updating its internal weights. This ability enables the time series base model to quickly adapt to new tasks or data distributions without explicit retraining.
[0050] In one case, the type of the time series base model is autoregressive. The Chronos model is used as an example of an autoregressive model. The Chronos model adopts a Transformer-based encoder-decoder architecture and uses cross-entropy loss during training to predict the next time step of single variable information.
[0051] like Figure 3 As shown, given the historical time series data x(1), x(2), ..., x(t) of variable information x for t time steps, the autoregressive model can predict the variable information x(t+1) at the next time step t+1. The Chronos model pre-training uses public datasets and synthetic data, covering business scenarios in multiple fields such as finance, meteorology, and healthcare, with a total scale of 8.4 billion observations. It can directly predict unseen datasets in multiple business scenarios without fine-tuning.
[0052] Since the Chronos model only supports the input of historical values of a single variable information as a target, it cannot consider the impact of external variables on the variable information as a target.
[0053] In another case, the type of the time series basic model is the masking and completion type. The Moirai model is used as an example of the masking and completion type. The Moirai model adopts the Transformer-based encoder-decoder architecture to randomly mask the time series data (replacing the original value with a placeholder [mask] to form a missing value), and predict the missing values in the time series data to complete pre-training. When applying the Moirai model, the position to be predicted in the time series is masked (that is, the placeholder [mask]) to generate the corresponding predicted value.
[0054] like Figure 4As shown in the figure, in order to process multivariate information, the time series data of multivariate information is usually flattened into single time series data and input into the Moirai model. For example, given the variable information x1, x2, x3, the time series data x1(1), x1(2), ..., x1(t), [mask], the time series data x2(1), x2(2), ..., x2(t+1), and the time series data x3(1), x3(2), ..., x3(t+1) are concatenated and input into the Moirai model, and the Moirai model predicts x1(t+1).
[0055] The Moirai model's pre-training data contains 27 billion observations, covering business scenarios in nine major fields such as retail and healthcare. It can directly predict unseen data sets in multiple business scenarios without fine-tuning.
[0056] Although the Moirai model can be extended to time series data of any variable information, it flattens the time series data of multivariate information into time series data of single variable information for processing, and is essentially still a time series basic model of single variable information.
[0057] When considering N (N is a positive integer) variable information, the sequence length of the input Moirai model is N+1 times the length of the variable information. Since the computational complexity of the Transformer self-attention mechanism is proportional to the square of the sequence length, the computational complexity at this time is (N+1) when predicting a single variable information. 2 times, which may lead to insufficient computing resources or slow computing speed. Therefore, the number of variable information used in training the Moirai model is usually one.
[0058] When applying a time series basic model applicable to multiple business scenarios to the current business scenario, one or more variable information under the second variable type can be set for the prediction task of the current business scenario, and the variable information used as the target under the first variable type can be enhanced with external information prompts. By utilizing the contextual learning ability of the time series basic model, external variable information can be injected into the time series basic model without changing the weight of the time series basic model, which will effectively improve the accuracy and usability of the time series basic model in this business scenario.
[0059] The so-called external information prompt enhancement refers to the introduction of additional external variable information into the time series basic model during the inference stage to improve the predictive ability of the time series basic model. These external variable information can be related time series data, contextual information, etc.
[0060] The variable information under the second variable type may be set by technicians based on experience, or may be set based on a correlation coefficient with the variable information under the first variable type, etc. This embodiment does not impose any restrictions on this.
[0061] For example, in rail transit (business scenario), the variable information under the second variable type is weather data, holidays / working days, etc. In substations (business scenarios), the variable information under the second variable type is weather data (especially sunshine, wind power, etc.), holidays / working days, etc.
[0062] In order to minimize the amount of data finally input into the time series basic model, in an offline environment, the encoder can be independently trained using the external variable information under the second variable type as a sample, and the external encoder can be used to reduce the dimension of the external variable information into a time series data.
[0063] The so-called independence means that the training process of the time series basic model is independent of the training process of the encoder. After the initial pre-training of the time series basic model is completed, appropriate external variable information can be selected according to the business scenario to train the encoder.
[0064] Exemplarily, the encoder may include a machine learning model, such as a random forest, a linear regression model, etc., and may also include a deep learning model, such as an LSTM (Long Short-Term Memory), a GRU (Gated Recurrent Unit), etc., which is not limited in this embodiment.
[0065] Furthermore, in order to make the external variable information contain as much information as possible related to the target variable information during encoding, and at the same time be in a similar distribution range as the target variable information, an encoder independent of the time series basic model can be trained using the target variable information under the first variable type as a label and the external variable information under the second variable type as a sample.
[0066] Among them, since the time series basic model is trained for the variable information as the target under the first variable type, keeping the external variable information under the second variable type in the same or similar distribution range as the variable information as the target under the first variable type will help the time series basic model to correctly understand and process the external variable information under the second variable type.
[0067] In addition, the length of the external variable information is limited to the same as the length of the target variable information, so that the total length of the two after splicing is twice the length of the target variable information, ensuring that the additional computational cost of the time series basic model is within a limited range.
[0068] In a specific implementation, first sample variable information belonging to a first variable type and second sample variable information belonging to a second variable type generated within the same time range are collected in the current business scenario.
[0069] The second sample variable information is input into the encoder and encoded into sample variable features.
[0070] At this point, the encoding process can be expressed as:
[0071]
[0072] in, is the encoder (such as random forest, etc.), x 1:N (t) is the second sample variable information at time t, is the sample variable characteristic at time t.
[0073] The preset loss function is used to calculate the difference between the first sample variable information and the sample variable characteristics as the loss value, and then the corresponding optimization algorithm is used to update the encoder according to the loss value until the performance of the encoder meets the training requirements.
[0074] Among them, for machine learning models, taking random forest as an example, optimization algorithms include decision tree generation algorithm, decision tree pruning algorithm, etc. For deep learning models, optimization algorithms include SGD (stochastic gradient descent), Adam (Adaptive momentum), etc.
[0075] Exemplarily, the loss value includes the mean square error. In this case, the process of updating the encoder can be expressed as:
[0076]
[0077] in, For encoder The weight of x 1:N (t) is the second sample variable information, is the sample variable feature, x0 is the first sample variable information, argmin represents the independent variable value that the loss function obtains the minimum value in its domain (i.e. ).
[0078] Step 102: Collect first target variable information of a first variable type and first external variable information of a second variable type generated in a first historical time period in the current business scenario.
[0079] In this embodiment, if Figure 2As shown, various historical information generated in the current business scenario can be collected and recorded using logs or other means. When executing tasks related to time series prediction, on the one hand, first target variable information generated in one or more first time periods and belonging to the first variable type is filtered out from various information in the historical records. On the other hand, first external variable information generated in one or more first time periods and belonging to the second variable type is filtered out from various information in the historical records.
[0080] The first time period is before the current time, and the first target variable information and the first external variable information are variable information generated within the same first time period.
[0081] When there are multiple first time periods, the lengths of the first time periods may be equal or unequal, and this embodiment does not impose any limitation on this.
[0082] In a specific implementation, target events related to the target variable information can be determined in the current business scenario. The target events occur less frequently, for example, specific holidays in rail transit (such as National Day, Labor Day, etc.), extreme weather (such as typhoons, etc.), and so on.
[0083] Determine whether a target event occurs in the current business scenario within a second time period in the future.
[0084] If the target event does not occur in the current business scenario within the second time period in the future, the specified historical time length is intercepted backward with the current time as the end point to obtain the first time period of history.
[0085] In the current business scenario, first target variable information belonging to a first variable type and first external variable information belonging to a second variable type generated in a first time period are collected.
[0086] like Figure 5 As shown, if the target event Event occurs in the current business scenario within the future second time period T2, the specified historical time length is intercepted backward with the current time as the end point to obtain the historical first time period T1.
[0087] The query history is used to find the first time point at which one or more target events (especially the most recent one or more target events) occur.
[0088] Each first time point is traversed to construct a first time period T1 including the first time point.
[0089] For example, Figure 5As shown, the second time point at which the target event occurs is queried within the second time period, the first segment duration between the second time point and the end point of the second time period is calculated, the historical duration of the first time period is added to the future duration of the second time period to obtain the total duration, and the first segment duration is subtracted from the total duration to obtain the second segment duration.
[0090] In this example, let the duration of the first segment be ΔT e , the historical length of the first time period is T h , the future duration of the second time period is T f , then the duration of the second segment is (T h +T f -ΔT e ).
[0091] For each first time point, taking the first time point as a base point, the first segment duration is cut forward and the second segment duration is cut backward to obtain a first time period T1 including the first time point.
[0092] In the current business scenario, first original variable information belonging to the first variable type and second original variable information belonging to the second variable type generated in each first time period T1 are collected.
[0093] The first original variable information is spliced into the first target variable information in chronological order, and the second original variable information is spliced into the first external variable information in chronological order.
[0094] Among them, the splicing method of the first original variable information is the same as the splicing method of the second original variable information. For example, the earlier the first time period, the higher the first original variable information is ranked, and the higher the second original variable information is ranked. Conversely, the later the first time period, the later the first original variable information is ranked, and the later the second original variable information is ranked.
[0095] In this embodiment, for external target events, additional cross-time period data retrieval is added, and the first target variable information and the first external variable information related to the target event are added, which is beneficial for the time series basic model to take into account the relationship between the historical target event pre-data and the historical target event inter-event data, thereby using the most recent target event pre-data to predict the inter-target event data.
[0096] Step 103: Collect second external variable information of a second variable type generated in a second future time period in the current business scenario.
[0097] like Figure 2 As shown, in the current business scenario, second external variable information of a second variable type generated in a second time period in the future may be collected.
[0098] The second time period is a period after the current time, especially a period starting from the current time.
[0099] Furthermore, the second external variable information can be variable information that is explicitly generated in a second time period in the future and belongs to the second variable type, such as holidays / working days, rail transit passenger flow restriction measures, rail transit extended closing time measures, etc., or it can be variable information that is predictively generated in a second time period in the future and belongs to the second variable type, such as weather data, etc. This embodiment does not impose any restrictions on this.
[0100] Step 104: Call an encoder to encode the first external variable information into a first external variable feature, and encode the second external variable information into a second external variable feature.
[0101] In this embodiment, if Figure 2 As shown, the first external variable information is input into the encoder and encoded as the first external variable feature, and the second external variable information is input into the encoder and encoded as the second external variable feature, thereby quickly reducing the dimension of any number of external variable information (including the first external variable information and the second external variable information) to a single external variable feature (including the first external variable feature and the second external variable feature).
[0102] Furthermore, if an encoder independent of the time series basic model is first trained with the variable information of the target under the first variable type as a label and the external variable information under the second variable type as a sample, the first external variable information can be input into the encoder and encoded as a first external variable feature, so that the first external variable feature tends to the first target variable information in terms of distribution range, and the second external variable information can be input into the encoder and encoded as a second external variable feature, so that the second external variable feature tends to the second target variable information of the first variable type generated in the second time period in the current business scenario in terms of distribution range.
[0103] When encoded, the first external variable information and the second external variable information contain as much information as possible related to the first target variable information and the second target variable information, and are at the same time in a similar distribution range to the first target variable information and the second target variable information, so as to facilitate the time series basic model to correctly understand and process the first external variable information, the second external variable information and the first target variable information, thereby improving the accuracy of predicting the second target variable information.
[0104] In addition, the length of the first external variable information is the same as the length of the first target variable information, and the length of the second external variable information is the same as the length of the second target variable information, so that the total length of the first external variable information and the first target variable information, and the second external variable information and the second target variable information after splicing is twice the length of the first target variable information and the second target variable information, ensuring that the additional calculation amount caused to the time series basic model is within a limited range.
[0105] Step 105: Arrange the first target variable information, the first external variable feature, and the second external variable feature into a fused variable feature.
[0106] Step 106: Input the fused variable features into the time series basic model to predict the second target variable information of the first variable type generated in the second time period in the current business scenario.
[0107] Different types of time series basic models have different requirements for input data. Therefore, in this embodiment, Figure 2 As shown, the first target variable information, the first external variable characteristics and the second external variable characteristics can be arranged into structured data according to the requirements of different types of time series basic models, so that the structured data that meets the requirements (i.e., the first target variable information, the first external variable characteristics and the second external variable characteristics) are input into the time series basic model to predict the second target variable information belonging to the first variable type generated in the second time period in the current business scenario.
[0108] Further, if Figure 6 As shown, the first target variable information T1 and the first external variable feature O1 can be interleaved time step by time step, and the second target variable information T2 and the second external variable feature O2 can be interleaved time step by time step, which directly demonstrates to the time series basic model the causal relationship between the external variable features (i.e., the first external variable feature O1 and the second external variable feature O2) and the target variable information (i.e., the first target variable information T1 and the second target variable information T2) at the same time step, which is beneficial for the time series basic model to use context learning capabilities to infer the impact of future external variable features on target variable information, thereby improving the accuracy of predicting target variable information.
[0109] The so-called staggered arrangement means that the first target variable information T1 and the first external variable feature O1 at the same time step are arranged adjacent to each other, and the second target variable information T2 and the second external variable feature O2 at the same time step are arranged adjacent to each other. In some cases, a specified placeholder (such as "[mask]") is used to replace the second external variable feature T2.
[0110] In one case, if the type of the time series basic model is autoregressive, then during arrangement, the first external variable feature and the first target variable information at the same time step are arranged adjacent to each other to obtain the first historical variable feature, and the second external variable feature currently at the next time step is spliced into the first historical variable feature to obtain the fused variable feature.
[0111] Then, during prediction, the fused variable features are input into the time series basic model to predict the first target variable value of the first variable type generated in the next time step in the second time period of the current business scenario. At this time, the second external variable features generated in the next time step in the fused variable features are arranged adjacent to the first target variable value.
[0112] Determine whether all the second external variable features have been spliced; if so, splice the first target variable values under multiple time steps in chronological order into the second target variable information generated by the current business scenario within the second time period; if not, return to the arranged operation and execute the step of splicing the second external variable feature currently in the next time step into the first historical variable feature to obtain the fused variable feature, and repeat this cycle until all the second external variable features are spliced.
[0113] In another case, if the type of the time series basic model is the masking and completion type, then during arrangement, the first external variable feature and the first target variable information at the same time step are arranged adjacent to each other to obtain the second historical variable feature.
[0114] A plurality of time-step placeholders (eg, "[mask]") are generated for the second time period, wherein the number of placeholders (ie, time steps) is equal to the number of second external variable features (ie, time steps).
[0115] Arrange the second external variable features at the same time step adjacent to the placeholder to obtain the future variable features.
[0116] The second historical variable feature and the future variable feature are spliced into a fusion variable feature in chronological order.
[0117] Then, during prediction, the fused variable features are input into the time series basic model, and multiple placeholders are replaced with the second target variable values of the first variable type generated by multiple time steps in the second time period of the current business scenario.
[0118] The second target variable values of the replacement placeholders at multiple time steps are extracted from the third fusion variable features output by the time series basic model, and the second target variable values at multiple time steps are spliced in chronological order into the second target variable information generated by the current business scenario in the second time period.
[0119] In this embodiment, a time series base model independently trained for a first variable type in multiple business scenarios and an encoder independently trained for a second variable type in a current business scenario are determined; first target variable information belonging to the first variable type and first external variable information belonging to the second variable type generated in a first historical time period are collected in the current business scenario; second external variable information belonging to the second variable type generated in a second future time period are collected in the current business scenario; the encoder is called to encode the first external variable information into a first external variable feature and the second external variable information into a second external variable feature; the first target variable information, the first external variable feature, and the second external variable feature are arranged into a fused variable feature; and the fused variable feature is input into the time series base model to predict the second target variable information belonging to the first variable type generated in the second time period in the current business scenario. This embodiment uses external variable information to enhance the target variable information with external information prompts, and utilizes the contextual learning capability of the time series base model to inject the external variable information into the time series base model without changing the weight of the time series base model and maintaining the performance of the time series base model, thereby effectively improving the accuracy and usability of the time series base model in the business scenario.
[0120] Moreover, different external variable information can be introduced in different business scenarios, which has high flexibility. The work mainly involves encoders, which has less workload and low cost.
[0121] Example 2
[0122] See also Figure 7 , shows a schematic diagram of the structure of a business information prediction device provided by the second embodiment of the present invention. Figure 7 As shown, the device includes:
[0123] A model determination module 701 is configured to determine a time series base model independently trained for a first variable type in multiple business scenarios, and an encoder independently trained for a second variable type in a current business scenario;
[0124] A historical variable information collection module 702 is configured to collect, in the current business scenario, first target variable information of the first variable type and first external variable information of the second variable type generated within a first historical time period;
[0125] A future variable information collection module 703 is configured to collect, in the current business scenario, second external variable information of the second variable type generated within a second future time period;
[0126] An external variable encoding module 704 is configured to call the encoder to encode the first external variable information into a first external variable feature and to encode the second external variable information into a second external variable feature;
[0127] A variable arrangement module 705 is configured to arrange the first target variable information, the first external variable feature, and the second external variable feature into a fused variable feature;
[0128] The target variable prediction module 706 is used to input the fused variable feature into the time series basic model to predict the second target variable information of the first variable type generated in the current business scenario within the second time period.
[0129] In one embodiment of the present invention, the historical variable information collection module 702 includes:
[0130] A target event determination module, configured to determine a target event in the current business scenario;
[0131] A first interception module is configured to intercept a specified historical time period backward from the current time as an end point to obtain a first historical time period if the target event does not occur in the current business scenario within a second future time period;
[0132] a single-period variable information collection module, configured to collect, in the current business scenario, first target variable information of the first variable type and first external variable information of the second variable type generated within the first time period;
[0133] A second interception module is configured to intercept a specified historical time period backward from the current time as an end point to obtain a first historical time period if the target event occurs in the current business scenario within a second time period in the future;
[0134] A first time point query module, used to query the first time point at which the target event occurred in history;
[0135] a time period construction module, configured to construct a first time period including the first time point;
[0136] a multi-period variable information collection module, configured to collect, in the current business scenario, first original variable information of the first variable type and second original variable information of the second variable type generated in each of the first time periods;
[0137] a target variable information splicing module, configured to splice each of the first original variable information into first target variable information in chronological order;
[0138] The external variable information splicing module is used to splice each of the second original variable information into the first external variable information in chronological order.
[0139] In one embodiment of the present invention, the time period construction module includes:
[0140] A second time point query module, configured to query a second time point at which the target event occurs within the second time period;
[0141] a segment duration calculation module, configured to calculate a first segment duration between the second time point and the end point of the second time period;
[0142] a total duration calculation module, configured to add the historical duration of the first time period to the future duration of the second time period to obtain a total duration;
[0143] a segment duration calculation module, configured to subtract the first segment duration from the total segment duration to obtain a second segment duration;
[0144] The time extension module is used to take the first time point as a base point, cut the first segment length forward and cut the second segment length backward to obtain a first time period including the first time point.
[0145] In one embodiment of the present invention, it further comprises:
[0146] A sample variable information collection module is used to collect first sample variable information belonging to a first variable type and second sample variable information belonging to a second variable type generated within the same time range in a current business scenario;
[0147] Sample variable feature encoding, used for inputting the second sample variable information into an encoder and encoding it into a sample variable feature;
[0148] a loss value calculation module, configured to calculate the difference between the first sample variable information and the sample variable feature as a loss value;
[0149] An encoder updating module, configured to update the encoder according to the loss value;
[0150] The encoder includes a random forest and the loss value includes a mean squared error.
[0151] In one embodiment of the present invention, the external variable encoding module 704 includes:
[0152] a first distribution encoding module, configured to input the first external variable information into the encoder and encode it into a first external variable feature, so that the first external variable feature tends to the first target variable information in terms of distribution range;
[0153] The second distribution encoding module is used to input the second external variable information into the encoder and encode it into a second external variable feature, so as to use the second external variable feature to tend to the second target variable information of the first variable type generated by the current business scenario within the second time period in terms of distribution range.
[0154] In one embodiment of the present invention, the variable arrangement module 705 includes:
[0155] a first staggered arrangement module, configured to arrange the first external variable features and the first target variable information adjacent to each other at the same time step to obtain a first historical variable feature if the type of the time series basic model is an autoregressive type;
[0156] an external variable splicing module, configured to splice the second external variable feature currently at the next time step into the first historical variable feature to obtain a fused variable feature;
[0157] The target variable prediction module 706 includes:
[0158] A time step prediction module, configured to input the first fused variable feature into the time series basic model to predict a first target variable value of the first variable type generated in the next time step of the current business scenario in the second time period if the splicing is completed;
[0159] A splicing judgment module, used to judge whether all the second external variable features have been spliced; if so, execute the time step splicing module; if not, return to execute the external splicing module;
[0160] The first time step splicing module is used to splice the first target variable values under multiple time steps into the second target variable information generated by the current business scenario within the second time period.
[0161] In one embodiment of the present invention, the variable arrangement module 705 includes:
[0162] a second staggered arrangement module, configured to arrange the first external variable features and the first target variable information at the same time step adjacent to each other to obtain second historical variable features if the type of the time series basic model is a masking and completion type;
[0163] a placeholder generating module, configured to generate placeholders for a plurality of time steps for the second time period;
[0164] a placeholder replacement module, configured to arrange the second external variable feature and the placeholder adjacent to each other at the same time step to obtain a future variable feature;
[0165] A third staggered arrangement module is used to splice the second historical variable feature and the future variable feature into a fused variable feature;
[0166] The target variable prediction module 706 includes:
[0167] a variable value replacement module, configured to input the fused variable feature into the time series basic model and replace the plurality of placeholders with second target variable values of the first variable type generated by the current business scenario at multiple time steps in the second time period;
[0168] The second time step splicing module is used to splice the second target variable values under multiple time steps into the second target variable information generated by the current business scenario within the second time period.
[0169] The business information prediction device provided by the embodiment of the present invention can execute the business information prediction method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the business information prediction method.
[0170] Example 3
[0171] See also Figure 8 , which shows a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, blade servers, mainframe computers, and other suitable computers. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0172] like Figure 8 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0173] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0174] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, a digital signal processor (DSP), and any other suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the method for predicting business information.
[0175] In some embodiments, the method for predicting business information may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method for predicting business information described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the method for predicting business information in any other appropriate manner (e.g., by means of firmware).
[0176] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0177] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0178] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0179] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0180] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0181] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0182] Example 4
[0183] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the method for predicting business information provided by any embodiment of the present invention.
[0184] The computer program product may be implemented by writing computer program code for performing the operations of the present invention in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0185] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0186] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A method for predicting business information, characterized in that: include: Determining a time series base model independently trained for a first variable type in multiple business scenarios, and an encoder independently trained for a second variable type in a current business scenario; In the current business scenario, first target variable information belonging to the first variable type and first external variable information belonging to the second variable type generated in a first historical time period are collected; collecting, in the current business scenario, second external variable information generated in a second future time period and belonging to the second variable type; calling the encoder to encode the first external variable information into a first external variable feature and to encode the second external variable information into a second external variable feature; Arranging the first target variable information, the first external variable feature, and the second external variable feature into a fused variable feature; The fused variable feature is input into the time series basic model to predict the second target variable information of the first variable type generated in the second time period of the current business scenario.
2. The method according to claim 1, characterized in that The collecting of first target variable information belonging to the first variable type and first external variable information belonging to the second variable type generated in a first historical time period in the current business scenario includes: Identify target events in the current business scenario; If the target event does not occur in the current business scenario within the second time period in the future, then the specified historical time period is intercepted backward from the current time to obtain the first time period of history; collecting, in the current business scenario, first target variable information belonging to the first variable type and first external variable information belonging to the second variable type generated within the first time period; If the target event occurs in the current business scenario within the second time period in the future, then the specified historical time period is intercepted backward from the current time to obtain the first historical time period; Query the first time point in the history where the target event occurs; constructing a first time period including the first time point; Collecting, in the current business scenario, first original variable information belonging to a first variable type and second original variable information belonging to a second variable type generated in each of the first time periods; splicing the first original variable information into first target variable information in chronological order; The second original variable information is spliced into first external variable information in chronological order.
3. The method according to claim 2, characterized in that The constructing includes a first time period at the first time point, including: Querying a second time point at which the target event occurs within the second time period; Calculating the duration of a first segment between the second time point and the end point of the second time period; Add the historical duration of the first time period to the future duration of the second time period to obtain the total duration; Subtract the duration of the first segment from the total duration to obtain the duration of the second segment; Taking the first time point as a base point, the first segment duration is cut forward and the second segment duration is cut backward to obtain a first time period including the first time point.
4. The method according to claim 1, wherein Also includes: Collecting first sample variable information belonging to a first variable type and second sample variable information belonging to a second variable type generated within the same time range in the current business scenario; Inputting the second sample variable information into an encoder and encoding it into a sample variable feature; Calculating the difference between the first sample variable information and the sample variable feature as a loss value; updating the encoder according to the loss value; The encoder includes a random forest and the loss value includes a mean squared error.
5. The method according to claim 4, characterized in that The calling the encoder to encode the first external variable information into a first external variable feature and the encoding the second external variable information into a second external variable feature includes: Inputting the first external variable information into the encoder and encoding it into a first external variable feature, so that the first external variable feature tends to the first target variable information in terms of distribution range; The second external variable information is input into the encoder and encoded into a second external variable feature, so as to use the second external variable feature to tend towards the second target variable information of the first variable type generated in the second time period in the current business scenario in terms of distribution range.
6. The method according to any one of claims 1 to 5, characterized in that The step of interlacing and arranging the first target variable information, the first external variable feature, and the second external variable feature into a fused variable feature includes: If the type of the time series basic model is an autoregressive type, the first external variable feature and the first target variable information at the same time step are arranged adjacent to each other to obtain a first historical variable feature; splicing the second external variable feature currently at the next time step into the first historical variable feature to obtain a fused variable feature; The step of inputting the fused variable feature into the time series basic model to predict second target variable information of the first variable type generated in the second time period of the current business scenario includes: Inputting the fused variable feature into the time series basic model to predict the first target variable value of the first variable type generated in the next time step of the current business scenario in the second time period; Determine whether all the second external variable features have been spliced; if so, splice the first target variable values under multiple time steps into the second target variable information generated by the current business scenario within the second time period; if not, return to execute the splicing of the second external variable feature currently in the next time step into the first historical variable feature to obtain a fused variable feature.
7. The method according to any one of claims 1 to 5, characterized in that The step of interlacing and arranging the first target variable information, the first external variable feature, and the second external variable feature into a fused variable feature includes: If the type of the time series basic model is the masking and completion type, the first external variable feature and the first target variable information at the same time step are arranged adjacent to each other to obtain a second historical variable feature; generating a plurality of time step placeholders for the second time period; Arranging the second external variable feature and the placeholder adjacent to each other at the same time step to obtain a future variable feature; splicing the second historical variable feature and the future variable feature into a fused variable feature; The step of inputting the fused variable feature into the time series basic model to predict second target variable information of the first variable type generated in the second time period of the current business scenario includes: Inputting the fused variable feature into the time series basic model, replacing the multiple placeholders with the second target variable values of the first variable type generated by multiple time steps in the second time period of the current business scenario; The second target variable values at multiple time steps are spliced into the second target variable information generated by the current business scenario within the second time period.
8. A business information prediction device, characterized in that: include: A model determination module, configured to determine a time series base model independently trained for a first variable type in multiple business scenarios, and an encoder independently trained for a second variable type in a current business scenario; a historical variable information collection module, configured to collect, in the current business scenario, first target variable information belonging to the first variable type and first external variable information belonging to the second variable type generated within a first historical time period; a future variable information collection module, configured to collect, in the current business scenario, second external variable information of the second variable type generated within a second future time period; an external variable encoding module, configured to call the encoder to encode the first external variable information into a first external variable feature and to encode the second external variable information into a second external variable feature; a variable arrangement module, configured to arrange the first target variable information, the first external variable feature, and the second external variable feature into a fused variable feature; The target variable prediction module is used to input the fused variable feature into the time series basic model to predict the second target variable information of the first variable type generated in the current business scenario within the second time period.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the method for predicting business information according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for predicting business information according to any one of claims 1 to 7 is implemented.