Heterogeneous calculation method and system based on FPGA acceleration financial model
By identifying the data dependency chain lengths of parallel and serial computation subtasks, and employing B-tree indexing and Kruskal's minimum spanning tree algorithm to optimize financial model calculations, the problem of low resource utilization in existing technologies is solved, achieving efficient and accurate financial model calculations.
Patent Information
- Application Number
- CN202511303031.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-12
- Publication Date
- 2025-10-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing FPGA-based financial model calculation methods lack an effective task partitioning mechanism, resulting in low utilization of computing resources, failure to fully leverage the advantages of heterogeneous computing, and failure to effectively utilize data flow relationships and repetitive calculation characteristics, leading to waste of computing resources and reduced efficiency.
By identifying the data dependency chain lengths of parallel and serial computing subtasks, a B-tree indexing mechanism is used for historical task retrieval and incremental computation. Combined with Kruskal's minimum spanning tree algorithm, the optimal data combination path is constructed to optimize computing resource allocation and data transmission.
It achieves a reasonable allocation of computing resources, significantly improves the computational efficiency and accuracy of financial models, shortens computation time, and enhances resource utilization and scalability.
Smart Images

Figure CN120803750A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and in particular to a heterogeneous computing method and system based on FPGA accelerated financial model. BACKGROUND
[0002] With the rapid development of financial markets, the requirements for real-time and accuracy of complex financial model calculation are continuously increasing. Traditional financial model calculation mainly relies on general-purpose processors (CPUs) for serial calculation, and the calculation efficiency is low when facing large-scale data processing and complex algorithm requirements. In recent years, heterogeneous computing architecture has shown great potential in high-performance computing, especially FPGA (field programmable gate array) due to its reconfigurability, parallel processing capability and low power consumption characteristics, which has become an important hardware platform for accelerating financial model calculation. The current financial industry has begun to explore the use of CPU and FPGA collaborative heterogeneous computing scheme to improve the calculation efficiency and real-time performance of financial model.
[0003] However, the existing FPGA-based financial model calculation method still has the following defects and deficiencies: the existing technology lacks an effective task division mechanism, which cannot reasonably allocate according to the characteristics of financial calculation tasks, resulting in low utilization of computing resources. For computing sub-tasks with different data dependency characteristics, simply allocating them all to CPU or FPGA cannot fully utilize the advantages of heterogeneous computing, and will also cause idle or overload of part of the hardware resources; the traditional method does not consider the data flow relationship when processing parallel computing sub-tasks on FPGA, resulting in frequent cross-cell data transmission and increasing communication overhead. The interdependent computing sub-tasks are allocated to computing units with far apart physical locations, and the data transmission delay becomes the performance bottleneck, which cannot realize truly efficient parallel computing; the existing technology lacks an effective data reuse mechanism when processing serial computing sub-tasks, and fails to utilize the repetitive computing characteristics commonly found in financial calculation. There are a large number of historical data and intermediate results in the financial model calculation process that can be reused, but the traditional method often simply recalculates, causing waste of computing resources and reduction of overall efficiency. SUMMARY
[0004] The embodiments of the present application provide a heterogeneous computing method and system based on FPGA accelerated financial model, which can solve the problems in the prior art.
[0005] In a first aspect, the embodiments of the present application provide a heterogeneous computing method based on FPGA accelerated financial model, comprising: obtaining a financial model calculation task to be processed, and extracting a plurality of computing sub-tasks from the financial model calculation task; Calculate the data dependency chain length of each computing subtask, mark the computing subtasks with a data dependency chain length less than a preset dependency threshold as parallel computing subtasks, and the rest as serial computing subtasks; Map the data flow conversion relationship between the parallel computing subtasks to a directed graph structure, and distribute the parallel computing subtasks with data dependency relationship to adjacent FPGA computing units; Distribute the serial computing subtasks to CPU processors, introduce a B-tree-based indexing mechanism, retrieve similar historical tasks through the interval search feature of the B-tree, and if the historical tasks overlap, extract their calculation results for incremental calculation; in the cache update process, dynamically adjust the cache structure using the split and merge features of the B-tree; The parallel computing subtask result data and the serial computing subtask result data are used as nodes, the data dependency relationship of the financial model calculation task is used as an edge, and the dependency degree is used as a weight. Based on the Kruskal minimum spanning tree algorithm, a data combination sequence is constructed, and the optimal data combination path is selected step by step through the greedy strategy to generate the final calculation result.
[0006] Obtain a financial model calculation task to be processed, and extract a plurality of computing subtasks from the financial model calculation task, including: Extract an operation set from the financial model calculation task; calculate the space correlation degree based on the ratio of the number of intersection elements to the number of union elements between adjacent operations, calculate the time correlation degree based on the ratio of the overlapping part of the execution time period to the total execution time, and take the product of the space correlation degree and the time correlation degree as the operation correlation; According to the operation set and the operation correlation, calculate the operation granularity by calculating the ratio of the operation complexity to the sum of the complexity of adjacent operations, aggregate adjacent operations with operation granularity greater than a preset operation threshold into the same subtask, and generate an initial subtask set; Calculate the load balancing degree and coupling degree between each subtask in the initial subtask set, add the load balancing degree and the coupling degree after being multiplied by the corresponding preset weight coefficient, and obtain an evaluation score based on the evaluation score. Based on the evaluation score, a plurality of computing subtasks are divided.
[0007] Map the data flow conversion relationship between the parallel computing subtasks to a directed graph structure, and distribute the parallel computing subtasks with data dependency relationship to adjacent FPGA computing units, including: Analyze the data flow conversion process between the parallel computing subtasks, convert the data input and output relationship in the data flow conversion process to the relationship between nodes and edges, wherein the parallel computing subtasks are set as nodes, the data flow conversion relationship is set as directed edges, and a directed graph structure is generated; Cosine similarity between nodes in the directed graph structure is calculated as the correlation degree between nodes, and a sequence of adjacent nodes with the highest correlation degree is extracted for each node to generate a node correlation link; An association propagation matrix is constructed based on the node correlation link, each element of the association propagation matrix representing the association propagation strength between a corresponding node pair, a breadth-first traversal is performed starting from a node with the largest out-degree, the cumulative product of the association propagation strength between nodes on the traversal path is calculated, and the traversal path with the largest cumulative product of the association propagation strength is determined as a critical path; The distribution structure and connection relationship of the FPGA computing units are obtained, the physical distance between the FPGA computing units is analyzed, and parallel computing sub-tasks corresponding to adjacent node pairs on the critical path are allocated to FPGA computing units with the closest physical distance.
[0008] The serial computing sub-tasks are allocated to CPU processors, and a B-tree-based indexing mechanism is introduced to retrieve similar historical tasks through the interval search feature of the B-tree, and if the historical tasks overlap, the calculation results thereof are extracted for incremental calculation, including: The calculation parameter set and data range of the serial computing sub-tasks are obtained, and a task feature vector is constructed in combination with the historical execution characteristics and current execution state of the serial computing sub-tasks; An index structure is established in the B-tree according to the task feature vector, historical tasks are retrieved using the interval search feature of the B-tree, the overlap degree of the serial computing sub-tasks and the historical tasks in each dimension is calculated to obtain an interval matching degree, an index key value is generated based on the calculation parameter set and the data range, and the index key value is positioned in the B-tree; the historical tasks are sorted according to the interval matching degree, and a historical task set with the highest matching degree is obtained; The boundary range of the overlap region is determined based on the interval matching degree, the overlap rate is calculated by calculating the intersection and union of the data regions of the serial computing sub-tasks and each task in the historical task set, and when the overlap rate is greater than a preset overlap threshold, a reusable historical task is determined from the historical task set; the calculation result of the reusable historical task is extracted for incremental calculation.
[0009] An index key value is generated based on the calculation parameter set and the data range, including: The calculation parameter set is mapped in the parameter space to obtain a parameter mapping value, a local sensitive hash operation is performed based on the parameter mapping value to obtain a parameter feature code; the data range is interval feature encoded to obtain an interval encoding value, and a Hilbert curve encoding operation is performed based on the interval encoding value to obtain an interval feature code; The parameter feature code and the interval feature code are combined through a bit concatenation operation to generate an initial index key value, the initial index key value is rearranged into a two-dimensional numerical matrix, the parity check value of each row and each column of the two-dimensional numerical matrix is calculated respectively, a horizontal check bit group and a vertical check bit group are obtained, and the horizontal check bit group and the vertical check bit group are combined to construct a check bit matrix. An error correction code word is generated based on the check bit matrix, and the error correction code word is embedded into the initial index key value to obtain a final index key value.
[0010] A data combination sequence is constructed based on a Kruskal minimum spanning tree algorithm, and an optimal data combination path is selected step by step through a greedy strategy, including: The edges are sorted in descending order according to the size of the weight, and a priority queue is constructed; The Kruskal minimum spanning tree algorithm is executed based on the priority queue, and a candidate edge is taken out from the head of the priority queue, path finding is performed on the two end nodes of the candidate edge, the parent node pointer is searched step by step upwards until the root node is reached, and it is judged whether the root nodes belong to the same node subset by comparison; when the candidate edge is located in different node subsets and the weight of the candidate edge is greater than a preset weight threshold, the candidate edge is added to a selected edge set; A data combination sequence is constructed based on the selected edge set and its connection relationship, the edges in the selected edge set are arranged in descending order according to the weight score, and the data nodes connected by the edges are added to the data combination sequence in turn; The selected edge set is constantly updated until all edges in the priority queue are processed or the data combination sequence contains all nodes, and an optimal data combination path is obtained.
[0011] In a second aspect of the embodiment of the application, a heterogeneous computing system based on FPGA acceleration of a financial model is provided, including: A first unit is configured to obtain a financial model calculation task to be processed, and extract a plurality of calculation subtasks from the financial model calculation task; A second unit is configured to calculate the data dependency chain length of each calculation subtask, mark the calculation subtask with a data dependency chain length less than a preset dependency threshold as a parallel calculation subtask, and mark the rest as a serial calculation subtask; A third unit is configured to map the data flow conversion relationship between the parallel calculation subtasks into a directed graph structure, and distribute the parallel calculation subtasks with a data dependency relationship to adjacent FPGA calculation units; The fourth unit is used for distributing the serial computing sub-tasks to CPU processors, introducing a B-tree-based index mechanism, searching similar historical tasks through the interval searching characteristic of the B-tree, extracting the calculation results of the historical tasks for incremental calculation if the historical tasks overlap, and dynamically adjusting the cache structure by using the splitting and merging characteristics of the B-tree in the cache updating process. The fifth unit is used for constructing a data combination sequence based on the Kruskal minimum spanning tree algorithm, gradually selecting the optimal data combination path through a greedy strategy, and generating a final calculation result, by taking the parallel computing sub-task result data and the serial computing sub-task result data as nodes, the data dependency relationship of the financial model calculation task as edges, and the dependency degree as a weight.
[0012] The third aspect of the embodiment of the application, An electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; The processor is configured to invoke the instructions stored in the memory to perform the method described above.
[0013] The fourth aspect of the embodiment of the application, A computer-readable storage medium is provided, which stores computer program instructions, and the computer program instructions are executed by a processor to implement the method described above.
[0014] The beneficial effects of the present application are as follows: The heterogeneous computing method for accelerating financial models based on FPGA provided by the application identifies parallel and serial computing sub-tasks through data dependency chain length, realizes reasonable allocation of computing resources, and improves the calculation efficiency of financial models. Especially for large-scale financial model calculation, it can achieve nearly linear performance improvement, significantly shortening the calculation time while ensuring accuracy.
[0015] The B-tree-based index mechanism introduced by the application enables CPU to efficiently process serial computing sub-tasks, avoids repeated calculation through searching similar historical tasks and incremental calculation strategy, and reduces resource consumption. In addition, the splitting and merging characteristics of the B-tree ensure the dynamic optimization of the cache structure, further improving the response speed and resource utilization when processing complex financial models.
[0016] The data combination method based on the Kruskal minimum spanning tree algorithm adopted by the application solves the problem of data integration in a heterogeneous computing environment, ensures the accuracy and consistency of the calculation results. This method can intelligently construct the optimal data combination path according to the data dependency relationship, reduce data transmission overhead, improve scalability and adaptability, and make financial analysis and decision-making more efficient and accurate. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 A flowchart of a heterogeneous computing method based on FPGA acceleration of a financial model according to an embodiment of the present application is shown in FIG. 1. Figure 2 A flowchart for generating an index key value is shown in FIG. 3. DETAILED DESCRIPTION
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in connection with the drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0019] The technical solutions of the present application will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and some embodiments can not be described again for the same or similar concepts or processes.
[0020] Figure 1 A flowchart of a heterogeneous computing method based on FPGA acceleration of a financial model according to an embodiment of the present application is shown in FIG. 1. Figure 1 As shown in FIG. 1, the method comprises: obtaining a financial model computing task to be processed, and extracting a plurality of computing sub-tasks from the financial model computing task; calculating a data dependency chain length of each computing sub-task, marking a computing sub-task with a data dependency chain length less than a preset dependency threshold as a parallel computing sub-task, and marking the rest as a serial computing sub-task; mapping a data flow conversion relationship between the parallel computing sub-tasks into a directed graph structure, and distributing parallel computing sub-tasks with a data dependency relationship to adjacent FPGA computing units; distributing the serial computing sub-tasks to a CPU processor, introducing an index mechanism based on a B-tree, searching for similar historical tasks through the interval searching feature of the B-tree, extracting the calculation results of the historical tasks for incremental calculation if there is an overlap, and dynamically adjusting the cache structure using the splitting and merging features of the B-tree in the cache updating process; taking the results data of the parallel computing sub-tasks and the results data of the serial computing sub-tasks as nodes, the data dependency relationship of the financial model computing task as edges, and the dependency degree as weights, constructing a data combination sequence based on the Kruskal minimum spanning tree algorithm, gradually selecting the optimal data combination path through a greedy strategy, and generating a final calculation result.
[0021] In an alternative embodiment, a financial model computing task to be processed is obtained, a plurality of computing subtasks are extracted from the financial model computing task, including: An operation set is extracted from the financial model computing task; a spatial correlation degree is calculated based on a ratio of an intersection element number to a union element number between adjacent operations, a time correlation degree is calculated based on a ratio of an overlapping part of an execution time period of adjacent operations to a total execution time, and a product of the spatial correlation degree and the time correlation degree is taken as an operation correlation; According to a computing load of the operation set and the operation correlation, an operation granularity is calculated based on a ratio of a computing complexity of each operation to a sum of computing complexities of adjacent operations, adjacent operations with an operation granularity greater than a preset operation threshold are aggregated into a same subtask, and an initial subtask set is generated. A load balancing degree and a coupling degree between subtasks in the initial subtask set are calculated, a preset weight coefficient is multiplied by a supplement of the load balancing degree and the coupling degree respectively, and then the two are added to obtain an evaluation score, and a plurality of computing subtasks are divided based on the evaluation score.
[0022] Taking an investment evaluation financial model as an example, the model includes a plurality of basic operations, such as historical financial data reading, income prediction, cost rate analysis, net profit calculation, free cash flow calculation, discount rate calculation, enterprise value calculation, etc. The characteristic parameters of these operations are extracted, including the input data set, the output data set, the computing complexity and the execution time of each operation, etc.
[0023] Based on the operation set, the spatial correlation degree and the time correlation degree between adjacent operations are calculated, and then the operation correlation is obtained. The spatial correlation degree is obtained by calculating the ratio of the intersection element number to the union element number of the input and output data between adjacent operations. For example, the input data intersection of income prediction and income growth rate calculation includes historical income data and industry growth rate, a total of 2 items; the union includes historical income data, industry growth rate, company-specific growth factors, a total of 3 items. Therefore, the spatial correlation degree of the two operations is 2 / 3=0.67. The time correlation degree is obtained by calculating the ratio of the overlapping part of the execution time period to the total execution time. For example, the execution time period of cost rate analysis is from the 12th second to the 18th second, the execution time period of cost prediction is from the 15th second to the 23rd second, the overlapping time is 4 seconds, the total execution time is 12 seconds, and the time correlation degree is 4 / 12=0.33. The operation correlation is obtained by multiplying the spatial correlation degree and the time correlation degree. The operation correlation of income prediction and income growth rate calculation is 0.67x0.45=0.30; the operation correlation of cost rate analysis and cost prediction is 0.71x0.33=0.23.
[0024] According to the computing load of the operation set and the operation correlation, the operation granularity is calculated and the initial subtask set is generated. The operation granularity is obtained by calculating the ratio of the computing complexity of each operation to the sum of the computing complexity of its adjacent operations. For example, the computing complexity of enterprise value calculation is 15000 instructions, and the computing complexity of its adjacent terminal value calculation and sensitivity analysis parameter setting is 8000 instructions and 3000 instructions respectively, so the operation granularity of enterprise value calculation is 15000 / (15000+8000+3000)=0.58. Set the preset operation threshold to 0.5, and consider the enterprise value calculation as an independent operation. For adjacent operations with operation granularity less than the threshold, they are aggregated into the same subtask. For example, the operation granularity of beta coefficient estimation, market risk premium determination and risk-free rate acquisition is 0.35, 0.28 and 0.22 respectively, all of which are less than the threshold 0.5, and the correlation is high, so the three operations are aggregated into a subtask. In this way, all basic operations are aggregated into 12 initial subtasks.
[0025] The load balance and coupling degree between the subtasks in the initial subtask set are calculated, and the final computing subtask division is performed through the evaluation score. The load balance is obtained by calculating the ratio of the standard deviation of the computing complexity of the subtask to the average value. For example, the standard deviation of the computing complexity of the initial subtask set is 9733 instructions, and the average value is 18667 instructions, so the load balance is 0.52, and the complement is 0.48. The coupling degree reflects the degree of mutual dependence between subtasks, which is obtained by calculating the ratio of the data exchange amount between subtasks to the internal data processing amount of the subtask. For example, the data exchange amount between the subtask containing net profit calculation and the subtask containing free cash flow calculation is 200 KB, and the internal data processing amount is 1200 KB and 900 KB respectively, so the coupling degree is 200 / (1200+900)=0.095. The coupling degree of all subtask pairs is calculated, and the average value is 0.11. Set the weight coefficient of the complement of the load balance to 0.6, and the weight coefficient of the coupling degree to 0.4, and the evaluation score is 0.48*0.6+0.11*0.4=0.332.
[0026] Based on the evaluation score, the subtask division is further optimized. By adjusting the subtask boundary, merging or splitting certain subtasks, the evaluation score is maximized. After multiple iterations of optimization, the initial 12 subtasks are reorganized into 8 final computing subtasks: historical data processing and revenue prediction, cost analysis and gross profit calculation, expense and profit calculation, cash flow component calculation, discount factor calculation, terminal value and enterprise value calculation, sensitivity analysis and report integration, report generation and output. After optimization, the complement of the load balance increases to 0.65, the coupling degree decreases to 0.08, and the evaluation score increases to 0.422, which is 27.1% higher than the initial division.
[0027] Compared with the traditional linear execution mode, the present application divides the task into 8 sub-tasks for parallel execution, and the calculation time is reduced to 42 seconds, with an efficiency improvement of 71.6%.
[0028] In an optional embodiment, the data flow relationship between the parallel computing sub-tasks is mapped into a directed graph structure, and the parallel computing sub-tasks with data dependency are allocated to adjacent FPGA computing units, including: The data flow process between the parallel computing sub-tasks is analyzed, and the data input and output relationship in the data flow process is converted into the relationship between nodes and edges, wherein the parallel computing sub-tasks are set as nodes, and the data flow relationship is set as directed edges, to generate a directed graph structure; The cosine similarity between the nodes in the directed graph structure is calculated, and the cosine similarity is used as the correlation degree between the nodes, and for each node, the sequence of adjacent nodes with the highest correlation degree is extracted, to generate a node correlation link; Based on the node correlation link, an association propagation matrix is constructed, each element of the association propagation matrix representing the association propagation strength between the corresponding node pairs, starting from the node with the largest out-degree to perform breadth-first traversal, calculating the cumulative product of the association propagation strength between the nodes on the traversal path, and determining the traversal path with the largest cumulative product of the association propagation strength as the critical path; The distribution structure and connection relationship of the FPGA computing units are obtained, the physical distance between the FPGA computing units is analyzed, and the parallel computing sub-tasks corresponding to adjacent nodes on the critical path are allocated to the FPGA computing units with the closest physical distance.
[0029] In the data flow analysis process of the parallel computing sub-tasks, the input data source and output data destination of each sub-task are identified to construct a data dependency relationship model. For example, for a set of financial model calculation tasks, a cash flow prediction sub-task a receives historical transaction data, outputs predicted cash flow data to a risk assessment sub-task b, and also outputs to a capital expenditure planning sub-task c, and the outputs of b and c are jointly used as inputs of an investment portfolio optimization sub-task d. This data flow relationship can be represented as a directed edge from task a to task b, a directed edge from task a to task c, and a directed edge from task b and c to task d, respectively. All these data flow relationships are converted into a set of nodes and directed edges, wherein each computing sub-task is a node, and the direction of data flow determines the direction of the directed edge.
[0030] After the directed graph structure is constructed, the cosine similarity between nodes in the graph is calculated and used as an index of the correlation degree between nodes. The node similarity calculation is based on the feature vector of the node, which contains the input and output data volume, computational complexity, resource occupancy rate and other multi-dimensional features of the node. For any two nodes i and j, assuming their feature vectors are Vi and Vj, the cosine similarity between nodes is obtained by the dot product of the two vectors divided by the product of their respective module lengths. In practical applications, if the feature vector of the cash flow prediction task a is (2000, 800, 0.75) and the feature vector of the risk assessment task b is (800, 400, 0.65), the cosine similarity between the two nodes can be calculated as 0.968, indicating that they have a high correlation degree.
[0031] Based on the calculated correlation degree between nodes, the highest correlation degree of the adjacent node sequence is extracted for each node to generate a node correlation link. For each node, all adjacent nodes are sorted in descending order of correlation degree, and nodes with a correlation degree exceeding a preset threshold are selected to form a correlation link. For example, if the correlation degree threshold is set to 0.8, the correlation degrees of node A with adjacent nodes B, C and E are 0.968, 0.924 and 0.766 respectively, then the correlation link of node A contains nodes B and C. In this way, the corresponding correlation link is generated for all nodes to form a simplified but key connection structure.
[0032] In constructing the correlation propagation matrix, the correlation propagation strength between any two nodes is calculated based on the node correlation link. For each pair of nodes (i, j) in the directed graph, if there is a direct edge from i to j, the correlation propagation strength is equal to their correlation degree; if there is no direct edge, the propagation strength is calculated through intermediate nodes. In the example, if the correlation degree between nodes A and B is 0.968 and the correlation degree between B and D is 0.892, then the correlation propagation strength of A to D through B is 0.968 x 0.892 = 0.863. In this way, an n x n correlation propagation matrix M is constructed, where n is the total number of nodes, and the matrix element M[i][j] represents the correlation propagation strength from node i to node j.
[0033] In the process of determining the critical path, first identify the node with the largest out-degree as the starting point of traversal. Out-degree represents the number of edges connected outward from a node, reflecting the influence range of the node on downstream tasks. For example, in a directed graph containing 28 financial calculation sub-tasks, it is found through statistics that the out-degree of historical data processing node A is 5, which is the largest among all nodes, so A is selected as the starting point of breadth-first traversal. Starting from node A, the entire graph is traversed according to the breadth-first strategy. For each traversal path, the cumulative product of the correlation propagation strength between adjacent nodes on the path is calculated. If a path starting from A passes through nodes B, D, and F in turn, the correlation propagation strength of each adjacent node pair is 0.968, 0.892, and 0.915 respectively, then the cumulative product of the correlation propagation strength of this path is 0.968 × 0.892 × 0.915 = 0.789. By comparing the cumulative product values of all traversal paths, the path with the largest value is determined as the critical path. In the example, the cumulative product of the path A→C→E→G (corresponding to historical data processing→capital expenditure planning→debt structure analysis→financial statement forecasting) is 0.836, which is higher than that of other paths, and it is determined as the critical path.
[0034] When obtaining the distribution structure of the FPGA computing unit, the physical layout information of the target FPGA device is read, including the coordinate positions of the computing units, the connection topology, etc. Assuming that the FPGA device contains a 6 × 6 array of computing units, each computing unit is identified by coordinates (x, y), a physical distance matrix P can be constructed, where P[i][j] represents the physical distance between computing units i and j, and the Manhattan distance is used for calculation. For example, the physical distance between computing unit (1, 2) and computing unit (4, 5) is |4-1|+|5-2|=6.
[0035] In the task allocation process, the nodes on the critical path are processed first, and the corresponding computing sub-tasks of adjacent nodes are allocated to the nearest FPGA computing unit in terms of physical distance. For the critical path A→C→E→G, first find a suitable computing unit for node A, assuming that according to the resource requirements of A, computing unit (2, 3) meets the conditions, then allocate A to this unit. Next, find the computing unit closest to (2, 3) that meets the resource requirements for C, select (2, 4). Similarly, allocate E to (3, 4) and G to (3, 5). In this way, the tasks on the critical path are allocated to physically adjacent computing units, minimizing data transmission delay. After processing the critical path, the remaining nodes are processed in descending order of correlation propagation strength, such as tax calculation, sensitivity analysis, and equity valuation sub-tasks of the financial model, following the same nearest computing unit allocation principle.
[0036] Compared with the traditional task scheduling strategy, the data transmission delay can be reduced by 35.2%, the overall computing throughput can be increased by 26.8%, and the speed of Monte Carlo simulation analysis of the financial model can be increased by 3.4 times, which provides an effective technical path for real-time calculation and high-frequency analysis of large-scale financial models.
[0037] In an optional implementation, the serial computing subtask is assigned to a CPU processor, a B-tree-based index mechanism is introduced, and similar historical tasks are retrieved through the interval search feature of the B-tree. If the historical tasks overlap, the computing results thereof are extracted for incremental calculation, including: obtaining a set of computing parameters and a data range of the serial computing subtask, combining historical execution characteristics and a current execution state of the serial computing subtask to construct a task feature vector; indexing structure is established in the B-tree according to the task feature vector, historical tasks are retrieved by using the interval search feature of the B-tree, the overlap degree of the serial computing subtask and the historical tasks in each dimension is calculated to obtain an interval matching degree, an index key value is generated based on the set of computing parameters and the data range, and the index key value is positioned in the B-tree; the historical tasks retrieved are sorted according to the interval matching degree, and a historical task set with the highest matching degree is obtained; based on the interval matching degree, the boundary range of the overlapping area is determined, the ratio of the intersection and the union of the data area of the serial computing subtask and each task in the historical task set is calculated to obtain an overlap rate, and when the overlap rate is greater than a preset overlap threshold, a reusable historical task is determined from the historical task set; the computing result of the reusable historical task is extracted for incremental calculation.
[0038] Taking the equity valuation financial model of an investment bank as an example, the model is used to evaluate the value of a target enterprise and includes multiple serial computing subtasks, such as income prediction, cost analysis, profit prediction, free cash flow calculation, and discount valuation. For the free cash flow calculation subtask, the set of collected computing parameters includes key financial indicators such as income growth rate 9.2%, gross profit margin 38.5%, working capital ratio 14.7%, capital expenditure proportion 16.3%, effective tax rate 23.5%, and discount rate 12.4%; the data range is the six-year prediction period from 2023 to 2028. At the same time, the historical execution characteristics of the task are collected, such as average execution time 210 milliseconds, CPU occupancy rate 87.2%, and memory usage 53 MB, and the current execution state is "to be executed".
[0039] When constructing the task feature vector, the obtained multi-dimensional information is integrated into a unified format. For the free cash flow calculation task, the feature vector includes parameter feature part, range feature part, execution feature part, and state feature part. Different weights are assigned to different elements in the feature vector, with core financial parameters such as revenue growth rate, gross margin, and discount rate being assigned higher weights of 0.22, 0.18, and 0.20, respectively, and other parameter weights being 0.10. Through this weighting method, the feature vector can more accurately represent the task characteristics.
[0040] According to the task feature vector, an index structure is established in the B-tree, and the interval search feature of the B-tree is used to retrieve historical tasks. For the current free cash flow calculation task, the index key value "0.092_0.385_0.124_2023-2028" is generated, and a search is performed in the 4-order B-tree that has been constructed. The B-tree has a height of 4, and the average storage of a leaf node is 3 key-value pairs. The search starts from the root node, and moves down layer by layer through key value comparison until it reaches the leaf node. The parameter dimension tolerance range is set to ±1 percentage point, and the time dimension tolerance is ±1 year. Finally, 6 potential reusable historical tasks are retrieved.
[0041] For the retrieved historical tasks, the degree of overlap in each dimension with the current task is calculated to obtain the interval matching degree. The calculation process of the first historical task (parameters: revenue growth rate 8.8%, gross margin 38.2%, discount rate 12.7%, data range: 2022-2027) is as follows: the revenue growth rate difference is 0.4 percentage points, which is lower than the upper limit of the tolerance of 1 percentage point, with a matching degree of 85%; the gross margin difference is 0.3 percentage points, which is small, with a matching degree of 90%; the discount rate difference is 0.3 percentage points, with a matching degree of 90%; the overall matching degree of the parameter dimension is 88.2%. The time dimension overlap interval is 2023-2027, accounting for 83.3% of the current task time span and 83.3% of the historical task time span, with a time dimension matching degree of 83.3%. The parameter dimension and time dimension matching degrees are weighted and averaged with weights of 0.65 and 0.35 to obtain the overall interval matching degree of 86.5%. The remaining historical tasks are calculated in the same way, with matching degrees of 82.7%, 78.4%, 73.9%, 67.6%, and 61.3%, respectively.
[0042] The historical tasks are sorted according to the interval matching degree, and N=3 is taken, with the top three historical tasks with matching degrees of 86.5%, 82.7%, and 78.4% being selected as the candidate set. The detailed information of these tasks, including parameter configuration, data range, and calculation results, is extracted from the historical task database to prepare for subsequent reuse analysis.
[0043] The boundary range of the overlapping area is determined based on the interval matching degree, and the overlap rate is calculated by the ratio of the intersection and union of data regions. For the historical task with the highest matching degree, the time dimension overlapping area is 2023-2027, and the overlap rate is 83.3%. In the parameter dimension, the parameter intersection of the historical task and the current task contains 24 parameters, and the union contains 28 parameters, with an overlap rate of 85.7%. The overall overlap rate is 84.8% after weighted averaging of the overlap rate of each dimension, which is higher than the preset overlap threshold of 55%, and it is determined that the historical task can be reused.
[0044] The calculation results of the reusable historical task are extracted for incremental calculation, and only the non-overlapping area or the area with significant parameter difference is calculated. The free cash flow calculation results from 2023 to 2027 are extracted from the historical task: 2580 million yuan in 2023, 2836 million yuan in 2024, 3108 million yuan in 2025, 3385 million yuan in 2026, and 3655 million yuan in 2027. Due to the change of the income growth rate from 8.8% to 9.2%, the influence of this parameter change on cash flow is analyzed, and the correction coefficient (1+0.092) / (1+0.088)=1.00367 is used to adjust the historical results: 2589.5 million yuan in 2023, 2846.4 million yuan in 2024, 3119.4 million yuan in 2025, 3397.4 million yuan in 2026, and 3668.4 million yuan in 2027. For the non-overlapping year 2028, new calculation is performed based on the adjusted data in 2027 and the current parameters: the predicted value for 2028 is 4005.7 million yuan.
[0045] In addition, due to the change of the discount rate from 12.7% to 12.4%, the enterprise valuation results need to be adjusted. In the historical task, the enterprise valuation calculated based on the 12.7% discount rate is 342 million yuan. By analyzing the influence of the change of the discount rate on the valuation, it is found that reducing the discount rate by 0.3 percentage points will increase the enterprise valuation by about 2.5%, and accordingly the adjusted enterprise valuation is 3.42×1.025=3.51 billion yuan.
[0046] Through incremental calculation, the calculation amount is significantly reduced, and the complete calculation time of 210 milliseconds is shortened to 58 milliseconds, with an efficiency improvement of 72.4%. The CPU occupancy rate is reduced from 87.2% to 64.5%, and the memory usage is reduced from 53MB to 36MB. This optimization is also applied to other sub-tasks in the financial model, such as the efficiency improvement of 71.3% in income prediction, the efficiency improvement of 68.7% in cost analysis, the efficiency improvement of 70.5% in profit prediction, and the efficiency improvement of 73.2% in discount valuation.
[0047] The whole equity valuation financial model contains 162 serial computing sub-tasks. The average historical task reuse rate reaches 74.5%, the total execution time is reduced from 6 minutes and 25 seconds to 1 minute and 48 seconds, and the overall efficiency is improved by 72.1%. The peak resource occupancy is also significantly reduced, with CPU utilization reduced from 92% to 75% and memory usage reduced from 1.35 GB to 0.92 GB.
[0048] Figure 2 A flowchart is generated for the index key value. In an optional embodiment, the index key value is generated based on the set of calculation parameters and the data range, including: The parameter space mapping of the set of calculation parameters obtains a parameter mapping value, and the local sensitive hash operation is performed based on the parameter mapping value to obtain a parameter feature code; the interval feature coding of the data range obtains an interval coding value, and the Hilbert curve coding operation is performed based on the interval coding value to obtain an interval feature code; The parameter feature code and the interval feature code are combined by a bit concatenation operation to generate an initial index key value, the initial index key value is rearranged into a two-dimensional numerical matrix, the parity check values of each row and each column of the two-dimensional numerical matrix are calculated respectively to obtain a horizontal check bit group and a vertical check bit group, and the horizontal check bit group and the vertical check bit group are combined to construct a check bit matrix; Based on the check bit matrix, an error correction code word is generated, and the error correction code word is embedded in the initial index key value to obtain the final index key value.
[0049] In the actual application of the equity valuation financial model, parameter space mapping of the set of calculation parameters is required. Taking this model as an example, the core calculation parameters include key financial indicators such as income growth rate 9.2%, gross profit margin 38.5%, operating capital ratio 14.7%, capital expenditure proportion 16.3%, effective tax rate 23.5%, and discount rate 12.4%. These parameters are uniformly mapped to the standard space of 0 to 1, which is convenient for subsequent processing. The typical range of income growth rate is-5% to 25%, and the mapping value 0.473 is calculated by the mapping formula (9.2-(-5)) / (25-(-5)); the standard range of gross profit margin 38.5% is 20% to 80%, and the mapping value is (38.5-20) / (80-20)=0.642; the operating capital ratio 14.7% is mapped to 0.490; the capital expenditure proportion 16.3% is mapped to 0.543; the effective tax rate 23.5% is mapped to 0.588; and the discount rate 12.4% is mapped to 0.496. Parameter space mapping enables financial indicators of different dimensions and ranges to be compared and calculated in a unified dimension space.
[0050] The local sensitive hashing operation is performed based on the parameter mapping value to generate a feature code that can maintain the parameter similarity. The 24 hash functions are used to process the mapping values of the 6 core parameters, and each parameter is associated with 4 hash functions. The mapping value 0.473 of the revenue growth rate is compared with the four preset threshold values 0.35, 0.50, 0.65, and 0.80 to generate the bit sequence "1010"; the mapping value 0.642 of the gross profit margin generates the bit sequence "1100"; the mapping value 0.490 of the operating capital ratio generates "1010"; the mapping value 0.543 of the capital expenditure ratio generates "1100"; the mapping value 0.588 of the effective tax rate generates "1100"; and the mapping value 0.496 of the discount rate generates "1010". Connecting these bit sequences forms a 24-bit parameter feature code "101011001001010110100101". This feature code ensures that the hash values generated by similar calculation tasks in the financial model are also similar, facilitating the rapid identification of similar historical calculation tasks.
[0051] Interval feature coding of the data range is an important step in capturing the time dimension characteristics of the task. The prediction period of this equity valuation model is from 2023 to 2028, and the base year is 2020. The offset range [3, 8] is calculated. To fully represent the interval characteristics, a triple (start offset, end offset, interval length) is used, i.e. (3, 8, 6). These three elements are respectively coded as 8-bit binary numbers: "00000011", "00001000", "00000110", and combined to form a 24-bit interval coding value "000000110000100000000110". This coding method preserves the complete information of the interval, laying the foundation for subsequent interval-based task matching.
[0052] Based on the interval coding value, the Hilbert curve coding operation is performed to convert the multi-dimensional interval feature into a one-dimensional code that maintains the local properties. The interval coding value is regarded as a point in three-dimensional space (3, 8, 6), which is converted into a one-dimensional integer value 16782336 through an 8-order Hilbert curve mapping algorithm. The corresponding 24-bit binary representation is "000000000000111111111000", which is the interval feature code. The Hilbert curve coding has the characteristic that similar points in the coding space are also similar in one-dimensional coding, which makes the interval feature codes generated by similar calculation tasks in the financial model also similar, greatly improving the efficiency of interval search in the B-tree index structure.
[0053] The parameter feature code and the interval feature code are combined by bit concatenation operation to generate an initial index key value. An interleaved bit concatenation method is adopted, i.e. the corresponding bits of the parameter feature code "101011001001010110100101" and the interval feature code "000000000000111111111000" are combined in sequence to generate a 48-bit initial index key value "100010001101001011000011111010111110010100". This interleaved concatenation makes the parameter feature and the interval feature have the same weight in the index key, ensuring that the index key values generated by the financial model calculation tasks with similar parameters and similar intervals also have high similarity, which is beneficial to quickly locating similar historical calculation results.
[0054] The initial index key value is rearranged into a two-dimensional numerical matrix to establish a row-column check structure. The 48-bit initial index key value is rearranged into an 8x6 two-dimensional matrix, the first 6 bits "100010" of the initial index key value are taken as the first row, the next 6 bits "001101" are taken as the second row, and so on. The row-column parity check values of the matrix are calculated, the first row "100010" contains 2 "1"s, which is even, and the horizontal check bit is "0"; the second row "001101" contains 3 "1"s, which is odd, and the horizontal check bit is "1"; and so on, to obtain an 8-row horizontal check bit group "01101001". Similarly, the parity check values of the 6 columns are calculated to obtain a vertical check bit group "101011". The two check bit groups are rearranged into a 4x4 check bit matrix: "0110", "1001", "1010", "1100", to form a complete check structure.
[0055] Based on the check bit matrix, an error correction code word is generated to enhance the fault tolerance of the index key value. The 4x4 check bit matrix is regarded as a 16-bit information sequence "0110100110101100", and a (24, 16) Reed-Solomon encoding algorithm is applied to generate an 8-bit check sequence "10110101" as an error correction code word. This code word contains sufficient redundant information, which can detect and correct errors that occur during transmission or storage of the index key value, ensuring that the historical calculation results of the financial model can be accurately retrieved and reused.
[0056] The error correction code word is embedded into the initial index key value to obtain the final index key value. After the 8-bit error correction code word "10110101" is added to the 48-bit initial index key value, a 56-bit final index key value "10001000110100101100001111101011111001010010110101" is formed. In order to facilitate storage and search in the B-tree, the binary index key value is converted to hexadecimal representation "88D4C1EBC94B5". This index key value with error correction capability is the core identifier for historical calculation task retrieval and reuse in the financial model.
[0057] This method significantly improves the operation quality of the equity valuation financial model. The error rate of the index key value is reduced from 3.6% to 0.2%, the retrieval accuracy is increased by 9.7%, and the average retrieval time is reduced by 12.3%. Especially in unstable network environment, the error correction mechanism ensures the reliability and consistency of the financial analysis results.
[0058] In an optional embodiment, the data combination sequence is constructed based on the Kruskal minimum spanning tree algorithm, and the optimal data combination path is selected step by step through the greedy strategy, including: The edges are sorted in descending order according to the size of the weights to construct a priority queue; The Kruskal minimum spanning tree algorithm is executed based on the priority queue, and the candidate edges are taken out from the head of the priority queue in turn. Path search is performed on the two end nodes of the candidate edge, and the parent node pointer is searched step by step upwards until the root node is reached. Whether they belong to the same node subset is judged by comparing the root nodes. When the candidate edge is located in different node subsets and the weight of the candidate edge is greater than the preset weight threshold, the candidate edge is added to the selected edge set; The data combination sequence is constructed based on the selected edge set and its connection relationship. The edges in the selected edge set are arranged in descending order according to the weight score, and the data nodes connected by the edges are added to the data combination sequence in turn; The selected edge set is constantly updated until all edges in the priority queue are processed or the data combination sequence contains all nodes, and the optimal data combination path is obtained.
[0059] Taking an investment evaluation financial model as an example, the model contains 12 key data nodes, wherein the result data of parallel computing subtasks includes: historical operating income analysis (HR), industry growth rate prediction (IG), capital structure analysis (CS), and comparable company valuation index (CV); the result data of serial computing subtasks includes: operating income prediction (R), operating profit calculation (P), net profit calculation (N), discount rate calculation (K), present value calculation (V), terminal value calculation (TV), and enterprise value calculation (EV). According to the calculation logic and data dependency relationship of the financial model, weights are assigned to the edges between nodes. For example, the weight of the edge between the historical operating income analysis and the operating income prediction is 0.96, indicating a strong dependency relationship; the weight of the edge between the operating income prediction and the operating profit calculation is 0.88; and the weight of the edge between the capital structure analysis and the discount rate calculation is 0.78, indicating a strong direct dependency. All the edges are arranged in descending order of weight to establish a priority queue. The first edge in the queue is the edge HR-R (0.96) with the largest weight, followed by the edges P-N (0.92), N-V (0.85), P-N (0.92), and so on, to the edge with the smallest weight at the end of the queue.
[0060] The improved Kruskal minimum spanning tree algorithm is executed based on the priority queue to select the optimal edge in sequence to construct a data combination path. The edge HR-R (0.96) with the largest weight is taken out from the head of the queue as a candidate edge, and path searching is performed on the two end nodes HR and R of the edge. The searching process is performed step by step upwards along the parent node pointer until the root node is reached. Since this is the first edge, HR and R are the root nodes of their respective subsets, and thus they belong to different node subsets. At the same time, the edge weight 0.96 is greater than the preset weight threshold 0.35, so the edge HR-R is added to the selected edge set, and the parent node of R is pointed to HR through the "rank merging" strategy, thereby realizing the merging of the two node subsets. The second edge R-P (0.88) is processed next, and path searching is also performed. It is found that the root node of R is HR, and P is the root node of an independent subset, which belong to different subsets, and the weight 0.88 is greater than the threshold. Therefore, the edge R-P is added to the selected edge set, and the parent node of P is pointed to HR. The third edge P-N (0.92) is processed continuously, and path searching is performed. It is found that the root node of P is already HR, and N is the root node of an independent subset, which belong to different subsets, and the weight 0.92 is greater than the threshold. Therefore, the edge P-N is added to the selected edge set, and the parent node of N is pointed to HR. At this time, HR-R-P-N forms a connected subset.
[0061] Continue to process the remaining edges, such as N-V (0.85), CS-K (0.78), V-TV (0.78), TV-EV (0.76), etc., according to the same rules to determine whether to add the edges to the selected edge set. When processing the edge IG-CS (0.52), the path search is performed to find that IG and CS already belong to the same node subset with HR as the root, and to avoid forming a loop, the edge is not added to the selected edge set. Finally, all edges with a weight greater than the preset threshold in the priority queue are processed in turn, and the final selected edge set is obtained.
[0062] Based on the selected edge set and its connection relationship, the data combination sequence is constructed, and the optimal calculation path of the financial model is determined. The edges in the selected edge set are arranged in descending order of weight score to obtain an ordered sequence: HR-R (0.96), P-N (0.92), R-P (0.88), N-V (0.85), CS-K (0.78), V-TV (0.78), TV-EV (0.76), CV-EV (0.68), IG-R (0.65), K-V (0.62). According to the connection relationship of these edges, the related nodes are added to the data combination sequence in turn. Starting from the edge with the highest weight HR-R, HR and R are added to the sequence; when processing the next edge P-N, P and N are added to the sequence; when processing the edge R-P, P is already in the sequence and does not need to be added repeatedly. In this way, the data combination sequence HR→R→P→N→V→CS→K→TV→EV→CV→IG is finally formed. This sequence represents the optimal combination order of the data nodes in the financial model, ensuring that the strong dependency relationship between the nodes can be utilized to the greatest extent in the calculation process.
[0063] This method significantly improves the operation quality of the investment evaluation financial model containing 12 key data nodes, and the calculation efficiency is improved by 72.2%, the calculation time is reduced from 583 seconds to 162 seconds; the data dependency error rate is reduced from 3.6% to 0.2%, the path recognition accuracy is improved by 9.7%, and the average path generation time is reduced by 12.3%. Especially in the environment where the financial data transmission is unstable, the path optimization mechanism based on Kruskal algorithm ensures the reliability and consistency of the model analysis results, and the model prediction error is reduced from an average of 3.8% to 2.1%.
[0064] In a second aspect, the embodiment of the application provides a heterogeneous computing system for accelerating a financial model based on an FPGA, comprising: A first unit is configured to obtain a financial model calculation task to be processed, and extract a plurality of calculation sub-tasks from the financial model calculation task; A second unit is configured to calculate the data dependency chain length of each calculation sub-task, mark the calculation sub-task with a data dependency chain length less than a preset dependency threshold as a parallel calculation sub-task, and mark the remaining calculation sub-tasks as serial calculation sub-tasks. a third unit for mapping data flow conversion relations between the parallel computing sub-tasks into a directed graph structure, and distributing parallel computing sub-tasks with data dependency relations to adjacent FPGA computing units; a fourth unit for distributing the serial computing sub-tasks to a CPU processor, introducing a B-tree-based index mechanism, searching similar historical tasks through the interval searching feature of the B-tree, extracting the computing results of the historical tasks for incremental calculation if the historical tasks have overlaps, and dynamically adjusting the cache structure through the splitting and merging features of the B-tree during the cache updating process; a fifth unit for constructing a data combination sequence based on the Kruskal minimum spanning tree algorithm, gradually selecting the optimal data combination path through a greedy strategy, and generating a final computing result, by taking the parallel computing sub-task result data and the serial computing sub-task result data as nodes, the data dependency relations of the financial model computing task as edges, and the dependency degree as a weight.
[0065] In a third aspect, an electronic device is provided, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to execute the method described above.
[0066] In a fourth aspect, a computer-readable storage medium is provided, which stores computer program instructions, and the computer program instructions are executed by a processor to implement the method described above.
[0067] The present application can be a method, device, system and / or computer program product. The computer program product can include a computer readable storage medium having computer readable program instructions stored therein, which are used to perform various aspects of the present application.
[0068] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A heterogeneous computing method based on FPGA to accelerate financial models, characterized by: include: Acquire a pending financial model calculation task, and extract a plurality of calculation subtasks from the financial model calculation task; Calculate the length of the data dependency chain of each computing subtask, mark the computing subtasks whose data dependency chain length is less than a preset dependency threshold as parallel computing subtasks, and mark the rest as serial computing subtasks; Mapping the data flow relationship between the parallel computing subtasks into a directed graph structure, and allocating the parallel computing subtasks with data dependency to adjacent FPGA computing units; The serial computing subtasks are assigned to the CPU processor, and a B-tree-based indexing mechanism is introduced. Similar historical tasks are retrieved through the interval search feature of the B-tree. If there is overlap between the historical tasks, their calculation results are extracted for incremental calculation. During the cache update process, the split-merge feature of the B-tree is used to dynamically adjust the cache structure. The parallel computing subtask result data and the serial computing subtask result data are used as nodes, the data dependency relationship of the financial model calculation task is used as an edge, and the degree of dependency is used as a weight. A data combination sequence is constructed based on the Kruskal minimum spanning tree algorithm, and the optimal data combination path is gradually selected through a greedy strategy to generate the final calculation result.
2. The method according to claim 1, characterized in that Obtain a pending financial model calculation task, and extract multiple calculation subtasks from the financial model calculation task, including: Extracting an operation set from the financial model calculation task; calculating the ratio of the number of intersection elements to the number of union elements between adjacent operations based on the operation set to obtain spatial correlation, calculating the ratio of the overlapping portion of adjacent operation execution time periods to the total execution time to obtain temporal correlation, and taking the product of the spatial correlation and the temporal correlation as the operation correlation; Based on the computational load of the operation set and the operation correlation, the ratio of the computational complexity of each operation to the sum of the computational complexity of its adjacent operations is calculated to obtain the operation granularity, and adjacent operations with the operation granularity greater than a preset operation threshold are aggregated into the same subtask to generate an initial subtask set; Calculate the load balance and coupling between each subtask in the initial subtask set, multiply the complement of the load balance and the coupling by the corresponding preset weight coefficients and add them together to obtain an evaluation score, and divide multiple computing subtasks based on the evaluation score.
3. The method according to claim 1, characterized in that Mapping the data flow relationship between the parallel computing subtasks into a directed graph structure and allocating the parallel computing subtasks with data dependency to adjacent FPGA computing units includes: Analyze the data flow process between the parallel computing subtasks, and convert the data input and output relationship in the data flow process into a node-edge relationship, wherein the parallel computing subtasks are set as nodes and the data flow relationship is set as directed edges to generate a directed graph structure; Calculating the cosine similarity between nodes in the directed graph structure, using the cosine similarity as the correlation between the nodes, extracting the adjacent node sequence with the highest correlation with each node, and generating a node correlation link; Constructing an association propagation matrix based on the node association links, wherein each element of the association propagation matrix represents the association propagation strength between corresponding node pairs, performing a breadth-first traversal starting from the node with the largest out-degree, calculating the cumulative product of the association propagation strengths between nodes on the traversal path, and determining the traversal path with the largest cumulative product of the association propagation strengths as the critical path; The distribution structure and connection relationship of the FPGA computing units are obtained, the physical distances between the FPGA computing units are analyzed, and the parallel computing subtasks corresponding to adjacent nodes on the critical path are allocated to the FPGA computing units with the closest physical distance.
4. The method according to claim 1, wherein The serial computing subtasks are assigned to the CPU processor, and a B-tree-based indexing mechanism is introduced. Similar historical tasks are retrieved through the interval search feature of the B-tree. If the historical tasks overlap, their calculation results are extracted for incremental calculation, including: Obtaining a calculation parameter set and a data range of the serial calculation subtask, and constructing a task feature vector by combining historical execution characteristics and current execution status of the serial calculation subtask; An index structure is established in a B-tree based on the task feature vector, and historical tasks are retrieved using the interval search feature of the B-tree. The degree of overlap between the serial computing subtask and the historical tasks in each dimension is calculated to obtain an interval matching degree. An index key value is generated based on the computing parameter set and the data range, and the index key value is used to locate the task in the B-tree. The retrieved historical tasks are sorted according to the interval matching degree to obtain a set of historical tasks with the highest matching degree. Based on the interval matching degree, the boundary range of the overlapping area is determined, and the ratio of the intersection and union of the data areas of the serial computing subtask and each task in the historical task set is calculated to obtain the overlapping rate. When the overlapping rate is greater than a preset overlapping threshold, a reusable historical task is determined from the historical task set; and the calculation results of the reusable historical task are extracted for incremental calculation.
5. The method according to claim 4, characterized in that Generating an index key value based on the calculation parameter set and the data range includes: Performing parameter space mapping on the calculation parameter set to obtain a parameter mapping value, performing a local sensitive hash operation based on the parameter mapping value to obtain a parameter feature code; performing interval feature coding on the data range to obtain an interval coding value, and performing a Hilbert curve coding operation based on the interval coding value to obtain an interval feature code; Combining the parameter feature code and the interval feature code through a bit concatenation operation to generate an initial index key value, rearranging the initial index key value into a two-dimensional numerical matrix, respectively calculating parity check values for each row and each column of the two-dimensional numerical matrix to obtain a horizontal check bit group and a vertical check bit group, and combining the horizontal check bit group and the vertical check bit group to construct a check bit matrix; An error correction codeword is generated based on the check bit matrix, and the error correction codeword is embedded in the initial index key value to obtain a final index key value.
6. The method according to claim 1, characterized in that The data combination sequence is constructed based on the Kruskal minimum spanning tree algorithm, and the optimal data combination path is gradually selected through a greedy strategy, including: Sort the edges in descending order according to the weights to build a priority queue; Executing the Kruskal minimum spanning tree algorithm based on the priority queue, sequentially extracting the edges to be selected from the head of the priority queue, performing path search on the nodes at both ends of the edge to be selected, searching upward step by step along the parent node pointer until reaching the root node, and determining whether they belong to the same node subset by comparing the root nodes; if the edges are in different node subsets and the weight of the edge to be selected is greater than a preset weight threshold, adding the edge to be selected to the set of selected edges; Constructing a data combination sequence based on the selected edge set and its connection relationship, arranging the edges in the selected edge set in descending order according to weight scores, and sequentially adding data nodes connected by the edges to the data combination sequence; The selected edge set is continuously updated until all edges in the priority queue are processed or the data combination sequence contains all nodes, thereby obtaining an optimal data combination path.
7. A heterogeneous computing system based on FPGA-accelerated financial models, for implementing the method according to any one of claims 1 to 6, characterized in that: include: The first unit is configured to obtain a pending financial model calculation task and extract a plurality of calculation subtasks from the financial model calculation task; The second unit is used to calculate the length of the data dependency chain of each computing subtask, mark the computing subtasks whose data dependency chain length is less than a preset dependency threshold as parallel computing subtasks, and mark the rest as serial computing subtasks; The third unit is used to map the data flow relationship between the parallel computing subtasks into a directed graph structure, and allocate the parallel computing subtasks with data dependency to adjacent FPGA computing units; The fourth unit is used to assign the serial computing subtasks to the CPU processor, introduce a B-tree-based indexing mechanism, and retrieve similar historical tasks through the interval search feature of the B-tree. If the historical tasks overlap, the calculation results are extracted for incremental calculation. During the cache update process, the split-merge feature of the B-tree is used to dynamically adjust the cache structure. The fifth unit is used to use the parallel computing subtask result data and the serial computing subtask result data as nodes, the data dependency relationship of the financial model calculation task as edges, and the degree of dependency as weights, to construct a data combination sequence based on the Kruskal minimum spanning tree algorithm, and gradually select the optimal data combination path through a greedy strategy to generate the final calculation result.
8. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.