Data trend prediction method and device

By using the transaction volume prediction model based on the Transformer model, the correlation between time labels and region-type labels in financial transaction volume data is solved, and the problem of difficulty in accurately predicting transaction volume data trends in the existing technology is achieved, and more accurate transaction volume prediction and resource optimization are achieved.

CN119760407AInactive Publication Date: 2025-04-04CHINA ELECTRONICS ENGINEERING DESIGN INSTITUTECO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510249217.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-04
Publication Date
2025-04-04
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology is difficult to accurately predict the trend of financial transaction volume data, which leads to the system being unable to expand resources in time when the transaction volume exceeds expectations, resulting in processing delays or storage bottlenecks.

Method used

By obtaining historical transaction volume data, using the transaction volume prediction model based on the Transformer model, the correlation between time tags and region-type tags is analyzed, the transaction volume data for the next period is predicted, and the characteristic weight is adjusted through the self-attention mechanism to optimize the prediction results.

Benefits of technology

It realizes a more accurate prediction of transaction volume data trends, provides a basis for optimizing and adjusting transaction resources and making decisions, ensuring that the system can expand resources in a timely manner when facing high transaction volumes, avoiding delays and storage bottlenecks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760407A_ABST
    Figure CN119760407A_ABST
Patent Text Reader

Abstract

The invention provides a data trend prediction method and device, and belongs to the technical field of data prediction.According to the data trend prediction method, time labels and region type labels are considered, so that the time rule and regional difference of transaction behaviors can be more accurately captured, and the transaction behaviors can be more accurately predicted. According to the method, the situation that demands on workdays or holidays are different or consumption modes in a working area and a living area are obviously different can be considered, so that data trend prediction is more accurate, and a basis for optimization adjustment and decision making of transaction resources is also provided through calculation of the difference quantity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data prediction, and in particular to a data trend prediction method and device. Background Art

[0002] Transactions in the financial industry, such as bank transactions, payment institution transactions, and general consumer account transactions, involve a large amount of real-time data. These transaction data usually include transaction amounts, account information of both parties, transaction timestamps, clearing information, etc. The processing and storage of these data require high throughput, low latency, and high reliability to ensure the smooth completion of the transaction process and the accurate flow of funds. In order to meet these requirements, financial institutions usually need to process these financial data in real time to ensure real-time settlement and risk control of transactions.

[0003] The processing of financial transactions not only relies on data storage, but also requires powerful computing resources for tasks such as transaction processing, risk control assessment, clearing calculations, and compliance review. For example, banks or payment institutions need to calculate the risk level of each transaction, conduct anti-fraud detection, or conduct cross-border settlements. These processes usually involve complex algorithms and a large amount of data analysis, so the demand for computing resources is high. At the same time, the transaction data itself needs to be stored efficiently for subsequent queries, audits, and compliance checks. Storage requirements grow exponentially with the increase in transaction volume, especially in the context of large-scale data.

[0004] In extreme cases, when the transaction volume exceeds expectations, the system may not be able to expand resources in time, resulting in processing delays or storage bottlenecks, which may affect the transaction processing speed, delay transaction confirmation, and ultimately affect customer experience. Therefore, how to estimate the transaction volume to reasonably plan the transaction backend resources allocated to a certain group of people is an urgent problem to be solved. Summary of the invention

[0005] The present invention provides a data trend prediction method and device, which are used to solve the defect that it is difficult to predict the transaction volume data trend in the prior art, and achieve the effect of making the transaction volume data trend prediction more accurate.

[0006] The present invention provides a data trend prediction method, comprising: Obtain the first transaction volume data of the target population in the first historical period; The first transaction volume data is input into a transaction volume prediction model, and the correlation between the time label and the region type label corresponding to the first transaction volume data is analyzed by the transaction volume prediction model to obtain the second transaction volume data in the next time period output by the transaction volume prediction model; the transaction volume prediction model is trained based on the sample transaction volume data of the target population in the second historical time period; the sample transaction volume data is the historical transaction volume data including the time label and the region type label; the time label is used to indicate that the transaction time label is one of a working day, a public holiday, and a holiday, and the region type label is used to indicate that the transaction region type is one of a working area and a residential area; A difference between the second transaction volume data and the first transaction volume data is determined.

[0007] According to a data trend prediction method provided by the present invention, the analysis of the correlation between the time label and the regional type label corresponding to the first transaction volume data by the transaction volume prediction model to obtain the second transaction volume data in the next time period output by the transaction volume prediction model includes: Performing label identification on the first transaction volume data by using the transaction volume prediction model; Based on the result of tag recognition, feature extraction is performed on the first transaction volume data to obtain time period features, regional type features, and transaction volume trend features corresponding to the first transaction volume data; The first self-attention mechanism is used to assign target weights to the time period features, regional type features, and transaction volume trend features to calculate the initial transaction volume prediction results; Based on the time label and regional type label of the initial transaction volume prediction result, the weights corresponding to the time period features and regional type features in the target weight are adjusted based on the global time label and regional type label of the second historical period through a second self-attention mechanism to obtain the second transaction volume data in the next time period output by the transaction volume prediction model; the duration of the second historical period is greater than the duration of the first historical period.

[0008] According to a data trend prediction method provided by the present invention, the time period characteristics are determined in the following manner: Based on the time tags in the first transaction volume data, respectively encode different types of time tags to obtain time category codes; Based on the time category code and the time period data of the next period, a periodicity code is obtained; The time category code and the periodic code are fused to obtain the time period feature.

[0009] According to a data trend prediction method provided by the present invention, the weights corresponding to the time period features and the regional type features in the target weight are adjusted based on the time label and the regional type label of the initial transaction volume prediction result, respectively, based on the global time label and the regional type label of the second historical period, through a second self-attention mechanism, including: Calculate the attention scores of each time label and each region type label of the initial transaction volume prediction result respectively, and obtain the first contribution of the time period feature and the region type feature to the prediction result; Based on the attention scores of the global time labels and regional type labels in the second historical period, the second contribution of the time period feature and the regional type feature in the transaction volume data of the second historical period is obtained; Based on the difference between the first contribution and the second contribution, the weights corresponding to the time period feature and the region type feature in the target weight are adjusted.

[0010] According to a data trend prediction method provided by the present invention, the determining the difference between the second transaction volume data and the first transaction volume data includes: Obtaining the number of transaction settlement parties and the amount of data associated with the transaction corresponding to the first transaction volume data; Based on the difference in the number of transactions between the second transaction volume data and the first transaction volume data, the difference in the number of transaction settlement parties and the amount of transaction-associated data between the second transaction volume data and the first transaction volume data is determined.

[0011] According to a data trend prediction method provided by the present invention, the transaction volume prediction model is trained in the following manner: Using the historical transaction volume data in the second historical period as the sample transaction volume data; A training set and a test set are constructed based on the sample transaction volume data, and the transaction volume prediction model is trained using the training set, and the transaction volume prediction model is tested using the test set to obtain a final transaction volume prediction model.

[0012] According to a data trend prediction method provided by the present invention, the transaction volume prediction model is obtained based on Transformer model training.

[0013] The present invention also provides a data trend prediction device, comprising: An acquisition module, used to acquire first transaction volume data of a target population in a first historical period; A prediction module, used for inputting the first transaction volume data into a transaction volume prediction model, analyzing the correlation between the time label and the region type label corresponding to the first transaction volume data through the transaction volume prediction model, and obtaining the second transaction volume data in the next time period output by the transaction volume prediction model; the transaction volume prediction model is trained based on the sample transaction volume data of the target population in the second historical time period; the sample transaction volume data is the historical transaction volume data including the time label and the region type label; the time label is used to indicate that the transaction time label is one of a working day, a public holiday and a holiday, and the region type label is used to indicate that the transaction region type is one of a working area and a residential area; A comparison module is used to determine the difference between the second transaction volume data and the first transaction volume data.

[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the data trend prediction method described above is implemented.

[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the data trend prediction method as described in any one of the above is implemented.

[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the data trend prediction methods described above.

[0017] A data trend prediction method and device provided by the present invention can more accurately capture the time patterns and regional differences of transaction behaviors by taking into account time tags and regional type tags. Specifically, it can take into account different demands on weekdays or holidays, or significant differences in consumption patterns between work areas and residential areas, thereby making data trend predictions more accurate. By calculating the difference amount, it also provides a basis for optimizing and adjusting transaction resources and making decisions. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 This is one of the flow charts of a data trend prediction method provided by the present invention; Figure 2 This is the second flow chart of a data trend prediction method provided by the present invention; Figure 3 It is a structural schematic diagram of a data trend prediction device provided by the present invention; Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0021] Combine the following Figure 1-Figure 4 A data trend prediction method and device of the present invention are described.

[0022] like Figure 1 As shown, a data trend prediction method according to an embodiment of the present invention mainly includes step 110, step 120 and step 130.

[0023] Step 110, obtaining first transaction volume data of the target population in a first historical period.

[0024] The target population refers to a specific group of users whose characteristics can be defined based on different criteria, such as user ID, age, region, transaction frequency, etc.

[0025] Generally speaking, the target population is defined by a set of user identifiers, which can be based on user profiles, tags or filtering conditions. For example, the target population can be people in a certain area who use a certain payment tool at a certain frequency.

[0026] The first historical period refers to a specific time range, such as a month, a quarter, etc.

[0027] It is understandable that the relevant transaction records can be filtered according to the start and end time of the first historical period and based on this time range. On this basis, all transaction data of the target population in the first historical period can be queried from the database.

[0028] For large-scale data, query efficiency can be improved through index optimization such as timestamp, user ID field index, partition table, etc.

[0029] Step 120, input the first transaction volume data into the transaction volume prediction model, analyze the correlation between the time label and the regional type label corresponding to the first transaction volume data through the transaction volume prediction model, and obtain the second transaction volume data in the next time period output by the transaction volume prediction model.

[0030] The transaction volume prediction model is trained based on the sample transaction volume data of the target population in the second historical period; the sample transaction volume data is the historical transaction volume data including a time label and a region type label; the time label is used to indicate that the transaction time label is one of a working day, a public holiday, and a holiday, and the region type label is used to indicate that the transaction region type is one of a working area and a residential area.

[0031] It can be understood that by inputting the first transaction volume data into the transaction volume prediction model and utilizing the analysis capability of the model, the second transaction volume data in the next time period, such as the next month or the next week, can be predicted.

[0032] The purpose of the trading volume prediction model is to predict future trading volume based on historical trading data. The model is trained using data from a second historical period. In other words, the model learns and establishes prediction rules based on trading data from a period of time.

[0033] Model training is done through sample transaction volume data, which includes time labels and region type labels.

[0034] The time label indicates the time when the transaction occurred, which is based on the classification of weekdays, holidays, and weekends. In other words, the model will consider the changing patterns of trading volume in different time periods. For example, the trading volume on weekdays may be different from the trading volume on holidays.

[0035] The region type label indicates the type of location where the transaction occurs, which is divided into work area and residential area. For example, the transaction volume in the work area and the transaction volume in the residential area may have different patterns, especially when users have different transaction behaviors on weekdays and holidays. Specifically, the work area can also include areas of different transaction types. For example, areas with dense financial institutions or commercial entities are large-volume and high-value transaction areas, while general office areas may be small-volume transaction areas.

[0036] After obtaining the first transaction volume data, these data can reflect the time label and region type label. After inputting these data into the transaction volume prediction model, the transaction volume prediction model will analyze the correlation between them and find the impact of different time periods and different region types on the transaction volume.

[0037] The transaction volume prediction model analyzes the first transaction volume data and studies the relationship between different time tags and region type tags and transaction volume. For example, the transaction volume may be low in a residential area on a weekday, while it may be high in a working area on holidays. Through these correlations, the model can learn what kind of change trend the transaction volume usually presents in a specific time period and specific region type.

[0038] Based on the correlation learned by the trading volume prediction model, the trading volume prediction model will output a second trading volume data, that is, predict the trading volume of the next period. This second trading volume is based on the input first trading volume data and the model's correlation analysis results for time and region.

[0039] Step 130: Determine the difference between the second transaction volume data and the first transaction volume data.

[0040] It is understandable that by analyzing the difference, we can measure and analyze the changes in the trading volume of the next cycle (forecast data) relative to the trading volume of the previous cycle (historical data). This change can help determine the trend of trading volume and then adjust resources and strategies to meet future trading needs.

[0041] In some embodiments, the transaction volume of the previous cycle and the next cycle can be compared to calculate the difference between the two. The absolute change can show the absolute size of the change in transaction volume. For example, if the transaction volume of the previous cycle is 10,000 and the predicted transaction volume of the next cycle is 12,000, then the transaction volume has increased by 2,000, and it can be determined that more resources are needed in the next cycle to handle the additional load.

[0042] In addition to the absolute change, you can also calculate the ratio of volume change, which is the relative change. The relative change can reflect the magnitude of the volume change, expressed as a percentage, which can give a clearer understanding of the scale of the change.

[0043] If the trading volume in the next cycle is greater than that in the previous cycle, whether in absolute terms or as a percentage, it can be foreseen that the load on the trading system will increase, requiring increased processing power, increased bandwidth, or optimized system architecture to ensure that trading can proceed smoothly.

[0044] If the transaction volume in the next cycle is less than that in the previous cycle, it means that the system load may be reduced. You can consider reducing resource allocation and reducing system operating costs, but you still need to pay attention to maintaining a certain redundancy to prevent unforeseen situations.

[0045] If the trading volume changes greatly, whether it is increasing or decreasing, it means that there is a great deal of uncertainty in future trading activities. At this time, it is necessary to prepare for the elastic adjustment of resources and may need to stress test the system to ensure stable operation even in the worst case.

[0046] In this embodiment, by comparing the actual transaction volume of the previous cycle with the predicted transaction volume of the next cycle, the specific situation of the transaction volume change can be obtained, and reasonable resource planning and adjustment can be made accordingly to maintain the smooth operation of the business.

[0047] A data trend prediction method provided in an embodiment of the present invention can more accurately capture the time patterns and regional differences of transaction behaviors by taking into account time tags and regional type tags. Specifically, it can take into account different demands on weekdays or holidays, or significant differences in consumption patterns between work areas and residential areas, thereby making data trend predictions more accurate. By calculating the difference amount, it also provides a basis for optimizing and adjusting transaction resources and making decisions.

[0048] In some embodiments, Figure 2 As shown, the correlation between the time label and the regional type label corresponding to the first transaction volume data is analyzed by the transaction volume prediction model to obtain the second transaction volume data in the next time period output by the transaction volume prediction model, including step 210, step 220, step 230 and step 240.

[0049] Step 210, performing label recognition on the first transaction volume data using a transaction volume prediction model; Step 220, extracting features from the first transaction volume data based on the result of tag recognition to obtain time period features, region type features, and transaction volume trend features corresponding to the first transaction volume data; Step 230, by using a first self-attention mechanism, target weights are assigned to the time period feature, the region type feature, and the transaction volume trend feature to calculate an initial transaction volume prediction result; Step 240, based on the time label and regional type label of the initial transaction volume prediction result, the weights corresponding to the time period features and regional type features in the target weight are adjusted based on the global time label and regional type label of the second historical period through a second self-attention mechanism to obtain the second transaction volume data in the next period output by the transaction volume prediction model.

[0050] It is understandable that the transaction volume prediction model is trained based on the Transformer model.

[0051] In volume forecasting, time series data usually contains information from multiple time points, which may be correlated. The Transformer model uses the self-attention mechanism to calculate the dependencies between various time points, rather than simply relying on a fixed time window like traditional methods. In other words, the model can flexibly capture the dynamic relationship between different time points, even long-distance correlations.

[0052] The input of the trading volume prediction model can contain multiple features, such as historical trading volume, time tags, region tags, etc. The Transformer model will transform these input features through the embedding layer, so that different types of inputs such as time information and region information can be properly represented.

[0053] The Transformer model learns how to extract patterns and regularities from historical data through training, so that it can accurately predict future trading volumes. During the training process, the model continuously adjusts its parameters to maximize the accuracy of predictions. This process includes training based on historical data and improving the performance of the model by optimizing the loss function.

[0054] In some embodiments, the transaction volume prediction model is trained in the following manner: historical transaction volume data within the second historical period is used as sample transaction volume data; a training set and a test set are constructed based on the sample transaction volume data, and the training set is used to train the transaction volume prediction model, and the test set is used to test the transaction volume prediction model to obtain the final transaction volume prediction model.

[0055] It is understandable that the training set is used to train the model, and the test set is used to evaluate the model's predictive performance. Generally speaking, the training set contains most of the data and is used to learn the model, while the test set contains unseen data and is used to test the model's generalization ability.

[0056] The trading volume prediction model is trained using the training set. The goal of the training process is to minimize the loss function, such as mean square error, cross entropy, etc., so that the model's prediction results are as close as possible to the actual trading volume data.

[0057] After training is complete, the model is tested on the test set to evaluate its predictive performance. The data in the test set has not been used in the training process, so it can be checked whether the model can be effectively generalized to new data.

[0058] After training and testing, the final transaction volume prediction model is obtained, which can make more accurate predictions on new data.

[0059] In this embodiment, by reasonably dividing the training set and the test set, it is ensured that the model can not only fit the training data but also effectively predict the unseen data, thereby improving the practical application performance of the model.

[0060] The Transformer model uses position encoding to add the position information of features to the model to make up for the defect that the Transformer model itself does not have the ability to process sequence order.

[0061] In the prediction of trading volume, the Transformer model can use the self-attention mechanism to calculate the weights of different time points and different regions based on the historical data of time series, combined with multiple input features (such as time period, region type, etc.), and then predict future trading volume. The model can not only consider short-term time dependence, but also capture the correlation of longer time spans, which is very important for accurately predicting trading volume.

[0062] In step 230, the first self-attention mechanism assigns different weights to the time period characteristics, regional type characteristics, and transaction volume trend characteristics, respectively, so that the impact of each feature on the result in the final prediction is adjusted according to its importance, thereby obtaining an initial transaction volume prediction result.

[0063] The second self-attention mechanism is to adjust the weights of the time period and region type features again to obtain more accurate trading volume predictions.

[0064] Through the second self-attention mechanism, the transaction volume prediction model adjusts the target feature weights according to the global time label and regional type label of the second historical period.

[0065] The duration of the second historical period is longer than that of the first historical period, which means that the trading volume prediction model will use more historical data to adjust the weights and consider the changing trends over a longer period of time. In this process, only the data labels within the second historical period need to be extracted, and all data do not need to be analyzed. This can save the calculation amount of the trading volume prediction model and improve the working efficiency of the model.

[0066] This adjustment process further optimizes the relationship between time labels and region type labels. By adjusting the weights, the model can more accurately capture the long-term impact of time and region on transaction volume, thereby optimizing transaction volume prediction.

[0067] Finally, through the interaction of these two self-attention mechanisms, the second trading volume data for the next period is obtained, that is, the trading volume for a certain period of time in the future predicted by the trading volume prediction model.

[0068] In the first stage of the transaction volume prediction model, the first self-attention mechanism is used to perform weighted calculations on the time labels and regional type labels to obtain preliminary prediction results. It is assumed that this stage has been able to capture the time and regional characteristics in the historical data well, but due to some reasons, such as specific time periods or regional characteristics are not fully modeled, there may be prediction bias.

[0069] The prediction results at this stage are calculated based on preliminary feature weights, but may not be completely accurate, especially when there are large differences between time categories and region types. However, differences in time labels such as weekdays, public holidays, and holiday labels, and region type labels such as work areas and residential areas, do have a large impact on transaction volume.

[0070] The main purpose of the second self-attention mechanism is to adjust the deviations in time categories and region types generated in the predictions of the first self-attention mechanism. Specifically, the second self-attention mechanism will readjust the weights of each time period and region type feature based on global information, so that the prediction results are more accurate and meet the requirements of global optimization.

[0071] The second self-attention mechanism does not simply recalculate the feature weights, but corrects the prediction errors of time categories and region types to ensure that the predictions of different time categories and region types are as close to the actual data as possible.

[0072] In some embodiments, based on the time label and regional type label of the initial transaction volume prediction result, the weights corresponding to the time period features and regional type features in the target weight are adjusted based on the global time label and regional type label of the second historical period through a second self-attention mechanism, including the following process.

[0073] The attention scores of each time label and each region type label of the initial transaction volume prediction result can be calculated respectively to obtain the first contribution of the time period feature and region type feature to the prediction result.

[0074] On this basis, based on the attention scores of the global time labels and regional type labels in the second historical period, the second contribution of the time period features and regional type features in the transaction volume data of the second historical period is obtained.

[0075] Finally, based on the difference between the first contribution and the second contribution, the weights corresponding to the time period characteristics and the region type characteristics in the target weight are adjusted.

[0076] In this embodiment, the weights of the time period features and the regional type features are adjusted through the self-attention mechanism. First, based on the initial transaction volume prediction results, the attention score of each time label and regional type label is calculated to obtain their contribution to the prediction results. Then, based on the data of the second historical period, the contribution of the time label and regional type label in the period is calculated. Finally, by comparing the difference between the first contribution and the second contribution, the weights of the time period features and regional type features are adjusted to optimize the final prediction results.

[0077] The attention score of each label is obtained by weighted summing the label with other labels and their corresponding features, for example, it can be calculated by the dot product attention mechanism. The attention score of each time label and region type label is calculated by the self-attention mechanism to obtain their contribution to the initial prediction result.

[0078] The first contribution can be calculated by weighting the respective features of the time label and the region type label using the attention scores to obtain the first contribution of the time period feature and the region type feature to the initial prediction result.

[0079] The second contribution can be calculated using the attention scores of the global time label and the regional type label of the second historical period to obtain the contribution of the time period feature and the regional type feature in the second historical period.

[0080] On this basis, by comparing the difference between the first contribution and the second contribution, the weights of the time period characteristics and regional type characteristics are adjusted to optimize the model prediction results.

[0081] By calculating the error between the first round of forecast results and the actual results, for example, the difference between the forecast value and the true value, it is determined which time categories and region types have large forecast deviations.

[0082] Based on this error information, the second self-attention mechanism adjusts the weights of the time label and region type features. For those time categories and region types with large errors, the model will increase their weights to give more importance to these categories in the second round of predictions; while for those time and region types with small errors, the model can reduce their weights to avoid overfitting.

[0083] It is understandable that after adjusting the time and regional features of different categories through the second self-attention mechanism, the model can optimize the weights of different categories, making the prediction results for each time period and region more accurate and minimizing the overall prediction error. With the help of the second self-attention mechanism, the model is not only locally optimal, but can also achieve the global optimal prediction effect by dynamically adjusting the weights of different categories and regional types.

[0084] Finally, the feature representation adjusted by the second self-attention mechanism will be passed to the trading volume prediction model to obtain the revised trading volume prediction result, namely the second trading volume data. This result will be more accurate in terms of time and regional categories, and can better reflect the global data patterns.

[0085] In some embodiments, the time period feature is determined in the following manner: different types of time tags may be encoded respectively before the time tags in the first transaction volume data to obtain time category codes; then, based on the time category codes and the time period data of the next period, periodicity codes may be obtained; and finally, the time category codes and periodicity codes may be merged to obtain the time period feature.

[0086] Time category encoding refers to converting these time labels (such as days of the week, months, etc.) into a numerical representation that can be processed by the model. General encoding can use One-hot encoding or Embedding encoding to convert the category information of each time period into a vector form for subsequent processing.

[0087] The purpose of periodic coding is to capture the periodic characteristics of time, such as the time of day, the day of the week, and the change of seasons. Periodic coding can use mathematical functions (such as sine and cosine) to express periodic changes because this method can maintain the consistency of periodic information.

[0088] Finally, the time category encoding and periodicity encoding are fused into an overall time period feature. The model can simultaneously consider the category information of the time label (which week) and the periodic changes, such as the weekly cycle.

[0089] The fusion method can be a simple concatenation, such as concatenating two encoding vectors together, or some weighted combination.

[0090] The final time period feature can provide useful information related to time. Time period features are very important in the trading volume prediction model, because trading volume is often closely related to different levels of time (such as hours, dates, weeks, quarters, etc.), and periodic coding can help the model capture the regular changes in these time dimensions.

[0091] In some embodiments, determining the difference between the second transaction volume data and the first transaction volume data includes the following process.

[0092] You can first obtain the number of transaction settlement parties and the amount of data associated with the transaction corresponding to the first transaction volume data; based on the difference in transaction quantity between the second transaction volume data and the first transaction volume data, determine the difference in the number of transaction settlement parties and the amount of data associated with the transaction between the second transaction volume data and the first transaction volume data.

[0093] Transaction settlement parties usually refer to different entities or institutions involved in a transaction, such as buyers and sellers. The first transaction volume data contains this data, that is, how many different transaction settlement parties participated in these transactions.

[0094] The amount of data associated with a transaction refers to the amount of data associated with each transaction, which may be the contract terms of the transaction, the number of transactions, the transaction amount, the transaction status, etc. This measure reflects the complexity or scale of the transaction.

[0095] The first transaction volume data provides detailed information on the current number of transaction settlement parties and the amount of associated data for each transaction.

[0096] There is a difference in the number of transactions between the second transaction volume data and the first transaction volume data. This difference may be a change in the number of transactions, for example, an increase or decrease in the transaction volume over a period of time. Usually, this difference refers to the change in the number of transactions in the second transaction volume data relative to the first transaction volume data.

[0097] With each additional transaction settlement party (such as buyer, seller, etc.), the computational complexity of the transaction process may increase, especially when multi-party computation and verification are required. If multiple transaction parties are involved, more computing resources may be required to handle operations such as merging, calculating, and verifying transaction data.

[0098] Specifically, when multiple transaction parties are involved, more algorithms may be needed to verify whether the transactions match, whether compliance requirements are met, whether there are potential transaction risks, etc., which increases the computational burden.

[0099] As the amount of data associated with each transaction increases, the demand for computing resources will also increase. Processing this transaction data requires more CPU, memory, and network bandwidth for fast query, analysis, update, and access operations.

[0100] For example, when the amount of data involved in a transaction is larger, more resources are needed for data calculation, data synchronization, and data query. Especially in real-time transaction systems, the demand for computing resources may show exponential growth.

[0101] The number of transaction settlement parties directly affects the storage requirements, because each transaction party often generates transaction records, account information, transaction history and other data related to it. As the number of transaction parties increases, the number of transaction records that need to be stored and the amount of relevant data for each transaction party will increase proportionally.

[0102] As the amount of data associated with each transaction increases, the storage space required will also increase significantly. The amount of data for each transaction includes not only the transaction itself, but may also include additional information such as documents, logs, audit records, compliance data, etc. As the number of transactions increases and the complexity of each transaction increases, the storage space requirements will also increase.

[0103] As the number of trading parties increases, the system's concurrent processing capabilities, transaction verification capabilities, and multi-party coordination capabilities will also increase. Therefore, when planning resources, it is necessary to consider how to optimize computing resources to ensure that the system can still operate efficiently when adding more trading parties.

[0104] If there are a large number of related parties and a large amount of data, the transaction throughput and latency will be affected. Computing resources must not only be able to handle a large number of transactions, but also ensure low latency and high throughput. This places higher demands on system design and resource allocation, especially in large-scale transaction systems that require real-time processing and response.

[0105] Therefore, the number of related transaction parties and the amount of transaction data have a significant impact on computing and storage resources. When planning resources, identifying changes in related transaction parties and data volume in advance will help effectively configure computing resources and storage resources, optimize system performance, and ensure that the system can run and expand smoothly in future transaction activities.

[0106] A data trend prediction device provided by the present invention is described below. The data trend prediction device described below and the data trend prediction method described above can be referenced to each other.

[0107] like Figure 3 As shown, the data trend prediction device of the embodiment of the present invention mainly includes an acquisition module 310 , a prediction module 320 and a comparison module 330 .

[0108] The acquisition module 310 is used to acquire first transaction volume data of a target population in a first historical period; The prediction module 320 is used to input the first transaction volume data into the transaction volume prediction model, analyze the correlation between the time label and the region type label corresponding to the first transaction volume data through the transaction volume prediction model, and obtain the second transaction volume data in the next time period output by the transaction volume prediction model; the transaction volume prediction model is trained based on the sample transaction volume data of the target population in the second historical time period; the sample transaction volume data is the historical transaction volume data including the time label and the region type label; the time label is used to indicate that the label of the transaction time is one of the working day, the public holiday and the holiday, and the region type label is used to indicate that the transaction region type is one of the working area and the residential area; The comparison module 330 is used to determine the difference between the second transaction volume data and the first transaction volume data.

[0109] A data trend prediction device provided in an embodiment of the present invention can more accurately capture the time patterns and regional differences of transaction behaviors by taking into account time tags and regional type tags. Specifically, it can take into account different demands on weekdays or holidays, or significant differences in consumption patterns between work areas and residential areas, thereby making data trend predictions more accurate. By calculating the difference amount, it also provides a basis for optimizing and adjusting transaction resources and making decisions.

[0110] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the data trend prediction method, which includes: obtaining the first transaction volume data of the target population in the first historical period; inputting the first transaction volume data into the transaction volume prediction model, analyzing the correlation between the time label and the regional type label corresponding to the first transaction volume data through the transaction volume prediction model, and obtaining the second transaction volume data in the next period output by the transaction volume prediction model; the transaction volume prediction model is trained based on the sample transaction volume data of the target population in the second historical period; the sample transaction volume data is the historical transaction volume data including the time label and the regional type label; the time label is used to indicate that the transaction time label is one of the working day, the public holiday and the holiday, and the regional type label is used to indicate that the transaction area type is one of the working area and the residential area; and determining the difference between the second transaction volume data and the first transaction volume data.

[0111] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0112] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the data trend prediction method provided by the above methods, which includes: obtaining first transaction volume data of a target population in a first historical period; inputting the first transaction volume data into a transaction volume prediction model, and analyzing the correlation between the time label and the regional type label corresponding to the first transaction volume data through the transaction volume prediction model to obtain second transaction volume data in the next period output by the transaction volume prediction model; the transaction volume prediction model is trained based on the sample transaction volume data of the target population in the second historical period; the sample transaction volume data is historical transaction volume data including a time label and a regional type label; the time label is used to indicate that the transaction time label is one of a working day, a public holiday, and a holiday, and the regional type label is used to indicate that the transaction area type is one of a working area and a residential area; and determining the difference between the second transaction volume data and the first transaction volume data.

[0113] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the data trend prediction method provided by the above-mentioned methods, the method comprising: obtaining first transaction volume data of a target population within a first historical period; inputting the first transaction volume data into a transaction volume prediction model, analyzing the correlation between the time label and the regional type label corresponding to the first transaction volume data through the transaction volume prediction model, and obtaining second transaction volume data within the next period output by the transaction volume prediction model; the transaction volume prediction model is trained based on the sample transaction volume data of the target population within the second historical period; the sample transaction volume data is historical transaction volume data including a time label and a regional type label; the time label is used to indicate that the transaction time label is one of a working day, a public holiday, and a holiday, and the regional type label is used to indicate that the transaction area type is one of a working area and a residential area; and determining the difference between the second transaction volume data and the first transaction volume data.

[0114] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0115] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data trend prediction method, characterized in that: include: Obtain the first transaction volume data of the target population in the first historical period; The first transaction volume data is input into a transaction volume prediction model, and the correlation between the time label and the region type label corresponding to the first transaction volume data is analyzed by the transaction volume prediction model to obtain the second transaction volume data in the next time period output by the transaction volume prediction model; the transaction volume prediction model is trained based on the sample transaction volume data of the target population in the second historical time period; the sample transaction volume data is the historical transaction volume data including the time label and the region type label; the time label is used to indicate that the transaction time label is one of a working day, a public holiday, and a holiday, and the region type label is used to indicate that the transaction region type is one of a working area and a residential area; A difference between the second transaction volume data and the first transaction volume data is determined.

2. The data trend prediction method according to claim 1, characterized in that: The step of analyzing the correlation between the time label and the region type label corresponding to the first transaction volume data by the transaction volume prediction model to obtain the second transaction volume data in the next time period output by the transaction volume prediction model includes: Performing label identification on the first transaction volume data by using the transaction volume prediction model; Based on the result of tag recognition, feature extraction is performed on the first transaction volume data to obtain time period features, regional type features, and transaction volume trend features corresponding to the first transaction volume data; The first self-attention mechanism is used to assign target weights to the time period features, regional type features, and transaction volume trend features to calculate the initial transaction volume prediction results; Based on the time label and regional type label of the initial transaction volume prediction result, the weights corresponding to the time period features and regional type features in the target weight are adjusted based on the global time label and regional type label of the second historical period through a second self-attention mechanism to obtain the second transaction volume data in the next time period output by the transaction volume prediction model; the duration of the second historical period is greater than the duration of the first historical period.

3. The data trend prediction method according to claim 2, characterized in that: The time period characteristics are determined in the following manner: Based on the time tags in the first transaction volume data, respectively encode different types of time tags to obtain time category codes; Based on the time category code and the time period data of the next period, a periodicity code is obtained; The time category code and the periodic code are fused to obtain the time period feature.

4. The data trend prediction method according to claim 2, characterized in that: The time label and the regional type label based on the initial transaction volume prediction result are used to adjust the weights corresponding to the time period feature and the regional type feature in the target weight based on the global time label and the regional type label of the second historical period through the second self-attention mechanism, including: Calculate the attention scores of each time label and each region type label of the initial transaction volume prediction result respectively, and obtain the first contribution of the time period feature and the region type feature to the prediction result; Based on the attention scores of the global time labels and regional type labels in the second historical period, the second contribution of the time period feature and the regional type feature in the transaction volume data of the second historical period is obtained; Based on the difference between the first contribution and the second contribution, the weights corresponding to the time period feature and the region type feature in the target weight are adjusted.

5. The data trend prediction method according to claim 1, characterized in that: The determining the difference between the second transaction volume data and the first transaction volume data comprises: Obtaining the number of transaction settlement parties and the amount of data associated with the transaction corresponding to the first transaction volume data; Based on the difference in transaction quantity between the second transaction volume data and the first transaction volume data, the difference in the number of transaction settlement parties and the amount of transaction-associated data between the second transaction volume data and the first transaction volume data is determined.

6. The data trend prediction method according to claim 1, characterized in that: The transaction volume prediction model is trained in the following way: Using the historical transaction volume data in the second historical period as the sample transaction volume data; A training set and a test set are constructed based on the sample transaction volume data, and the transaction volume prediction model is trained using the training set, and the transaction volume prediction model is tested using the test set to obtain a final transaction volume prediction model.

7. The data trend prediction method according to claim 1, characterized in that: The transaction volume prediction model is obtained based on Transformer model training.

8. A data trend prediction device, characterized in that: include: An acquisition module, used to acquire first transaction volume data of a target population in a first historical period; A prediction module, used for inputting the first transaction volume data into a transaction volume prediction model, analyzing the correlation between the time label and the region type label corresponding to the first transaction volume data through the transaction volume prediction model, and obtaining the second transaction volume data in the next time period output by the transaction volume prediction model; the transaction volume prediction model is trained based on the sample transaction volume data of the target population in the second historical time period; the sample transaction volume data is the historical transaction volume data including the time label and the region type label; the time label is used to indicate that the transaction time label is one of a working day, a public holiday and a holiday, and the region type label is used to indicate that the transaction region type is one of a working area and a residential area; A comparison module is used to determine the difference between the second transaction volume data and the first transaction volume data.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor executes the program, it implements the data trend prediction method as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data trend prediction method as described in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Unmanned aerial vehicle path dynamic adjustment and safe homeward voyage system based on space-time meteorological prediction

    CN121680437A