Index node updating method and apparatus, and computer device
Patent Information
- Application Number
- CN202511217561.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2045-08-28
AI Technical Summary
但这种更新方式存在无法单独指定某一个特定的需要更新的指标,更新不够灵活的问题
[0062] The aforementioned index node update method, apparatus, and computer equipment, when it is necessary to update nodes in the index tree structure, further select nodes to be updated from the ancestral nodes of the initially selected nodes to be updated, group the nodes to be updated into groups so that each group of nodes to be updated has child nodes that also belong to the nodes to be updated; determine a first resource allocation order for different groups according to the connection relationship between the nodes to be updated in the groups, and allocate parallel computing resources to the nodes to be updated in each group in sequence according to the first resource allocation order, and then execute the index update task in parallel through each parallel computing resource. This application embodiment allows selecting a subset of specific metrics from the metric tree for updating. By tracing ancestor nodes that meet the update conditions, it can automatically determine which metrics still need to be updated when updating these metrics. Furthermore, this application embodiment groups the nodes to be updated according to their common child nodes and determines the order in which parallel computing resources are allocated to each group based on the dependencies between groups. This ensures that parallel computing resources can synchronously compute the nodes to be updated within the same group, and that groups containing parent nodes complete computation before groups containing child nodes. This reduces the likelihood of situations where, when a node to be updated depends on multiple parent nodes, the update task must pause and wait for all parent nodes to complete their computations before one parent node finishes. Further, for nodes belonging to the same group, this application embodiment can more precisely determine the order in which parallel computing resources are allocated to each node within the group based on the mutual dependencies between nodes within the group, ensuring that nodes within the group are computed and updated in the optimal order as much as possible. This application embodiment improves the efficiency of metric updates.
Smart Images

Figure CN120956739B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus and computer device for updating indicator nodes. Background Technology
[0002] Businesses generate a large amount of data in their daily operations. The foundation for data analysis lies in rationally determining which indicators need to be calculated to utilize this data and under what circumstances each indicator should be updated.
[0003] In related technologies, an indicator tree containing multiple indicator nodes can be constructed, and each level of the indicator tree is updated sequentially from top to bottom when a preset update time is reached. However, this update method has the problem of not being able to specify a particular indicator that needs to be updated individually, resulting in insufficient flexibility in the update process. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, and computer device for updating indicator nodes to address the aforementioned technical problems.
[0005] Firstly, this application provides a method for updating indicator nodes. The method includes:
[0006] At least one node to be updated is determined from the index tree structure, and at least one more node to be updated is further determined from each ancestor node of the node to be updated; wherein the further determined node to be updated is the ancestor node that satisfies the update conditions;
[0007] Based on the connection relationship between the nodes to be updated, the nodes to be updated are grouped; the nodes to be updated belonging to the same group have the same child nodes to be updated.
[0008] Based on the connection relationship between the nodes to be updated belonging to different groups, a first resource allocation order for each group is determined, and parallel computing resources are allocated to the nodes to be updated in each group according to the first resource allocation order.
[0009] The index update tasks of each node to be updated are executed in parallel by each of the parallel computing resources in the order in which the nodes to be updated are allocated to the parallel computing resources.
[0010] In one embodiment, the allocation of parallel computing resources to the nodes to be updated in each group according to the first resource allocation order includes:
[0011] For any of the aforementioned groups, a second resource allocation order for each of the nodes to be updated in the group is determined based on the connection relationship between them.
[0012] Using 1 as the current first resource allocation order, each group corresponding to the current first resource allocation order is taken as the target group, and in accordance with the second resource allocation order from smallest to largest, parallel computing resources are allocated to each node to be updated corresponding to each target group.
[0013] Increment the current first resource allocation order by 1, and jump to the step of taking each group corresponding to the current first resource allocation order as the target group, until all the nodes to be updated in all the groups have completed resource allocation.
[0014] In one embodiment, determining the first resource allocation order for each of the groups based on the connection relationships between nodes to be updated belonging to different groups includes:
[0015] Based on the connection relationships between nodes to be updated belonging to different groups, at least one group dependency chain is constructed;
[0016] For any of the group dependency chains, the order in which the groups are arranged on the dependency chain of the node to be updated is taken as the first resource allocation order of the groups.
[0017] If there are groups corresponding to more than one first resource allocation order, the smallest first resource allocation order among all the first resource allocation orders corresponding to the group is updated to the first resource allocation order of the group.
[0018] In one embodiment, the update condition includes at least one of the following: the ancestor node does not have corresponding cached metric data, the ancestor node is a preset real-time computing node, or the ancestor node is the real-time computing node corresponding to the node to be updated.
[0019] In one embodiment, the process of grouping the nodes to be updated based on the connection relationships between them includes:
[0020] For any of the nodes to be updated, obtain the parent nodes of the node to be updated in the other nodes to be updated, and use each of the parent nodes as an initial group;
[0021] The initial groups are deduplicated to obtain multiple groups corresponding to each node to be updated.
[0022] In one embodiment, further determining at least one node to be updated from the ancestor nodes of the node to be updated includes:
[0023] The node to be updated is taken as the reference node, all parent nodes of the reference node are obtained, and the node to be updated that meets the update conditions is further determined from each of the parent nodes.
[0024] Each of the further determined nodes to be updated is taken as the base node, and the process jumps to the step of obtaining all the parent nodes of the base node until the base node has no parent nodes.
[0025] In one embodiment, the method further includes:
[0026] In response to the addition of an indicator, the target indicator node corresponding to the indicator is displayed in the indicator tree structure interface.
[0027] In response to the calculation formula editing operation for the target indicator node, the connection relationship between the target indicator node and each indicator node in the indicator tree structure is displayed in the indicator tree structure interface; wherein, each indicator node connected to the target indicator node is an indicator node corresponding to the indicator included in the calculation formula.
[0028] In response to the completion of the editing operation on the indicator tree structure interface, the indicator tree structure after adding the target indicator node is displayed in the indicator tree structure interface.
[0029] In one embodiment, after the editing operation on the indicator tree structure interface is completed, the method further includes:
[0030] Based on the dependency relationships between the indicator nodes in the indicator tree structure, at least one indicator node dependency chain is constructed.
[0031] Based on the order of the indicator nodes in the indicator node dependency chain, the level of each indicator node in the indicator tree structure is re-determined, and based on the level of each indicator node in the indicator tree structure, the indicator tree structure after adding the target indicator node is generated.
[0032] Secondly, this application also provides an indicator node updating device. The device includes:
[0033] The first determining module is used to determine at least one node to be updated from the index tree structure, and to further determine at least one node to be updated from each ancestor node of the node to be updated; wherein the further determined node to be updated is the ancestor node that satisfies the update conditions.
[0034] The grouping module is used to group the nodes to be updated based on the connection relationship between them; the nodes to be updated belonging to the same group have the same child nodes to be updated.
[0035] The second determining module is used to determine the first resource allocation order of each group based on the connection relationship between the nodes to be updated belonging to different groups, and to allocate parallel computing resources to the nodes to be updated of each group according to the first resource allocation order.
[0036] The execution module is used to execute the index update tasks of each node to be updated in parallel through each of the parallel computing resources, according to the order in which each node to be updated is allocated to each of the parallel computing resources.
[0037] In one embodiment, the second determining module is further configured to:
[0038] For any of the aforementioned groups, a second resource allocation order for each of the nodes to be updated in the group is determined based on the connection relationship between them.
[0039] Using 1 as the current first resource allocation order, each group corresponding to the current first resource allocation order is taken as the target group, and in accordance with the second resource allocation order from smallest to largest, parallel computing resources are allocated to each node to be updated corresponding to each target group.
[0040] Increment the current first resource allocation order by 1, and jump to the step of taking each group corresponding to the current first resource allocation order as the target group, until all the nodes to be updated in all the groups have completed resource allocation.
[0041] In one embodiment, the second determining module is further configured to:
[0042] Based on the connection relationships between nodes to be updated belonging to different groups, at least one group dependency chain is constructed;
[0043] For any of the group dependency chains, the order in which the groups are arranged on the dependency chain of the node to be updated is taken as the first resource allocation order of the groups.
[0044] If there are groups corresponding to more than one first resource allocation order, the smallest first resource allocation order among all the first resource allocation orders corresponding to the group is updated to the first resource allocation order of the group.
[0045] In one embodiment, the update condition includes at least one of the following: the ancestor node does not have corresponding cached metric data, the ancestor node is a preset real-time computing node, or the ancestor node is the real-time computing node corresponding to the node to be updated.
[0046] In one embodiment, the grouping module is further configured to:
[0047] For any of the nodes to be updated, obtain the parent nodes of the node to be updated in the other nodes to be updated, and use each of the parent nodes as an initial group;
[0048] The initial groups are deduplicated to obtain multiple groups corresponding to each node to be updated.
[0049] In one embodiment, the first determining module is further configured to:
[0050] The node to be updated is taken as the reference node, all parent nodes of the reference node are obtained, and the node to be updated that meets the update conditions is further determined from each of the parent nodes.
[0051] Each of the further determined nodes to be updated is taken as the base node, and the process jumps to the step of obtaining all the parent nodes of the base node until the base node has no parent nodes.
[0052] In one embodiment, the device further includes:
[0053] The first display module is used to display the target indicator node corresponding to the indicator in the indicator tree structure interface in response to the addition operation of the indicator.
[0054] The second display module is used to respond to the calculation formula editing operation for the target indicator node and display the connection relationship between the target indicator node and each indicator node in the indicator tree structure interface; wherein, each indicator node connected to the target indicator node is the indicator node corresponding to the indicator included in the calculation formula.
[0055] The third display module is used to display the indicator tree structure after adding the target indicator node in the indicator tree structure interface in response to the completion of the editing operation for the indicator tree structure interface.
[0056] In one embodiment, the device further includes:
[0057] A construction module is used to construct at least one indicator node dependency chain based on the dependency relationship between each indicator node in the indicator tree structure.
[0058] The third determining module is used to redetermine the level of each indicator node in the indicator tree structure based on the arrangement order of each indicator node on the indicator node dependency chain, and generate the indicator tree structure after adding the target indicator node based on the level of each indicator node in the indicator tree structure.
[0059] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement any of the methods described above.
[0060] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements any of the above methods.
[0061] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements any of the above methods.
[0062] The aforementioned index node update method, apparatus, and computer equipment, when it is necessary to update nodes in the index tree structure, further select nodes to be updated from the ancestral nodes of the initially selected nodes to be updated, group the nodes to be updated into groups so that each group of nodes to be updated has child nodes that also belong to the nodes to be updated; determine a first resource allocation order for different groups according to the connection relationship between the nodes to be updated in the groups, and allocate parallel computing resources to the nodes to be updated in each group in sequence according to the first resource allocation order, and then execute the index update task in parallel through each parallel computing resource. This application embodiment allows selecting a subset of specific metrics from the metric tree for updating. By tracing ancestor nodes that meet the update conditions, it can automatically determine which metrics still need to be updated when updating these metrics. Furthermore, this application embodiment groups the nodes to be updated according to their common child nodes and determines the order in which parallel computing resources are allocated to each group based on the dependencies between groups. This ensures that parallel computing resources can synchronously compute the nodes to be updated within the same group, and that groups containing parent nodes complete computation before groups containing child nodes. This reduces the likelihood of situations where, when a node to be updated depends on multiple parent nodes, the update task must pause and wait for all parent nodes to complete their computations before one parent node finishes. Further, for nodes belonging to the same group, this application embodiment can more precisely determine the order in which parallel computing resources are allocated to each node within the group based on the mutual dependencies between nodes within the group, ensuring that nodes within the group are computed and updated in the optimal order as much as possible. This application embodiment improves the efficiency of metric updates. Attached Figure Description
[0063] Figure 1 This is a flowchart illustrating an indicator node update method in one embodiment;
[0064] Figure 2 This is a schematic diagram of the index tree structure in one embodiment;
[0065] Figure 3 This is a schematic diagram illustrating the process of allocating parallel computing resources in one embodiment;
[0066] Figure 4 This is a flowchart illustrating the process of editing an indicator tree structure on the front-end interface in one embodiment.
[0067] Figure 5 This is a structural block diagram of an indicator node update device in one embodiment;
[0068] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0069] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0070] In one embodiment, such as Figure 1 As shown, a method for updating indicator nodes is provided. This embodiment illustrates the method by applying it to a server. It is understood that this method can also be applied to a terminal, or to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0071] Step 102: Determine at least one node to be updated from the index tree structure, and further determine at least one node to be updated from each ancestor node of the node to be updated; wherein the further determined node to be updated is an ancestor node that satisfies the update conditions.
[0072] In this embodiment, the indicator tree structure includes multiple indicator nodes. When a lower-level indicator node is connected to an upper-level indicator node, it means that the lower-level indicator node needs to use the upper-level indicator node for calculation. Indicator nodes can be connected across levels. Each upper-level indicator node can connect to multiple lower-level indicator nodes, and each lower-level indicator node can also connect to multiple upper-level indicator nodes.
[0073] like Figure 2 The image shown is a schematic diagram of an indicator tree structure in a fund management scenario. Figure 2The top-level (Level 1) indicator nodes are those that can be directly obtained from the collected data, such as total deposits and actual reserves. The Level 2 indicator nodes are those that require calculation using Level 1 indicators, such as required reserves. The Level 3 indicator nodes are those that require calculation using indicators from any of the levels above (i.e., Level 2 or Level 1), such as excess reserves.
[0074] The metric tree structure can be pre-built by technical personnel or users. This tree structure can serve as the data structure for storing various metrics on the server, or it can be displayed to users in a visual format on the front end.
[0075] Nodes awaiting update are those in the indicator tree structure that require data updates. When a user needs to perform real-time calculations on one or more indicator nodes, they can select certain indicator nodes as nodes awaiting update. Alternatively, these indicator nodes become nodes awaiting update when their automatic update time is reached.
[0076] When the metric value of a node to be updated depends on the values of its parent metric nodes, updating the parent metric nodes may require updating the parent node first. This can be achieved by obtaining all ancestor nodes of the node to be updated and identifying those that meet the update conditions from among them.
[0077] In one embodiment, determining all upper-level indicator nodes that need updating includes: using the node to be updated as a base node, obtaining all parent nodes of the base node, and further determining the nodes to be updated that meet the update conditions from each parent node; using each further determined node to be updated as a base node, and jumping to the step of obtaining all parent nodes of the base node, until the base node has no parent nodes. In this embodiment, based on the initial node to be updated, the indicator nodes that need to be updated synchronously are traced up one level, and then based on the nodes traced up one level, the indicator nodes that need to be updated synchronously are traced up to the next higher level. This process is repeated until the top level is reached to obtain all nodes that need to be updated.
[0078] In one embodiment, the update conditions may be pre-configured and include at least one of the following: the ancestor node does not have corresponding cached metric data, the ancestor node is a preset real-time computing node, or the ancestor node is the real-time computing node corresponding to the node to be updated.
[0079] The cached metric data is stored in the database after the ancestor node updates the metrics, and this cached metric data has an expiration time. After the expiration time is reached, the cached metric data is deleted from the database, at which point the ancestor node meets the update conditions. The expiration time can be set according to actual needs, such as at the end of each day or at the end of each hour.
[0080] A real-time computing node refers to a node that, under the condition that its corresponding real-time computing requirements are met, needs to be recalculated regardless of whether the node has cached metric data. The preset real-time computing condition for a node is that any descendant node of that node becomes a node to be updated; that is, if a descendant node needs to be updated, the preset real-time computing node needs to be updated synchronously. Such nodes can be nodes with high data timeliness, such as total deposits or required reserves.
[0081] The real-time computing node corresponding to the node to be updated is a pre-configured node with a high correlation to the node to be updated. The real-time computing condition for this type of node is that among the descendant nodes of this node, the pre-configured node associated with this node becomes the node to be updated. For example, if the node to be updated is the liquidity coverage ratio (which can be calculated by the ratio of high-quality liquid assets to cash outflows over the next 30 days), then the real-time computing node corresponding to this node can be set to the total cash outflow to calculate the liquidity coverage ratio based on the real-time updated expected customer deposit withdrawals.
[0082] Step 104: Based on the connection relationship between the nodes to be updated, the nodes to be updated are grouped; the nodes to be updated belonging to the same group have the same child nodes to be updated.
[0083] After obtaining the initially determined nodes to be updated, and further nodes to be updated from ancestor nodes, to ensure the efficiency of subsequent parallel updates of each node to be updated, all parent nodes of a given node to be updated should ideally complete their computations simultaneously. To achieve this, the nodes to be updated can be grouped based on their connectivity relationships. Nodes belonging to the same group should have the same child nodes to be updated; a child node to be updated refers to a node whose child nodes are also children of the node to be updated. For example, if the nodes to be updated include total deposits, required reserves, and excess reserves, then since excess reserves belong to the node to be updated and are a child node of both total deposits and required reserves, total deposits and required reserves can be grouped together. Each node to be updated can belong to multiple groups simultaneously.
[0084] In one embodiment, the grouping process includes: for each node to be updated, obtaining the parent nodes corresponding to that node among other nodes to be updated, and using these parent nodes as initial groups. Then, deduplication is performed on the initial groups; that is, if multiple initial groups exist containing identical nodes to be updated, one group is retained and the remaining groups are deleted. This yields groups of nodes belonging to the same group that have the same child nodes to be updated.
[0085] Step 106: Based on the connection relationship between the nodes to be updated belonging to different groups, determine the first resource allocation order of each group, and allocate parallel computing resources to the nodes to be updated in each group according to the first resource allocation order.
[0086] In this embodiment, the order in which parallel computing resources are allocated to each group is determined based on the connection relationships between nodes to be updated in different groups. Parallel computing resources may include threads, processors, servers, etc., capable of executing tasks in parallel. Since these parallel computing resources typically process tasks in the order they are submitted, to improve node update efficiency, it is necessary to ensure that the update tasks of all ancestor nodes of each node to be updated are submitted before the update task of the node to be updated.
[0087] To achieve this goal, if a node to be updated in a certain group A is the parent node of a node to be updated in another group B, then group A needs to be allocated resources before group B so that the order in which tasks are executed can satisfy both the requirement that all the parent nodes to be updated of the aforementioned node should ideally complete their calculations at the same time, and the requirement that all the update tasks of the parent nodes should ideally be submitted before the update task of the node to be updated.
[0088] In one embodiment, the above requirement can be achieved by sorting the groups. This includes: traversing each group; setting the first resource allocation order of the first traversed group to 1; for groups not traversed initially, if a target group exists for the current traversed group, then the smallest first resource allocation order corresponding to each target group is used as the first resource allocation order for the current group, and then all first resource allocation orders greater than or equal to the first resource allocation order corresponding to the current group are incremented by 1. The target group is the group containing child nodes of the node to be updated in the current group. If no target group exists, the first resource allocation order of the current group is set based on resource load balancing.
[0089] To illustrate the above process with a practical example, if groups A, B, and C are traversed sequentially, the first resource allocation order for A when it is traversed is 1. When B is traversed, assuming there is no target group corresponding to B, the order in which resources are allocated between B and other groups is not important; the first resource allocation order for B can be set based on the resource load balancing principle. For example, if the total number of nodes to be updated in all target groups corresponding to a certain first resource allocation order is less than the total number of parallel computing resources, then that first resource allocation order can be set as the first resource allocation order for B. If no such first resource allocation order exists, the order in which resources are allocated to B can be made as early or late as possible, for example, also set to 1, or set to the current largest first resource allocation order + 1 (i.e., 2).
[0090] When C is traversed, assuming the target group corresponding to C is A and B, then C needs to be allocated resources before A and B. The smallest first resource allocation order corresponding to the target group is 1, so the first resource allocation order of C is set to 1, and then the first resource allocation order of A and B is shifted one position to the right. The final first resource allocation order is: A: 2, B: 2 or 3, C: 1.
[0091] This method avoids handling nested grouping scenarios and is highly efficient in allocating the first resource allocation order.
[0092] In another embodiment, the above requirement can be achieved by constructing a group dependency chain. This includes: constructing at least one group dependency chain based on the connection relationship between nodes to be updated belonging to different groups; for any group dependency chain, using the order of each group on the dependency chain of the nodes to be updated as the first resource allocation order of the group; and if there are groups with more than one corresponding first resource allocation order, updating the first resource allocation order of the group with the smallest first resource allocation order among all the first resource allocation orders corresponding to the group.
[0093] In a group dependency chain, for two adjacent groups, the node in the preceding group is the parent node of the node in the following group. Group dependency chains can branch; for example, if group C contains the parent nodes of nodes in both group A and group B, then the group dependency chain can be C connecting both A and B, with A and B being parallel. When there are nested group dependency chains, it is necessary to split the group dependency chain into multiple group dependency chains.
[0094] In one example, the specific methods for constructing and splitting dependency chains are as follows: Traverse each group. If a node in another group is found to be a parent node in the currently traversed group, add that group to the dependency chain after the currently traversed group. Repeat this process until no more groups can be added to the dependency chain. If a group in the dependency chain exhibits multiple nested loops, break the dependency chain from the group preceding the point where the loop occurs. For example, if the dependency chain is CAC, break the dependency chain at point A, splitting it into CA and AC.
[0095] The above process will be illustrated with a practical example. Assume there are groups D, E, and F, where D1 in D is the parent node of E1 in E, E2 in E is the parent node of F1 in F, and F2 in F is the parent node of D2 in D. Then the dependency chain of the nodes to be updated is: DEF, FD.
[0096] The first resource allocation order is assigned to each group according to its order in the group dependency chain. The first resource allocation orders for each group are: D: 1, 2; E: 2; F: 3, 1. For groups corresponding to multiple first resource allocation orders, the smaller of the respective first resource allocation orders is used. The final first resource allocation order is: D: 1, E: 2, F: 1.
[0097] This method can ensure that each group is assigned to a smaller first resource allocation order.
[0098] After obtaining the initial resource allocation order for each group, parallel computing resources are allocated to the nodes to be updated in each group according to this order. This is equivalent to first allocating resources to the nodes to be updated in the group with the smallest initial resource allocation order. Once all nodes to be updated in all groups corresponding to this initial resource allocation order have been allocated resources, resources are then allocated to the nodes to be updated in the next group with the next smallest initial resource allocation order. This process is repeated until all nodes to be updated have been allocated resources.
[0099] Taking the above groups D, E, and F as an example, assume there are two parallel computing resources. First, allocate resources to the nodes (D1, D2, F1, F2) to be updated in the groups (D, F) corresponding to the smallest first resource allocation order. During allocation, try to assign each node to be updated to different parallel computing resources. For example, resource 1 is allocated to D1 and F1 in sequence, and resource 2 is allocated to D2 and F2 in sequence.
[0100] Then, resources are allocated to the nodes (E1, E2) to be updated in the group (E) corresponding to the next first resource allocation order. For example, resource 1 is allocated to E1, and resource 2 is allocated to E2.
[0101] In one embodiment, such as Figure 3 As shown, parallel computing resources are allocated to the nodes to be updated in each group according to the first resource allocation order, including:
[0102] Step 302: For any group, determine the second resource allocation order of each node to be updated in the group based on the connection relationship between each node to be updated in the group;
[0103] Step 304: Take 1 as the current first resource allocation order, take each group corresponding to the current first resource allocation order as the target group, and allocate parallel computing resources to each node to be updated corresponding to each target group in ascending order of the second resource allocation order.
[0104] Increment the current first resource allocation order by 1, and jump to the step of taking each group corresponding to the current first resource allocation order as the target group, until all the nodes to be updated in all groups have completed resource allocation.
[0105] In this embodiment, considering that nodes to be updated within the same group may also have connections, it is also necessary to process the order in which the nodes to be updated within the same group are allocated resources. For example, if node 1 to be updated is the parent node of node 2 to be updated, and nodes 1 and 2 are both the parent nodes of node 3 to be updated, then nodes 1 and 2 will belong to the same group. In this case, it is best for node 1 to be allocated resources before node 2 to be updated, so that when the update task of node 2 is executed, the update task of node 1 should ideally have already been completed.
[0106] The second resource allocation order can be achieved by sorting the nodes to be updated or by constructing a dependency chain of the nodes to be updated. For details, please refer to the process of sorting the groups or constructing the group dependency chain in the previous embodiments. This application will not repeat the process in the embodiments.
[0107] This allows for the execution of the aforementioned resource allocation process, starting with the smallest first resource allocation order. For each target group corresponding to the first resource allocation order, parallel computing resources are allocated to the nodes to be updated in each target group according to the second resource allocation order, from smallest to largest. For example, if the second resource allocation order of D1 and F2 in the previous example is 1, and the second resource allocation order of D2 and F1 is 2, then when allocating resources to the nodes to be updated in D and F, parallel computing resources are first allocated to D1 and F2, and then to D2 and F1.
[0108] Step 108: In accordance with the order in which each node to be updated is allocated to each parallel computing resource, the index update tasks of each node to be updated are executed in parallel through each parallel computing resource.
[0109] In this embodiment, each parallel computing resource executes the metric update task for each node to be updated in the order in which the nodes are allocated to that resource. The metric update task may include recalculating the metric data of the node to be updated, storing the recalculated metric data as cached metric data in the database, and displaying the metric data on the front-end interface, etc.
[0110] During the computation process, the time required for parallel computing resources to execute each update task can be recorded. For nodes whose update tasks take longer, the second thread allocation order within their respective groups can be advanced to prioritize the execution of their update tasks, further improving update efficiency.
[0111] The indicator node update method provided in this application, when it is necessary to update nodes in the indicator tree structure, further selects nodes to be updated from the ancestor nodes of the initially selected nodes to be updated, groups the nodes to be updated, so that each group of nodes to be updated has child nodes that also belong to the node to be updated; determines a first resource allocation order for different groups according to the connection relationship between the nodes to be updated in the groups, and allocates parallel computing resources to the nodes to be updated in each group in sequence according to the first resource allocation order, and then executes the indicator update task in parallel through each parallel computing resource. This application allows selecting a portion of specific indicators from the indicator tree for updating, and can automatically determine which indicators also need to be updated when updating these indicators; in addition, it makes it possible to make parallel computing resources calculate the nodes to be updated in the same group synchronously as much as possible, and to make it possible to make the group containing parent nodes complete the calculation before the group containing child nodes, which can reduce the situation where when a node to be updated depends on multiple parent nodes at the same time, the calculation of one parent node is completed before the calculation of other parent nodes is completed, causing the update task to be paused and waiting for all parent nodes to complete the calculation, thus improving the update efficiency.
[0112] In one embodiment, such as Figure 4 As shown, the above method also includes:
[0113] Step 402: In response to the operation of adding an indicator, display the target indicator node corresponding to the indicator in the indicator tree structure interface.
[0114] Step 404: In response to the calculation formula editing operation for the target indicator node, the connection relationship between the target indicator node and each indicator node in the indicator tree structure is displayed in the indicator tree structure interface; wherein, each indicator node connected to the target indicator node is the indicator node corresponding to the indicator included in the calculation formula.
[0115] Step 406: In response to the completion of the editing operation for the indicator tree structure interface, the indicator tree structure after adding the target indicator node is displayed in the indicator tree structure interface.
[0116] In this embodiment, the user can edit the indicator tree structure on the front end. The indicator tree structure interface can display the current indicator tree structure and an add indicator control. After the user triggers the add indicator control, they can enter the indicator name and data type (value, percentage, etc.), and then complete the indicator addition operation by triggering the indicator addition completion control. The server then displays the target indicator node added by the user in the indicator tree structure interface accordingly.
[0117] Users can further configure how the metrics are calculated. Each metric node displays a metric editing control. After triggering the metric editing control, users can configure whether the metric retrieves data directly, reads it from a database, obtains it from an external interface, or needs to be calculated using other metrics. If calculation using other metrics is required, users can select an existing metric node on the page to reference other metrics and use a rich text editor that supports basic operators such as addition, subtraction, multiplication, and division, as well as advanced operators such as branching, ternary operators, and not equal to operators, to configure the metric's calculation formula. All metric nodes involved in the user-configured calculation formula are parent nodes of the target metric node. This relationship can be indicated on the front-end interface by connecting these nodes to the target metric node.
[0118] Users can complete editing of the indicator tree structure interface by triggering the edit completion control. The server then displays the indicator tree structure after adding the target indicator node on the front-end interface.
[0119] Users can configure the automatic update cycle of the indicator tree structure, for example, setting it to update daily at the beginning of each day. At the start of the automatic update cycle, the server updates all indicator nodes as nodes to be updated. A real-time calculation control can also be set on the indicator tree structure interface. Users can select some indicator nodes and trigger the real-time calculation control. The server will then treat the user-selected nodes as nodes to be updated and update them in the manner described in the previous embodiment.
[0120] During the update process, the server can identify each node to be updated by using special colors, borders, prompts, etc. after each node has been calculated. The update progress can be calculated by the ratio of the number of updated nodes to the total number of nodes to be updated, and the update progress can be displayed on the front-end page to improve the user experience.
[0121] In one embodiment, the above method further includes:
[0122] Based on the dependency relationships between indicator nodes in the indicator tree structure, construct at least one indicator node dependency chain;
[0123] Based on the order of each indicator node in the indicator node dependency chain, the level of each indicator node in the indicator tree structure is redefined, and based on the level of each indicator node in the indicator tree structure, the indicator tree structure after adding the target indicator node is generated.
[0124] In this embodiment of the application, after the user adds a target indicator node in the indicator tree structure, it may be necessary to adjust the hierarchy of some indicator nodes.
[0125] The hierarchy of each indicator node can be determined by constructing an indicator node dependency chain. The method for constructing the indicator node dependency chain can be found in the aforementioned embodiments, and will not be repeated in this application. Indicator nodes that do not depend on any other indicators are fixed at the top level (level 1) in the indicator tree structure. The hierarchy of each other indicator node is the level of the lowest-level parent node among all its dependent parent nodes + 1.
[0126] After determining the level of each indicator node, the indicator tree structure after adding the target indicator node can be regenerated and displayed on the front end.
[0127] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0128] Based on the same inventive concept, this application also provides an indicator node updating apparatus for implementing the indicator node updating method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more indicator node updating apparatus embodiments provided below can be found in the limitations of the indicator node updating method described above, and will not be repeated here.
[0129] In one embodiment, such as Figure 5As shown, an indicator node update device 500 is provided, including: a first determination module 502, a grouping module 504, a second determination module 506, and an execution module 508, wherein:
[0130] The first determining module 502 is used to determine at least one node to be updated from the index tree structure, and further determine at least one node to be updated from each ancestor node of the node to be updated; wherein the further determined node to be updated is the ancestor node that satisfies the update conditions.
[0131] The grouping module 504 is used to group the nodes to be updated based on the connection relationship between them; the nodes to be updated belonging to the same group have the same child nodes to be updated.
[0132] The second determining module 506 is used to determine the first resource allocation order of each group based on the connection relationship between the nodes to be updated belonging to different groups, and to allocate parallel computing resources to the nodes to be updated of each group according to the first resource allocation order.
[0133] The execution module 508 is used to execute the index update task of each node to be updated in parallel through each of the parallel computing resources in the order in which each node to be updated is allocated to each of the parallel computing resources.
[0134] In one embodiment, the second determining module 506 is further configured to:
[0135] For any of the aforementioned groups, a second resource allocation order for each of the nodes to be updated in the group is determined based on the connection relationship between them.
[0136] Using 1 as the current first resource allocation order, each group corresponding to the current first resource allocation order is taken as the target group, and in accordance with the second resource allocation order from smallest to largest, parallel computing resources are allocated to each node to be updated corresponding to each target group.
[0137] Increment the current first resource allocation order by 1, and jump to the step of taking each group corresponding to the current first resource allocation order as the target group, until all the nodes to be updated in all the groups have completed resource allocation.
[0138] In one embodiment, the second determining module 506 is further configured to:
[0139] Based on the connection relationships between nodes to be updated belonging to different groups, at least one group dependency chain is constructed;
[0140] For any of the group dependency chains, the order in which the groups are arranged on the dependency chain of the node to be updated is taken as the first resource allocation order of the groups.
[0141] If there are groups corresponding to more than one first resource allocation order, the smallest first resource allocation order among all the first resource allocation orders corresponding to the group is updated to the first resource allocation order of the group.
[0142] In one embodiment, the update condition includes at least one of the following: the ancestor node does not have corresponding cached metric data, the ancestor node is a preset real-time computing node, or the ancestor node is the real-time computing node corresponding to the node to be updated.
[0143] In one embodiment, the grouping module 504 is further configured to:
[0144] For any of the nodes to be updated, obtain the parent nodes of the node to be updated in the other nodes to be updated, and use each of the parent nodes as an initial group;
[0145] The initial groups are deduplicated to obtain multiple groups corresponding to each node to be updated.
[0146] In one embodiment, the first determining module 502 is further configured to:
[0147] Using the node to be updated as the reference node, obtain all the parent nodes of the reference node, and further determine the node to be updated that meets the update conditions from each of the parent nodes;
[0148] Each of the further determined nodes to be updated is taken as the base node, and the process jumps to the step of obtaining all the parent nodes of the base node until the base node has no parent nodes.
[0149] In one embodiment, the device further includes:
[0150] The first display module is used to display the target indicator node corresponding to the indicator in the indicator tree structure interface in response to the addition operation of the indicator.
[0151] The second display module is used to respond to the calculation formula editing operation for the target indicator node and display the connection relationship between the target indicator node and each indicator node in the indicator tree structure interface; wherein, each indicator node connected to the target indicator node is the indicator node corresponding to the indicator included in the calculation formula.
[0152] The third display module is used to display the indicator tree structure after adding the target indicator node in the indicator tree structure interface in response to the completion of the editing operation for the indicator tree structure interface.
[0153] In one embodiment, the device further includes:
[0154] A construction module is used to construct at least one indicator node dependency chain based on the dependency relationship between each indicator node in the indicator tree structure.
[0155] The third determining module is used to redetermine the level of each indicator node in the indicator tree structure based on the arrangement order of each indicator node on the indicator node dependency chain, and generate the indicator tree structure after adding the target indicator node based on the level of each indicator node in the indicator tree structure.
[0156] Each module in the above-mentioned device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0157] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements an index node update method.
[0158] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0159] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0160] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0161] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0162] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0163] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0164] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0165] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for updating indicator nodes, characterized in that, The method includes: At least one node to be updated is determined from the index tree structure, and at least one more node to be updated is further determined from each ancestor node of the node to be updated; wherein the further determined node to be updated is the ancestor node that satisfies the update conditions; For any of the nodes to be updated, obtain the parent nodes of the node to be updated in other nodes to be updated, and take each parent node as an initial group. Perform deduplication on each initial group to obtain multiple groups corresponding to each node to be updated; the nodes to be updated belonging to the same group have the same child nodes to be updated. Based on the connection relationship between the nodes to be updated belonging to different groups, the first resource allocation order of each group is determined, including: traversing each group, setting the first resource allocation order of the first traversed group to 1, for groups not traversed first, if the current traversed group has a corresponding target group, then the smallest first resource allocation order among the target groups is taken as the first resource allocation order corresponding to the current group, and all first resource allocation orders greater than or equal to the first resource allocation order corresponding to the current group are incremented by 1; if no target group exists, then the first resource allocation order of the current group is set based on resource load balancing, the target group contains child nodes of the nodes to be updated in the current group, and parallel computing resources are allocated to the nodes to be updated in each group according to the first resource allocation order; The index update tasks of each node to be updated are executed in parallel by each of the parallel computing resources in the order in which the nodes to be updated are allocated to the parallel computing resources.
2. The method according to claim 1, characterized in that, The allocation of parallel computing resources to the nodes to be updated in each group according to the first resource allocation order includes: For any of the aforementioned groups, a second resource allocation order for each of the nodes to be updated in the group is determined based on the connection relationship between them. Using 1 as the current first resource allocation order, each group corresponding to the current first resource allocation order is taken as the target group, and in accordance with the second resource allocation order from smallest to largest, parallel computing resources are allocated to each node to be updated corresponding to each target group. Increment the current first resource allocation order by 1, and jump to the step of taking each group corresponding to the current first resource allocation order as the target group, until all the nodes to be updated in all the groups have completed resource allocation.
3. The method according to claim 1, characterized in that, The step of determining the first resource allocation order for each of the groups based on the connection relationships between nodes to be updated belonging to different groups includes: Based on the connection relationships between nodes to be updated belonging to different groups, at least one group dependency chain is constructed; For any of the group dependency chains, the order in which the groups are arranged on the dependency chain of the node to be updated is taken as the first resource allocation order of the groups. If there are groups corresponding to more than one first resource allocation order, the smallest first resource allocation order among all the first resource allocation orders corresponding to the group is updated to the first resource allocation order of the group.
4. The method according to claim 1, characterized in that, The update conditions include at least one of the following: the ancestor node does not have corresponding cached metric data, the ancestor node is a preset real-time computing node, or the ancestor node is the real-time computing node corresponding to the node to be updated.
5. The method according to claim 1, characterized in that, The step of further determining at least one node to be updated from each of the ancestor nodes of the node to be updated includes: Using the node to be updated as the reference node, obtain all the parent nodes of the reference node, and further determine the node to be updated that meets the update conditions from each of the parent nodes; Each of the further determined nodes to be updated is taken as the base node, and the process jumps to the step of obtaining all the parent nodes of the base node until the base node has no parent nodes.
6. The method according to claim 1, characterized in that, The method further includes: In response to the addition of an indicator, the target indicator node corresponding to the indicator is displayed in the indicator tree structure interface. In response to the calculation formula editing operation for the target indicator node, the connection relationship between the target indicator node and each indicator node in the indicator tree structure is displayed in the indicator tree structure interface; wherein, each indicator node connected to the target indicator node is an indicator node corresponding to the indicator included in the calculation formula. In response to the completion of the editing operation on the indicator tree structure interface, the indicator tree structure after adding the target indicator node is displayed in the indicator tree structure interface.
7. The method according to claim 6, characterized in that, The method further includes the following steps after the editing operation on the indicator tree structure interface is completed: Based on the dependency relationships between the indicator nodes in the indicator tree structure, at least one indicator node dependency chain is constructed. Based on the order of the indicator nodes in the indicator node dependency chain, the level of each indicator node in the indicator tree structure is re-determined, and based on the level of each indicator node in the indicator tree structure, the indicator tree structure after adding the target indicator node is generated.
8. An indicator node updating device, characterized in that, The device includes: The first determining module is used to determine at least one node to be updated from the index tree structure, and to further determine at least one node to be updated from each ancestor node of the node to be updated; wherein the further determined node to be updated is the ancestor node that satisfies the update conditions. The grouping module is used to, for any node to be updated, obtain the parent node corresponding to the node to be updated in other nodes to be updated, and take each parent node as an initial group, perform deduplication on each initial group to obtain multiple groups corresponding to each node to be updated; the nodes to be updated belonging to the same group have the same child nodes to be updated. The second determining module is used to determine the first resource allocation order of each group based on the connection relationship between the nodes to be updated belonging to different groups. Specifically, it is used to traverse each group, set the first resource allocation order of the first group traversed to 1, and for groups that are not the first group traversed, if there is a corresponding target group for the current group, then the smallest first resource allocation order among the target groups is taken as the first resource allocation order corresponding to the current group, and all first resource allocation orders that are greater than or equal to the first resource allocation order corresponding to the current group are incremented by 1. If there is no target group, then the first resource allocation order of the current group is set based on resource load balancing. The target group contains child nodes of the nodes to be updated in the current group, and parallel computing resources are allocated to the nodes to be updated in each group according to the first resource allocation order. The execution module is used to execute the index update tasks of each node to be updated in parallel through each of the parallel computing resources, according to the order in which each node to be updated is allocated to each of the parallel computing resources.
9. The apparatus according to claim 8, characterized in that, The second determining module is also used for: For any of the aforementioned groups, a second resource allocation order for each of the nodes to be updated in the group is determined based on the connection relationship between them. Using 1 as the current first resource allocation order, each group corresponding to the current first resource allocation order is taken as the target group, and in accordance with the second resource allocation order from smallest to largest, parallel computing resources are allocated to each node to be updated corresponding to each target group. Increment the current first resource allocation order by 1, and jump to the step of taking each group corresponding to the current first resource allocation order as the target group, until all the nodes to be updated in all the groups have completed resource allocation.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Anchor point updating method and device
CN111104144A
Resource data grouping method and device, computer equipment and storage medium
CN116561074A
Automobile offline detection method, device, equipment and medium
CN119555398A