A fund flow prediction analysis method for a fund pool based on deep learning
By extracting time-series features at multiple time scales and modeling the structure of the capital pool association graph, the problems of low accuracy and insufficient representation of correlation in existing capital flow prediction are solved, achieving high-precision and full-dimensional capital flow prediction with powerful anomaly early warning capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUIZHOU PLANNING & DESIGN INST OF POSTS & TELECOMM
- Filing Date
- 2026-04-21
- Publication Date
- 2026-06-05
AI Technical Summary
Existing methods for predicting cash flow are unable to effectively extract time-series features across multiple time scales and cannot fully characterize the relationships between cash pools, resulting in low prediction accuracy and a lack of anomaly warning capabilities.
We employ multi-timescale temporal feature extraction, adaptive attention fusion, and capital pool association graph structure modeling. We use deep learning methods to extract global association features of the relationships between capital pools and perform end-to-end capital flow prediction.
It significantly improves the accuracy and anti-interference ability of capital flow forecasting, reduces the mean absolute error, realizes full-dimensional and high-precision capital flow forecasting, and provides a reliable anomaly early warning mechanism.
Smart Images

Figure CN122155849A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial data analysis and prediction technology, and in particular to a method for predicting and analyzing the flow of funds in a pool of funds based on deep learning. Background Technology
[0002] With the rapid development of financial technology and the continuous improvement of the sophistication of corporate financial management, cash pooling has become a core tool for corporate group financial management. A cash pool refers to a fund operation model in which a group enterprise concentrates the funds of multiple member units into a single master account for unified allocation and management. Its purpose is to improve fund utilization efficiency, reduce financing costs, and strengthen financial control. In practice, commercial banks, insurance companies, securities companies, and other financial institutions, as well as large corporate groups, widely adopt the cash pooling model for daily fund management, involving various complex scenarios such as interbank fund transfers, cross-border fund aggregation, and internal settlements.
[0003] Cash flow forecasting is a crucial aspect of cash pooling management. Accurate forecasts help financial managers plan cash positions in advance, optimize investment allocation, and mitigate liquidity risks. Traditional cash flow forecasting methods primarily rely on expert experience and simple statistical models, such as moving averages, exponential smoothing, and ARIMA time series models. In recent years, with the development of deep learning technology, sequence models such as recurrent neural networks (RNNs), long short-term memory networks (LSTMs), and gated recurrent units (GRUs) have been widely applied in the field of time series forecasting, achieving significant progress in cash flow forecasting.
[0004] However, in practical applications, existing methods for predicting cash flow still have many technical limitations: On the one hand, while traditional Prophet time series decomposition methods can effectively capture trend components, periodic components, and holiday effects in time series, their fixed decomposition granularity and limited expressive power make it difficult to fully explore the multi-scale time series patterns contained in capital flow data. Capital flow data often simultaneously contains short-term fluctuations (such as changes in daily trading volume), medium-term cycles (such as weekly and monthly settlement patterns), and long-term trends (such as seasonal changes in capital demand). However, existing methods use a single-scale feature extraction strategy, which cannot adaptively capture periodic patterns across different time spans, thus limiting prediction accuracy.
[0005] On the other hand, existing methods have significant shortcomings in handling the relationships between multiple fund pools. In the actual operations of group enterprises or financial institutions, there are complex fund transfer relationships between different fund pools, including internal transfers, position allocation, and risk hedging. These relationships contain important predictive information. However, existing technologies mainly focus on time series modeling of individual fund pools, treating each fund pool as an independent object and ignoring the spatial dependencies and network topology between fund pools. This makes it impossible to effectively utilize the correlation information to improve prediction accuracy.
[0006] Furthermore, the existing Prophet+LightGBM solution separates the time series decomposition and machine learning regression processes, lacking an end-to-end joint optimization mechanism. This leads to inconsistencies between the objectives of feature extraction and prediction tasks, impacting the overall model performance. Additionally, this solution uses a weighted fusion approach to simply merge inflow and outflow prediction results, failing to adaptively learn the importance weights of features at different time scales, thus reducing the model's flexibility and adaptability.
[0007] A search revealed that the invention patent CN114154696A, entitled "Method, System, Computer Equipment and Storage Medium for Predicting Cash Flows," discloses a method for predicting cash flow. This patent uses the Prophet time series tool to decompose historical cash flow data into time series data, obtaining time series data including trend terms, cycle terms, activity effect terms, and error terms. Then, feature shift transformation is performed on the time series data to convert it into training data conforming to the input format of the LightGBM regression model. A cash inflow prediction model and a cash outflow prediction model are constructed and trained separately. Finally, the outputs of the two models are weighted and fused to obtain the prediction result.
[0008] The existing technical solution has the following characteristics: it integrates the advantages of time series models and machine learning regression models, and can uncover important time-related features; it summarizes important influencing factors through multi-source data exploration, and has relatively rich input features and model knowledge; it realizes separate prediction of capital inflows and outflows, and improves the pertinence of prediction.
[0009] However, the existing technical solution has the following limitations: Prophet time series decomposition uses a fixed decomposition granularity, which cannot adaptively extract multi-scale time series features; it establishes separate inflow and outflow prediction models, ignoring the correlation between different fund pools; it adopts a simple weighted fusion strategy, which cannot dynamically learn the importance weights of different features; and it lacks an end-to-end joint optimization mechanism, resulting in inconsistencies between feature extraction and prediction task objectives. Therefore, a new technical solution is urgently needed to solve the above technical problems. Summary of the Invention
[0010] This invention provides a solution to the technical problem that existing predictions of fund pool flows are difficult to effectively extract time-series features at multiple time scales and cannot fully characterize the relationships between fund pools, resulting in low prediction accuracy and a lack of anomaly warning capabilities.
[0011] To solve the above problems, the technical solution adopted by the invention is as follows: A deep learning-based method for predicting and analyzing the flow of funds in a capital pool includes the steps of acquiring a historical transaction dataset of the capital pool and preprocessing the dataset to obtain a time-series feature matrix. The method further includes the following steps: S01: Perform multi-time-scale temporal feature extraction on the temporal feature matrix to obtain at least two sets of temporal features at different time scales; S02: Based on the contribution of time series features at each time scale to the prediction results, dynamically assign fusion weights to time series features at each time scale, and perform weighted fusion of multiple sets of time series features based on the fusion weights to obtain fused time series features; S03: Construct a fund pool association graph structure based on the historical transaction association data between each fund pool, and input the fused time series features and the fund pool association graph structure into the graph feature extraction network to extract global association features that characterize the association relationship between fund pools; S04: Input the global correlation features and prediction time series encoding into the prediction decoder, and output the predicted value of capital flow for each capital pool in the target prediction period.
[0012] A deep learning-based system for predicting and analyzing the cash flow of a fund pool, characterized by comprising: The data acquisition module is used to acquire historical transaction datasets and real-time transaction data streams from multiple fund pools; The data preprocessing module is communicatively connected to the data acquisition module and is used to preprocess the historical transaction dataset to obtain a time-series feature matrix. A multi-scale feature extraction module, which is communicatively connected to the data preprocessing module, is used to extract time-series features from the time-series feature matrix at multiple time scales to obtain at least two sets of time-series features at different time scales. An adaptive attention fusion module, which is communicatively connected to the multi-scale feature extraction module, is used to dynamically allocate fusion weights according to the contribution of time-series features at each time scale, and to perform weighted fusion of multiple sets of time-series features to obtain fused time-series features. The fund pool association graph construction module is used to construct the fund pool association graph structure based on the historical transaction association data between various fund pools. The global association feature extraction module is communicatively connected to the adaptive attention fusion module and the fund pool association graph construction module, respectively, and is used to extract global association features that characterize the association relationship between fund pools by combining the fused temporal features and the fund pool association graph structure. The prediction decoding module is communicatively connected to the global correlation feature extraction module and is used to combine global correlation features with prediction time series encoding to output the predicted value of capital flow for each capital pool in the target prediction period. The processor is communicatively connected to each of the above modules and is used for the above-mentioned fund pool flow prediction and analysis method. The memory, which is communicatively connected to the processor, is used to store model parameters, historical transaction data, and prediction result data.
[0013] The principle and advantages of this scheme are as follows: The principle of this scheme is as follows: First, for the preprocessed time-series feature matrix, through a multi-time-scale time-series feature extraction step, the characteristics of fund flow changes under different time dimensions are simultaneously mined from the historical transaction data of the fund pool. This fully covers the fluctuation patterns of fund flow behavior in different time periods, avoiding the omission of key features caused by single-time-scale modeling. Second, based on the actual contribution of time-series features at each time scale to the fund flow prediction results, corresponding fusion weights are dynamically assigned to different time-series features. Through weighted fusion, efficient integration of multi-dimensional time-series features is achieved, strengthening core effective features while weakening the interference of low-contribution features and noisy data on the prediction results. Subsequently, based on the historical transactions between each fund pool... The associated data is used to construct a fund pool association graph structure, which intuitively represents the transaction and linkage relationships between different fund pools in the form of a graph structure. Then, the fused time series features and the fund pool association graph structure are simultaneously input into the graph feature extraction network to explore the implicit association influence and fund flow transmission patterns between different fund pools. The individual time series features of a single fund pool are upgraded into global association features that can represent the linkage relationships of all fund pools. Finally, the global association features that integrate individual time series patterns and group association characteristics are combined with the prediction time series encoding of the target prediction period and input into the prediction decoder. Through end-to-end decoding operations, the prediction values of fund flow for each fund pool within the target prediction period are accurately output, completing the full-dimensional and high-precision prediction of fund pool fund flow.
[0014] Compared with existing technologies, existing fund pool flow prediction technologies have the core technical problems of low prediction accuracy, weak generalization ability, and lack of early warning support for anomalies, which are difficult to effectively extract time-series features at multiple time scales and cannot fully characterize the relationships between fund pools.
[0015] Most existing technologies employ a single time-scale time series modeling approach, which can only capture the patterns of capital flow in fixed periods. This approach is prone to missing differentiated features such as short-term sudden capital fluctuations, medium-term operating cycle capital transactions, and long-term strategic capital allocation. In contrast, this solution uses a multi-time-scale feature extraction method to simultaneously cover capital flow behavior in different time periods. For example, it can capture full-dimensional features for capital flows in different periods such as daily high-frequency operating receipts and payments, monthly salary and tax payments, quarterly operating cash inflows, and annual investment and financing capital allocation for corporate groups. Compared with existing technologies, this approach avoids the omission of key predictive information and significantly improves the completeness of time series features. At the feature fusion level, existing technologies mostly use fixed-weight feature splicing or average fusion methods, which cannot distinguish the differentiated contributions of features at different time scales to the prediction results. They are easily interfered with by low-value noise data, and the prediction deviation is significantly amplified in special scenarios such as market fluctuations and holidays. In contrast, this solution dynamically allocates fusion weights based on feature contribution, which can adaptively adjust the influence weights of different time-series features. In special scenarios, it automatically strengthens the role of features at the corresponding time scale, significantly improving the scenario adaptability and anti-interference ability of the prediction model. At the level of relational modeling, most existing technologies perform independent predictions for single fund pools, completely ignoring the interconnected impact of fund transfers between different fund pools within a group or between related entities. They fail to capture the transmission patterns of fund flows across fund pools. In contrast, this solution fully explores the implicit linkage effects between different fund pools through fund pool relational graph structure modeling and global relational feature extraction. It upgrades independent prediction for single pools to global prediction through multi-pool collaboration. For example, it can accurately capture the transmission patterns of fund flows in scenarios such as fund allocation between the group headquarters and its subsidiaries, and payment linkage between fund pools of upstream and downstream cooperative enterprises. According to actual tests, the average absolute error of fund flow prediction can be reduced by more than 30% compared to existing independent prediction technologies for single pools. At the same time, the high-precision fund flow prediction values output by this solution can provide a reliable benchmark for defining the normal flow range of fund pools, filling the technical gap of existing technologies that cannot achieve early warning of abnormal flows due to insufficient prediction accuracy.
[0016] Furthermore, in step S01, multi-scale temporal feature extraction is performed using the multi-scale temporal feature extraction network MSFEN. The multi-scale temporal feature extraction network includes at least three parallel one-dimensional convolutional branches with different receptive field sizes. Each convolutional branch extracts temporal features at different time scales, and the outputs of each convolutional branch are concatenated through skip connections. Specifically, the first convolutional branch uses a one-dimensional convolutional layer with a kernel size of 3 to extract short-term temporal features, the second convolutional branch uses a one-dimensional convolutional layer with a kernel size of 7 to extract medium-term temporal features, and the third convolutional branch uses a one-dimensional convolutional layer with a kernel size of 15 to extract long-term temporal features.
[0017] Furthermore, in step S02, the fusion weights are dynamically allocated through the Adaptive Attention Fusion (AAM) module, and the calculation formula for the fusion weights is as follows:
[0018] in: The attention weight for the i-th time scale feature, with a value between 0 and 1; Let be the learnable weight matrix corresponding to the i-th time scale feature, with dimension d×d; Let be the feature vector of the i-th time scale, with dimension d×1; Let be the bias vector corresponding to the i-th time scale feature, with a dimension of d×1; This represents the total number of features on the time scale. For exponential function operations; the fused feature vector The calculation formula is: .
[0019] Furthermore, the method for constructing the fund pool association diagram structure in S03 includes: S51 calculates the transaction frequency weight between any two fund pools i and j. :
[0020] in, This represents the number of transfers from fund pool i to fund pool j within a historical period. The maximum number of transfers between any two funds pool pairs; the transaction frequency weight. This is the ratio of the number of transfers from pool i to pool j within a historical period to the maximum number of transfers between all pool pairs. S52 calculates the weight of fund flow between any two fund pools i and j. :
[0021] in, Let t be the amount transferred from fund pool i to fund pool j at time t. Let be the amount transferred from fund pool j to fund pool i at time t. The weight of the fund flow is the total time step. It is the ratio of the cumulative transfer amount from fund pool i to fund pool j to the cumulative transfer amount from fund pool j to fund pool i within the historical period. S53 performs weighted fusion based on the transaction frequency weight and fund flow weight to construct the adjacency matrix A of the fund pool association graph structure, wherein the elements of the adjacency matrix are... The calculation formula is:
[0022] Wherein, β is the weight balance coefficient, with a value range of 0.3 to 0.7; the graph feature extraction network is a graph convolutional network (GCN), which updates the input features layer by layer by adding a self-connected adjacency matrix, degree matrix and learnable weight matrix, and performs non-linear transformation through the ReLU activation function to output global correlation features; The feature update formula for the graph convolutional network (GCN) is as follows:
[0023] in: The input feature matrix of the l-th layer graph convolutional network; : The output feature matrix of the l-th layer graph convolutional network; Add a self-connected adjacency matrix. , where I is the identity matrix; Degree matrix, ; The learnable weight matrix of the l-th layer; Activation function ).
[0024] Furthermore, in step S04, the prediction decoder incorporates a Temporal Dynamic Evolution (TDEM) mechanism, and the prediction output calculation formula of the prediction decoder is as follows:
[0025] in: Forecasted standardized cash flows; The global association feature has a dimension of d×1; Predictive temporal coding uses sine and cosine functions for temporal feature encoding. , This is the k-th periodic component; The market sentiment vector is obtained by encoding external macroeconomic indicators and market sentiment characteristics, and has a dimension of d×1. For vector concatenation operation; MLP: Multilayer Perceptron, which contains at least two fully connected layers and non-linear activation functions; The output layer activation function uses the Sigmoid function to map the output to the interval between 0 and 1. Dynamic correction factor ,in The correction factor ranges from 0.05 to 0.2. This is the attenuation coefficient, with a value ranging from 0.01 to 0.1; To predict the time span; The dynamic correction vector is calculated based on autoregressive feedback of historical prediction errors. ,in Let be the i-th order autoregressive coefficient. Let be the prediction error at time ti, and L be the autoregression order, ranging from 3 to 7.
[0026] Furthermore, the method also includes a pre-training step for the prediction model: constructing a training dataset, setting model training hyperparameters, and iteratively optimizing the network parameters of multi-scale temporal feature extraction, adaptive weight fusion, graph feature extraction, and prediction decoder through backpropagation algorithm until the model converges; The pre-training step uses the Adaptive Multi-Scale Loss Function (AMSL) for parameter optimization. The calculation formula for the Adaptive Multi-Scale Loss Function is as follows:
[0027]
[0028] in: Total loss value; Number of prediction timescales, S≥2; The adaptive weights at the s-th time scale ,in This is a temperature parameter, with a value ranging from 2 to 5. Let be the prediction error ratio at the s-th time scale. ; The combined loss at the s-th time scale; Mean squared error loss function ; for loss function ,in for The loss hyperparameters range from 1.0 to 2.0; θ is the combination coefficient, ranging from 0.3 to 0.7. The pre-training step employs a dynamic learning rate adjustment strategy, with an initial learning rate... The value ranges from 0.0001 to 0.001. The learning rate decay adopts a cosine annealing strategy. An early stopping mechanism is used during training. Training stops when the validation set loss no longer decreases for 5-15 consecutive training cycles.
[0029] Furthermore, the method also includes an abnormal flow early warning step: Step E1: Establish a normal liquidity benchmark model based on the historical capital flow data of the capital pool to determine the normal fluctuation range of capital flow in each capital pool; Step E2: Compare the predicted cash flow value output in step D with the normal fluctuation range. When the predicted cash flow deviation exceeds the preset deviation threshold, trigger an abnormal warning signal. The formula for calculating the deviation is:
[0030] in: This represents the projected cash flow value. This represents the average of normal historical cash flows. The standard deviation of historical normal cash flows; The preset deviation threshold has a value range of 2-3. Attached Figure Description
[0031] Figure 1 This is a flowchart of the steps of the present invention; Figure 2 This is a flowchart of the present invention; Figure 3 This is a schematic diagram of the 6-node association network + adjacency matrix of the present invention; Detailed Implementation Example 1 As attached Figure 1-3 As shown, a deep learning-based method for predicting and analyzing the flow of funds in a capital pool includes the steps of acquiring a historical transaction dataset of the capital pool and preprocessing the dataset to obtain a time-series feature matrix. The method further includes the following steps: S01: Perform multi-time-scale temporal feature extraction on the temporal feature matrix to obtain at least two sets of temporal features at different time scales; S02: Based on the contribution of time series features at each time scale to the prediction results, dynamically assign fusion weights to time series features at each time scale, and perform weighted fusion of multiple sets of time series features based on the fusion weights to obtain fused time series features; S03: Construct a fund pool association graph structure based on the historical transaction association data between each fund pool, and input the fused time series features and the fund pool association graph structure into the graph feature extraction network to extract global association features that characterize the association relationship between fund pools; S04: Input the global correlation features and prediction time series encoding into the prediction decoder, and output the predicted value of capital flow for each capital pool in the target prediction period.
[0032] A deep learning-based fund pool flow prediction and analysis system includes a data acquisition module for acquiring historical transaction datasets and real-time transaction data streams from multiple fund pools. The data preprocessing module is communicatively connected to the data acquisition module and is used to preprocess the historical transaction dataset to obtain a time-series feature matrix. A multi-scale feature extraction module, which is communicatively connected to the data preprocessing module, is used to extract time-series features from the time-series feature matrix at multiple time scales to obtain at least two sets of time-series features at different time scales. An adaptive attention fusion module, which is communicatively connected to the multi-scale feature extraction module, is used to dynamically allocate fusion weights according to the contribution of time-series features at each time scale, and to perform weighted fusion of multiple sets of time-series features to obtain fused time-series features. The fund pool association graph construction module is used to construct the fund pool association graph structure based on the historical transaction association data between various fund pools. The global association feature extraction module is communicatively connected to the adaptive attention fusion module and the fund pool association graph construction module, respectively, and is used to extract global association features that characterize the association relationship between fund pools by combining the fused temporal features and the fund pool association graph structure. The prediction decoding module is communicatively connected to the global correlation feature extraction module and is used to combine global correlation features with prediction time series encoding to output the predicted value of capital flow for each capital pool in the target prediction period. The processor is communicatively connected to each of the above modules and is used to execute the fund pool flow prediction and analysis method as described in any one of claims 1 to 7. The memory, which is communicatively connected to the processor, is used to store model parameters, historical transaction data, and prediction result data.
[0033] The principle of this scheme is as follows: First, for the preprocessed time-series feature matrix, through a multi-time-scale time-series feature extraction step, the characteristics of fund flow changes under different time dimensions are simultaneously mined from the historical transaction data of the fund pool. This fully covers the fluctuation patterns of fund flow behavior in different time periods, avoiding the omission of key features caused by single-time-scale modeling. Second, based on the actual contribution of time-series features at each time scale to the fund flow prediction results, corresponding fusion weights are dynamically assigned to different time-series features. Through weighted fusion, efficient integration of multi-dimensional time-series features is achieved, strengthening core effective features while weakening the interference of low-contribution features and noisy data on the prediction results. Subsequently, based on the historical transactions between each fund pool... The associated data is used to construct a fund pool association graph structure, which intuitively represents the transaction and linkage relationships between different fund pools in the form of a graph structure. Then, the fused time series features and the fund pool association graph structure are simultaneously input into the graph feature extraction network to explore the implicit association influence and fund flow transmission patterns between different fund pools. The individual time series features of a single fund pool are upgraded into global association features that can represent the linkage relationships of all fund pools. Finally, the global association features that integrate individual time series patterns and group association characteristics are combined with the prediction time series encoding of the target prediction period and input into the prediction decoder. Through end-to-end decoding operations, the prediction values of fund flow for each fund pool within the target prediction period are accurately output, completing the full-dimensional and high-precision prediction of fund pool fund flow.
[0034] Compared with existing technologies, existing fund pool flow prediction technologies have the core technical problems of low prediction accuracy, weak generalization ability, and lack of early warning support for anomalies, which are difficult to effectively extract time-series features at multiple time scales and cannot fully characterize the relationships between fund pools.
[0035] Most existing technologies employ a single time-scale time series modeling approach, which can only capture the patterns of capital flow in fixed periods. This approach is prone to missing differentiated features such as short-term sudden capital fluctuations, medium-term operating cycle capital transactions, and long-term strategic capital allocation. In contrast, this solution uses a multi-time-scale feature extraction method to simultaneously cover capital flow behavior in different time periods. For example, it can capture full-dimensional features for capital flows in different periods such as daily high-frequency operating receipts and payments, monthly salary and tax payments, quarterly operating cash inflows, and annual investment and financing capital allocation for corporate groups. Compared with existing technologies, this approach avoids the omission of key predictive information and significantly improves the completeness of time series features. At the feature fusion level, existing technologies mostly use fixed-weight feature splicing or average fusion methods, which cannot distinguish the differentiated contributions of features at different time scales to the prediction results. They are easily interfered with by low-value noise data, and the prediction deviation is significantly amplified in special scenarios such as market fluctuations and holidays. In contrast, this solution dynamically allocates fusion weights based on feature contribution, which can adaptively adjust the influence weights of different time-series features. In special scenarios, it automatically strengthens the role of features at the corresponding time scale, significantly improving the scenario adaptability and anti-interference ability of the prediction model. At the level of relational modeling, most existing technologies perform independent predictions for single fund pools, completely ignoring the interconnected impact of fund transfers between different fund pools within a group or between related entities. They fail to capture the transmission patterns of fund flows across fund pools. In contrast, this solution fully explores the implicit linkage effects between different fund pools through fund pool relational graph structure modeling and global relational feature extraction. It upgrades independent prediction for single pools to global prediction through multi-pool collaboration. For example, it can accurately capture the transmission patterns of fund flows in scenarios such as fund allocation between the group headquarters and its subsidiaries, and payment linkage between fund pools of upstream and downstream cooperative enterprises. According to actual tests, the average absolute error of fund flow prediction can be reduced by more than 30% compared to existing independent prediction technologies for single pools. At the same time, the high-precision fund flow prediction values output by this solution can provide a reliable benchmark for defining the normal flow range of fund pools, filling the technical gap of existing technologies that cannot achieve early warning of abnormal flows due to insufficient prediction accuracy.
[0036] Furthermore, in step S01, multi-scale temporal feature extraction is performed using the Multi-Scale Temporal Feature Extraction Network (MSFEN). This network comprises at least three parallel one-dimensional convolutional branches with different receptive field sizes. Each convolutional branch extracts temporal features at different time scales, and the outputs of each branch are concatenated via skip connections. Specifically, the first convolutional branch uses a one-dimensional convolutional layer with a kernel size of 3 to extract short-term temporal features, the second branch uses a one-dimensional convolutional layer with a kernel size of 7 to extract medium-term temporal features, and the third branch uses a one-dimensional convolutional layer with a kernel size of 15 to extract long-term temporal features. The MSFEN network, composed of at least three parallel one-dimensional convolutional branches with different receptive field sizes, extracts short-term, medium-term, and long-term temporal features respectively using one-dimensional convolutional layers with kernel sizes of 3, 7, and 15. Simultaneously, the outputs of each branch are concatenated via skip connections. It can capture the changing patterns of capital flows over different time periods in parallel, without loss, and without delay within the same network structure: Convolutional kernel 3 can finely capture high-frequency, sudden, and instantaneous capital fluctuation features such as intraday and recent days, avoiding the smoothing and filtering of short-term abnormal information; Convolutional kernel 7 can effectively extract medium-term capital flow patterns such as weekly and ten-day periods, adapting to stable business scenarios such as regular operating income and expenditure and periodic payments; Convolutional kernel 15 can fully mine monthly, quarterly, and even longer-term capital trends, seasonal fluctuations, and strategic scheduling features, preventing the loss of long-term trend information due to insufficient receptive field; Parallel branch design avoids feature loss and computational redundancy caused by serial extraction, while skip connections retain the original feature information at each scale and prevent gradient vanishing, enabling the network to simultaneously possess the triple capabilities of fine-grained short-term perception, medium-term trend grasp, and long-term trend modeling, comprehensively covering the complex characteristics of multi-period superposition of capital flows, and significantly improving the completeness and robustness of time-series feature extraction.
[0037] Furthermore, in step S02, the fusion weights are dynamically allocated through the Adaptive Attention Fusion (AAM) module, and the calculation formula for the fusion weights is as follows:
[0038] in: The attention weight for the i-th time scale feature, with a value between 0 and 1; Let be the learnable weight matrix corresponding to the i-th time scale feature, with dimension d×d; Let be the feature vector of the i-th time scale, with dimension d×1; Let be the bias vector corresponding to the i-th time scale feature, with a dimension of d×1; This represents the total number of features on the time scale. For exponential function operations; the fused feature vector The calculation formula is: The adaptive attention fusion module (AAM) dynamically calculates and allocates fusion weights based on feature importance, employs Softmax normalization to adaptively adjust weights within the 0–1 range, and completes multi-scale feature fusion using a weighted summation method. This automatically strengthens time-scale features that contribute significantly to fund flow prediction while suppressing low-contribution features and noise interference, avoiding feature redundancy and dilution of effective information caused by traditional fixed weights, average fusion, or simple splicing. The learnable weight matrix and bias vector allow the model to autonomously optimize feature weight allocation logic during training based on different fund pools, business cycles, and market environments, without the need for manual parameter presets. In scenarios such as holiday fund surges, concentrated quarterly repayments, and sudden large-scale transfers, it can adaptively highlight corresponding key scale features, significantly improving the accuracy and scenario adaptability of feature fusion. The final output fused feature vector combines effective information at each scale with dynamic weight optimization attributes, focusing more on the core laws of fund flow compared to traditional fusion methods, significantly reducing subsequent prediction bias, and providing high-quality, highly recognizable feature inputs for fund pool correlation modeling and final prediction output.
[0039] Furthermore, the method for constructing the fund pool association diagram structure in S03 includes: S031 Calculates the transaction frequency weight between any two fund pools i and j. :
[0040] in, This represents the number of transfers from fund pool i to fund pool j within a historical period. The maximum number of transfers between any two funds pool pairs; the transaction frequency weight. This is the ratio of the number of transfers from pool i to pool j within a historical period to the maximum number of transfers between all pool pairs. S032 calculates the weight of fund flow between any two fund pools i and j. :
[0041] in, Let t be the amount transferred from fund pool i to fund pool j at time t. Let be the amount transferred from fund pool j to fund pool i at time t. The weight of the fund flow is the total time step. It is the ratio of the cumulative transfer amount from fund pool i to fund pool j to the cumulative transfer amount from fund pool j to fund pool i within the historical period. S033 constructs an adjacency matrix A for the fund pool association graph structure by weighting and fusing the transaction frequency weight and the fund flow weight, wherein the elements of the adjacency matrix are... The calculation formula is:
[0042] Wherein, β is the weight balance coefficient, with a value range of 0.3 to 0.7; the graph feature extraction network is a graph convolutional network (GCN), which updates the input features layer by layer by adding a self-connected adjacency matrix, degree matrix and learnable weight matrix, and performs non-linear transformation through the ReLU activation function to output global correlation features; The feature update formula for the graph convolutional network (GCN) is as follows:
[0043] in: The input feature matrix of the l-th layer graph convolutional network; : The output feature matrix of the l-th layer graph convolutional network; Add a self-connected adjacency matrix. , where I is the identity matrix; Degree matrix, ; The learnable weight matrix of the l-th layer; Activation function By combining transaction frequency weights and fund flow weights in a weighted fusion to construct an adjacency matrix for fund pool association graphs, and employing a graph convolutional network (GCN) with self-connections for global association feature extraction, this approach can accurately quantify the true strength of the associations and fund transmission relationships between fund pools, while ensuring stable graph network training and sufficient feature extraction. Transaction frequency weights reflect the frequency of transactions between fund pools and the tightness of business linkages, while fund flow weights reflect the scale and actual impact of fund transactions. The weighted fusion of these two factors takes into account both "frequency" and "magnitude," making it more closely aligned with the real patterns of fund linkages than a single indicator. The weight balancing coefficient β can be flexibly adapted to the correlation emphasis under different business scenarios, making the correlation graph modeling more in line with actual business. Adding self-connected adjacency matrices and degree matrix normalization effectively avoids isolated nodes, gradient vanishing and numerical instability problems. Combined with the ReLU activation function, nonlinear feature transformation is achieved, enabling GCN to fully explore the implicit correlations across fund pools, fund transmission paths and global linkage patterns, upgrade the independent time series features of a single fund pool to global correlation features, greatly improve the ability to perceive the linkage fluctuations of related fund pools, and significantly improve the accuracy and stability of prediction under complex fund networks.
[0044] Furthermore, in step S04, the prediction decoder incorporates a Temporal Dynamic Evolution (TDEM) mechanism, and the prediction output calculation formula of the prediction decoder is as follows:
[0045] in: Forecasted standardized cash flows; The global association feature has a dimension of d×1; Predictive temporal coding uses sine and cosine functions for temporal feature encoding. , This is the k-th periodic component; The market sentiment vector is obtained by encoding external macroeconomic indicators and market sentiment characteristics, and has a dimension of d×1. For vector concatenation operation; MLP: Multilayer Perceptron, which contains at least two fully connected layers and non-linear activation functions; The output layer activation function uses the Sigmoid function to map the output to the interval between 0 and 1. Dynamic correction factor ,in The correction factor ranges from 0.05 to 0.2. This is the attenuation coefficient, with a value ranging from 0.01 to 0.1; To predict the time span; The dynamic correction vector is calculated based on autoregressive feedback of historical prediction errors. ,in Let be the i-th order autoregressive coefficient. Let be the prediction error at time ti, and L be the autoregressive order, ranging from 3 to 7. A temporal dynamic evolution mechanism (TDEM) is introduced into the prediction decoder, which effectively integrates global correlation features, sine and cosine time-series encoding, and external market sentiment vectors. Combined with a dynamic correction vector based on historical prediction errors, the final prediction is completed. The advantages are: sine and cosine time-series encoding accurately injects cyclical information, enabling the model to automatically learn the intraday, weekly, monthly, and quarterly cyclical patterns of capital flows; the external market sentiment vector incorporates macroeconomic indicators and public opinion influences into the prediction system, effectively improving the model's adaptability to changes in the external environment; and the MLP (Multilayer Perceptron) is used for further analysis. It achieves high-dimensional nonlinear mapping and standardized output with the Sigmoid activation function, ensuring stable prediction results that conform to the business numerical range. The dynamic correction coefficient decays exponentially with the prediction time span, which can reasonably control the long-term correction magnitude. Combined with the autoregressive dynamic correction vector based on historical errors, it can compensate for the cumulative bias of the model in real time and significantly reduce long-term prediction drift. Compared with traditional time series prediction methods, when facing non-stationary, strongly correlated, and externally influenced capital flow scenarios, the prediction is more in line with actual fluctuations, has higher long-term accuracy, and stronger robustness. At the same time, it achieves accurate prediction by integrating time series patterns, correlations, external influences, and error feedback.
[0046] Furthermore, the method also includes a pre-training step for the prediction model: constructing a training dataset, setting model training hyperparameters, and iteratively optimizing the network parameters of multi-scale temporal feature extraction, adaptive weight fusion, graph feature extraction, and prediction decoder through backpropagation algorithm until the model converges; The pre-training step uses the Adaptive Multi-Scale Loss Function (AMSL) for parameter optimization. The calculation formula for the Adaptive Multi-Scale Loss Function is as follows:
[0047]
[0048] in: Total loss value; Number of prediction timescales, S≥2; The adaptive weights at the s-th time scale ,in This is a temperature parameter, with a value ranging from 2 to 5. Let be the prediction error ratio at the s-th time scale. ; The combined loss at the s-th time scale; Mean squared error loss function ; for loss function ,in for The loss hyperparameters range from 1.0 to 2.0; θ is the combination coefficient, ranging from 0.3 to 0.7. The pre-training step employs a dynamic learning rate adjustment strategy, with an initial learning rate... The value range is from 0.0001 to 0.001. The learning rate decays using a cosine annealing strategy. An early stopping mechanism is employed during training; training stops when the validation set loss no longer decreases for 5-15 consecutive training epochs. The adaptive multi-scale loss function AMSL is used for model optimization, and pre-training is completed in conjunction with the cosine annealing dynamic learning rate and early stopping mechanism. This approach can adaptively balance errors at different scales in multi-timescale prediction tasks, considering both global accuracy and outlier robustness, achieving stable and rapid convergence while avoiding overfitting. The adaptive multi-scale loss automatically allocates weights based on the prediction error ratios at different time scales, focusing on optimizing scales with larger errors. This approach addresses the shortcomings of traditional fixed-weight loss methods in balancing short-term and long-term predictions. It integrates MSE and Huber loss to ensure prediction accuracy under normal fluctuations while maintaining strong robustness against large-scale fund fluctuations and extreme values, preventing excessive interference from anomalous samples during model training. The cosine annealing learning rate strategy enables rapid convergence in the early stages of training and fine-tuning in the later stages. An early stopping mechanism prevents overfitting by stopping training promptly. Overall, the model achieves stable convergence and stronger generalization ability across various fund pool scenarios. Multi-period joint prediction accuracy is significantly improved, and both training efficiency and model reliability surpass traditional single-loss and fixed-learning-rate training methods.
[0049] Furthermore, the method also includes an abnormal flow early warning step: S051: Establish a normal liquidity benchmark model based on the historical capital flow data of the capital pool to determine the normal fluctuation range of capital flow in each capital pool; S052: Compare the predicted cash flow value output by S04 with the normal fluctuation range. When the predicted cash flow deviation exceeds the preset deviation threshold, trigger an abnormal warning signal. The formula for calculating the deviation is:
[0050] in: This represents the projected cash flow value. This represents the average of normal historical cash flows. The standard deviation of historical normal cash flows; The system uses a preset deviation threshold, ranging from 2 to 3. By establishing a benchmark model based on historical normal capital flow data and employing a deviation calculation formula to quantitatively compare the predicted capital flow value with the normal fluctuation range, it can accurately identify abnormal capital fluctuations in a standardized, unbiased, and stable manner. Using the historical mean as the normal flow benchmark and the standard deviation as the fluctuation boundary, it objectively reflects the flow pattern of the capital pool itself, avoiding subjectivity and misjudgment caused by manually setting thresholds. The deviation threshold is set in the range of 2–3 times the standard deviation, which conforms to the normal distribution judgment criteria in the financial and capital management fields. It can effectively filter out normal small fluctuations in daily life and sensitively capture abnormal behaviors that deviate from the normal range, such as large transfers, concentrated payments, and sudden inflows / outflows. This enables early detection, early warning, and no false alarms or omissions, providing a directly applicable quantitative early warning basis for capital risk prevention and liquidity security management. It fills the gap in existing technologies that only make predictions and lack proactive and standardized abnormal early warning capabilities.
[0051] The application scenario of this embodiment is as follows: A large enterprise group includes one headquarters main fund pool and 24 subsidiary fund sub-pools, totaling 25 fund pool nodes. It needs to predict the daily fund inflow and outflow scale for the next 1-30 days, and at the same time realize early warning of abnormal fund flows.
[0052] The hardware operating environment of this embodiment is: Intel Xeon 8375C CPU, NVIDIA A10080G GPU, 128G memory; the software operating environment is: Ubuntu 20.04 operating system, Python 3.9, PyTorch 2.0 deep learning framework, PyTorch Geometric graph neural network library.
[0053] The complete execution steps of the method in this embodiment are as follows: S00 data acquisition and preprocessing, generating time series feature matrix This step is a prerequisite for the implementation of the invention, used to transform the raw transaction data into a standardized time-series feature matrix that can be input into the model. The specific implementation is as follows: Data collection: Through the group's financial system and the direct connection interface between banks and enterprises, historical transaction datasets of 25 fund pools for two consecutive years (730 days) are collected. Each transaction data includes: transaction time, payer fund pool ID, payee fund pool ID, transaction amount, transaction type (operating receipts and payments, salary payment, tax payment, investment and financing transfer, internal transactions, etc.), and whether the transaction occurred on a holiday / end of the month / end of the quarter / end of the year.
[0054] Data cleaning: Missing value handling: Fill with the historical average of the same fund pool, same period and same transaction type; features with a missing rate of more than 30% are removed. Outlier handling: The 3σ principle is used to remove extreme abnormal transactions whose single transaction amount exceeds three times the standard deviation of the historical average, while retaining large transactions within the normal operating range; Duplicate value handling: Delete duplicate transaction records with identical transaction time, payee / payee, and transaction amount.
[0055] Time series data aggregation and feature engineering: Using natural days as the time step, aggregated by the dimension of capital pool, generating 8 basic characteristics for each capital pool: total capital inflow, total capital outflow, net inflow, number of transactions, maximum amount of a single transaction, proportion of internal transactions, proportion of operating transactions, and proportion of investment and financing transactions. Derived time characteristics: six time dimensions including whether the day of generation is a working day, a holiday, the end of the month, the end of the quarter, the end of the year, and the week number of the current month; Ultimately, each fund pool corresponds to 14-dimensional features daily, and the 25 fund pools are aligned according to time steps to generate the original time-series feature matrix with dimensions [730, 25, 14] (time step × number of fund pools × feature dimension).
[0056] Data standardization: The Z-Score standardization method is used to standardize each feature dimension separately. The calculation formula is as follows: Where x is the original feature value, This is the mean of the feature across the entire training data. This represents the standard deviation of the feature in the full training data; after standardization, all feature values have a mean of 0 and a variance of 1, eliminating the impact of dimensional differences on model training.
[0057] Dataset partitioning: The standardized time-series feature matrix is divided into training set (first 80%, 584 days), validation set (middle 10%, 73 days), and test set (last 10%, 73 days) in chronological order. The partitioning process does not disrupt the chronological order to avoid leakage of time-series data.
[0058] Sliding window construction: The sliding window method is used to construct the model input samples. The historical input window length is set to 30 days (i.e., based on the historical data of the past 30 days, the data of the future target period is predicted). The prediction window length can be configured to 1 day, 7 days, or 30 days. The input of each sample is a time series feature matrix of [30, 25, 14], and the corresponding label is the actual value of the daily capital inflow / outflow of each capital pool within the prediction window.
[0059] Step S01: Multi-timescale temporal feature extraction This step uses the Multi-Scale Temporal Feature Extraction Network (MSFEN) to extract features from the input temporal feature matrix at multiple time scales. The specific implementation is as follows: Network Structure: The multi-scale temporal feature extraction network MSFEN contains three parallel one-dimensional convolutional branches. The input to each branch is the temporal feature matrix output from step S00, with an input dimension of [batch_size, 30, 14] (batch size × history window length × feature dimension). The structure of each branch is as follows: The first branch (short-term feature extraction) uses a single 1D convolutional layer with a kernel size of 3, a stride of 1, padding of 1, an output channel count of 64, and an activation function of ReLU; it is used to extract short-term, high-frequency capital fluctuation features within 3 days, such as intraday trading fluctuations and overnight capital transfers. The second branch (mid-term feature extraction) uses a single one-dimensional convolutional layer with a kernel size of 7, a stride of 1, padding of 3, an output channel count of 64, and an activation function of ReLU; it is used to extract mid-term cycle features of about 7 days, such as weekly operating payment and receipt patterns and weekly position scheduling. The third branch (long-term feature extraction): uses a single one-dimensional convolutional layer with a kernel size of 15, a stride of 1, padding of 7, an output channel count of 64, and the activation function ReLU; it is used to extract long-term trend features over 15 days, such as monthly salary payments, quarterly tax payments, and seasonal financial fluctuations. Feature concatenation and skip connections: The output feature dimensions of the three branches are all [batch_size, 30, 64]. The outputs of the three branches are concatenated in the channel dimension. At the same time, the original input features are passed through a 1×1 one-dimensional convolution (output channel number 64) through skip connections and then added to the concatenated features. Finally, the multi-scale temporal features are output with dimensions [batch_size, 30, 192]. Feature dimensionality reduction and output: By using a 1×1 one-dimensional convolutional layer, the number of concatenated feature channels is reduced to 64, resulting in 3 sets of time-series features corresponding to short-term, medium-term, and long-term respectively. The feature dimension of each set is [batch_size, 30, 64], thus completing the extraction of time-series features at multiple time scales.
[0060] Step S02 Adaptive attention weight allocation and multi-scale feature fusion This step uses the Adaptive Attention Fusion (AAM) module to dynamically assign fusion weights to temporal features at different time scales, thus completing weighted fusion. The specific implementation is as follows: Feature Dimension Alignment: The three sets of temporal features output from step S01 are processed by global average pooling to obtain feature vectors for each time scale, each with dimensions [batch_size, 64] (i.e., feature dimension d = 64), denoted as follows: (short term), (Mid-term) (Long-term), total number of time scales K=3.
[0061] Attention weight calculation: For each time scale feature vector, the corresponding attention weight is calculated using the following formula: In this embodiment, the learnable weight matrix The matrix has dimensions of 64×64 and is initialized as a random matrix following a normal distribution; the bias vector... The dimension is 64×1, initialized to 0; It is the natural exponential function; the calculated result is... Let be the attention weight for the i-th time scale feature, with a value ranging from 0 to 1, and satisfying the following conditions: .
[0062] Weighted Feature Fusion: Based on the calculated attention weights, the three sets of temporal features are weighted and summed to obtain the fused temporal features. The calculation formula is as follows: fused feature vector With a dimension of [batch_size, 64], this feature integrates short-term, medium-term, and long-term time series patterns, and strengthens the feature dimension that contributes more to the prediction results through dynamic weights.
[0063] Step S03: Construction of the Fund Pool Relationship Graph and Extraction of Global Relationship Features This step constructs a relational graph structure based on historical transaction data between fund pools, combines fused temporal features, and extracts global relational features through a graph convolutional network. The specific implementation is as follows: Sub-step S031: Construct the capital pool relationship graph structure The graph representing the fund pool is a directed weighted graph G=(V,E,A), where: Node set V: Each fund pool corresponds to one node, and in this embodiment, the number of nodes N=25; Edge set E: If there are historical transaction records between two fund pools, then there exists a directed edge; Adjacency matrix A: 25×25 dimensions, matrix elements This represents the association weight between fund pool i and fund pool j. The specific construction process is as follows: Calculate the transaction frequency weights: Based on historical data from the training set, calculate the transaction frequency weights between any two funding pools i and j. The formula is: in, The training set contains the cumulative number of transfers from fund pool i to fund pool j within a historical period. This represents the maximum number of transfers between all fund pool pairs; in this example, the number of transfers from the headquarters main pool to subsidiary A sub-pool is 1260, which is the maximum value across all pools. The transaction frequency weight ranges from 0 to 1.
[0064] Calculate the weights of fund flows: Based on historical data from the training set, calculate the weights of fund flows between any two fund pools i and j. The formula is: in, Let t be the amount transferred from fund pool i to fund pool j at time t. Let be the amount transferred from pool j to pool i at time t, and T be the total training time step of 584 days. To avoid a denominator of 0, if there is no transfer record from pool j to i, the denominator is set to 1e-8. To ensure the stability of the weight values, the calculation results are normalized using min-max normalization. Map to the 0-1 interval.
[0065] Weighted fusion to generate adjacency matrix: The adjacency matrix elements are obtained by weighting and fusing the transaction frequency weight and the fund flow weight. The formula is: In this embodiment, the weight balance coefficient β is set to 0.5 to take into account the impact of transaction frequency and capital scale; finally, a 25×25 directed weighted adjacency matrix A is generated.
[0066] Sub-step S032 Global Association Feature Extraction A two-layer graph convolutional network (GCN) is used as the graph feature extraction network. The input is a graph structure that fuses temporal features and the fund pool association, and the output is a global association feature. The specific implementation is as follows: Graph network input processing: Node feature matrix: The fused time series features output in step S02 are expanded according to the fund pool nodes to generate a node feature matrix H0 with dimensions [25, 64] (number of nodes × feature dimension). Adjacency matrix processing: Add self-connects to the adjacency matrix to obtain A′=A+I, where I is a 25×25 identity matrix, to avoid the loss of node features during convolution; Calculate the degree matrix: Calculate the degree matrix D corresponding to the adjacency matrix after adding self-joins, where the degree matrix elements... Off-diagonal elements are 0; Graph Convolutional Feature Update: The feature update formula for a 2-layer GCN is: in: Layer 1 GCN: Input Features The dimension is [25, 64], and the learnable weight matrix is... The dimension is 64×128, and the output features are... The dimensions are [25, 128], and the activation function is ReLU; Layer 2 GCN: Input Features The dimension is [25, 128], the learnable weight matrix W1 has a dimension of 128×64, and the output features are... The dimensions are [25, 64], and the activation function is ReLU; Global correlation feature output: For the node feature matrix output by the second-layer GCN, perform global average pooling and max pooling along the node dimension, and concatenate the pooling results to obtain the final global correlation features. With dimensions of [batch_size, 128], this feature fully represents the relationships, fund transmission patterns, and global linkage characteristics among all fund pools.
[0067] Step S04: Prediction Decoding and Capital Flow Prediction Output This step utilizes the predictive decoder of the built-in Temporal Dynamic Evolution (TDEM) mechanism, combined with global correlation features and predictive temporal coding, to output the predicted value of capital flow for the target prediction period. The specific implementation is as follows: Predictive timing code generation: For each time step t of the target prediction period, predictive timing codes are generated using sine and cosine functions. The encoding dimension is 128, and the calculation formula is: Where k is the encoding dimension index. , t represents the encoding dimension; t represents the time step within the prediction window, ranging from 1 to the prediction window length (30 in this embodiment); the final generated prediction temporal encoding dimension is [batch_size, 30, 128]. Average pooling is performed on the encoding of each time step to obtain a temporal encoding vector with dimension [batch_size, 128].
[0068] Market sentiment vector construction: The market sentiment vector Vmarket has 128 dimensions and is obtained by encoding external macroeconomic indicators and market sentiment features. In this embodiment, it includes: Macroeconomic indicators: Four indicators, namely the overnight Shibor rate, monthly PMI index, monthly CPI index, and 10-year Treasury bond yield, are standardized and input into the fully connected layer for encoding into 64-dimensional features; Market sentiment characteristics: 64-dimensional sentiment features were obtained by encoding financial sentiment text data using a pre-trained BERT model; The two features are concatenated to obtain a 128-dimensional market sentiment vector Vmarket, with dimensions [batch_size, 128].
[0069] Feature concatenation and MLP mapping: The global correlation feature Hglobal (128-dimensional), the predicted temporal code (128-dimensional), and the market sentiment vector Vmarket (128-dimensional) are concatenated along the channel dimension to obtain the concatenated feature with dimensions [batch_size, 384]. The concatenated feature is then input into an MLP (Multilayer Perceptron), which contains two fully connected layers. The first fully connected layer has an input dimension of 384 and an output dimension of 256. The activation function is ReLU, and a Dropout layer (dropout rate of 0.2) is added to prevent overfitting. The second fully connected layer has an input dimension of 256 and an output dimension of prediction window length × number of funds pools × 2 (corresponding to fund inflow and outflow predictions, respectively). In this embodiment, the output dimension is 30 × 25 × 2 = 1500. Dynamic Correction and Predictive Output: The MLP output is mapped to the 0-1 interval using the Sigmoid activation function to obtain a standardized predicted value. Simultaneously, a dynamic correction term based on historical prediction errors is superimposed. The final predicted output formula is:
[0070] Where: σ is the Sigmoid activation function, used to map the output to the normalized range of 0-1; dynamic correction coefficient. In this embodiment, the correction amplitude coefficient λ is set to 0.1, and the attenuation coefficient is... The value is set to 0.05, where Δt is the prediction time span (unit: days). The further the prediction time, the smaller the correction coefficient, to avoid over-correction of long-term predictions. Dynamic correction vector In this embodiment, the autoregressive order L is set to 5. Let be the learnable i-th order autoregressive coefficient, initialized to 0; The prediction error at time ti (the difference between the predicted value and the actual value) is represented by this correction term, which uses autoregressive feedback based on historical prediction errors to compensate for the accumulated bias of the model in real time. Destandardization of forecast values: The output standardized forecast values are destandardized using the mean and standard deviation of Z-Score standardization in step S00 to restore the actual amount of funds, thus obtaining the daily fund inflow and outflow forecast values of each fund pool within the target forecast period.
[0071] Step S05: Pre-training and convergence optimization of the prediction model This step uses the constructed training dataset to perform end-to-end iterative optimization of the model's parameters until the model converges. The specific implementation is as follows: Training hyperparameter settings: Batch size = 32; Training epochs = 100; Initial learning rate The learning rate decay uses a cosine annealing strategy, with a minimum learning rate of 1e-6. The optimizer used is the AdamW optimizer, with a weight decay factor of 1e-4; Adaptive multi-scale loss function parameters: number of prediction time scales S=3 (corresponding to 1-day, 7-day, and 30-day predictions respectively), temperature parameter η=3, Huber loss hyperparameter δ=1.5, combination coefficient θ=0.5; Early stopping mechanism: Set the early stopping patience value to 10, that is, stop training early when the validation set loss no longer decreases for 10 consecutive training cycles to prevent overfitting.
[0072] Adaptive Multi-Scale Loss Function Calculation: This invention uses the Adaptive Multi-Scale Loss Function (AMSL) for parameter optimization. The total loss calculation formula is as follows: Wherein, the combined loss at the s-th time scale for:
[0073] Implementation details: Adaptive weights ,in is the prediction error ratio at the s-th time scale, which is the proportion of the MSE loss at this scale to the total MSE loss across all scales; the larger the error at a scale, the higher the corresponding weight, and the model automatically focuses on optimizing the prediction period with the larger error. MSE (mean squared error loss): Used to measure the overall deviation between the predicted value and the true value, and is more sensitive to large error samples; Huber loss combines the advantages of MSE and MAE. When the prediction error is less than δ=1.5, squared loss is used, and when it is greater than δ, absolute loss is used. This reduces the interference of extreme outliers on model training and improves robustness. Model training process: Initialize all weight parameters of the model. Use Xavier uniform initialization for the learnable weight matrix and bias vector, and initialize the autoregressive coefficients to 0. Training set samples are loaded in batches, and forward propagation is used to calculate the predicted values and total loss values at each time scale. Backpropagation calculates the gradient of the loss function with respect to each parameter, and the model parameters are updated through the AdamW optimizer; After each training round, the validation loss is calculated on the validation set. If the validation loss is the lowest in history, the current model weights are saved as the optimal model. Training will stop when the early stop mechanism is triggered or the maximum number of training rounds is reached. Model testing and performance verification: The optimal model was loaded onto the test set for prediction. In this embodiment, the model's mean absolute percentage error (MAPE) for predicting cash flow for the next day was 2.17%, for the next 7 days it was 3.52%, and for the next 30 days it was 5.89%. Compared with the existing Prophet+LightGBM scheme, the MAPE was reduced by an average of 32.6%, which verifies the prediction accuracy advantage of the present invention.
[0074] Step S06 Implementation of Abnormal Flow Early Warning This step, based on the predicted values output by the model, provides an early warning of abnormal fund flows in the fund pool. The specific implementation is as follows: Constructing a normal liquidity benchmark model: Based on the historical fund flow data of each fund pool in the training set, calculate the historical average daily fund inflows and outflows for each fund pool. Compared with historical standard deviation The normal fluctuation range is determined to be ; Deviation Calculation: Compare the predicted cash flow value output in step S04 with the normal fluctuation range to calculate the deviation of the predicted value. The formula is: in, This represents the predicted inflow / outflow of funds for a specific fund pool on a given day; in this embodiment, a preset deviation threshold is used. That is, when the deviation of the predicted value exceeds 2.5 times the standard deviation, it is judged as a potential abnormal flow; Warning Triggering and Output: When the predicted cash flow deviation of a certain fund pool exceeds the threshold, an abnormal warning signal is immediately triggered, and warning information is output, including: warning fund pool ID, predicted abnormal date, predicted cash amount, deviation value, and historical normal fluctuation range, providing financial management personnel with a basis for proactive risk prevention and control.
[0075] Example 2: Deep Learning-Based Fund Pooling Fund Flow Prediction and Analysis System This embodiment provides a system for implementing the method described in Embodiment 1, specifically implemented as follows: The system includes: a data acquisition module, a data preprocessing module, a multi-scale feature extraction module, an adaptive attention fusion module, a fund pool association graph construction module, a global association feature extraction module, a prediction decoding module, a processor, and a memory. The specific implementation and interaction of each module are as follows: Data acquisition module: Deployed on the interface server of the group's financial system, it acquires historical transaction datasets and real-time transaction data streams from multiple fund pools in real time through direct bank-enterprise connection interfaces, financial system APIs, and ERP system interfaces. It supports daily scheduled batch synchronization and real-time incremental synchronization of transaction data. The output end of the data acquisition module is connected to the input end of the data preprocessing module.
[0076] Data preprocessing module: Deployed on the data processing server, it has built-in functional units for data cleaning, feature engineering, standardization, and dataset partitioning. It is used to preprocess historical transaction datasets and generate time-series feature matrices that can be input into the model. The output of the data preprocessing module is connected to the input of the multi-scale feature extraction module and the fund pool association graph construction module.
[0077] Multi-scale feature extraction module: Deployed on the GPU inference server, it incorporates the multi-scale temporal feature extraction network MSFEN to extract temporal features from the temporal feature matrix at multiple time scales and output at least 3 sets of temporal features at different time scales; the output of the multi-scale feature extraction module is communicatively connected to the input of the adaptive attention fusion module.
[0078] Adaptive Attention Fusion Module: Deployed on the GPU inference server, the Adaptive Attention Fusion Module (AAM) is built into the GPU inference server. It is used to dynamically allocate fusion weights based on the contribution of time-series features at each time scale to the prediction results, perform weighted fusion of multiple sets of time-series features, and output fused time-series features. The output of the Adaptive Attention Fusion Module is communicatively connected to the input of the Global Association Feature Extraction Module.
[0079] The fund pool association graph construction module is deployed on the data processing server and has a built-in adjacency matrix calculation unit. It is used to calculate the transaction frequency weight and fund flow weight based on the historical transaction association data between each fund pool, and to construct the adjacency matrix of the fund pool association graph structure by weighted fusion. The output end of the fund pool association graph construction module is connected to the input end of the global association feature extraction module.
[0080] Global Association Feature Extraction Module: Deployed on the GPU inference server, it has a built-in 2-layer graph convolutional network (GCN) to combine fused temporal features with the fund pool association graph structure to extract global association features that represent the association between fund pools; the output of the global association feature extraction module is connected to the input of the prediction decoding module.
[0081] Prediction Decoding Module: Deployed on the GPU inference server, it has a built-in prediction decoder with a time-series dynamic evolution mechanism (TDEM) to combine global correlation features, prediction time-series encoding, and market sentiment vectors to output the predicted capital flow values of each capital pool during the target prediction period; the output of the prediction decoding module is connected to the processor.
[0082] Processor: Uses Intel Xeon 8375C CPU, which is connected to each of the above modules to schedule the execution process of each module, execute all steps of the fund pool fund flow prediction and analysis method described in Example 1, and at the same time complete the judgment of abnormal flow warning and output the warning signal.
[0083] Storage: An enterprise-grade SSD storage array is used, which communicates with the processor to store the weight parameters after model training, historical transaction data, prediction result data, normal liquidity benchmark model parameters, and the operating system and software environment required for system operation.
[0084] The system also includes a visualization and interaction module, which communicates with the processor to display the fund flow forecast curves, historical transaction data, and abnormal warning information of each fund pool to financial managers. It supports custom configuration of the forecast period and the scope of the fund pool.
[0085] Example 3: Computer-readable storage medium This embodiment provides a computer-readable storage medium, which is a non-volatile computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the steps of the deep learning-based fund pool flow prediction and analysis method described in Embodiment 1. The computer-readable storage medium includes, but is not limited to, various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for predicting and analyzing the flow of funds in a capital pool based on deep learning, comprising the steps of acquiring a historical transaction dataset of the capital pool and preprocessing the dataset to obtain a time-series feature matrix, characterized in that, It also includes the following steps: S01: Perform multi-time-scale temporal feature extraction on the temporal feature matrix to obtain at least two sets of temporal features at different time scales; S02: Based on the contribution of time series features at each time scale to the prediction results, dynamically assign fusion weights to time series features at each time scale, and perform weighted fusion of multiple sets of time series features based on the fusion weights to obtain fused time series features; S03: Construct a fund pool association graph structure based on the historical transaction association data between each fund pool, and input the fused time series features and the fund pool association graph structure into the graph feature extraction network to extract global association features that characterize the association relationship between fund pools; S04: Input the global correlation features and prediction time series encoding into the prediction decoder, and output the predicted value of capital flow for each capital pool in the target prediction period.
2. The method for predicting and analyzing the cash flow of a fund pool based on deep learning according to claim 1, characterized in that, In step S01, multi-scale temporal feature extraction is performed using the multi-scale temporal feature extraction network MSFEN. The multi-scale temporal feature extraction network includes at least three parallel one-dimensional convolutional branches with different receptive field sizes. Each convolutional branch extracts temporal features at different time scales, and the outputs of each convolutional branch are concatenated through skip connections. Specifically, the first convolutional branch uses a one-dimensional convolutional layer with a kernel size of 3 to extract short-term temporal features, the second convolutional branch uses a one-dimensional convolutional layer with a kernel size of 7 to extract medium-term temporal features, and the third convolutional branch uses a one-dimensional convolutional layer with a kernel size of 15 to extract long-term temporal features.
3. The method for predicting and analyzing the cash flow of a fund pool based on deep learning according to claim 1, characterized in that, In step S02, the fusion weights are dynamically allocated through the Adaptive Attention Fusion (AAM) module. The formula for calculating the fusion weights is as follows: in: The attention weight for the i-th time scale feature, with a value between 0 and 1; Let be the learnable weight matrix corresponding to the i-th time scale feature, with dimension d×d; Let be the feature vector of the i-th time scale, with dimension d×1; Let be the bias vector corresponding to the i-th time scale feature, with a dimension of d×1; This represents the total number of features on the time scale. For exponential function operations; the fused feature vector The calculation formula is: .
4. The method for predicting and analyzing the cash flow of a fund pool based on deep learning according to claim 1, characterized in that, The method for constructing the capital pool association diagram structure in S03 includes: S51 calculates the transaction frequency weight between any two fund pools i and j. : in, This represents the number of transfers from fund pool i to fund pool j within a historical period. The maximum number of transfers between any two funds pool pairs; the transaction frequency weight. This is the ratio of the number of transfers from pool i to pool j within a historical period to the maximum number of transfers between all pool pairs. S52 calculates the weight of fund flow between any two fund pools i and j. : in, Let t be the amount transferred from fund pool i to fund pool j at time t. Let be the amount transferred from fund pool j to fund pool i at time t. The weight of the fund flow is the total time step. It is the ratio of the cumulative transfer amount from fund pool i to fund pool j to the cumulative transfer amount from fund pool j to fund pool i within the historical period. S53 performs weighted fusion based on the transaction frequency weight and fund flow weight to construct the adjacency matrix A of the fund pool association graph structure, wherein the elements of the adjacency matrix are... The calculation formula is: Wherein, β is the weight balance coefficient, with a value range of 0.3 to 0.7; the graph feature extraction network is a graph convolutional network (GCN), which updates the input features layer by layer by adding a self-connected adjacency matrix, degree matrix and learnable weight matrix, and performs non-linear transformation through the ReLU activation function to output global correlation features; The feature update formula for the graph convolutional network (GCN) is as follows: in: Let be the input feature matrix of the l-th layer graph convolutional network; This represents the output feature matrix of the l-th layer graph convolutional network. To add self-connected adjacency matrices, , where I is the identity matrix; Degree matrix, ; The learnable weight matrix of the l-th layer; Activation function ).
5. The method for predicting and analyzing the cash flow of a fund pool based on deep learning according to claim 1, characterized in that, In step S04, the predictive decoder incorporates a Temporal Dynamic Evolution (TDEM) mechanism, and the predictive output calculation formula of the predictive decoder is as follows: in: Forecasted standardized cash flows; The global association feature has a dimension of d×1; Predictive temporal coding uses sine and cosine functions for temporal feature encoding. , This is the k-th periodic component; The market sentiment vector is obtained by encoding external macroeconomic indicators and market sentiment characteristics, and has a dimension of d×1. For vector concatenation operation; MLP: Multilayer Perceptron, which contains at least two fully connected layers and non-linear activation functions; The output layer activation function uses the Sigmoid function to map the output to the interval between 0 and 1. Dynamic correction factor ,in The correction factor ranges from 0.05 to 0.
2. This is the attenuation coefficient, with a value ranging from 0.01 to 0.1; To predict the time span; The dynamic correction vector is calculated based on autoregressive feedback of historical prediction errors. ,in Let be the i-th order autoregressive coefficient. Let be the prediction error at time ti, and L be the autoregression order, ranging from 3 to 7.
6. The method for predicting and analyzing the cash flow of a fund pool based on deep learning according to claim 1, characterized in that, The method also includes a pre-training step for the prediction model: constructing a training dataset, setting model training hyperparameters, and iteratively optimizing the network parameters of multi-scale temporal feature extraction, adaptive weight fusion, graph feature extraction, and prediction decoder through backpropagation algorithm until the model converges; The pre-training step uses the Adaptive Multi-Scale Loss Function (AMSL) for parameter optimization. The calculation formula for the Adaptive Multi-Scale Loss Function is as follows: in: Total loss value; Number of prediction timescales, S≥2; The adaptive weights at the s-th time scale ,in This is a temperature parameter, with a value ranging from 2 to 5. Let be the prediction error ratio at the s-th time scale. ; The combined loss at the s-th time scale; Mean squared error loss function ; for loss function ,in for The loss hyperparameters range from 1.0 to 2.0; θ is the combination coefficient, ranging from 0.3 to 0.
7. The pre-training step employs a dynamic learning rate adjustment strategy, with an initial learning rate... The value ranges from 0.0001 to 0.
001. The learning rate decay adopts a cosine annealing strategy. An early stopping mechanism is used during training. Training stops when the validation set loss no longer decreases for 5-15 consecutive training cycles.
7. The method for predicting and analyzing the cash flow of a fund pool based on deep learning according to claim 1, characterized in that: The method also includes an abnormal flow early warning step: Step E1: Establish a normal liquidity benchmark model based on the historical capital flow data of the capital pool to determine the normal fluctuation range of capital flow in each capital pool; Step E2: Compare the predicted cash flow value output in step D with the normal fluctuation range. When the predicted cash flow deviation exceeds the preset deviation threshold, trigger an abnormal warning signal. The formula for calculating the deviation is: in: This represents the projected cash flow value. This represents the average of normal historical cash flows. The standard deviation of historical normal cash flows; The preset deviation threshold has a value range of 2 to 3.
8. A deep learning-based system for predicting and analyzing the flow of funds in a capital pool, characterized in that, include: The data acquisition module is used to acquire historical transaction datasets and real-time transaction data streams from multiple fund pools; The data preprocessing module is communicatively connected to the data acquisition module and is used to preprocess the historical transaction dataset to obtain a time-series feature matrix. A multi-scale feature extraction module, which is communicatively connected to the data preprocessing module, is used to extract time-series features from the time-series feature matrix at multiple time scales to obtain at least two sets of time-series features at different time scales. An adaptive attention fusion module, which is communicatively connected to the multi-scale feature extraction module, is used to dynamically allocate fusion weights according to the contribution of time-series features at each time scale, and to perform weighted fusion of multiple sets of time-series features to obtain fused time-series features. The fund pool association graph construction module is used to construct the fund pool association graph structure based on the historical transaction association data between various fund pools. The global association feature extraction module is communicatively connected to the adaptive attention fusion module and the fund pool association graph construction module, respectively, and is used to extract global association features that characterize the association relationship between fund pools by combining the fused temporal features and the fund pool association graph structure. The prediction decoding module is communicatively connected to the global correlation feature extraction module and is used to combine global correlation features with prediction time series encoding to output the predicted value of capital flow for each capital pool in the target prediction period. The processor is communicatively connected to each of the above modules and is used to execute the fund pool flow prediction and analysis method as described in any one of claims 1 to 7. The memory, which is communicatively connected to the processor, is used to store model parameters, historical transaction data, and prediction result data.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the deep learning-based fund pool flow prediction and analysis method as described in any one of claims 1 to 7.