Financial risk control system index set calculation optimization method and device, equipment and medium
By building directed acyclic graphs and topological sorting in the financial risk control system, the problem of handling dependencies between complex indicators is solved, efficient calculations and parallel calculations are realized, and the overall performance of the system is improved.
Patent Information
- Application Number
- CN202411865684.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-03-28
AI Technical Summary
The prior art is difficult to effectively represent and handle complex dependencies between indicators in financial risk control systems, resulting in inefficient computing and difficulty in leveraging the advantages of parallel computing.
By constructing a directed acyclic graph (DAG) to clearly represent the dependencies between indicators, avoid circular dependencies, and determine the calculation order and depth through topological sorting, parallel computing is realized to improve computing efficiency.
It effectively avoids circular dependence, dynamically adjusts the calculation order, improves the computing efficiency of the system, and makes full use of multi-core processing capabilities or distributed clusters through parallel computing.
Smart Images

Figure CN119721710A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment and medium for calculating and optimizing an indicator set of a financial risk control system. Background Art
[0002] In modern decision-making systems, indicator sets have been widely used in risk assessment, especially in the fields of financial risk control and real-time anti-fraud. Accurate and timely acquisition of various indicators is the key to measuring system performance. However, with the continuous growth of business needs, the relationship between indicators is becoming increasingly complex, involving not only multi-dimensional cross-dependencies and diverse data sources, but also the need to dynamically adjust the calculation order.
[0003] In the prior art, traditional indicator acquisition methods mainly use sequential processing and hierarchical processing. Sequential processing usually queues indicators according to dependencies and calculates them sequentially. This linear processing method is difficult to deal with complex indicator dependencies and is cumbersome when expressing indicator relationships. Hierarchical processing divides indicators into multiple levels. Although it can express dependencies to a certain extent and calculate low-level indicators in sequence to provide input for high-level indicators, under complex multi-dimensional cross-relationships, it is difficult for the hierarchical structure to fully cover all dependencies. And because sequential and hierarchical processing rely on preset fixed calculation paths, it is impossible to effectively analyze the inherent dependencies of the indicator set, which makes it difficult for the system to fully utilize the advantages of parallel computing, limiting the improvement of computing efficiency. In addition, traditional sequential processing lacks effective visualization tools, making it difficult to intuitively display the dependencies between indicators. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and storage medium for calculating and optimizing the indicator set of a financial risk control system, which can clearly represent the dependency relationship between indicators by constructing a directed acyclic graph to avoid circular dependency, and can find the calculation bottleneck and optimize it by analyzing the path, effectively improving the calculation efficiency. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a method for calculating and optimizing an indicator set of a financial risk control system, comprising:
[0006] Acquire configuration information of several indicators in a preset indicator set of a financial risk control system from a preset storage unit, determine indicator data corresponding to the several indicators according to the configuration information, and construct a directed acyclic graph corresponding to the several indicators based on the configuration information;
[0007] Performing topological sorting on the directed acyclic graph to determine a calculation order of the plurality of indicators and a calculation depth of the plurality of indicators in the directed acyclic graph, and performing parallel calculations on indicator data corresponding to the plurality of indicators based on the calculation order and the calculation depth to determine a calculation time consumption corresponding to the plurality of indicators;
[0008] The path to be optimized that consumes the longest time in the directed acyclic graph is determined according to the calculation time, and the index to be optimized corresponding to the path to be optimized is optimized.
[0009] Optionally, the obtaining, from a preset storage unit, configuration information of several indicators in a preset indicator set of a financial risk control system, determining indicator data corresponding to the several indicators according to the configuration information, and constructing a directed acyclic graph corresponding to the several indicators based on the configuration information, includes:
[0010] Determine a number of indicators in a preset indicator set, and obtain configuration information corresponding to the number of indicators from a preset storage unit;
[0011] Determine the data source corresponding to the plurality of indicators based on the configuration information, and collect data from the data source to obtain indicator source data corresponding to the plurality of indicators;
[0012] Filling missing values in the indicator source data, and standardizing the obtained filled data to obtain indicator data corresponding to the several indicators;
[0013] Determine the indicator dependency relationships corresponding to the plurality of indicators according to the configuration information, and construct a directed acyclic graph corresponding to the plurality of indicators based on the dependency relationships.
[0014] Optionally, determining the indicator dependency relationships corresponding to the plurality of indicators according to the configuration information, and constructing a directed acyclic graph corresponding to the plurality of indicators based on the dependency relationships includes:
[0015] Performing traversal detection on the indicator dependency relationship by using a preset traversal algorithm to determine whether there is a circular dependency in the indicator dependency relationship;
[0016] If there is a circular dependency in the indicator dependency, a dependency modification notification is generated, and the dependency modification notification is fed back to the management end, and then after receiving the dependency modification instruction fed back by the management end, the indicator dependency is modified, and a directed acyclic graph corresponding to the several indicators is established based on the obtained modified dependency;
[0017] If there is no circular dependency in the indicator dependency relationship, a directed acyclic graph corresponding to the plurality of indicators is constructed based on the dependency relationship.
[0018] Optionally, the topological sorting of the directed acyclic graph to determine the calculation order of the plurality of indicators and the calculation depth of the plurality of indicators in the directed acyclic graph includes:
[0019] Determine a number of indicator nodes corresponding to the number of indicators in a directed acyclic graph, and perform topological sorting on the directed acyclic graph to determine a calculation order corresponding to the number of indicator nodes;
[0020] The calculation position of each indicator node among the plurality of indicator nodes in each calculation path is determined according to the calculation order, and the calculation position with the highest value corresponding to each indicator node is used as the calculation depth of each indicator node.
[0021] Optionally, the performing parallel calculation on the indicator data corresponding to the plurality of indicators based on the calculation order and the calculation depth to determine the calculation time consumption corresponding to the plurality of indicators includes:
[0022] The index nodes with the same calculation depth are taken as the same group of nodes to be calculated, so as to obtain several groups of nodes to be calculated;
[0023] Based on the calculation order, the indicator data corresponding to the several indicators in the several groups of nodes to be calculated are calculated in parallel in sequence to determine the calculation time consumption corresponding to the several indicators.
[0024] Optionally, determining the path to be optimized that consumes the longest time in the directed acyclic graph according to the calculation time consumption, and optimizing the index to be optimized corresponding to the path to be optimized, includes:
[0025] Setting a starting node and an ending node, and setting a starting weight for the starting node, and then using the calculation time as the indicator weight of the multiple indicators in the directed acyclic graph;
[0026] Taking the starting weight and the indicator weight as node weights, and constructing a weighted directed acyclic graph based on the starting node, the ending node, the directed acyclic graph, and the node weights;
[0027] Based on the weighted directed acyclic graph, the path to be optimized that consumes the longest time is determined, and the index to be optimized corresponding to the path to be optimized is determined, and the index to be optimized is analyzed and optimized.
[0028] Optionally, determining the longest time-consuming path to be optimized based on the weighted directed acyclic graph includes:
[0029] Calculate the earliest occurrence time and the latest occurrence time corresponding to each node in the weighted directed acyclic graph according to the node weight, and take the node with the same earliest occurrence time and the latest occurrence time as the target node;
[0030] The paths corresponding to the obtained target nodes are taken as the paths to be optimized.
[0031] In a second aspect, the present application discloses a device for calculating and optimizing an indicator set of a financial risk control system, comprising:
[0032] A directed acyclic graph construction module, used to obtain configuration information of several indicators in a preset indicator set of a financial risk control system from a preset storage unit, to determine indicator data corresponding to the several indicators according to the configuration information, and to construct a directed acyclic graph corresponding to the several indicators based on the configuration information;
[0033] An indicator calculation time-consuming determination module is used to perform topological sorting on the directed acyclic graph to determine the calculation order of the several indicators and the calculation depth of the several indicators in the directed acyclic graph, and perform parallel calculation on the indicator data corresponding to the several indicators based on the calculation order and the calculation depth to determine the calculation time corresponding to the several indicators;
[0034] The indicator optimization module is used to determine the path to be optimized with the longest time consumption in the directed acyclic graph according to the calculation time consumption, and optimize the indicator to be optimized corresponding to the path to be optimized.
[0035] In a third aspect, the present application discloses an electronic device, comprising:
[0036] Memory, used to store computer programs;
[0037] A processor is used to execute the computer program to implement the aforementioned financial risk control system indicator set calculation optimization method.
[0038] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned financial risk control system indicator set calculation optimization method.
[0039] In the present application, configuration information of several indicators in a preset indicator set of a financial risk control system can be obtained from a preset storage unit to determine indicator data corresponding to the several indicators according to the configuration information, and a directed acyclic graph corresponding to the several indicators is constructed based on the configuration information; the directed acyclic graph is topologically sorted to determine the calculation order of the several indicators and the calculation depth of the several indicators in the directed acyclic graph, and the indicator data corresponding to the several indicators are calculated in parallel based on the calculation order and the calculation depth to determine the calculation time corresponding to the several indicators; the path to be optimized that consumes the longest time in the directed acyclic graph is determined according to the calculation time, and the indicator to be optimized corresponding to the path to be optimized is optimized. It can be seen that through the method of the present application, after obtaining the configuration information of several indicators in the preset indicator set of the financial risk control system, the corresponding indicator data can be determined according to the configuration information, and then the directed acyclic graph corresponding to several indicators can be constructed according to the configuration information, and the constructed directed acyclic graph can be topologically sorted to determine the calculation order and calculation depth of several indicators, and then the indicator data can be calculated in parallel according to the determined calculation order and calculation depth to obtain the calculation time corresponding to each indicator, and finally the path to be optimized with the longest time consumption can be determined according to the calculation time consumption to optimize it. In this way, the complex dependencies between indicators can be clearly represented by constructing a directed acyclic graph, circular dependencies can be effectively avoided, and the calculation order can be dynamically adjusted; and parallel calculations can be performed according to the dependencies obtained by analysis to improve the overall computing efficiency of the system; and the computing bottleneck can be found by analyzing the path and the indicators on the key computing path can be optimized to improve the overall computing performance and response speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0041] Figure 1 This is a flow chart of a method for calculating and optimizing a financial risk control system indicator set disclosed in this application;
[0042] Figure 2 An index directed acyclic graph disclosed in this application;
[0043] Figure 3 This is a schematic diagram of an indicator grouping disclosed in this application;
[0044] Figure 4 This is a flow chart of another method for calculating and optimizing an indicator set of a financial risk control system disclosed in this application;
[0045] Figure 5 An index-weighted directed acyclic graph disclosed in this application;
[0046] Figure 6 This is a schematic diagram of the structure of a financial risk control system indicator set calculation and optimization device disclosed in this application;
[0047] Figure 7 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] In the prior art, traditional indicator acquisition methods mainly adopt sequential processing and hierarchical processing. However, since sequential and hierarchical processing rely on preset fixed calculation paths, they cannot effectively analyze the inherent dependencies of the indicator set, which makes it difficult for the system to fully utilize the advantages of parallel computing, limiting the improvement of computing efficiency.
[0050] In order to overcome the above-mentioned technical problems, the present application discloses a method, device, equipment and storage medium for optimizing the calculation of a financial risk control system indicator set. The dependency relationship between indicators can be clearly represented by constructing a directed acyclic graph to avoid circular dependencies. The calculation bottleneck can be found and optimized by analyzing the path, thereby effectively improving the calculation efficiency.
[0051] See also Figure 1 As shown, the embodiment of the present invention discloses a method for calculating and optimizing an indicator set of a financial risk control system, including:
[0052] Step S11, obtaining configuration information of several indicators in a preset indicator set of the financial risk control system from a preset storage unit, determining indicator data corresponding to the several indicators according to the configuration information, and constructing a directed acyclic graph corresponding to the several indicators based on the configuration information.
[0053] In this embodiment, it is necessary to obtain the configuration information of several indicators in the preset indicator set of the financial risk control system, and then determine the indicator data of several indicators that need to be calculated based on the obtained configuration information, and then build a corresponding directed acyclic graph based on the configuration information. Specifically, it is necessary to determine several indicators in the preset indicator set, and then read the configuration information corresponding to each indicator from the storage unit of the financial risk control system, wherein the obtained configuration information includes but is not limited to the name of each indicator, the data source, the calculation method, the list of other dependent indicators and other information, and then determine the data source corresponding to each indicator based on the obtained configuration information, that is, the data source, and then perform data collection of the indicator data based on the determined data source of each indicator, and then obtain the indicator source data corresponding to each indicator.
[0054] Furthermore, after obtaining the indicator source data, the indicator source data needs to be preprocessed. Specifically, the indicator source data needs to be analyzed to determine the missing values in the indicator source data, and the missing values need to be filled. Then the filled data needs to be standardized to obtain the indicator data corresponding to each indicator. Then, the dependency relationship of each indicator needs to be determined based on the list of other dependent indicators in the configuration information. It should be noted that the dependency relationship between each indicator is unidirectional. Then, based on the dependency relationship, the directed acyclic graph corresponding to the indicator is established through DAG (Directed Acyclic Graph), that is, AOV (Activity on vertex Network) network, and the constructed directed acyclic graph is as follows: Figure 2 As shown, Figure 2 For example, there are indicators A to F, among which indicator A has a one-way dependency relationship with indicator D and indicator E respectively, indicator B has a one-way dependency relationship with indicator D, indicator C has a one-way dependency relationship with indicator E and indicator F respectively, and indicator D has a one-way dependency relationship with indicator E and indicator F respectively.
[0055] In another step, before constructing the directed acyclic graph, the dependency relationship between the indicator nodes in the directed acyclic graph can be traversed and detected by a preset traversal algorithm to ensure that there is no circular dependency between the dependencies of the indicators. For example, the circular dependency between indicator A, indicator B and indicator C is indicator A-indicator B-indicator C-indicator A. Among them, the preset traversal algorithm can be selected according to the needs of the user, such as a recursive traversal algorithm, a DFS (Depth-First Search) algorithm, etc. If there is a circular dependency in the indicator dependency, a dependency correction notification needs to be generated, and the dependency correction notification is fed back to the management end of the financial risk control system, so that the relevant personnel can issue the dependency correction instruction through the management end after completing the correction, and after receiving the dependency correction instruction fed back by the management end, the indicator dependency is corrected, and the directed acyclic graph corresponding to the several indicators is re-established based on the obtained corrected dependency; in another case, if there is no circular dependency in the indicator dependency, the directed acyclic graph corresponding to the several indicators is constructed based on the dependency. In this way, accurate management of complex dependencies can be achieved through DAG modeling. The system can clearly represent the complex dependencies between indicators and effectively avoid circular dependencies.
[0056] Step S12: topologically sort the directed acyclic graph to determine the calculation order of the several indicators and the calculation depth of the several indicators in the directed acyclic graph, and perform parallel calculations on the indicator data corresponding to the several indicators based on the calculation order and the calculation depth to determine the calculation time corresponding to the several indicators.
[0057] In this embodiment, the constructed directed acyclic graph can be topologically sorted to determine the calculation order of several indicators and the calculation depth of the several indicators in the directed acyclic graph. Specifically, the indicator node corresponding to each indicator in the directed acyclic graph can be determined, and the directed acyclic graph can be topologically sorted to determine the calculation order corresponding to the several indicator nodes. Then, the calculation position of each of the several indicator nodes in each calculation path can be determined according to the calculation order, and the calculation position with the highest value corresponding to each indicator node is used as the calculation depth of each indicator node. That is, in the process of performing topological sorting, the nodes can be grouped according to the depth or level of the nodes, and the indicator nodes with the same calculation depth are used as the same group of nodes to be calculated to obtain several groups of nodes to be calculated, where the depth represents the longest path length starting from the source node. Nodes with the same depth can be calculated in parallel at the same level because there is no direct dependency between them. Through this hierarchical grouping method, task groups that can be executed in parallel can be identified, thereby improving the parallelism of the calculation. Figure 3Indicators A, B, and C are shown as having in-degree 0, and are processed in stage 1 as the first group. Indicator D depends on indicators A and B and is processed in stage 2. Indicators E and F are processed in stage 3. In this way, the results of grouping by depth can clearly show the dependency structure of each level, so that the system can perform calculations simultaneously in the same group, further optimizing the utilization of computing resources.
[0058] Furthermore, after determining the order and depth of indicator calculation, the indicator data corresponding to the indicator can be calculated in parallel to determine the calculation time corresponding to each indicator. Specifically, the indicator data can be calculated in parallel according to the grouping, such as Figure 3 As shown in the figure, indicators A, B and C are in the same group, which is stage 1; indicator D is in a separate group, which is stage 2; indicator E and indicator F are in the same group, which is stage 3. Then, the indicator data corresponding to each indicator in the same group can be calculated in parallel in the order of stage 1 to stage 2 to stage 3 to determine the calculation time corresponding to each indicator. In this way, the overall calculation efficiency of the system can be improved by calculating multiple indicators without dependencies at the same time, and the multi-core processing power or distributed cluster can be fully utilized.
[0059] Step S13, determining the path to be optimized that consumes the longest time in the directed acyclic graph according to the calculation time, and optimizing the index to be optimized corresponding to the path to be optimized.
[0060] In this embodiment, it is necessary to determine the longest time-consuming path to be optimized in the directed acyclic graph based on the calculation time, and optimize the indicators to be optimized corresponding to the path to be optimized. Specifically, a starting node and an ending node can be set, and a starting weight can be set for the starting node. Then, the calculation time is used as the indicator weight of the several indicators in the directed acyclic graph, and the starting weight and the indicator weight are used as the node weight. A weighted directed acyclic graph is constructed based on the starting node, the ending node, the directed acyclic graph and the node weight. Finally, based on the weighted directed acyclic graph, the longest time-consuming path to be optimized is determined, and the indicators to be optimized corresponding to the path to be optimized are determined, and the indicators to be optimized are analyzed and optimized.
[0061] Furthermore, the DAG-based visualization tool can be used to intuitively display the dependencies and calculation processes between indicators. Through the interaction of the graphical interface, users can view the calculation status, time consumption, and dependency structure of each indicator. Integrated analysis tools allow developers or users to monitor and tune the indicator calculation performance.
[0062] It can be seen that through the method of the present application, after obtaining the configuration information of several indicators in the preset indicator set of the financial risk control system, the corresponding indicator data can be determined according to the configuration information, and then the directed acyclic graph corresponding to several indicators can be constructed according to the configuration information, and the constructed directed acyclic graph can be topologically sorted to determine the calculation order and calculation depth of several indicators, and then the indicator data can be parallel calculated according to the determined calculation order and calculation depth to obtain the calculation time corresponding to each indicator, and finally the path to be optimized with the longest time consumption can be determined according to the calculation time consumption to optimize it. In this way, on the one hand, the complex dependency relationship between indicators can be clearly represented by constructing a directed acyclic graph, the circular dependency can be effectively avoided, and the calculation order can be dynamically adjusted; on the one hand, parallel calculation can be performed according to the dependency relationship obtained by analysis, so as to improve the overall calculation efficiency of the system, and the calculation bottleneck can be found by analyzing the path and the indicators on the key calculation path can be optimized to improve the overall calculation performance and response speed; on the other hand, the DAG visualization display tool can be integrated so that users can intuitively understand the indicator dependency structure, provide optimization suggestions and realize performance monitoring and tuning.
[0063] Based on the above embodiments, it can be known that through the method of the present application, the path to be optimized that takes the longest time in the directed acyclic graph can be determined according to the calculation time, and the index to be optimized corresponding to the path to be optimized can be optimized. For this reason, this embodiment describes in detail how to optimize the index to be optimized corresponding to the path to be optimized. Figure 4 As shown, the embodiment of the present invention discloses a method for calculating and optimizing an indicator set of a financial risk control system, including:
[0064] Step S21, setting a starting node and an ending node, and setting a starting weight for the starting node, and then using the calculation time as the indicator weight of several indicators in the directed acyclic graph.
[0065] In this embodiment, a unified start node and end node can be added on the basis of the established AOV network. Among them, the start node points to all indicator nodes with an in-degree of 0, and the weight of the edge from the start node to these indicator nodes represents the time consumption of the preparation phase, which is set to 1 millisecond in this embodiment; the end node connects all indicator nodes with an out-degree of 0 to the calculation end node, and then the set 1 millisecond is used as the starting weight of the start node, and the calculation time consumption of each indicator is used as the indicator weight of the indicator in the directed acyclic graph.
[0066] Step S22: taking the starting weight and the indicator weight as node weights, and constructing a weighted directed acyclic graph based on the starting node, the ending node, the directed acyclic graph, and the node weights.
[0067] In this embodiment, the starting weight and the indicator weight are used as node weights, and a weighted directed acyclic graph is constructed based on the starting node, the ending node, the directed acyclic graph and the node weights. That is, an AOE network (Activity on Edge Network) is constructed based on the constructed AOV network and combined with the newly created starting node and ending node, and the constructed AOE network is as follows: Figure 5 It should be noted that the node weight needs to be used as the edge weight in the AOE network. For example, if indicator D depends on indicator A and indicator B, and the calculation time of indicator A is 3 milliseconds and the calculation time of indicator B is 4 milliseconds, then the edge weights between indicator D and indicators A and B are 3 and 4 respectively.
[0068] Step S23: determining the longest time-consuming path to be optimized based on the weighted directed acyclic graph, determining the index to be optimized corresponding to the path to be optimized, and analyzing and optimizing the index to be optimized.
[0069] In this embodiment, it is necessary to determine the path to be optimized that takes the longest time based on the constructed weighted directed acyclic graph. Specifically, Figure 5 As shown, it is necessary to calculate the earliest occurrence time and the latest occurrence time corresponding to each node in the weighted directed acyclic graph according to the node weight, and take the node with the same earliest occurrence time and latest occurrence time as the target node, and finally take the paths corresponding to the obtained target nodes as the paths to be optimized. It should be noted that the calculation process of the earliest occurrence time is as follows: first, the earliest occurrence time of the starting point needs to be initialized e[0]=0, and the earliest occurrence time of each node is calculated in turn according to the topological order, and the calculation formula is as follows:
[0070] ;
[0071] Among them, w[i,j] is the weight of edge (i,j).
[0072] According to the formula, the earliest occurrence time of each indicator is calculated as follows:
[0073] e[calculation start] = 0;
[0074] e[Indicator A] = e[Calculation start] + 1 = 1;
[0075] e[Indicator B] = e[Calculation start] + 1 = 1;
[0076] e[Indicator C] = e[Calculation start] + 1 = 1;
[0077] e[Indicator D] = max(e[Indicator A] + 3, e[Indicator B] + 4) = max(1 + 3, 1 + 4) = 5;
[0078] e[Indicator E] = max(e[Indicator A] + 3, e[Indicator C] + 15, e[Indicator D] + 5) = max(1 +3, 1 + 15, 5 + 5) = 16;
[0079] e[indexF] = max(e[indexC] + 15, e[indexD] + 5) = max(1 + 15, 5 + 5) = 16;
[0080] e[calculation end] = max(e[index E] + 4, e[index F] + 7) = max(16 + 4, 16 + 7) = 23;
[0081] Furthermore, it is necessary to calculate the latest occurrence time for the indicator to start operation, and the calculation process of the latest occurrence time is as follows: initialize the latest occurrence time of the end point l[n-1]=e[n-1] (the latest occurrence time of the end point is equal to the earliest occurrence time), and calculate the latest occurrence time of each node in reverse order according to the topological order. The formula is as follows:
[0082] ;
[0083] Among them, w[i,j] is the weight of edge (i,j).
[0084] The latest time for each indicator is calculated according to the formula as follows:
[0085] l[Calculation end] = e[Calculation end] = 23;
[0086] l[Indicator E] = l[Calculation end] - 4 = 23 - 4 = 19;
[0087] l[Indicator F] = l[Calculation end] - 7 = 23 - 7 = 16;
[0088] l[Indicator D] = min(l[Indicator E] - 5, l[Indicator F] - 5) = min(19 - 5, 16 - 5) = 11;
[0089] l[Indicator C] = min(l[Indicator E] - 15, l[Indicator F] - 15) = min(19 - 15, 16 - 15) = 1;
[0090] l[Indicator B] = l[Indicator D] - 4 = 11 - 4 = 7;
[0091] l[IndexA] = min(l[IndexD] - 3, l[IndexE] - 3) = min(11 - 3, 19 - 3) = 8;
[0092] l[Calculation start] = min(l[Indicator A] - 1, l[Indicator B] - 1, l[Indicator C] - 1) = min(8 -1, 7 - 1, 1 - 1) = 0;
[0093] Then, it is necessary to generate a timetable based on the earliest and latest occurrence time of each indicator calculated. The generated timetable is shown in Table 1:
[0094] Table 1
[0095]
[0096] Then, the target node is determined according to the generated schedule, and the target node is the node whose earliest start time is equal to the latest start time, indicating that the node has no idle space in the entire calculation process. Therefore, it can be seen that the target node has calculation start→index C (e[index C] = l[index C] = 1), index C→index F (e[index F] = l[index F] = 16), index F→calculation end (e[calculation end] = l[calculation end] = 23), so the target nodes are index C and index F, and the path to be optimized is calculation start→index C→index F→calculation end. Therefore, the calculation time of index C and index F can be reduced through critical path analysis to effectively shorten the total calculation time of the entire index set. The above method is used to continuously analyze and optimize, improve the calculation time of the index set, and ensure a more efficient calculation process.
[0097] It can be seen that in this embodiment, the starting node and the ending node are first set, and the starting weight is set for the starting node, and then the calculation time is used as the indicator weight of several indicators in the directed acyclic graph, and then the starting weight and the indicator weight are used as the node weight, and a weighted directed acyclic graph is constructed based on the starting node, the ending node, the directed acyclic graph and the node weight, and finally the path to be optimized with the longest time consumption is determined based on the weighted directed acyclic graph, and the indicator to be optimized corresponding to the path to be optimized is determined, and the indicator to be optimized is analyzed and optimized. In this way, the critical path analysis method can be used to find out the calculation bottleneck and optimize the indicators on the key calculation path, so as to improve the overall calculation performance and response speed.
[0098] See also Figure 6As shown, the embodiment of the present invention discloses a financial risk control system indicator set calculation optimization device, including:
[0099] A directed acyclic graph construction module 11 is used to obtain configuration information of several indicators in a preset indicator set of a financial risk control system from a preset storage unit, determine indicator data corresponding to the several indicators according to the configuration information, and construct a directed acyclic graph corresponding to the several indicators based on the configuration information;
[0100] The indicator calculation time-consuming determination module 12 is used to perform topological sorting on the directed acyclic graph to determine the calculation order of the several indicators and the calculation depth of the several indicators in the directed acyclic graph, and perform parallel calculation on the indicator data corresponding to the several indicators based on the calculation order and the calculation depth to determine the calculation time corresponding to the several indicators;
[0101] The index optimization module 13 is used to determine the path to be optimized with the longest time consumption in the directed acyclic graph according to the calculation time consumption, and optimize the index to be optimized corresponding to the path to be optimized.
[0102] In this embodiment, configuration information of several indicators in a preset indicator set of a financial risk control system can be obtained from a preset storage unit to determine indicator data corresponding to the several indicators based on the configuration information, and a directed acyclic graph corresponding to the several indicators is constructed based on the configuration information; the directed acyclic graph is topologically sorted to determine the calculation order of the several indicators and the calculation depth of the several indicators in the directed acyclic graph, and the indicator data corresponding to the several indicators are calculated in parallel based on the calculation order and the calculation depth to determine the calculation time corresponding to the several indicators; the path to be optimized that consumes the longest time in the directed acyclic graph is determined based on the calculation time, and the indicator to be optimized corresponding to the path to be optimized is optimized. It can be seen that through the method of the present application, after obtaining the configuration information of several indicators in the preset indicator set of the financial risk control system, the corresponding indicator data can be determined according to the configuration information, and then the directed acyclic graph corresponding to several indicators can be constructed according to the configuration information, and the constructed directed acyclic graph can be topologically sorted to determine the calculation order and calculation depth of several indicators, and then the indicator data can be calculated in parallel according to the determined calculation order and calculation depth to obtain the calculation time corresponding to each indicator, and finally the path to be optimized with the longest time consumption can be determined according to the calculation time consumption to optimize it. In this way, the complex dependencies between indicators can be clearly represented by constructing a directed acyclic graph, circular dependencies can be effectively avoided, and the calculation order can be dynamically adjusted; and parallel calculations can be performed according to the dependencies obtained by analysis to improve the overall computing efficiency of the system; and the computing bottleneck can be found by analyzing the path and the indicators on the key computing path can be optimized to improve the overall computing performance and response speed.
[0103] In some embodiments, the directed acyclic graph construction module 11 may specifically include:
[0104] A configuration information acquisition unit, used to determine a number of indicators in a preset indicator set, and acquire configuration information corresponding to the number of indicators from a preset storage unit;
[0105] An indicator source data collection unit, used to determine the data source corresponding to the several indicators based on the configuration information, and collect data from the data source to obtain the indicator source data corresponding to the several indicators;
[0106] A data processing unit, used to fill missing values in the indicator source data, and perform standardization processing on the filled data to obtain indicator data corresponding to the several indicators;
[0107] The directed acyclic graph construction submodule is used to determine the indicator dependency relationship corresponding to the plurality of indicators according to the configuration information, and to construct the directed acyclic graph corresponding to the plurality of indicators based on the dependency relationship.
[0108] In some embodiments, the directed acyclic graph construction submodule may specifically include:
[0109] A dependency determination unit, used to perform traversal detection on the indicator dependency using a preset traversal algorithm to determine whether there is a circular dependency in the indicator dependency;
[0110] A first directed acyclic graph construction unit is used to generate a dependency modification notification if there is a circular dependency in the indicator dependency, and feed back the dependency modification notification to the management end, and then modify the indicator dependency after receiving the dependency modification instruction fed back by the management end, and establish a directed acyclic graph corresponding to the plurality of indicators based on the obtained modified dependency;
[0111] The second directed acyclic graph construction unit is used to construct a directed acyclic graph corresponding to the plurality of indicators based on the dependency relationship if there is no circular dependency in the indicator dependency relationship.
[0112] In some embodiments, the indicator calculation time-consuming determination module 12 may specifically include:
[0113] A calculation order determination unit, used to determine a number of indicator nodes corresponding to the number of indicators in the directed acyclic graph, and to perform topological sorting on the directed acyclic graph to determine the calculation order corresponding to the number of indicator nodes;
[0114] A calculation depth determination unit is used to determine the calculation position of each indicator node in each calculation path according to the calculation order, and take the calculation position with the highest value corresponding to each indicator node as the calculation depth of each indicator node.
[0115] In some embodiments, the indicator calculation time-consuming determination module 12 may specifically include:
[0116] A computing node grouping unit, used to take the index nodes with the same computing depth as the same group of nodes to be calculated, so as to obtain a plurality of groups of nodes to be calculated;
[0117] The indicator calculation time determination unit is used to perform parallel calculations on the indicator data corresponding to the several indicators in the several groups of nodes to be calculated based on the calculation order, so as to determine the calculation time corresponding to the several indicators.
[0118] In some embodiments, the indicator optimization module 13 may specifically include:
[0119] An indicator weight determination unit, used to set a starting node and an ending node, and set a starting weight for the starting node, and then use the calculation time as the indicator weight of the multiple indicators in the directed acyclic graph;
[0120] A weighted directed acyclic graph construction unit, used to use the starting weight and the indicator weight as node weights, and to construct a weighted directed acyclic graph based on the starting node, the ending node, the directed acyclic graph, and the node weights;
[0121] The indicator optimization submodule is used to determine the path to be optimized that takes the longest time based on the weighted directed acyclic graph, determine the indicator to be optimized corresponding to the path to be optimized, and analyze and optimize the indicator to be optimized.
[0122] In some embodiments, the indicator optimization submodule may specifically include:
[0123] A node determination unit, configured to calculate the earliest occurrence time and the latest occurrence time corresponding to each node in the weighted directed acyclic graph according to the node weight, and take the node with the same earliest occurrence time and the latest occurrence time as the target node;
[0124] The to-be-optimized path determination unit is used to take the paths corresponding to the obtained plurality of target nodes as the to-be-optimized paths.
[0125] Furthermore, the present application also discloses an electronic device. Figure 7 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0126] Figure 7 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the method for calculating and optimizing the indicator set of the financial risk control system disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0127] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0128] In addition, the memory 22 as a carrier for resource storage may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.
[0129] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the financial risk control system indicator set calculation optimization method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.
[0130] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed financial risk control system indicator set calculation optimization method is implemented. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0131] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0132] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0133] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0134] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0135] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for calculating and optimizing an indicator set of a financial risk control system, characterized in that: include: Acquire configuration information of several indicators in a preset indicator set of a financial risk control system from a preset storage unit, determine indicator data corresponding to the several indicators according to the configuration information, and construct a directed acyclic graph corresponding to the several indicators based on the configuration information; Performing topological sorting on the directed acyclic graph to determine a calculation order of the plurality of indicators and a calculation depth of the plurality of indicators in the directed acyclic graph, and performing parallel calculations on indicator data corresponding to the plurality of indicators based on the calculation order and the calculation depth to determine a calculation time consumption corresponding to the plurality of indicators; The path to be optimized that consumes the longest time in the directed acyclic graph is determined according to the calculation time, and the index to be optimized corresponding to the path to be optimized is optimized.
2. The method for calculating and optimizing the indicator set of a financial risk control system according to claim 1, characterized in that: The step of acquiring configuration information of several indicators in a preset indicator set of the financial risk control system from a preset storage unit, determining indicator data corresponding to the several indicators according to the configuration information, and constructing a directed acyclic graph corresponding to the several indicators based on the configuration information includes: Determine a number of indicators in a preset indicator set, and obtain configuration information corresponding to the number of indicators from a preset storage unit; Determine the data source corresponding to the plurality of indicators based on the configuration information, and collect data from the data source to obtain indicator source data corresponding to the plurality of indicators; Filling missing values in the indicator source data, and standardizing the obtained filled data to obtain indicator data corresponding to the several indicators; Determine the indicator dependency relationships corresponding to the plurality of indicators according to the configuration information, and construct a directed acyclic graph corresponding to the plurality of indicators based on the dependency relationships.
3. The method for calculating and optimizing the indicator set of a financial risk control system according to claim 2, characterized in that: Determining the indicator dependency relationship corresponding to the plurality of indicators according to the configuration information, and constructing a directed acyclic graph corresponding to the plurality of indicators based on the dependency relationship, includes: Performing traversal detection on the indicator dependency relationship by using a preset traversal algorithm to determine whether there is a circular dependency in the indicator dependency relationship; If there is a circular dependency in the indicator dependency, a dependency modification notification is generated, and the dependency modification notification is fed back to the management end, and then after receiving the dependency modification instruction fed back by the management end, the indicator dependency is modified, and a directed acyclic graph corresponding to the several indicators is established based on the obtained modified dependency; If there is no circular dependency in the indicator dependency relationship, a directed acyclic graph corresponding to the plurality of indicators is constructed based on the dependency relationship.
4. The method for calculating and optimizing the indicator set of a financial risk control system according to claim 1, characterized in that: The topological sorting of the directed acyclic graph to determine the calculation order of the plurality of indicators and the calculation depth of the plurality of indicators in the directed acyclic graph includes: Determine a number of indicator nodes corresponding to the number of indicators in a directed acyclic graph, and perform topological sorting on the directed acyclic graph to determine a calculation order corresponding to the number of indicator nodes; The calculation position of each indicator node among the plurality of indicator nodes in each calculation path is determined according to the calculation order, and the calculation position with the highest value corresponding to each indicator node is used as the calculation depth of each indicator node.
5. The method for calculating and optimizing the indicator set of a financial risk control system according to claim 4, characterized in that: The performing parallel calculation on the indicator data corresponding to the plurality of indicators based on the calculation order and the calculation depth to determine the calculation time consumption corresponding to the plurality of indicators includes: The index nodes with the same calculation depth are taken as the same group of nodes to be calculated, so as to obtain several groups of nodes to be calculated; Based on the calculation order, the indicator data corresponding to the several indicators in the several groups of nodes to be calculated are calculated in parallel in sequence to determine the calculation time consumption corresponding to the several indicators.
6. The method for calculating and optimizing the indicator set of a financial risk control system according to any one of claims 1 to 5, characterized in that: The step of determining the path to be optimized that consumes the longest time in the directed acyclic graph according to the calculation time consumption, and optimizing the index to be optimized corresponding to the path to be optimized, comprises: Setting a starting node and an ending node, and setting a starting weight for the starting node, and then using the calculation time as the indicator weight of the multiple indicators in the directed acyclic graph; Taking the starting weight and the indicator weight as node weights, and constructing a weighted directed acyclic graph based on the starting node, the ending node, the directed acyclic graph, and the node weights; Based on the weighted directed acyclic graph, the path to be optimized that consumes the longest time is determined, and the index to be optimized corresponding to the path to be optimized is determined, and the index to be optimized is analyzed and optimized.
7. The method for calculating and optimizing the indicator set of a financial risk control system according to claim 6, characterized in that: The determining the longest time-consuming path to be optimized based on the weighted directed acyclic graph includes: Calculate the earliest occurrence time and the latest occurrence time corresponding to each node in the weighted directed acyclic graph according to the node weight, and take the node with the same earliest occurrence time and the latest occurrence time as the target node; The paths corresponding to the obtained target nodes are taken as the paths to be optimized.
8. A device for calculating and optimizing an indicator set of a financial risk control system, characterized in that: include: A directed acyclic graph construction module, used to obtain configuration information of several indicators in a preset indicator set of a financial risk control system from a preset storage unit, to determine indicator data corresponding to the several indicators according to the configuration information, and to construct a directed acyclic graph corresponding to the several indicators based on the configuration information; An indicator calculation time-consuming determination module is used to perform topological sorting on the directed acyclic graph to determine the calculation order of the several indicators and the calculation depth of the several indicators in the directed acyclic graph, and perform parallel calculation on the indicator data corresponding to the several indicators based on the calculation order and the calculation depth to determine the calculation time corresponding to the several indicators; The indicator optimization module is used to determine the path to be optimized with the longest time consumption in the directed acyclic graph according to the calculation time consumption, and optimize the indicator to be optimized corresponding to the path to be optimized.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the financial risk control system indicator set calculation optimization method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the method for calculating and optimizing the indicator set of a financial risk control system as described in any one of claims 1 to 7 is implemented.