CN116911431A - Data flow prediction model training method, device, storage medium and equipment - Google Patents

Data flow prediction model training method, device, storage medium and equipment Download PDF

Info

Publication number
CN116911431A
CN116911431A CN202310670902.5A CN202310670902A CN116911431A CN 116911431 A CN116911431 A CN 116911431A CN 202310670902 A CN202310670902 A CN 202310670902A CN 116911431 A CN116911431 A CN 116911431A
Authority
CN
China
Prior art keywords
data
flow
sample
sample training
transaction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310670902.5A
Other languages
Chinese (zh)
Inventor
周宇
熊永福
王伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Ant Consumer Finance Co ltd
Original Assignee
Chongqing Ant Consumer Finance Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Ant Consumer Finance Co ltd filed Critical Chongqing Ant Consumer Finance Co ltd
Priority to CN202310670902.5A priority Critical patent/CN116911431A/en
Publication of CN116911431A publication Critical patent/CN116911431A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/09Supervised learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/03Credit; Loans; Processing thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Accounting & Taxation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • General Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Molecular Biology (AREA)
  • Development Economics (AREA)
  • Finance (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Marketing (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Technology Law (AREA)
  • Game Theory and Decision Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The specification discloses a data flow prediction model training method, a device, a storage medium and equipment, wherein the method comprises the following steps: and acquiring a multi-element flow data sequence of transaction data from a historical flow log based on a preset time dimension, performing sliding window and zero filling operation on the multi-element flow data sequence to obtain sample training data and standard flow results corresponding to the sample training data respectively, inputting the sample training data into a data flow prediction model to obtain data flow prediction results corresponding to the sample training data respectively, performing supervision training on the data flow prediction model based on a preset loss function, the standard data flow results corresponding to the sample training data and the data flow prediction results, and iteratively updating model parameters of the data flow prediction model until the data flow prediction model converges to obtain a trained data flow prediction model.

Description

Data flow prediction model training method, device, storage medium and equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data flow prediction model training method, apparatus, storage medium, and device.
Background
In the consumer finance scenario, credit funds are raised by multiple financing channels and multiple financing institutions. Due to the large demand of funds and various modes of fund raising, the financing plan is often planned in advance so as to reduce the use cost of funds while meeting the liquidity risk. On the one hand, if financing is low, there is insufficient in-table assets to accommodate the user's demand for use in a future period of time, resulting in a risk of free-money lending, i.e., liquidity; on the other hand, if the financing program is higher than the actual one, the asset will be left unused, resulting in an increase in the cost of the use of funds.
Therefore, the total demand and the rhythm of future funds are accurately estimated, risk identification and emergency disposal can be assisted, and the requirements of supervision on the liability indexes are positively responded. The prediction of the paying and repaying in the consumption financial scene can provide important references for reasonable financing planning, and is an important link for actively constructing a mobility management system.
Disclosure of Invention
According to the data flow prediction model training method, device, storage medium and equipment, the data flow prediction model which can accurately predict future data flow can be obtained. The technical scheme is as follows:
In a first aspect, embodiments of the present disclosure provide a data flow prediction model training method, the method including:
acquiring a multi-flow data sequence of transaction data from a history flow log based on a preset time dimension, wherein the multi-flow data comprises flow data of the transaction data, a date covariate, a known transaction covariate and an unknown transaction covariate;
sliding window and zero filling operation are carried out on the multi-element flowing data sequence, so that each sample training data and standard flowing results corresponding to each sample training data are obtained, and the sample training data comprise continuous at least one multi-element flowing data;
inputting each sample training data into a data flow prediction model to obtain data flow prediction results respectively corresponding to each sample training data;
and performing supervision training on the data flow prediction model based on a preset loss function, the standard data flow result corresponding to the sample training data and the data flow prediction result, and iteratively updating model parameters of the data flow prediction model until the data flow prediction model converges, so as to obtain a trained data flow prediction model.
In a second aspect, embodiments of the present disclosure provide a data flow prediction method, the method including:
determining a date to be predicted, and collecting a multi-flow data sequence in a preset time period before the date to be predicted from a historical flow log of transaction data based on a preset time dimension, wherein the multi-flow data comprises flow data, a date covariate, a known transaction covariate and an unknown transaction covariate of the transaction data;
zero filling operation and normalization processing are carried out on the multi-element flow data sequence, and data characteristics to be predicted are obtained;
inputting the data characteristics to be predicted into a data flow prediction model obtained by training a data flow prediction model training method according to any one of claims 1 to 7, and outputting a data flow prediction result.
In a third aspect, embodiments of the present disclosure provide a data flow prediction model training apparatus, the apparatus comprising:
the training data acquisition module is used for acquiring a multi-element flow data sequence of transaction data from the historical flow log based on a preset time dimension, wherein the multi-element flow data comprises flow data of the transaction data, a date covariate, a known transaction covariate and an unknown transaction covariate;
The sample data acquisition module is used for obtaining each sample training data and standard flow results respectively corresponding to each sample training data by carrying out sliding window and zero filling operation on the multi-element flow data sequence, wherein the sample training data comprises continuous at least one multi-element flow data;
the sample data prediction module is used for inputting each sample training data into the data flow prediction model to obtain a data flow prediction result corresponding to each sample training data;
and the model training module is used for performing supervision training on the data flow prediction model based on a preset loss function, the standard data flow result corresponding to the sample training data and the data flow prediction result, and iteratively updating model parameters of the data flow prediction model until the data flow prediction model converges to obtain a trained data flow prediction model.
In a fourth aspect, embodiments of the present disclosure provide a data flow prediction apparatus, the apparatus comprising:
the prediction data acquisition module is used for determining a date to be predicted, acquiring a multi-element flow data sequence in a preset time period before the date to be predicted from a historical flow log of transaction data based on a preset time dimension, wherein the multi-element flow data comprises flow data, a date covariate, a known transaction covariate and an unknown transaction covariate of the transaction data;
The prediction data processing module is used for performing zero filling operation and normalization processing on the multi-element flow data sequence to obtain data characteristics to be predicted;
the data flow prediction module is configured to input the data feature to be predicted into a trained data flow prediction model obtained by using the training method of the data flow prediction model according to any one of claims 1 to 7, and output a data flow prediction result.
In a fifth aspect, the present description embodiments provide a computer program product storing at least one instruction adapted to be loaded by a processor and to perform the above-described method steps.
In a sixth aspect, the present description provides a storage medium storing a computer program adapted to be loaded by a processor and to perform the above-mentioned method steps.
In a seventh aspect, embodiments of the present disclosure provide an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
The technical scheme provided by some embodiments of the present specification has the following beneficial effects:
According to the training method for the data flow prediction model, firstly, a multi-flow data sequence of transaction data is acquired from a historical flow log based on a preset time dimension, the multi-flow data comprises flow data of the transaction data, a date covariate, a known transaction covariate and an unknown transaction covariate, then sliding window and zero filling operation are carried out on the multi-flow data sequence to obtain sample training data and standard flow results corresponding to the sample training data respectively, the sample training data are input into the data flow prediction model to obtain data flow prediction results corresponding to the sample training data respectively, finally, supervision training is carried out on the data flow prediction model based on a preset loss function, the standard data flow results corresponding to the sample training data and the data flow prediction results, and model parameters of the data flow prediction model are iteratively updated until the data flow prediction model converges, and the trained data flow prediction model capable of accurately predicting future data flow is obtained; the training of the model is carried out through the multi-flow data, so that the trained data flow prediction model can learn the correlation among a plurality of covariates, and the prediction precision of the data flow prediction model on future data flow can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present description, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a training method of a data flow prediction model according to an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart of a training method of a data flow prediction model according to an embodiment of the present disclosure;
FIG. 3 is an exemplary schematic diagram of a sliding window operation provided in an embodiment of the present disclosure;
FIG. 4 is an exemplary diagram of sample training data provided in an embodiment of the present disclosure;
fig. 5 is a flow chart of a data flow prediction method according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a training device for data flow prediction model according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a sample data prediction module according to an embodiment of the present disclosure;
Fig. 8 is a schematic structural diagram of a data flow prediction device according to an embodiment of the present disclosure;
fig. 9 is a block diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
The technical solutions of the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is apparent that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
In the description of the present specification, it should be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In the description of the present specification, it should be noted that, unless expressly specified and limited otherwise, "comprise" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus. The specific meaning of the terms in this specification will be understood by those of ordinary skill in the art in the light of the specific circumstances. In addition, in the description of the present specification, unless otherwise indicated, "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
In the related art, in the existing paying and repayment prediction method in the consumption financial scene, independent modeling prediction is generally carried out on paying and repayment, so that the correlation between paying and repayment is ignored, such as the hysteresis influence of paying on repayment; more methods based on statistics, tree models and time sequence decomposition are adopted in the existing prediction methods, and the fitting capability to trends and fluctuation in time sequence data is weak.
Based on this, the embodiment of the specification proposes a training method of a data flow prediction model, firstly, based on a multi-flow data sequence of transaction data collected from a history flow log in a preset time dimension, the multi-flow data comprises flow data of the transaction data, a date covariate, a known transaction covariate and an unknown transaction covariate, then, through sliding window and zero filling operation on the multi-flow data sequence, standard flow results corresponding to each sample training data and each sample training data are obtained, each sample training data is input into the data flow prediction model, data flow prediction results corresponding to each sample training data are obtained, finally, based on a preset loss function, the standard data flow results corresponding to the sample training data and the data flow prediction results, the data flow prediction model is supervised and trained, and model parameters of the data flow prediction model are iteratively updated until the data flow prediction model converges, and a data flow prediction model which can accurately predict future data flow after training is completed is obtained; the model is trained through the multi-flow data, so that the trained data flow prediction model can learn the correlation among a plurality of covariates, and adopts a mode of simultaneous prediction of data inflow and data outflow to fully learn the correlation among data inflow and data outflow time sequences, thereby improving the prediction precision of the data flow prediction model on future data flow.
When the data flow prediction model is applied to a consumption finance scene to predict future repayment, repayment and repayment prediction can be simultaneously performed, correlation between repayment and repayment is fully considered, prediction precision of repayment data and repayment data is improved, future repayment and repayment prediction is performed based on multi-element flow data, the multi-element flow data contains multi-element data types, influences of various factors on repayment are fully considered, fitting capacity of the model on data fluctuation is improved, and prediction precision of the model on repayment is further improved.
The following is a detailed description of embodiments in connection with the examples of the present specification. The implementations described in the following exemplary examples do not represent all implementations consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present description as detailed in the accompanying claims. The flow diagrams depicted in the figures are exemplary only and are not necessarily to be taken in the order shown. For example, some steps are juxtaposed and there is no strict order of logic, so the actual order of execution is variable.
Referring to fig. 1, a flow chart of a data flow prediction model training method according to an embodiment of the present disclosure is provided. In the embodiments in the present specification, the data flow prediction model training method is applied to a data flow prediction model training apparatus or an electronic device configured with the data flow prediction model training apparatus. The following details about the flowchart shown in fig. 1, the data flow prediction model training method specifically may include the following steps:
S102, acquiring a multi-flow data sequence of transaction data from a history flow log based on a preset time dimension, wherein the multi-flow data comprises flow data of the transaction data, a date covariate, a known transaction covariate and an unknown transaction covariate;
in the embodiment of the present specification, before training the model, a sequence of multi-flow data required for training the model needs to be collected from a history flow log of transaction data, where the multi-flow data includes flow data of the transaction data, date covariates, known transaction covariates, and unknown transaction covariates.
The transaction data may be data types with flowing properties, such as fund data, population data, and the like, according to different application scenarios. The history flow log records the flow condition of the transaction data on each history time node. For example, when the transaction data is funds data, the history log records the funds inflow and funds outflow on each history time node, as well as some relevant data.
The preset time dimension refers to a time difference value between adjacent collected multi-element flow data, the preset time dimension may be days, weeks, months, etc., and the specific dimension of the preset time dimension is not specifically limited in the embodiment of the present disclosure.
The multi-flow data sequence comprises a plurality of continuous multi-flow data which are collected in a preset time dimension according to time sequence, wherein the multi-flow data comprises flow data of transaction data, date covariates, known transaction covariates and unknown transaction covariates. The flow data is the flow condition of the transaction data in a preset time dimension, and the date covariates are various date conditions corresponding to the multi-element flow data, such as: week number, month number, holiday, etc., the known transaction covariates are covariates known both in history and in the future, and the unknown transaction covariates are related covariates known in history but not in the future.
In one embodiment of the present disclosure, the application scenario may be a financial scenario, the transaction data may be funds, the preset time dimension may be days, the sequence of multi-flow data includes multi-flow data for a plurality of consecutive days, the multi-flow data includes current day's funds flow data, date covariates related to current day's funds flow, known transaction covariates related to current day's funds flow, unknown transaction covariates related to current day's funds flow, wherein the funds flow data includes current day's funds flow data and current day's funds flow data. And acquiring multi-element flowing data of multiple days in the fund flowing log by taking the day as the time dimension, and splicing the multi-element flowing data of continuous multiple days according to the time sequence to obtain a multi-element flowing data sequence.
For example, where the transaction data is funds, the movement data in the multi-element movement data includes the current day of movement data and the current movement data, the date covariates may be day of the week, day of the month, whether or not it is holiday, the known transaction covariates may be agreement-determined payoff day information, user's withdrawal and derate information, etc., and the unknown transaction covariates may be historic known but future agnostic covariates, such as the effect of historic movement data on future movement data, the effect of historic movement data on future movement data.
S104, performing sliding window and zero filling operation on the multi-element flowing data sequence to obtain each sample training data and standard flowing results respectively corresponding to the sample training data, wherein the sample training data comprises at least one continuous multi-element flowing data;
in this embodiment of the present disclosure, after obtaining a multi-element streaming data sequence, performing a sliding window operation and a zero padding operation on the multi-element streaming data sequence according to a preset time window, to obtain each sample training data corresponding to the preset time window, and standard streaming results corresponding to each sample training data, where the sample training data includes at least one multi-element streaming data.
Optionally, in one embodiment, after obtaining the multi-element flowing data sequence, performing sliding window operation on the multi-element flowing data sequence according to a preset time window to obtain initial window data corresponding to the preset time window respectively, then performing zero filling operation on each initial window data to obtain each sample training data, and finally determining a standard flowing result corresponding to the sample training data in the initial window data based on the sample training data.
S106, inputting the training data of each sample into a data flow prediction model to obtain data flow prediction results respectively corresponding to the training data of each sample;
in this embodiment of the present disclosure, after standard flow results corresponding to each sample training data and each sample training data are obtained, data flow prediction needs to be performed on the data flow prediction model based on each sample training data and the standard flow results corresponding to each sample training data, and first, each sample training data is input into a pre-built initial data flow prediction model to obtain a data flow prediction result of the initial data flow prediction model on each sample training data.
Optionally, in an embodiment, the data flow prediction result includes a data flow prediction result and a data flow prediction result, the data flow prediction model includes a feature extraction network, a data flow prediction network, and the inputting the training data of each sample into the data flow prediction model to obtain the data flow prediction result corresponding to each sample training data respectively may be: respectively carrying out normalization processing on each flow data, each date covariate, each known transaction covariate and each unknown transaction covariate in the sample training data to obtain sample data characteristics corresponding to each sample training data, inputting the sample data characteristics into a data outflow prediction network to obtain a data outflow prediction result corresponding to the sample training data, and inputting the sample data characteristics into the data inflow prediction network to obtain a data inflow prediction result corresponding to the sample training data.
In one embodiment, the inputting the sample data feature into the data outflow prediction network to obtain the data outflow prediction result corresponding to the sample training data may be: and carrying out feature enhancement processing on the sample data features based on a mixed attention mechanism combined with causal convolution to obtain first enhanced sample data features, and carrying out data outflow prediction based on the first enhanced sample data features to obtain a data outflow prediction result corresponding to sample training data.
In one embodiment, the inputting the sample data feature into the data inflow prediction network to obtain the data inflow prediction result corresponding to the sample training data may be: and carrying out feature enhancement processing on the sample data features based on a mixed attention mechanism combined with causal convolution to obtain second enhanced sample data features, and carrying out data inflow prediction based on the second enhanced sample data features to obtain a data inflow prediction result corresponding to sample training data.
In one embodiment, the normalizing process is performed on each flow data, each date covariate, each known transaction covariate, and each unknown transaction covariate in the sample training data to obtain sample data features corresponding to each sample training data, which may be: and carrying out min-max normalization processing on each flow data in the sample training data, and respectively carrying out standard normalization processing on each date covariates, each known transaction covariates and each unknown transaction covariates in the sample training data to obtain sample data characteristics respectively corresponding to each sample training data.
Optionally, in an embodiment, before performing normalization processing on each flow data, each date covariate, each known transaction covariate and each unknown transaction covariate in the sample training data to obtain sample data features corresponding to each sample training data respectively, inverted sequence numbering may be performed on each sample training data obtained by the sliding window to obtain window numbers corresponding to each sample training data respectively, and numbering is performed on each multi-element flow data in the sample training data according to a preset sequence to obtain position numbers corresponding to each multi-element flow data respectively. After each window number and each position number are obtained, respectively carrying out normalization processing on each flowing data, each date covariate, each known transaction covariate and each unknown transaction covariate in the sample training data to obtain normalized data characteristics respectively corresponding to each sample training data, carrying out characteristic extraction processing on window codes corresponding to the sample training data and position numbers respectively corresponding to multiple flowing data in the sample training data to obtain window coding characteristics and position coding characteristics corresponding to the sample training data, and carrying out characteristic fusion processing on the normalized data characteristics, the window coding characteristics and the position coding characteristics to obtain sample data characteristics.
S108, performing supervision training on the data flow prediction model based on a preset loss function, a standard data flow result corresponding to the sample training data and a data flow prediction result, and iteratively updating model parameters of the data flow prediction model until the data flow prediction model converges to obtain a trained data flow prediction model.
In this embodiment of the present disclosure, after obtaining each sample training data and standard flow results corresponding to each sample training data, data flow prediction is required to be performed on the data flow prediction model based on each sample training data and standard flow results corresponding to each sample training data, first, each sample training data is input into a pre-built initial data flow prediction model, so as to obtain a data flow prediction result of the initial data flow prediction model on each sample training data, then, a model loss value is calculated according to the data flow prediction result and the standard data flow result through a preset loss function, model parameters of the data flow prediction model are updated based on the model loss value, and supervised training is performed iteratively until the model converges, so as to finally obtain a trained data flow prediction model.
In the embodiment of the specification, firstly, a multi-element flow data sequence of transaction data is acquired from a historical flow log based on a preset time dimension, the multi-element flow data comprises flow data of the transaction data, a date covariate, a known transaction covariate and an unknown transaction covariate, then, through sliding window and zero filling operation on the multi-element flow data sequence, standard flow results corresponding to each sample training data and each sample training data are obtained, each sample training data is input into a data flow prediction model, a data flow prediction result corresponding to each sample training data is obtained, finally, the data flow prediction model is subjected to supervision training based on a preset loss function, the standard data flow result corresponding to the sample training data and the data flow prediction result, and model parameters of the data flow prediction model are iteratively updated until the data flow prediction model converges, and a trained data flow prediction model capable of accurately predicting future data flow is obtained; the training of the model is carried out through the multi-flow data, so that the trained data flow prediction model can learn the correlation among a plurality of covariates, and the prediction precision of the data flow prediction model on future data flow can be improved.
When the data flow prediction model trained by the method is applied to predicting the funds inflow and the funds outflow in a financial scene, the data flow prediction model can predict the funds inflow and the funds outflow at the same time, so that the hysteresis influence of the funds outflow on the funds inflow can be solved, and the prediction precision of the funds inflow can be effectively improved. Where the funds inflow may correspond to a user repayment and the funds outflow may correspond to a payment to the user.
Referring to fig. 2, a flow chart of a data flow prediction model training method provided in an embodiment of the present disclosure may include the following steps:
s202, acquiring a multi-flow data sequence of transaction data from a history flow log based on a preset time dimension, wherein the multi-flow data comprises flow data of the transaction data, a date covariate, a known transaction covariate and an unknown transaction covariate;
in the embodiment of the present disclosure, the step S202 is referred to the detailed description of the step S102 in another embodiment of the present disclosure, and will not be repeated here.
S204, performing sliding window operation on the multi-element flowing data sequence to obtain initial window data;
In the embodiment of the present disclosure, after the multi-element streaming data sequence is obtained, sliding window operation is performed on the multi-element streaming data sequence according to a preset time window, so as to obtain initial window data corresponding to the preset time window respectively.
In the embodiment of the present disclosure, the preset time window is used to collect initial window data corresponding to the number of days of the preset time window from the multi-flow data sequence by means of a sliding window. The initial window data is used for determining sample training data and standard flowing results corresponding to the sample training data.
The preset time window may be a window of preset days, and the preset days may be three days, five days, seven days, and the like.
Referring to fig. 3, an exemplary schematic diagram of a sliding window operation is provided in the embodiment of the present disclosure. As shown in fig. 3, the multi-element flow data sequence includes multi-element flow data of several DAYs, each multi-element flow data includes flow data, date covariates, known transaction covariates and unknown transaction covariates, and as shown in DAY1, DAY2, DAY3, DAY4 and DAY5 … DAY, the initial window data as shown in the figure can be obtained by performing sliding operation in the multi-element flow data sequence through a preset time window.
S206, performing zero padding operation on each initial window data to obtain each sample training data;
in the embodiment of the present disclosure, after a plurality of initial window data are acquired from a multi-component streaming data sequence based on a preset time window, zero padding operation is performed on each initial window data, so as to obtain each sample training data.
The initial window data includes multiple streaming data corresponding to a preset time window day, and for each initial window data, sample training data and a standard streaming result corresponding to the sample training data need to be determined from the multiple streaming data included in the initial window data. The data flow prediction model in the embodiment of the present disclosure is used to predict future flow data according to historical flow data, and in the initial window data, the sample training data is first time-series, and the standard flow result is later time-series. For example, if the initial window data includes seven days of multi-component flow data, the first five days of multi-component flow data at the front of the time sequence can be used as sample training data, and the last two days of multi-component flow data at the rear of the time sequence can be used as standard flow results.
It can be understood that the initial window data includes multi-element flowing data of continuous multiple days, sample training data is determined in the initial window data, the data of the initial window data, which needs to be predicted as the sample training data, is reserved, and the other multi-element flowing data is subjected to zero filling operation, so that the sample training data is finally obtained. For example, the initial window data includes multi-element flow data of seven continuous days, when model training is performed, the multi-element flow data of the first five days is scheduled to be used as data for prediction, and zero padding operation is performed on multi-element flow data of the last two days in the initial window data, so that sample training data is finally obtained.
Optionally, when performing zero-filling operation on the initial window data, performing zero-filling operation on a data type without a data value in the multi-flow data, so as to avoid feature crossing. For example, an unknown transaction covariate in the multi-flow data may not exist, and the value of the unknown transaction covariate does not exist in the collection process of the multi-flow data, then zero padding operation is performed on the unknown transaction covariate.
S208, determining a standard flow result corresponding to the sample training data in the initial window data based on the sample training data;
from the above, the sample training data is obtained by performing zero padding operation on a part of data in the initial window data, and then the flow data of the zero padded part in the initial window data is determined as a standard flow result corresponding to the sample training data.
It can be understood that the sample training data is multi-element flow data with the time sequence in the initial window data for a plurality of days before, the flow data of the zero filled part corresponds to the time sequence in the initial window data for a plurality of days after, and is also target prediction data of the sample training data, and the flow data corresponding to the sample training data when not being zero filled is the actual flow data of the corresponding date.
Referring to fig. 4, an exemplary schematic diagram of sample training data is provided in the embodiment of the present disclosure. As shown in fig. 4, the first four days of multi-flow data before the time series test in the initial window data are used as sample training data, and the second two days of multi-flow data after the time series are used as standard flow results.
S210, respectively carrying out normalization processing on each flow data, each date covariates, each known transaction covariates and each unknown transaction covariates in the sample training data to obtain sample data characteristics respectively corresponding to each sample training data;
in the embodiment of the present disclosure, after obtaining sample training data, normalization processing is performed on each flow data, each date covariates, each known transaction covariates, and each unknown transaction covariates in the sample training data, so as to obtain sample data features corresponding to each sample training data.
Optionally, in one embodiment, min-max normalization processing is performed on each flow data in the sample training data, and standard normalization processing is performed on each date covariates, each known transaction covariates and each unknown transaction covariates in the sample training data, so as to obtain sample data features corresponding to each sample training data respectively.
It can be understood that the flow data is normalized by adopting a min-max normalization mode, so that the normalized data can be conveniently mapped into the flow data, the mapping of the data in the flow prediction model is facilitated, and the prediction efficiency is further improved.
Optionally, in an embodiment, before performing normalization processing on each flow data, each date covariate, each known transaction covariate and each unknown transaction covariate in the sample training data to obtain sample data features corresponding to each sample training data respectively, inverted sequence numbering may be performed on each sample training data obtained by the sliding window to obtain window numbers corresponding to each sample training data respectively, and numbering is performed on each multi-element flow data in the sample training data according to a preset sequence to obtain position numbers corresponding to each multi-element flow data respectively. After each window number and each position number are obtained, respectively carrying out normalization processing on each flowing data, each date covariate, each known transaction covariate and each unknown transaction covariate in the sample training data to obtain normalized data characteristics respectively corresponding to each sample training data, carrying out characteristic extraction processing on window codes corresponding to the sample training data and position numbers respectively corresponding to multiple flowing data in the sample training data to obtain window coding characteristics and position coding characteristics corresponding to the sample training data, and carrying out characteristic fusion processing on the normalized data characteristics, the window coding characteristics and the position coding characteristics to obtain sample data characteristics.
It should be noted that, the window number is a number obtained by performing reverse sequence numbering on each sample training data obtained by the sliding window, and may reflect a time sequence relationship between each sample training data, for example, the multi-element flow data sequence includes multi-element flow data of 30 days, and the preset time window is 6 days, then five sample training data may be obtained by performing sliding window operation on the multi-element flow data sequence, performing reverse sequence numbering on the 5 sample training data, taking the sample training data with the last time sequence as number 1, and taking the sample training data with the most forward time sequence as number 5. The position number is the time sequence number of each multi-element flow data in the sample training data, and can reflect the time sequence relation of each multi-element flow data in the sample training data, for example, one sample training data comprises five days of multi-element flow data, and the multi-element flow data are numbered 1, 2, 3, 4 and 5 according to the time sequence.
Preferably, the window number of each sample training data may be a number of the reverse sequence segment, for example, the window timing relationship corresponding to the seven sample training data is as follows: sample training data 7, sample training data 6, sample training data 5, sample training data 4, sample training data 3, sample training data 2, and sample training data 1, then sample training data 3, sample training data 2, and sample training data 1 set windows can be encoded to 1, representing near-time recent data, sample training data 6, sample training data 5, and sample training data 4 set windows can be encoded to 2, representing mid-term data centered in time sequence, sample training data 7 set windows can be encoded to 3, and representing far-time data.
It may be understood that in the embodiment of the present disclosure, window coding features and position coding features corresponding to sample training data are obtained by performing window numbering on each sample training data and performing position numbering on multi-element flow data in the sample training data, then performing feature extraction processing on window codes corresponding to the sample training data and position numbers corresponding to each multi-element flow data in the sample training data, and performing feature fusion on normalized data features of the window coding features, the position coding features and the sample training data after normalization processing, so as to obtain sample data features fused with the window coding features and the position coding features. When the sample data features fused with the window coding features and the position coding features are input into the data flow prediction model for prediction, the data flow model can learn time sequence relations among different sample training data and time sequence relations among different multi-element flow data according to the window coding features and the position coding features, so that the prediction effect of the data flow prediction result can be improved, and the prediction precision is improved.
S212, inputting the characteristics of the sample data into a data outflow prediction network to obtain a data outflow prediction result corresponding to the sample training data;
The data flow prediction result includes a data flow prediction result and a data flow prediction result, and the data flow prediction model includes a feature extraction network, a data flow prediction network, and a data flow prediction network.
In the embodiment of the present disclosure, feature enhancement processing is performed on the sample data features based on a mixed attention mechanism combined with causal convolution, so as to obtain first enhanced sample data features, and then data outflow prediction is performed on the first enhanced sample data features, so as to obtain a data outflow prediction result corresponding to sample training data.
The feature enhancement processing is carried out on the sample data features by combining a causal convolution mixed attention mechanism, so that the fitting capacity of the data flow prediction model on the data volatility can be improved, the stability of the trained model is improved, and the prediction precision is ensured.
S214, inputting the characteristics of the sample data into a data inflow prediction network to obtain a data inflow prediction result corresponding to the sample training data;
in the embodiment of the present disclosure, feature enhancement processing is performed on the sample data features based on a mixed attention mechanism combined with causal convolution to obtain second enhanced sample data features, and then data inflow prediction is performed on the second enhanced sample data features to obtain a data inflow prediction result corresponding to sample training data.
S216, performing supervision training on the data flow prediction model based on a preset loss function, a standard data flow result corresponding to the sample training data and a data flow prediction result, and iteratively updating model parameters of the data flow prediction model until the data flow prediction model converges, so as to obtain the data flow prediction model after training.
In the embodiment of the present disclosure, the step S216 is referred to in another embodiment of the present disclosure for detailed description of the step S108, which is not repeated here.
In the embodiment of the specification, firstly, a multi-element flow data sequence of transaction data is acquired from a historical flow log based on a preset time dimension, wherein the multi-element flow data comprises flow data, date covariates, known transaction covariates and unknown transaction covariates of the transaction data, then sliding window and zero filling operation are carried out on the multi-element flow data sequence to obtain sample training data and standard flow results corresponding to the sample training data respectively, normalization processing is carried out on the flow data, the date covariates, the known transaction covariates and the unknown transaction covariates in the sample training data respectively to obtain sample data characteristics corresponding to the sample training data respectively, the sample data characteristics are input into a data outflow prediction network and a data inflow prediction network respectively to obtain data outflow prediction results and data inflow prediction results corresponding to the sample training data, finally, supervision training is carried out on the data flow prediction model based on a preset loss function, the standard data flow results corresponding to the sample training data and the data flow prediction results, and model parameters of the data flow prediction model are iteratively updated until the data flow prediction model converges, and the data flow prediction model can be accurately predicted, and the data flow prediction model of future data flow can be predicted after training is completed is obtained; the training of the model is carried out through the multi-component flow data, so that the trained data flow prediction model can learn the influence of a plurality of covariates on the flow data prediction result and the influence of the correlation of a plurality of covariates in time sequence on the flow data prediction result, the prediction precision of the data flow prediction model on the future data flow can be improved, the characteristic enhancement processing is carried out on the sample data characteristics based on the mixed attention mechanism combined with causal convolution in the prediction network, the fitting capacity of the model on the data volatility is improved, and the stability and the prediction precision of the model are ensured.
Referring to fig. 5, a flow chart of a data flow prediction method provided in an embodiment of the present disclosure is shown, where the data flow prediction method may include the following steps:
s302, determining a date to be predicted, and acquiring a multi-flow data sequence in a preset time period before the date to be predicted from a historical flow log of transaction data based on a preset time dimension, wherein the multi-flow data comprises flow data of the transaction data, a date covariate, a known transaction covariate and an unknown transaction covariate;
in the embodiment of the present disclosure, when predicting a data flow condition in a future time, first determining a date to be predicted, and then collecting, in a historical flow log of transaction data according to a preset time dimension, a multi-component flow data sequence within a preset time period before the date to be predicted. The multi-flow data comprises flow data of transaction data, date covariates, known transaction covariates and unknown transaction covariates.
For example, it may be determined that the date to be predicted is 2 months 25 days and 2 months 26 days, then the multi-component flow data of each day from 2 months 20 days to 2 months 24 days may be collected in the historical flow log, and the multi-component flow data of 5 days may be spliced to obtain the multi-component flow data sequence.
The transaction data may be data types with flowing properties, such as fund data, population data, and the like, according to different application scenarios. The history flow log records the flow condition of the transaction data on each history time node. For example, when the transaction data is funds data, the history log records the funds inflow and funds outflow on each history time node, as well as some relevant data.
The preset time dimension refers to a time difference value between adjacent acquired multi-element flow data, the preset time dimension can be days, weeks, months and the like, and the specific dimension of the preset time dimension is consistent with the time dimension predictable by the data flow prediction model.
The multi-flow data sequence comprises a plurality of continuous multi-flow data which are collected in a preset time dimension according to time sequence, wherein the multi-flow data comprises flow data of transaction data, date covariates, known transaction covariates and unknown transaction covariates. The flow data is the flow condition of the transaction data in a preset time dimension, and the date covariates are various date conditions corresponding to the multi-element flow data, such as: week number, month number, holiday, etc., the known transaction covariates are covariates known both in history and in the future, and the unknown transaction covariates are related covariates known in history but not in the future.
In this embodiment of the present disclosure, the application scenario may be a financial scenario, the transaction data may be funds, the preset time dimension may be days, the multi-flow data sequence includes multi-flow data for a plurality of consecutive days, the multi-flow data includes current day's funds flow data, date covariates related to current day's funds flow, known transaction covariates related to current day's funds flow, unknown transaction covariates related to current day's funds flow, wherein the funds flow data includes current day's funds inflow data and current day's funds outflow data. And acquiring multi-element flowing data of multiple days in the fund flowing log by taking the day as the time dimension, and splicing the multi-element flowing data of continuous multiple days according to the time sequence to obtain a multi-element flowing data sequence.
For example, where the transaction data is funds, the movement data in the multi-element movement data includes the current day of movement data and the current movement data, the date covariates may be day of the week, day of the month, whether or not it is holiday, the known transaction covariates may be agreement-determined payoff day information, user's withdrawal and derate information, etc., and the unknown transaction covariates may be historic known but future agnostic covariates, such as the effect of historic movement data on future movement data, the effect of historic movement data on future movement data.
S304, performing zero filling operation and normalization processing on the multi-element flow data sequence to obtain data characteristics to be predicted;
in the embodiment of the present disclosure, after a multi-element flow data sequence is acquired, zero padding operation is performed on a data type in which no data value exists in the multi-element flow data sequence, so as to obtain data to be predicted corresponding to the multi-element flow data sequence, and normalization processing is performed on each flow data, each date covariate, each known transaction covariate and each unknown transaction covariate in the data to be predicted after the zero padding operation, so as to obtain data characteristics to be predicted corresponding to the multi-element flow data sequence. The data feature to be predicted is used for inputting the data feature to be predicted into the data flow prediction model to conduct data flow prediction of the date to be predicted.
Alternatively, in one embodiment, when each flow data, each date covariate, each known transaction covariate, and each unknown transaction covariate in the data to be predicted are respectively normalized, the normalization process may be: and carrying out min-max normalization processing on each flow data in the data to be predicted, and carrying out standard normalization processing on each date covariates, each known transaction covariates and each unknown transaction covariates in the data to be predicted to obtain data characteristics to be predicted, which correspond to each data to be predicted respectively.
It can be understood that the flow data is normalized by adopting a min-max normalization mode, so that the normalized data can be conveniently mapped into the flow data, the mapping of the data in the flow prediction model is facilitated, and the prediction efficiency is further improved.
In one embodiment, after each flowing data, each date covariate, each known transaction covariate and each unknown transaction covariate in the data to be predicted are respectively normalized to obtain the characteristics of the data to be predicted, the method may further include: position numbering is carried out on each multi-element flowing data in the data to be predicted, position numbers corresponding to the multi-element flowing data are obtained, feature coding is carried out on the position numbers corresponding to the multi-element flowing data, position number features are obtained, feature fusion is carried out on the position number features and the data features to be predicted, and the data features to be predicted after the position coding features are fused are obtained. It can be understood that the fused data feature to be predicted contains the position number feature of each multi-element flow data, namely, contains the time sequence relation among the multi-element flow data, and can effectively improve the prediction precision of data flow when the data flow prediction is performed based on the data feature to be predicted after the position coding feature is fused.
In the training stage of the data flow prediction model, the training data of each sample obtained by the sliding window is numbered in reverse order to obtain window numbers corresponding to the training data of each sample. And carrying out feature fusion on window coding features corresponding to the window numbers and data features of sample training data so as to increase learning of a data flow prediction model on window time sequence relations and improve model prediction effects. In the application stage of the data flow prediction model of the embodiment of the application, for the data to be predicted, the data to be predicted can be used as each window data, and the window number of the data to be predicted is set to be the window number closest to the time sequence of the date to be predicted. For example, setting the window number of the data to be predicted as 1, performing feature coding on the window number corresponding to the data to be predicted to obtain window number features, and performing feature fusion on the window number features and the data features to be predicted to obtain the data features to be predicted after the window coding features are fused.
S306, inputting the data characteristics to be predicted into the trained data flow prediction model obtained by the training method of the data flow prediction model according to any one of claims 1 to 7, and outputting a data flow prediction result.
In the embodiment of the present disclosure, when data flow prediction is performed, a date to be predicted is first determined, then a multi-flow data sequence within a preset period of time before the date to be predicted is collected, where the multi-flow data includes flow data of transaction data, a date covariate, a known transaction covariate, and an unknown transaction covariate, zero padding operation and normalization processing are performed on the multi-flow data sequence to obtain features of the data to be predicted, and finally the features of the data to be predicted are input into a trained data flow prediction model obtained by using the training method of the data flow prediction model according to any one of claims 1 to 7, and a data flow prediction result is output.
Fig. 6 is a schematic structural diagram of a training device for data flow prediction model according to an embodiment of the present disclosure. As shown in fig. 6, the data flow prediction model training apparatus 1 may be implemented as all or a part of an electronic device by software, hardware, or a combination of both. According to some embodiments, the data flow prediction model training device 1 includes a training data acquisition module 11, a sample data acquisition module 12, a sample data prediction module 13, and a prediction model training module 14, specifically including:
The training data acquisition module 11 is configured to acquire a multi-component flow data sequence of transaction data from the historical flow log based on a preset time dimension, where the multi-component flow data includes flow data of the transaction data, a date covariate, a known transaction covariate, and an unknown transaction covariate;
the sample data obtaining module 12 is configured to obtain each sample training data and a standard flow result corresponding to each sample training data respectively by performing sliding window and zero filling operation on the multi-element flow data sequence, where the sample training data includes at least one continuous multi-element flow data;
the sample data prediction module 13 is configured to input each sample training data into a data flow prediction model, so as to obtain a data flow prediction result corresponding to each sample training data;
and the prediction model training module 14 is configured to perform supervised training on the data flow prediction model based on a preset loss function, the standard data flow result corresponding to the sample training data, and the data flow prediction result, and iteratively update model parameters of the data flow prediction model until the data flow prediction model converges, so as to obtain a trained data flow prediction model.
Optionally, the sample data obtaining module 12 is specifically configured to:
performing sliding window operation on the multi-element flowing data sequence to obtain initial window data;
zero filling operation is carried out on each initial window data respectively, so that each sample training data is obtained;
and determining a standard flow result corresponding to the sample training data in the initial window data based on the sample training data.
Optionally, the data flow prediction result includes a data flow prediction result and a data flow prediction result, and the data flow prediction model includes a feature extraction network, a data flow prediction network, and a data flow prediction network. Fig. 7 is a schematic structural diagram of a sample data prediction module according to an embodiment of the present disclosure. As shown in fig. 7, the sample data prediction module 13 includes:
the normalization processing unit 131 is configured to perform normalization processing on each flow data, each date covariate, each known transaction covariate, and each unknown transaction covariate in the sample training data, so as to obtain sample data features corresponding to each sample training data;
a data outflow prediction unit 132, configured to input the sample data features into the data outflow prediction network, to obtain a data outflow prediction result corresponding to the sample training data;
The data inflow prediction unit 133 is configured to input the sample data feature into the data inflow prediction network, and obtain a data inflow prediction result corresponding to the sample training data.
Optionally, please refer to fig. 7, which is a schematic diagram of a sample data prediction module according to an embodiment of the present disclosure. As shown in fig. 7, the sample data prediction module 13 further includes a data numbering unit 134, specifically configured to:
carrying out reverse sequence numbering on each sample training data obtained by the sliding window to obtain window numbers respectively corresponding to each sample training data;
numbering each multi-element flowing data in the sample training data according to a preset sequence to obtain position numbers corresponding to the multi-element flowing data respectively;
optionally, the normalization processing unit 131 is specifically configured to:
respectively carrying out normalization processing on each flow data, each date covariate, each known transaction covariate and each unknown transaction covariate in the sample training data to obtain normalized data characteristics respectively corresponding to each sample training data;
performing feature extraction processing on window codes corresponding to the sample training data and position numbers corresponding to the multi-element flow data in the sample training data respectively to obtain window coding features and position coding features corresponding to the sample training data;
And carrying out feature fusion processing on the normalized data features, the window coding features and the position coding features to obtain sample data features.
Optionally, the data outflow prediction unit 132 is specifically configured to:
performing feature enhancement processing on the sample data features based on a mixed attention mechanism combined with causal convolution to obtain first enhanced sample data features;
and carrying out data outflow prediction based on the first enhanced sample data characteristics to obtain a data outflow prediction result corresponding to the sample training data.
Optionally, the data flow prediction unit 133 is specifically configured to:
performing feature enhancement processing on the sample data features based on a mixed attention mechanism combined with causal convolution to obtain second enhanced sample data features;
and carrying out data inflow prediction based on the second enhanced sample data characteristics to obtain a data inflow prediction result corresponding to the sample training data.
Optionally, the normalization processing unit 131 is further configured to:
performing min-max normalization processing on each piece of flowing data in the sample training data, and performing standard normalization processing on each piece of date covariates, each piece of known transaction covariates and each piece of unknown transaction covariates in the sample training data to obtain sample data characteristics corresponding to each piece of sample training data.
In the embodiment of the specification, firstly, a multi-element flow data sequence of transaction data is acquired from a historical flow log based on a preset time dimension, the multi-element flow data comprises flow data of the transaction data, a date covariate, a known transaction covariate and an unknown transaction covariate, then, through sliding window and zero filling operation on the multi-element flow data sequence, standard flow results corresponding to each sample training data and each sample training data are obtained, each sample training data is input into a data flow prediction model, a data flow prediction result corresponding to each sample training data is obtained, finally, the data flow prediction model is subjected to supervision training based on a preset loss function, the standard data flow result corresponding to the sample training data and the data flow prediction result, and model parameters of the data flow prediction model are iteratively updated until the data flow prediction model converges, and a trained data flow prediction model capable of accurately predicting future data flow is obtained; the training of the model is carried out through the multi-flow data, so that the trained data flow prediction model can learn the correlation among a plurality of covariates, and the prediction precision of the data flow prediction model on future data flow can be improved.
It should be noted that, when the data flow prediction model training apparatus provided in the foregoing embodiment performs the data flow prediction model training method, only the division of the foregoing functional modules is used as an example, in practical application, the foregoing functional allocation may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the data flow prediction model training device and the data flow prediction model training method provided in the foregoing embodiments belong to the same concept, which embody detailed implementation procedures in the method embodiments, and are not described herein again.
The foregoing embodiment numbers of the present specification are merely for description, and do not represent advantages or disadvantages of the embodiments.
Fig. 8 is a schematic structural diagram of a data flow prediction apparatus according to an embodiment of the present disclosure. As shown in fig. 8, the data flow predicting means 2 may be implemented as all or a part of the electronic device by software, hardware or a combination of both. According to some embodiments, the data flow prediction device 2 includes a predicted data acquisition module 21, a predicted data processing module 22, and a data flow prediction module 23, and specifically includes:
A prediction data collection module 21, configured to determine a date to be predicted, and collect, from a historical flow log of transaction data, a multi-flow data sequence within a preset time period before the date to be predicted based on a preset time dimension, where the multi-flow data includes flow data, a date covariate, a known transaction covariate, and an unknown transaction covariate of the transaction data;
the prediction data processing module 22 is configured to perform zero padding operation and normalization processing on the multi-element flow data sequence to obtain a data feature to be predicted;
a data flow prediction module 23, configured to input the data feature to be predicted into a trained data flow prediction model obtained by using the training method of the data flow prediction model according to any one of claims 1 to 7, and output a data flow prediction result.
In the embodiment of the present disclosure, when data flow prediction is performed, a date to be predicted is first determined, then a multi-flow data sequence within a preset period of time before the date to be predicted is collected, where the multi-flow data includes flow data of transaction data, a date covariate, a known transaction covariate, and an unknown transaction covariate, zero padding operation and normalization processing are performed on the multi-flow data sequence to obtain features of the data to be predicted, and finally the features of the data to be predicted are input into a trained data flow prediction model obtained by using the training method of the data flow prediction model according to any one of claims 1 to 7, and a data flow prediction result is output.
It should be noted that, when the data flow prediction apparatus provided in the foregoing embodiment performs the data flow prediction method, only the division of the foregoing functional modules is used as an example, and in practical application, the foregoing functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the data flow prediction apparatus and the data flow prediction method embodiment provided in the foregoing embodiments belong to the same concept, which embody the implementation process in detail in the method embodiment, and are not repeated here.
The foregoing embodiment numbers of the present specification are merely for description, and do not represent advantages or disadvantages of the embodiments.
The embodiment of the present disclosure further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are adapted to be loaded by a processor and execute the data flow prediction model training method according to the embodiment shown in fig. 1 to 5, and the specific execution process may refer to the specific description of the embodiment shown in fig. 1 to 5, which is not repeated herein.
The present disclosure further provides a computer program product, where the computer program product stores at least one instruction, where the at least one instruction is loaded by the processor and executed by the processor to implement the data flow prediction model training method according to the embodiment shown in fig. 1 to 5, and the specific implementation process may refer to the specific description of the embodiment shown in fig. 1 to 5, which is not repeated herein.
Referring to fig. 9, a block diagram of an electronic device according to an embodiment of the present disclosure is provided. The electronic device in this specification may include one or more of the following: processor 110, memory 120, input device 130, output device 140, and bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected by a bus 150.
Processor 110 may include one or more processing cores. The processor 110 connects various parts within the overall terminal using various interfaces and lines, performs various functions of the terminal 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and invoking data stored in the memory 120. Alternatively, the processor 110 may be implemented in at least one hardware form of digital signal processing (digital signal processing, DSP), field-programmable gate array (field-programmable gate array, FPGA), programmable logic array (programmable logic Array, PLA). The processor 110 may integrate one or a combination of several of a central processor (central processing unit, CPU), an image processor (graphics processing unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for being responsible for rendering and drawing of display content; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the processor 110 and may be implemented solely by a single communication chip.
The memory 120 may include a random access memory (random Access Memory, RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer readable medium (non-transitory computer-readable storage medium). Memory 120 may be used to store instructions, programs, code, sets of codes, or sets of instructions.
The input device 130 is configured to receive input instructions or data, and the input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used to output instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In the embodiment of the present disclosure, the input device 130 may be a temperature sensor for acquiring an operation temperature of the terminal. The output device 140 may be a speaker for outputting audio signals.
In addition, those skilled in the art will appreciate that the configuration of the terminal illustrated in the above-described figures does not constitute a limitation of the terminal, and the terminal may include more or less components than illustrated, or may combine certain components, or may have a different arrangement of components. For example, the terminal further includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (wireless fidelity, WIFI) module, a power supply, a bluetooth module, and the like, which are not described herein again.
In the embodiment of the present specification, the execution subject of each step may be the terminal described above. Optionally, the execution subject of each step is an operating system of the terminal. The operating system may be an android system, an IOS system, or other operating systems, which embodiments of the present specification are not limited to.
In the electronic device of fig. 9, the processor 110 may be configured to invoke the data flow prediction model training program stored in the memory 120 and execute to implement the data flow prediction model training method as described in various method embodiments of the present description.
In the embodiment of the specification, firstly, a multi-element flow data sequence of transaction data is acquired from a historical flow log based on a preset time dimension, the multi-element flow data comprises flow data of the transaction data, a date covariate, a known transaction covariate and an unknown transaction covariate, then, through sliding window and zero filling operation on the multi-element flow data sequence, standard flow results corresponding to each sample training data and each sample training data are obtained, each sample training data is input into a data flow prediction model, a data flow prediction result corresponding to each sample training data is obtained, finally, the data flow prediction model is subjected to supervision training based on a preset loss function, the standard data flow result corresponding to the sample training data and the data flow prediction result, and model parameters of the data flow prediction model are iteratively updated until the data flow prediction model converges, and a trained data flow prediction model capable of accurately predicting future data flow is obtained; the training of the model is carried out through the multi-flow data, so that the trained data flow prediction model can learn the correlation among a plurality of covariates, and the prediction precision of the data flow prediction model on future data flow can be improved.
It will be clear to a person skilled in the art that the solution according to the present description can be implemented by means of software and/or hardware. "Unit" and "module" in this specification refer to software and/or hardware capable of performing a specific function, either alone or in combination with other components, such as Field programmable gate arrays (Field-Programmable Gate Array, FPGAs), integrated circuits (Integrated Circuit, ICs), etc.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present description is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present description. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the specification.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in this specification, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, such as the division of the units, merely a logical function division, and there may be additional manners of dividing the actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some service interface, device or unit indirect coupling or communication connection, electrical or otherwise.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present specification may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the above embodiments may be performed by hardware associated with a program that is stored in a computer readable memory, which may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
The foregoing is merely exemplary embodiments of the present specification and is not intended to limit the scope of the present specification. It is intended that all equivalent variations and modifications as taught herein fall within the scope of the present disclosure. Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This specification is intended to cover any variations, uses, or adaptations of the specification following, in general, the principles of the specification and including such departures from the present disclosure as come within known or customary practice within the art to which the specification pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the specification being indicated by the following claims.

Claims (13)

1. A method of training a data flow prediction model, the method comprising:
acquiring a multi-flow data sequence of transaction data from a history flow log based on a preset time dimension, wherein the multi-flow data comprises flow data of the transaction data, a date covariate, a known transaction covariate and an unknown transaction covariate;
sliding window and zero filling operation are carried out on the multi-element flowing data sequence, so that each sample training data and standard flowing results corresponding to each sample training data are obtained, and the sample training data comprise continuous at least one multi-element flowing data;
inputting each sample training data into a data flow prediction model to obtain data flow prediction results respectively corresponding to each sample training data;
and performing supervision training on the data flow prediction model based on a preset loss function, the standard data flow result corresponding to the sample training data and the data flow prediction result, and iteratively updating model parameters of the data flow prediction model until the data flow prediction model converges, so as to obtain a trained data flow prediction model.
2. The method of claim 1, wherein the obtaining each sample training data and the standard flow result corresponding to each sample training data by performing sliding window and zero padding operation on the multi-element flow data sequence includes:
Performing sliding window operation on the multi-element flowing data sequence to obtain initial window data;
zero filling operation is carried out on each initial window data respectively, so that each sample training data is obtained;
and determining a standard flow result corresponding to the sample training data in the initial window data based on the sample training data.
3. The method of claim 1, wherein the data flow prediction result includes a data flow prediction result and a data flow prediction result, the data flow prediction model includes a feature extraction network, a data flow prediction network, and the inputting each sample training data into the data flow prediction model to obtain a data flow prediction result respectively corresponding to each sample training data includes:
respectively carrying out normalization processing on each flow data, each date covariate, each known transaction covariate and each unknown transaction covariate in the sample training data to obtain sample data characteristics respectively corresponding to each sample training data;
inputting the sample data characteristics into the data outflow prediction network to obtain a data outflow prediction result corresponding to the sample training data;
And inputting the sample data characteristics into the data inflow prediction network to obtain a data inflow prediction result corresponding to the sample training data.
4. The method according to claim 3, wherein the normalizing process is performed on each flow data, each date covariates, each known transaction covariates, and each unknown transaction covariates in the sample training data, respectively, so as to obtain sample data features corresponding to each sample training data, respectively, before the normalizing process is performed, further comprising:
carrying out reverse sequence numbering on each sample training data obtained by the sliding window to obtain window numbers respectively corresponding to each sample training data;
numbering each multi-element flowing data in the sample training data according to a preset sequence to obtain position numbers corresponding to the multi-element flowing data respectively;
the normalization processing is performed on each flow data, each date covariate, each known transaction covariate and each unknown transaction covariate in the sample training data to obtain sample data characteristics corresponding to each sample training data, including:
respectively carrying out normalization processing on each flow data, each date covariate, each known transaction covariate and each unknown transaction covariate in the sample training data to obtain normalized data characteristics respectively corresponding to each sample training data;
Performing feature extraction processing on window codes corresponding to the sample training data and position numbers corresponding to the multi-element flow data in the sample training data respectively to obtain window coding features and position coding features corresponding to the sample training data;
and carrying out feature fusion processing on the normalized data features, the window coding features and the position coding features to obtain sample data features.
5. The method according to claim 3, wherein the inputting the sample data feature into the data outflow prediction network to obtain the data outflow prediction result corresponding to the sample training data includes:
performing feature enhancement processing on the sample data features based on a mixed attention mechanism combined with causal convolution to obtain first enhanced sample data features;
and carrying out data outflow prediction based on the first enhanced sample data characteristics to obtain a data outflow prediction result corresponding to the sample training data.
6. The method of claim 3, wherein the inputting the sample data feature into the data inflow prediction network to obtain the data inflow prediction result corresponding to the sample training data includes:
Performing feature enhancement processing on the sample data features based on a mixed attention mechanism combined with causal convolution to obtain second enhanced sample data features;
and carrying out data inflow prediction based on the second enhanced sample data characteristics to obtain a data inflow prediction result corresponding to the sample training data.
7. The method according to claim 3, wherein the normalizing the flow data, the date covariates, the known transaction covariates and the unknown transaction covariates in the sample training data respectively to obtain sample data features respectively corresponding to the sample training data comprises:
performing min-max normalization processing on each piece of flowing data in the sample training data, and performing standard normalization processing on each piece of date covariates, each piece of known transaction covariates and each piece of unknown transaction covariates in the sample training data to obtain sample data characteristics corresponding to each piece of sample training data.
8. A method of data flow prediction, the method comprising:
determining a date to be predicted, and collecting a multi-flow data sequence in a preset time period before the date to be predicted from a historical flow log of transaction data based on a preset time dimension, wherein the multi-flow data comprises flow data, a date covariate, a known transaction covariate and an unknown transaction covariate of the transaction data;
Zero filling operation and normalization processing are carried out on the multi-element flow data sequence, and data characteristics to be predicted are obtained;
inputting the data characteristics to be predicted into a data flow prediction model obtained by training a data flow prediction model training method according to any one of claims 1 to 7, and outputting a data flow prediction result.
9. A data flow prediction model training apparatus, comprising:
the training data acquisition module is used for acquiring a multi-element flow data sequence of transaction data from the historical flow log based on a preset time dimension, wherein the multi-element flow data comprises flow data of the transaction data, a date covariate, a known transaction covariate and an unknown transaction covariate;
the sample data acquisition module is used for obtaining each sample training data and standard flow results respectively corresponding to each sample training data by carrying out sliding window and zero filling operation on the multi-element flow data sequence, wherein the sample training data comprises continuous at least one multi-element flow data;
the sample data prediction module is used for inputting each sample training data into the data flow prediction model to obtain a data flow prediction result corresponding to each sample training data;
And the model training module is used for performing supervision training on the data flow prediction model based on a preset loss function, the standard data flow result corresponding to the sample training data and the data flow prediction result, and iteratively updating model parameters of the data flow prediction model until the data flow prediction model converges to obtain a trained data flow prediction model.
10. A data flow prediction apparatus comprising:
the prediction data acquisition module is used for determining a date to be predicted, acquiring a multi-element flow data sequence in a preset time period before the date to be predicted from a historical flow log of transaction data based on a preset time dimension, wherein the multi-element flow data comprises flow data, a date covariate, a known transaction covariate and an unknown transaction covariate of the transaction data;
the prediction data processing module is used for performing zero filling operation and normalization processing on the multi-element flow data sequence to obtain data characteristics to be predicted;
the data flow prediction module is configured to input the data feature to be predicted into a trained data flow prediction model obtained by using the training method of the data flow prediction model according to any one of claims 1 to 7, and output a data flow prediction result.
11. A storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the method according to any of claims 1-8.
12. An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the steps of the method according to any of claims 1-8.
13. A computer program product having stored thereon at least one instruction, which when executed by a processor, implements the steps of the method according to any of claims 1 to 8.
CN202310670902.5A 2023-06-06 2023-06-06 Data flow prediction model training method, device, storage medium and equipment Pending CN116911431A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310670902.5A CN116911431A (en) 2023-06-06 2023-06-06 Data flow prediction model training method, device, storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310670902.5A CN116911431A (en) 2023-06-06 2023-06-06 Data flow prediction model training method, device, storage medium and equipment

Publications (1)

Publication Number Publication Date
CN116911431A true CN116911431A (en) 2023-10-20

Family

ID=88351902

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310670902.5A Pending CN116911431A (en) 2023-06-06 2023-06-06 Data flow prediction model training method, device, storage medium and equipment

Country Status (1)

Country Link
CN (1) CN116911431A (en)

Similar Documents

Publication Publication Date Title
CN108171260B (en) Picture identification method and system
CN111221726A (en) Test data generation method and device, storage medium and intelligent equipment
CN111144658B (en) Medical risk prediction method, device, system, storage medium and electronic equipment
CN108573358A (en) A kind of overdue prediction model generation method and terminal device
CN110503564A (en) Save case processing method, system, equipment and storage medium from damage based on big data
CN112561535A (en) Transaction dispute data processing method, device, equipment and storage medium
US20190220924A1 (en) Method and device for determining key variable in model
CN110688478A (en) Answer sorting method, device and storage medium
CN111611390B (en) Data processing method and device
CN110263136B (en) Method and device for pushing object to user based on reinforcement learning model
CN111178656A (en) Credit model training method, credit scoring device and electronic equipment
CN113609697A (en) Event network-based analog simulation method and device and computer equipment
CN116911431A (en) Data flow prediction model training method, device, storage medium and equipment
CN116168403A (en) Medical data classification model training method, classification method, device and related medium
EP4246375A1 (en) Model processing method and related device
CN114995728A (en) Rule configuration method and device, electronic equipment and storage medium
CN114756720A (en) Time sequence data prediction method and device
CN114897607A (en) Data processing method and device for product resources, electronic equipment and storage medium
CN111080394A (en) Matching method, device and storage medium
CN111882339A (en) Prediction model training and response rate prediction method, device, equipment and storage medium
CN112132260B (en) Training method, calling method, device and storage medium of neural network model
EP4089592A1 (en) Method for determining annotation capability information, related apparatus and computer program product
KR102449831B1 (en) Electronic device for providing information regarding new text, server for identifying new text and operation method thereof
CN115953060A (en) Method and system for constructing dynamically configurable social stability index model
CN117235469A (en) Data prediction method, device, storage medium and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination