A method and device for processing financial data

By embedding processing and time series analysis of financial data, combined with multi-head self-attention mechanism and multi-layer perception machine, the problem of low-configuration server processing of financial data is solved, and the efficient processing and importance evaluation of financial data is realized. Financial analysis provides accurate data support.

CN118864133BActive Publication Date: 2024-12-17CHENGDU NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411349578.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2024-12-17
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

Low-configuration servers cannot effectively process large amounts of financial data in a short period of time, and cannot determine the importance of data, resulting in inefficient financial analysis.

Method used

By acquiring different types of financial data, embedding processing and time series analysis, the optimal time period is determined using the TimeNet model, feature data is extracted, and the financial data feature set and importance tag value are obtained using a multi-head self-attention mechanism and a multi-layer perceptron. .

Benefits of technology

Improves financial data processing efficiency, reduces the latency time of low-configuration servers, and provides a more accurate financial analysis data foundation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118864133B_ABST
    Figure CN118864133B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing, and specifically to a data processing method and a data processing device for financial data, including: embedding financial data so that the characteristics of the financial data can be more clearly distinguished. Feature data that meets different optimal time periods is extracted from the embedded financial data, so as to capture the periodicity of the financial data. A multi-head self-attention mechanism is used to capture the same type of correlation in each optimal time period, and the relevant features of the same type of feature data, feature data that meets different optimal time periods, and embedded financial data are fused, so as to obtain a financial data feature set with a simpler structure, so that a low-configuration server can effectively process the data. Finally, the importance of the financial data is determined by a multi-layer perceptron, so as to provide a more accurate data basis for subsequent financial analysis.
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 processing, and in particular to a method and a device for processing financial data. Background Art

[0002] At present, financial analysis is the core link of decision support, which relies on the collection, processing and analysis of a large amount of financial data. However, with the expansion of enterprise scale and diversification of business, the volume and complexity of financial data have increased significantly. Traditional low-configuration servers face serious processing bottlenecks and cannot efficiently meet the needs of financial analysis.

[0003] In financial analysis, enterprises need to quickly and accurately generate financial statements, make budget forecasts, analyze financial ratios and trends, etc. These operations usually require complex calculations and real-time analysis of large amounts of historical data. However, low-configuration servers currently have limited processing power and storage space. If a large amount of financial data is processed through low-configuration servers, the low-configuration servers cannot process a large amount of financial data effectively in a short period of time, resulting in high latency of low-configuration servers, and low-configuration servers cannot determine whether these financial data are important, resulting in low efficiency in financial analysis. Summary of the invention

[0004] In order to solve the above-mentioned problems of the prior art, the present invention provides a data processing method and a data processing device for financial data, which solve the problem in the prior art that low-configuration servers cannot effectively process a large amount of financial data in a short time and the low-configuration servers cannot determine whether the financial data are important, resulting in low efficiency in financial analysis.

[0005] According to one aspect of the present invention, there is provided a method for processing financial data, comprising:

[0006] Access different kinds of financial data;

[0007] Based on the embedding rules, embedding processing is performed on the different types of financial data to obtain embedded financial data;

[0008] Based on the TimeNet model, determining the optimal time period according to the embedded financial data;

[0009] Based on the extraction rules, feature data satisfying different optimal time periods are extracted from the embedded financial data;

[0010] Based on the multi-head self-attention mechanism, relevant features corresponding to the same type of feature data in the feature data under each optimal time period are extracted;

[0011] Merging the relevant features of the feature data of the same type, the feature data satisfying different optimal time periods, and the embedded financial data to obtain a financial data feature set corresponding to the different types of financial data;

[0012] Based on a multilayer perceptron and the financial data feature set, label values ​​corresponding to the different types of financial data are obtained; wherein the label values ​​represent the importance levels corresponding to the different types of financial data.

[0013] In one embodiment, before embedding the different types of financial data based on the embedding rule to obtain the embedded financial data, the data processing method for financial data further includes:

[0014] Sort each type of financial data in chronological order to obtain sorted financial data;

[0015] Wherein, based on the embedding rule, embedding processing is performed on the different types of financial data to obtain embedded financial data including:

[0016] Based on the embedding rule, embedding processing is performed on the sorted financial data to obtain embedded financial data.

[0017] In one embodiment, the embedding process is performed on the sorted financial data based on the embedding rule to obtain the embedded financial data, which includes:

[0018] Obtaining the time span and the index of the current time point; wherein the time span is a column span, and each column in the sorted financial data corresponds to a time point;

[0019] Dividing the sorted financial data according to the column span and the index of the current time point to obtain divided financial data;

[0020] Based on the embedding rule, embedding processing is performed on the divided financial data to obtain embedded financial data.

[0021] In one embodiment, the embedding process is performed on the divided financial data based on the embedding rule to obtain the embedded financial data, which includes:

[0022] Determine a time point corresponding to each column of the divided financial data in the sorted financial data;

[0023] Obtaining time characteristics of a time point corresponding to each column of the divided financial data;

[0024] The time feature is embedded into the column of the divided financial data corresponding to the time feature to obtain embedded financial data.

[0025] In one embodiment, determining the optimal time period based on the embedded financial data based on the TimeNet model includes:

[0026] Performing a fast Fourier transform on the embedded financial data to obtain transformed financial data;

[0027] Calculating the magnitude of the transformed financial data;

[0028] Calculating the mean of the transformed financial data according to the amplitude of the transformed financial data;

[0029] Based on the TimeNet model, the optimal time period is determined according to the mean value of the transformed financial data.

[0030] In one embodiment, extracting characteristic data satisfying different optimal time periods from the embedded financial data based on the extraction rule includes:

[0031] Filling the embedded financial data based on a filling rule to obtain filled financial data; wherein the filling rule includes adding an additional column to the filled financial data and filling each row of the additional column with 0;

[0032] Based on the optimal time period, the filled financial data is trimmed to obtain characteristic data under different optimal time periods.

[0033] In one embodiment, the fusing of the related features of the feature data of the same type, the feature data satisfying different optimal time periods, and the embedded financial data to obtain the financial data feature sets corresponding to the different types of financial data includes:

[0034] Project the tensor corresponding to the feature data of each optimal time period onto the target tensor to obtain specific features;

[0035] The relevant features of the feature data of the same type, the specific features and the embedded financial data are fused to obtain a financial data feature set corresponding to the different types of financial data.

[0036] In one embodiment, before extracting relevant features corresponding to feature data of the same type in the feature data under each optimal time period based on the multi-head self-attention mechanism, the data processing method for financial data further includes:

[0037] Stacking the feature data at different optimal time periods to obtain stacked feature data;

[0038] The method of extracting relevant features corresponding to the same type of feature data in the feature data under each optimal time period based on the multi-head self-attention mechanism includes:

[0039] Based on the multi-head self-attention mechanism, relevant features corresponding to the same type of feature data in each optimal time period in the stacked feature data are extracted.

[0040] In one embodiment, the calculation formula of the financial data feature set is:

[0041] ; Where Y represents the financial data feature set, Indicates specific characteristics, Represents related features of the same type of feature data, represents the embedded financial data, and is a learnable parameter, P represents proportional control, P= , I represents integral control, I= , D represents differential control, D= , Indicates the best time period, .

[0042] According to another aspect of the present invention, there is provided a data processing device for financial data, comprising:

[0043] Acquisition module, used to obtain different types of financial data;

[0044] An embedding module, used for embedding the different types of financial data based on embedding rules to obtain embedded financial data;

[0045] A scale recognition module is used to determine the optimal time period according to the embedded financial data based on the TimeNet model; based on the extraction rules, extract feature data that meets different optimal time periods from the embedded financial data;

[0046] A multi-head attention module is used to extract relevant features corresponding to the same type of feature data in the feature data under each optimal time period based on the multi-head self-attention mechanism;

[0047] A fusion module, used for fusing the relevant features of the feature data of the same type, the feature data satisfying different optimal time periods and the embedded financial data to obtain a financial data feature set corresponding to the different types of financial data;

[0048] The importance acquisition module is used to acquire the label values ​​corresponding to the different types of financial data based on the multi-layer perceptron and the financial data feature set; wherein the label values ​​represent the importance levels corresponding to the different types of financial data.

[0049] The beneficial effects of the present invention are embodied in that the present invention provides a data processing method and a data processing device for financial data, including: obtaining different types of financial data, embedding different types of financial data based on embedding rules to obtain embedded financial data, determining the optimal time period based on the TimeNet model according to the embedded financial data, extracting feature data that meets different optimal time periods from the embedded financial data based on extraction rules, extracting relevant features corresponding to feature data of the same type in the feature data under each optimal time period based on a multi-head self-attention mechanism, fusing relevant features of feature data of the same type, feature data that meets different optimal time periods, and embedded financial data to obtain financial data feature sets corresponding to different types of financial data, and obtaining label values ​​corresponding to different types of financial data based on a multi-layer perceptron and a financial data feature set, wherein the label value indicates the importance of different types of financial data. By embedding the financial data, the characteristics of the financial data can be more clearly distinguished. Then, feature data that meets different optimal time periods is extracted from the embedded financial data, thereby capturing the periodicity of the financial data. A multi-head self-attention mechanism is used to capture the same type of correlation in each optimal time period, and the related features of the same type of feature data, feature data that meet different optimal time periods, and embedded financial data are fused to obtain a simpler structure of financial data feature set, so that low-configuration servers can effectively process data. Finally, the financial data feature set is input into the multi-layer perceptron. Since the multi-layer perceptron requires fewer parameters, the low-configuration server is more efficient in processing data with a multi-layer perceptron than a complex large model, with a shorter delay time. The importance of financial data is determined by the multi-layer perceptron, thus providing a more accurate data basis for subsequent financial analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A flowchart of the data processing method for financial data provided by the present invention.

[0051] Figure 2 A schematic flow chart of the method for determining the optimal time period provided by the present invention.

[0052] Figure 3 This is a schematic diagram of the structure of the data processing device for financial data provided by the present invention.

[0053] Figure 4A schematic diagram of the structure of a data processing device for financial data provided by another exemplary embodiment of the present invention.

[0054] Figure 5 This is a structural diagram of the electronic device provided by the present invention.

[0055] Reference numerals:

[0056] 10. Electronic device; 11. Processor; 12. Memory; 13. Input device; 14. Output device. DETAILED DESCRIPTION

[0057] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0058] Embodiment 1: Figure 1 The flowchart of the data processing method of financial data provided by the present invention is as follows. Figure 1 As shown, the data processing method of financial data includes:

[0059] S110: Acquire different types of financial data.

[0060] In the embodiment of the present invention, different types of financial data may be obtained through a financial system or a common accounting system or a financial database, and the financial data may include costs, profits, etc.

[0061] S120: Based on the embedding rules, embedding processing is performed on different types of financial data to obtain embedded financial data.

[0062] In the embodiment of the present invention, in order to make the characteristics of financial data more obvious, the present invention embeds different types of financial data through embedding rules to generate embedded financial data. This embedding method can help capture the complex structure of financial data later, so that originally overlapping or similar data points can be effectively separated in the new space.

[0063] In addition, since the present invention requires that a low-configuration server can also process a large amount of financial data and perform financial analysis, the present invention can select financial data that meets the time span for embedding processing, thereby preventing a large amount of financial data from being processed at one time, resulting in the low-configuration server being unable to respond quickly. The embedding method makes the characteristics of the financial data more obvious, so that it can be more quickly determined whether these different types of financial data are more important.

[0064] S130: Based on the TimeNet model, determine the optimal time period according to the embedded financial data.

[0065] In the embodiment of the present invention, financial data may be affected by seasonal and cyclical factors, and its values ​​and characteristics are different. Therefore, understanding the cyclical characteristics of financial data can help the multi-layer perceptron predict whether these financial data are more important in financial analysis. The TimeNet model is a deep learning model for time series prediction, which is designed to process the cyclical and trend characteristics in time series data.

[0066] S140: Extracting feature data satisfying different optimal time periods from the embedded financial data based on the extraction rules.

[0067] In the embodiment of the present invention, in order to make the embedded financial data conform to the optimal time period, feature data that meets different optimal time periods can be extracted from the embedded financial data through extraction rules, so that the extracted data conforms to its periodic characteristics. Since the feature data that meets different optimal time periods is extracted from the embedded financial data, the data processed by the low-configuration server is reduced, thereby improving the processing memory and processing efficiency of the low-configuration server.

[0068] S150: Based on the multi-head self-attention mechanism, relevant features corresponding to the same type of feature data in the feature data under each optimal time period are extracted.

[0069] In an embodiment of the present invention, although the feature data under different optimal time periods conform to the periodic characteristics, the feature data under different optimal time periods only conform to the periodic characteristics as a whole, and the same type of data or local data in each optimal time period does not necessarily conform to the periodic characteristics. Therefore, through the multi-head self-attention mechanism, the relevant features corresponding to the feature data of the same type in the feature data under each optimal time period are extracted, so that the correlation of the same type of data that does not meet the periodic properties can be obtained. In time series data, the use of a multi-head self-attention mechanism can better capture the complex relationships and correlations between features, especially in different time periods of the data. The multi-head self-attention mechanism is an important technology in deep learning, especially in natural language processing (NLP) and time series analysis. It captures different aspects of the features in the data by calculating different attention weights in parallel through multiple "heads".

[0070] S160: Fusion the related features of the same type of feature data, feature data satisfying different optimal time periods, and embedded financial data to obtain financial data feature sets corresponding to different types of financial data.

[0071] In an embodiment of the present invention, by fusing the relevant features of the same type of feature data, feature data that meet different optimal time periods, and embedded financial data, the data is analyzed from multiple angles to discover potential patterns and associations that may have been overlooked. In addition, the relevant features of the same type of feature data, feature data that meet different optimal time periods, and embedded financial data represent different aspects and features of different types of financial data. By fusing different features, the data can be understood more comprehensively, and the relevant features of the same type of feature data, feature data that meet different optimal time periods, and embedded financial data are fused to make the network structure of different types of financial data simpler, so that low-configuration servers can process more effectively. It should be understood that low-configuration servers processing complex financial data will result in low processing efficiency and long delay time.

[0072] S170: Based on the multi-layer perceptron and the financial data feature set, obtain label values ​​corresponding to different types of financial data, wherein the label values ​​represent the importance of different types of financial data.

[0073] In an embodiment of the present invention, in order to determine which financial data is more critical before financial analysis and make the financial analysis more accurate, the feature set of financial data can be input into a multi-layer perceptron, so as to obtain label values ​​corresponding to different types of financial data, and determine whether the different types of financial data as a whole are more important to subsequent financial analysis.

[0074] In addition, since the multilayer perceptron requires fewer parameters than other large models, the multilayer perceptron can be configured in a low-configuration server compared to other large models, which can make the low-configuration server run quickly and improve the efficiency of the low-configuration server.

[0075] It can be understood that by inputting the feature set of financial data into the multi-layer perceptron, the label values ​​corresponding to different types of financial data can be output, including (values ​​of 0-1), and the higher the value, the higher the corresponding importance. Specifically, the probability value of 1 can be obtained through the softmax in the multi-layer perceptron or by inputting the value of the multi-layer perceptron into the softmax. The importance corresponding to different types of financial data can be directly determined through the probability value of 1. For example, when the probability value of 1 is 90%, it means that the importance is high, and when the probability value of 1 is 10%, it means that the importance is low.

[0076] By fusing the features obtained by different extraction methods, the multilayer perceptron can learn more complex and abstract patterns, thereby improving the accuracy of classification or regression. In addition, the structure of the multilayer perceptron is simpler than existing methods and requires fewer parameters. Therefore, even with low hardware configuration, it is possible to determine which data is more important for financial analysis when processing large-scale data.

[0077] In the present invention, the multilayer perceptron can be trained using a training data set, and the training data set can be historical financial data within a historical period and labeled historical financial data, wherein the label value of the labeled financial data is 1 or 0, 0 means not important, and 1 means relatively important. The multilayer perceptron is trained using the training data, and softmax can be added to the multilayer perceptron, or the output value of the multilayer perceptron is input into softmax, so that a probability value of 1 can be obtained.

[0078] The present invention provides a data processing method for financial data, comprising: obtaining different types of financial data, embedding different types of financial data based on embedding rules to obtain embedded financial data, determining the optimal time period based on the embedded financial data based on the TimeNet model, extracting feature data that meets different optimal time periods from the embedded financial data based on the extraction rule, extracting relevant features corresponding to feature data of the same type in the feature data under each optimal time period based on a multi-head self-attention mechanism, fusing relevant features of feature data of the same type, feature data that meets different optimal time periods, and embedded financial data to obtain financial data feature sets corresponding to different types of financial data, and obtaining label values ​​corresponding to different types of financial data based on a multi-layer perceptron and a financial data feature set, wherein the label value indicates the importance of different types of financial data. By embedding the financial data, the characteristics of the financial data can be more clearly distinguished. Then, feature data that meets different optimal time periods is extracted from the embedded financial data, thereby capturing the periodicity of the financial data. A multi-head self-attention mechanism is used to capture the same type of correlation in each optimal time period, and the related features of the same type of feature data, feature data that meet different optimal time periods, and embedded financial data are fused to obtain a simpler structure of financial data feature set, so that low-configuration servers can effectively process data. Finally, the financial data feature set is input into the multi-layer perceptron. Since the multi-layer perceptron requires fewer parameters, the low-configuration server is more efficient in processing data with a multi-layer perceptron than a complex large model, with a shorter delay time. The importance of financial data is determined by the multi-layer perceptron, thus providing a more accurate data basis for subsequent financial analysis.

[0079] Example 2: In one embodiment, before S120, the data processing method of financial data can be specifically implemented as follows: sorting each type of financial data in chronological order to obtain sorted financial data; S120 can be specifically implemented as follows: embedding the sorted financial data based on embedding rules to obtain embedded financial data.

[0080] In the embodiment of the present invention, the same type of data is first sorted in chronological order, thereby obtaining different types of time-series financial data. For example, profit: , Represents the profit at the Nth time point, N=1,2,3…; cost: , Represents the cost at the Nth time point, N=1,2,3….

[0081] Then, each type of time series data is taken as a row, and each type of time series data has N elements. Assuming there are M types of financial data, they can be combined to form a size of In order to make the characteristics of financial data more obvious, the present invention embeds different types of financial data through embedding rules to generate embedded financial data. This embedding method can help capture the complex structure of financial data later, so that originally overlapping or similar data points can be effectively separated in the new space.

[0082] Embodiment 3: In one embodiment, the data processing method of financial data can be specifically implemented as follows: obtaining a time span and an index of a current time point; wherein the time span is a column span, and each column in the sorted financial data corresponds to a time point; according to the column span and the index of the current time point, the sorted financial data is divided to obtain divided financial data; based on the embedding rule, the divided financial data is embedded to obtain embedded financial data.

[0083] In an embodiment of the present invention, in order to embed the financial data more quickly, the data matrix corresponding to the financial data can be divided into sub-matrices first, and then the sub-matrices corresponding to the divided financial data can be embedded, which can further reduce the running processing of the memory, and because a large amount of data is reduced, the computing processing capability is improved and the memory consumption is reduced.

[0084] Specifically, first determine the time span, which indicates the range of division. The time span in the present invention is the column span. Get the index of the current time point. The importance of which financial data to use to predict the overall financial data can be determined through the index of the current time point. Each column in the data matrix corresponding to the financial data corresponds to a time point. The submatrix corresponding to the divided financial data can be expressed as , where t is the index of the current time point and L represents the column span. Then, based on the embedding rule, the divided financial data is embedded to obtain the embedded financial data.

[0085] Embodiment 4: In one embodiment, the data processing method of financial data can be specifically implemented as follows: determining the time point corresponding to each column of the divided financial data in the sorted financial data; obtaining the time feature of the time point corresponding to each column of the divided financial data; embedding the time feature into the column of the divided financial data corresponding to the time feature to obtain the embedded financial data.

[0086] In an embodiment of the present invention, the time point corresponding to the submatrix corresponding to the divided financial data in the data matrix corresponding to the sorted financial data is determined. For example, if the first column of the submatrix corresponding to the divided financial data is the third column in the data matrix corresponding to the sorted financial data, then the time point of the first column of the submatrix corresponding to the divided financial data is the time point corresponding to the third column in the data matrix corresponding to the sorted financial data. The time point of each column in the submatrix corresponding to the divided financial data is determined in sequence. Then, a time matrix of the time points corresponding to each column of the submatrix corresponding to the divided financial data is obtained, and the time matrix is ​​embedded in each column of the submatrix corresponding to the divided financial data.

[0087] Among them, the embedded financial data is defined as , the calculation formula of the embedded financial data is: , where Conv1D is the convolutional layer, The submatrix of the data matrix X corresponding to the embedded financial data starting from the t-th column and the first L columns and rows is the divided financial data. t represents the time point or the t-th column, L represents the column span, and PE represents the time matrix or The position embedding result, SE represents a learnable global timestamp embedding.

[0088] Embodiment 5: Figure 2 FIG. 1 is a flow chart of the method for determining the optimal time period provided by the present invention. Figure 2 As shown, S130 may include:

[0089] S131: Perform fast Fourier transform on the embedded financial data to obtain transformed financial data.

[0090] In the embodiment of the present invention, the prominent time periodicity of financial data can be detected by fast Fourier transform. Fourier transform can transfer the embedded financial data to the frequency domain, which is the main frequency component of the data. In the frequency domain, the data is represented as a combination of multiple frequency components, each of which has its corresponding amplitude and phase. This representation method makes it easier to identify the strength of each frequency component in the signal.

[0091] If the Fourier transform result shows that some frequency components have larger amplitudes, this usually means that the original data has periodic changes corresponding to these frequencies in the time domain. For example, if the amplitude of one frequency is significantly higher than other frequencies, this indicates that the data has obvious periodic characteristics at this frequency. In the time domain, periodic signals will show sharp peaks in the frequency domain. By analyzing these peaks, we can understand the main periodic characteristics of the data.

[0092] S132: Calculate the amplitude of the transformed financial data.

[0093] S133: Calculate the mean of the transformed financial data according to the amplitude of the transformed financial data.

[0094] In the embodiment of the present invention, the calculation formula for the mean of the transformed financial data is:

[0095] ,in, represents the fast Fourier transform, represents the amplitude calculation, Indicates taking the mean value.

[0096] S134: Based on the TimeNet model, determine the optimal time period according to the mean of the transformed financial data.

[0097] In the embodiment of the present invention, in order to improve the accuracy of the evaluation by utilizing the correlation of different time scale series, it is necessary to determine the optimal period. After the mean corresponding to the transformed financial data is determined, the mean of the transformed financial data is input into the TimeNet model, and the TimeNet model can provide three optimal periods that best fit the data characteristics. , , .

[0098] Example 6: In one embodiment, S140 can be specifically implemented as follows: based on the filling rule, the embedded financial data is filled to obtain the filled financial data; wherein the filling rule includes adding an additional column to the filled financial data and filling each row of the additional column with 0; based on the optimal time period, the filled financial data is trimmed to obtain the characteristic data under different optimal time periods.

[0099] In an embodiment of the present invention, since the number of columns of the embedding matrix corresponding to the embedded financial data is certain, but the optimal time period may exceed the number of columns of the embedding matrix corresponding to the embedded financial data, the number of columns of the cropped matrix will not be able to meet the optimal time period. Therefore, the embedded financial data needs to be filled based on the filling rules.

[0100] Specifically, based on the filling rule, the embedded financial data is filled to obtain the filled financial data, including: determining the maximum cycle among multiple optimal cycles; determining the number of columns of the embedding matrix corresponding to the embedded financial data; if the number of columns is less than the maximum cycle, determining the number of additional columns according to the number of columns and the maximum cycle; filling the embedding matrix corresponding to the embedded financial data according to the number of additional columns to obtain the filled financial data; wherein the filling value of each row of the additional column is 0.

[0101] The number of additional columns can be obtained by the difference between the maximum period and the number of columns. That is, if the number of additional columns is 2, then it is necessary to add 2 columns of data to the embedding matrix corresponding to the embedded financial data, and both columns of data are composed of 0. In addition, in order to ensure that the feature data under different optimal time periods can include the data in the embedded financial data to the greatest extent, the number of columns can be added at the end of the embedding matrix corresponding to the embedded financial data.

[0102] Among them, the calculation formula of characteristic data under different optimal time periods is:

[0103] ,in, represents a filling operation, Represented as the embedding matrix corresponding to the embedded financial data, Indicates the best time period, i=1,2,3, Represents a crop operation.

[0104] It should be understood that the starting position of the optimal period corresponds to the starting time point of the embedding matrix corresponding to the embedded financial data, that is, the starting position of each optimal period corresponds to the starting time point of the embedding matrix corresponding to the embedded financial data, wherein the starting time point represents the starting column of the embedding matrix corresponding to the embedded financial data.

[0105] Optionally, if the lengths of each row and column of the data matrix corresponding to the financial data are different, it may result in a row or column in the embedded matrix corresponding to the embedded financial data having no data. Therefore, in order to keep the length of the embedded matrix corresponding to the embedded financial data consistent, the embedded matrix corresponding to the embedded financial data may also be filled based on the filling rule. Specifically, filling the embedded financial data based on the filling rule to obtain the filled financial data includes: determining the column without data in the embedded matrix corresponding to the embedded financial data as the target column; determining the row without data in the target column as the target row; filling the position of the target row in the target column with 0; determining the maximum cycle among multiple optimal cycles; determining the number of columns of the embedded matrix corresponding to the embedded financial data; if the number of columns is less than the maximum cycle, determining the number of additional columns according to the number of columns and the maximum cycle; filling the embedded matrix corresponding to the embedded financial data according to the number of additional columns to obtain the filled financial data; wherein the filling value of each row of the additional column is 0.

[0106] Example 7: In one embodiment, S160 can be specifically implemented as follows: projecting the tensor corresponding to the feature data of each optimal time period onto the target tensor to obtain specific features; fusing the relevant features, specific features and embedded financial data of the same type of feature data to obtain financial data feature sets corresponding to different types of financial data.

[0107] In the embodiment of the present invention, in order to capture specific and comprehensive dependencies between sequences, the present invention adopts multi-scale adaptive graph convolution to project the tensor corresponding to the i-th time scale back to the new tensor or the target tensor, and the multi-scale adaptive graph convolution can capture specific and comprehensive dependencies between sequences. The new tensor or the target tensor is a tensor with M variables.

[0108] The calculation formula of the specific feature is: ,in, represents a specific feature, the target tensor is a tensor with M variables, represents the learnable weights, Represents characteristic data under different optimal time periods.

[0109] Example 8: In one embodiment, before S150, the data processing method of financial data can be specifically implemented as follows: stacking the feature data under different optimal time periods to obtain stacked feature data; projecting the tensor corresponding to the feature of each optimal time period in the stacked feature data to the target tensor to obtain related features corresponding to the same type of feature data.

[0110] The calculation formula for the multi-head self-attention result is: ,in, It means to use multi-head self-attention mechanism at different time scales. Represents the tensor of the stacked feature data at different optimal time periods, Indicates the related features corresponding to the same type of feature data, Indicates the best time period, i = 1, 2, 3. The correlation within the sequence (the same financial data) is captured through the multi-head attention mechanism.

[0111] Embodiment 9: In one embodiment, the calculation formula of the financial data feature set is:

[0112] ; Where Y represents the fusion result, Indicates specific characteristics, Indicates the related features corresponding to the same type of feature data, represents the embedded financial data, and is a learnable parameter, P represents proportional control, P= , I represents integral control, I= , D represents differential control, D= , Indicates the best time period, .

[0113] Figure 3 This is a schematic diagram of the structure of the data processing device for financial data provided by the present invention. Figure 3 As shown, the data processing device for financial data includes: an acquisition module for acquiring different types of financial data; an embedding module for embedding different types of financial data based on embedding rules to obtain embedded financial data; a scale recognition module for determining the optimal time period based on the embedded financial data based on the TimeNet model; extracting feature data that meets different optimal time periods from the embedded financial data based on extraction rules; a multi-head attention module for extracting relevant features corresponding to feature data of the same type in the feature data under each optimal time period based on a multi-head self-attention mechanism; a fusion module for fusing relevant features of feature data of the same type, feature data that meets different optimal time periods, and embedded financial data to obtain financial data feature sets corresponding to different types of financial data; an importance acquisition module for acquiring label values ​​corresponding to different types of financial data based on a multi-layer perceptron and a financial data feature set; wherein the label values ​​represent the importance levels corresponding to different types of financial data.

[0114] Figure 4 This is a schematic diagram of the structure of a data processing device for financial data provided by another exemplary embodiment of the present invention. Figure 4As shown, before the embedding module, the data processing device of the financial data can be specifically configured as: sorting each type of financial data in chronological order to obtain sorted financial data; wherein, the embedding module can be specifically configured as: based on the embedding rules, embedding processing is performed on the sorted financial data to obtain embedded financial data.

[0115] In one embodiment, the embedding module can be specifically configured as follows: obtaining a time span and an index of a current time point; wherein the time span is a column span, and each column in the sorted financial data corresponds to a time point; dividing the sorted financial data according to the column span and the index of the current time point to obtain divided financial data; and embedding the divided financial data based on embedding rules to obtain embedded financial data.

[0116] In one embodiment, the embedding module can be specifically configured as follows: determining the time point corresponding to each column of the divided financial data in the sorted financial data; obtaining the time features of the time point corresponding to each column of the divided financial data; and embedding the time features into the column of the divided financial data corresponding to the time features to obtain the embedded financial data.

[0117] In one embodiment, the scale recognition module can be specifically configured as follows: performing a fast Fourier transform on the embedded financial data to obtain transformed financial data; calculating the amplitude of the transformed financial data; calculating the mean of the transformed financial data based on the amplitude of the transformed financial data; and determining the optimal time period based on the mean of the transformed financial data based on the TimeNet model.

[0118] In one embodiment, the scale recognition module can be specifically configured as follows: based on the filling rule, the embedded financial data is filled to obtain the filled financial data; wherein the filling rule includes adding an additional column to the filled financial data and filling each row of the additional column with 0; based on the optimal time period, the filled financial data is trimmed to obtain the characteristic data under different optimal time periods.

[0119] In one embodiment, the fusion module may include: a multi-scale adaptive graph convolution module unit, used to project the tensor corresponding to the feature data of each optimal time period to the target tensor to obtain specific features; and fuse the relevant features, specific features and embedded financial data of the same type of feature data to obtain financial data feature sets corresponding to different types of financial data.

[0120] In one embodiment, before the multi-head attention module 204, the data processing device for financial data can be specifically configured as: stacking the feature data under different optimal time periods to obtain stacked feature data; wherein the multi-head attention module 204 can be specifically configured as: based on the multi-head self-attention mechanism, extracting relevant features corresponding to the same type of feature data under each optimal time period in the stacked feature data.

[0121] In one embodiment, the calculation formula of the financial data feature set is: ; Where Y represents the financial data feature set, Indicates specific characteristics, Represents related features of the same type of feature data, represents the embedded financial data, and is a learnable parameter, P represents proportional control, P= , I represents integral control, I= , D represents differential control, D= , Indicates the best time period, .

[0122] Figure 5 A block diagram of an electronic device according to an embodiment of the present application is illustrated.

[0123] like Figure 5 As shown, the electronic device 10 includes one or more processors 11 and a memory 12 .

[0124] The processor 11 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 10 to perform desired functions.

[0125] The memory 12 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 11 may run the program instructions to implement the data processing method for financial data of each embodiment of the present application described above and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.

[0126] In one example, the electronic device 10 may further include: an input device 13 and an output device 14 , and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0127] When the electronic device 10 is a stand-alone device, the input device 13 may be a communication network connector for receiving collected input signals from the first device and the second device.

[0128] In addition, the input device 13 may also include, for example, a keyboard, a mouse, and the like.

[0129] The output device 14 can output various information to the outside, including the determined distance information, direction information, etc. The output device 14 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.

[0130] Of course, to simplify, Figure 5 Only some of the components related to the present application in the electronic device 10 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 10 may also include any other appropriate components.

[0131] The computer program product may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0132] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0133] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for processing financial data, characterized in that: include: Access different kinds of financial data; Based on the embedding rules, embedding processing is performed on the different types of financial data to obtain embedded financial data; Based on the TimeNet model, determining the optimal time period according to the embedded financial data; Based on the extraction rules, feature data satisfying different optimal time periods are extracted from the embedded financial data; Based on the multi-head self-attention mechanism, relevant features corresponding to the same type of feature data in the feature data under each optimal time period are extracted; Project the tensor corresponding to the feature data of each optimal time period onto the target tensor to obtain specific features; The relevant features of the feature data of the same type, the specific features and the embedded financial data are merged to obtain a financial data feature set corresponding to the different types of financial data; wherein the calculation formula of the financial data feature set is: ; Where Y represents the financial data feature set, and Y is a calculation formula constructed by proportional control, integral control, and differential control. Indicates specific characteristics, Represents related features of the same type of feature data, represents the embedded financial data, and is a learnable parameter, P represents proportional control, P= , I represents integral control, I= , D represents differential control, D= , Indicates the best time period, ; Based on a multilayer perceptron and the financial data feature set, label values ​​corresponding to the different types of financial data are obtained; wherein the label values ​​represent the importance levels corresponding to the different types of financial data.

2. The method for processing financial data according to claim 1, characterized in that: Before embedding the different types of financial data based on the embedding rule to obtain the embedded financial data, the method further includes: Sort each type of financial data in chronological order to obtain sorted financial data; Wherein, based on the embedding rule, embedding processing is performed on the different types of financial data to obtain embedded financial data including: Based on the embedding rule, embedding processing is performed on the sorted financial data to obtain embedded financial data.

3. The method for processing financial data according to claim 2, characterized in that: The embedding process of the sorted financial data based on the embedding rule to obtain the embedded financial data includes: Obtaining the time span and the index of the current time point; wherein the time span is a column span, and each column in the sorted financial data corresponds to a time point; Dividing the sorted financial data according to the column span and the index of the current time point to obtain divided financial data; Based on the embedding rule, embedding processing is performed on the divided financial data to obtain embedded financial data.

4. The method for processing financial data according to claim 3, characterized in that: The embedding process is performed on the divided financial data based on the embedding rule to obtain the embedded financial data, which includes: Determine a time point corresponding to each column of the divided financial data in the sorted financial data; Obtaining time characteristics of a time point corresponding to each column of the divided financial data; The time feature is embedded into the column of the divided financial data corresponding to the time feature to obtain embedded financial data.

5. The method for processing financial data according to claim 1, characterized in that: The determining of the optimal time period based on the TimeNet model and the embedded financial data includes: Performing a fast Fourier transform on the embedded financial data to obtain transformed financial data; Calculating the magnitude of the transformed financial data; Calculating the mean of the transformed financial data according to the amplitude of the transformed financial data; Based on the TimeNet model, the optimal time period is determined according to the mean value of the transformed financial data.

6. The method for processing financial data according to claim 5, characterized in that: The extracting of feature data satisfying different optimal time periods from the embedded financial data based on the extraction rule includes: Filling the embedded financial data based on a filling rule to obtain filled financial data; wherein the filling rule includes adding an additional column to the filled financial data and filling each row of the additional column with 0; Based on the optimal time period, the filled financial data is trimmed to obtain characteristic data under different optimal time periods.

7. The method for processing financial data according to claim 1, characterized in that: Before extracting relevant features corresponding to the same type of feature data in the feature data under each optimal time period based on the multi-head self-attention mechanism, the method further includes: Stacking the feature data at different optimal time periods to obtain stacked feature data; The method of extracting relevant features corresponding to the same type of feature data in the feature data under each optimal time period based on the multi-head self-attention mechanism includes: Based on the multi-head self-attention mechanism, relevant features corresponding to the same type of feature data in each optimal time period in the stacked feature data are extracted.

8. A data processing device for financial data, characterized in that: include: Acquisition module, used to obtain different types of financial data; An embedding module, used for embedding the different types of financial data based on embedding rules to obtain embedded financial data; A scale recognition module, for determining an optimal time period based on the embedded financial data based on a TimeNet model; Based on the extraction rules, feature data satisfying different optimal time periods are extracted from the embedded financial data; A multi-head attention module is used to extract relevant features corresponding to the same type of feature data in the feature data under each optimal time period based on the multi-head self-attention mechanism; A fusion module is used to project the tensor corresponding to the feature data of each optimal time period to the target tensor to obtain specific features; The relevant features of the feature data of the same type, the specific features and the embedded financial data are merged to obtain a financial data feature set corresponding to the different types of financial data; wherein the calculation formula of the financial data feature set is: ; Where Y represents the financial data feature set, and Y is a calculation formula constructed by proportional control, integral control, and differential control. Indicates specific characteristics, Represents related features of the same type of feature data, represents the embedded financial data, and is a learnable parameter, P represents proportional control, P= , I represents integral control, I= , D represents differential control, D= , Indicates the best time period, ; The importance acquisition module is used to acquire the label values ​​corresponding to the different types of financial data based on the multi-layer perceptron and the financial data feature set; wherein the label values ​​represent the importance levels corresponding to the different types of financial data.