Multi-dimensional data calculation method and device, electronic equipment, readable storage medium and chip
By limiting the calculation scope of multidimensional data, constructing a logical calculation path and eliminating invalid data, the problems of low efficiency and large amount of empty data in multidimensional data calculation are solved, and efficient and flexible multidimensional data processing is achieved.
Patent Information
- Application Number
- CN202510807170.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-10-17
AI Technical Summary
Existing multidimensional data calculation methods have problems such as insufficient computational efficiency and excessive void data. Especially in scenarios with uncertain data sources or asymmetric slicing, the target data cannot be effectively cleaned, which affects computational efficiency.
By determining the attributes and hierarchical relationships of data items in multidimensional data, limiting the calculation scope, building a logical calculation path, calculating valid data one by one, eliminating invalid data, and dynamically adjusting the calculation behavior, we can ensure that the calculation method of the target data item is clear.
It improves the overall efficiency and robustness of multidimensional data calculations, reduces irrelevant data interference and calculation errors, and adapts to the computing needs of different business scenarios.
Smart Images

Figure CN120803774A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of multi-dimensional data processing, in particular to a multi-dimensional data calculation method and device, electronic equipment, readable storage medium and chip. BACKGROUND
[0002] With the wide application of multi-dimensional databases, the traditional data processing method in various types of enterprises cannot meet the requirements of products on efficiency. There are mainly two kinds of multi-dimensional data calculation methods on the market: left-to-right and right-to-left. The left-to-right calculation method determines the calculation result and behavior of the right-side source data according to the left-side target. This method performs well when the target is clear and the data source is relatively fixed. However, the core problem is that the range of Cartesian product is difficult to control effectively, resulting in a large amount of hollow data in the calculation process, thereby reducing the overall calculation efficiency. In contrast, the right-to-left calculation method starts from the right-side source data and calculates the target data based on the source data. This method is suitable for scenarios where the source data range is large and the effective data is small. The core defect is that when the source data is empty, the target data cannot be effectively cleaned up, and asymmetric slicing is not supported, affecting the calculation efficiency. SUMMARY
[0003] The embodiments of the present application provide a multi-dimensional data calculation method, device, electronic equipment, readable storage medium and chip, which can solve the problem of insufficient calculation efficiency of multi-dimensional data calculation method and a large amount of hollow data in the calculation process.
[0004] Therefore, the embodiments of the first aspect of the present application provide a multi-dimensional data calculation method.
[0005] The embodiments of the second aspect of the present application provide a multi-dimensional data calculation device.
[0006] The embodiments of the third aspect of the present application provide an electronic equipment.
[0007] The embodiments of the fourth aspect of the present application provide a readable storage medium.
[0008] The embodiments of the fifth aspect of the present application provide a chip.
[0009] In order to achieve the above-mentioned purpose, the embodiments of the first aspect of the present application provide a multi-dimensional data calculation method, comprising: determining a plurality of data items in multi-dimensional data, the data items including data source items and target data items; determining a calculation range according to the data source items and the target data items; filtering the plurality of data items according to the calculation range to determine an effective data set; determining a logical calculation path from the data source items to the target data items in the effective data set; calculating the plurality of logical calculation paths one by one to determine a multi-dimensional data calculation result.
[0010] According to the multi-dimensional data calculation method provided by the application, the target data item in the multi-dimensional database is calculated, all data source items related to the target data item in the multi-dimensional database are determined, and the plurality of data source items and the target data item are included in the calculation scope. The calculation scope formed by the plurality of data source items and the target data item is preliminarily filtered, the effective data related to the target data item and the data source item in the multi-dimensional database is further screened, the effective data set is determined, and the problem of calculation expansion caused by too much data is avoided. After the effective data set is determined, the specific calculation path from the data source item to the target data item is determined, the logical calculation path is constructed, the path that needs to be calculated in the calculation process is ensured, and it is determined that the target data item is calculated through the data source item through the logical calculation path, that is, the calculation method of the target data item is determined. And the plurality of logical calculation paths are calculated independently, according to the definition of the logical calculation path, the calculation operation corresponding to each logical calculation path is executed, and in the actual calculation process, the calculation behavior is dynamically adjusted, and the multi-dimensional data calculation result corresponding to the target data item is determined.
[0011] It can be understood that through the multi-dimensional data calculation method provided by the application, the calculation scope is determined according to the target data item and the data source item, all related data is ensured to be included, the data range is limited, unnecessary calculation is reduced, and the overall efficiency of multi-dimensional data calculation is improved.
[0012] In the above technical solution, the calculation scope is determined according to the data source item and the target data item, including: determining the attribute information of the plurality of data items; determining the hierarchical relationship information of the data source item and the target data item according to the attribute information; and determining the calculation scope according to the hierarchical relationship information.
[0013] In this scheme, the attribute information is the inherent characteristics of the data item, including the data type, the dimension information and the business label. According to the data type, the dimension information and the business label in the attribute information, the membership or aggregation relationship between the plurality of data items is determined, and the hierarchical relationship information between the data source item and the target data item is determined according to the membership or aggregation relationship. The recursive topological relationship between the target data item and the data source item is determined through the hierarchical relationship information, the boundary of the recursive topological relationship is taken as the boundary of the calculation scope, and the calculation scope corresponding to the target data item in the multi-dimensional database is determined.
[0014] It can be understood that by determining the attribute information and the hierarchical relationship information of the plurality of data items, the matching rule of the data source item and the target data item is determined, the error calculation across levels or types is avoided, and the robustness in the automatic calculation process of the system is improved.
[0015] Optionally, the computing range is determined according to the hierarchical relationship information, including: determining the association paths between the target data item and the data source item according to the hierarchical relationship information; and determining the computing range according to the plurality of association paths.
[0016] In the present solution, the membership or aggregation relationship between the plurality of data items is determined according to the data type, dimension information and business label in the attribute information, and the hierarchical relationship information between the data source item and the target data item is determined according to the membership or aggregation relationship. By defining the membership logic of the data source item to the target data item, a structured basis is provided for the generation of the association path. Based on the hierarchical relationship information, the specific mapping path of the data source item to the target data item, i.e. the association path, is determined. Through the association path, the computing dependency relationship between the data source item and the target data item can be explicitly determined, the logical link of data flow is limited, and the computing range is determined, thereby reducing the data processing amount in the multidimensional data computing database and the computing omission problem caused by the hierarchical confusion in multidimensional computing, and improving the robustness of multidimensional data computing.
[0017] In any of the above technical solutions, the logical computing path of the data source item to the target data item in the effective data set is determined, including: determining the target computing logic corresponding to the target data item according to the attribute information and the hierarchical relationship information; determining a plurality of target computing sequences according to the target computing logic; determining the target data source item corresponding to the plurality of target computing sequences within the computing range; and determining the logical computing path according to the target data source item, the target data item and the target computing logic.
[0018] In the scheme, the attribute information is the inherent characteristics of the data item, including data type, dimension information and business label, and the attribute information is the basis for providing the calculation logic, for example, the target data of the "cost item" can only be generated by the source data of the "cost item"; the attribute information of the target data item "electricity fee" is: numerical type, dimension = "subject", and business label = "cost item". The hierarchical relationship information is determined by the recursive topological relationship between the data items, ensuring that the multi-dimensional data calculation process is always within the calculation range and will not cross the hierarchy or cross-type calculation. The target calculation logic from the multiple data source items to the target data item is determined by the attribute information and the hierarchical relationship information, and the target calculation logic includes mathematical formulas or business rules such as formulas, aggregation methods or conditional expressions. Each associated path corresponds to a target calculation logic. The target calculation sequence is a distributed calculation order decomposed based on the target calculation logic, and the purpose is to split the associated path between the target data item and the multiple data source items into independent executable calculation operations, and to sort the multiple calculation operations according to the sorting order to determine the logical calculation path. The logical calculation path is a complete calculation link from the target data item to the multiple data source items, and the logical calculation path includes data input, calculation logic, output target and calculation order. The logical calculation path supports non-conformal slicing, for example, only calculating part of the hierarchical path, which is used to adapt to different business needs.
[0019] It can be understood that the way of determining the target calculation logic corresponding to the target data item through the attribute information and the hierarchical relationship information, explicitly specifies the mathematical formula or business rule used by each associated path, and determines the calculation order according to the hierarchical relationship, that is, the target calculation sequence. According to the way of determining the logical calculation path according to the target calculation sequence and the multiple data items, it is clear how the target data is calculated by the source data, the calculation method of the target data is determined, and the complex multi-dimensional calculation is divided into a standardized and configurable process, improving the accuracy and flexibility of multi-dimensional data calculation, and laying the foundation for subsequent dynamic adjustment and data cleaning.
[0020] In any of the above technical solutions, optionally, before the multiple logical calculation paths are calculated one by one to determine the multi-dimensional data calculation result, the method further comprises: determining a target source parameter corresponding to the target data source item; determining the data type of the target data source item according to the target source parameter, the data type including a first data type and a second data type; and determining that the logical calculation path corresponding to the second data type is a hollow path.
[0021] In the scheme, the target source parameter corresponds to the attribute information of the target data source item, and the target source parameter is used to determine whether the data item is a hollow data. Specifically, the first data type is a valid data source item meeting the preset parameter requirement, and the second data type is a data source item not meeting the preset parameter requirement, including a hollow value, a data item exceeding a reasonable range, or an undefined data item. The first data type indicates that the data of the corresponding data source item is available, and the second data type indicates that the corresponding data source item is empty. When the system detects the data source item of the second data type, it is determined that the logical calculation path generated by the invalid data source item is a hollow path.
[0022] It can be understood that by distinguishing between valid data and invalid data, a classification basis is provided for subsequent path processing, invalid data or hollow data is avoided from participating in multidimensional data calculation, calculation resource waste is reduced, and the efficiency and practicality of multidimensional data calculation are improved.
[0023] In any of the above technical solutions, optionally, the plurality of logical calculation paths are calculated one by one to determine the multidimensional data calculation result, including: determining an execution calculation sequence corresponding to the target data item according to the target calculation sequence and the hollow path; and calculating the plurality of logical calculation paths according to the execution calculation sequence to determine the multidimensional data calculation result.
[0024] In the scheme, after the hollow path is determined, the original target calculation sequence is adjusted, that is, at least one hollow path is deleted in the target calculation sequence to determine an execution calculation sequence. The original calculation order is adjusted, the execution calculation order is determined by the execution calculation sequence, the calculation results of the plurality of logical calculation paths are determined, and the multidimensional data calculation result is determined according to the execution calculation order and the plurality of calculation results.
[0025] It can be understood that by eliminating the hollow path, only the valid calculation path is executed, and the invalid calculation amount is reduced. After deleting at least one hollow path, the original calculation order is dynamically adjusted to cope with data abnormalities or missing, and the accuracy and efficiency of multidimensional data calculation are improved.
[0026] Optionally, when the load of the calculation node is too high, part of the execution calculation sequence is moved to an idle calculation node, and the high-frequency access path is preferentially executed.
[0027] Optionally, during the calculation of the plurality of logical calculation paths according to the execution calculation sequence, if the calculation result of a logical calculation path conflicts with the calculation result of an associated path corresponding thereto, an alarm is triggered and the calculation of the corresponding plurality of associated paths is suspended. For example, according to the calculation results of the plurality of logical calculation paths, it is determined that the "branch sales" is greater than the "national sales", and the associated path corresponding to the "branch sales" is suspended and an alarm is triggered.
[0028] Optionally, the user can manually cancel the calculation disabling of the at least one hollow path during the system calculation process.
[0029] Embodiments of the second aspect of the application provide a multi-dimensional data calculation device, comprising: a determination module configured to determine a plurality of data items in multi-dimensional data, the data items comprising data source items and target data items; a range module configured to determine a calculation range according to the data source items and the target data items; a filtering module configured to filter the plurality of data items according to the calculation range to determine a valid data set; a path module configured to determine logical calculation paths from the data source items to the target data items in the valid data set; and a calculation module configured to calculate the plurality of logical calculation paths one by one to determine a multi-dimensional data calculation result.
[0030] The multi-dimensional data calculation device provided by the application calculates target data items in a multi-dimensional database, determines all data source items related to the target data items in the multi-dimensional database, and includes the plurality of data source items and the target data items in a calculation range. The calculation range formed by the plurality of data source items and the target data items is preliminarily filtered, and valid data related to the target data items and the data source items in the multi-dimensional database is further filtered to determine a valid data set, thereby avoiding the problem of calculation expansion caused by excessive data. After the valid data set is determined, specific calculation paths from the data source items to the target data items are determined, logical calculation paths are constructed, and the paths that need to be calculated in the calculation process are ensured. The logical calculation paths clearly indicate how the target data items are calculated through the data source items, i.e., the calculation method of the target data items is determined. The plurality of logical calculation paths are independently calculated, the calculation operations corresponding to each logical calculation path are performed according to the definition of the logical calculation path, and the calculation behavior is dynamically adjusted in the actual calculation process to determine the multi-dimensional data calculation result corresponding to the target data items. The multi-dimensional data calculation method is implemented by the multi-dimensional data calculation device, and the overall efficiency and robustness of multi-dimensional data calculation are improved.
[0031] Embodiments of the third aspect of the application provide an electronic device, comprising a processor, a memory, and a program or instructions stored in the memory and executable on the processor, the program or instructions being executed by the processor to implement the steps of the multi-dimensional data calculation method of the first aspect.
[0032] Embodiments of the fourth aspect of the application provide a readable storage medium, the readable storage medium storing a program or instructions, the program or instructions being executed by the processor to implement the steps of the multi-dimensional data calculation method of the first aspect.
[0033] Embodiments of the fifth aspect of the application provide a chip, the chip comprising a processor and a communication interface, the communication interface and the processor being coupled, the processor being configured to run a program or instructions to implement the steps of the multi-dimensional data calculation method of the first aspect.
[0034] Additional aspects and advantages of the technical solutions of the present application will become apparent from the following description with examples taken in connection with the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 A flowchart of a multi-dimensional data calculation method according to an embodiment of the present application is shown; Figure 2 A flowchart of a multi-dimensional data calculation method according to an embodiment of the present application is shown; Figure 3 A flowchart of a multi-dimensional data calculation method according to an embodiment of the present application is shown; Figure 4 A flowchart of a multi-dimensional data calculation method according to an embodiment of the present application is shown; Figure 5 A flowchart of a multi-dimensional data calculation method according to an embodiment of the present application is shown; Figure 6 A flowchart of a multi-dimensional data calculation method according to an embodiment of the present application is shown; Figure 7 A structural schematic block diagram of a multi-dimensional data calculation device according to an embodiment of the present application is shown; Figure 8 A structural schematic block diagram of an electronic device according to an embodiment of the present application is shown.
[0036] Wherein, Figure 7 And Figure 8 The correspondence between the reference signs and the component names in the drawings is as follows: 900: multi-dimensional data calculation device; 902: determination module; 904: range module; 906: filtering module; 908: path module; 910: calculation module; 1000: electronic device; 1110: processor; 1109: memory. DETAILED DESCRIPTION
[0037] In order to more clearly understand the above-mentioned purposes, features and advantages of the embodiments of the present application, the embodiments of the present application are further described in detail below in combination with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0038] In the following description, many specific details are set forth in order to provide a thorough understanding of the present application, however, embodiments of the present application can also be implemented in other ways different from those described herein, therefore, the scope of protection of the present application is not limited to the specific embodiments disclosed below.
[0039] The following will be described in combination with the accompanyingFigures 1 to 8 The multi-dimensional data calculation method, device, electronic device, readable storage medium and chip provided by the embodiments of the present application are described in detail through specific embodiments and application scenarios.
[0040] The embodiments provide a multi-dimensional data calculation method, which comprises the following steps as shown in the accompanying drawings. Figure 1 Step S100: determining a plurality of data items in multi-dimensional data. Step S102: determining a calculation range according to a data source item and a target data item. Step S104: screening the plurality of data items according to the calculation range to determine an effective data set. Step S106: determining a logical calculation path from the data source item to the target data item in the effective data set. Step S108: calculating the plurality of logical calculation paths one by one to determine a multi-dimensional data calculation result.
[0041] According to the multi-dimensional data calculation method provided by the embodiments, the target data item in the multi-dimensional database is calculated, all data source items related to the target data item in the multi-dimensional database are determined, and the plurality of data source items and the target data item are included in the calculation range (Scope). The calculation range formed by the plurality of data source items and the target data item is preliminarily filtered, the effective data related to the target data item and the data source item in the multi-dimensional database is further screened, the effective data set is determined, and the problem of calculation expansion caused by too much data is avoided. After the effective data set is determined, the specific calculation path from the data source item to the target data item is determined, the logical calculation path is constructed, the path that needs to be calculated in the calculation process is ensured, and it is determined how the target data item is calculated through the data source item through the logical calculation path, that is, the calculation method of the target data item is determined. The plurality of logical calculation paths are independently calculated, the calculation operation corresponding to each logical calculation path is executed according to the definition of the logical calculation path, and the calculation behavior is dynamically adjusted in the actual calculation process to determine the multi-dimensional data calculation result corresponding to the target data item.
[0042] It can be understood that, through the multi-dimensional data calculation method provided by the present application, the calculation range is determined according to the target data item and the data source item, all related data is ensured to be included, the data range is limited, unnecessary calculation is reduced, and the overall efficiency of multi-dimensional data calculation is improved.
[0043] Further, the data in the multi-dimensional database has high dimensionality. The effective data related to the target data item and the data source item is preliminarily filtered by screening a plurality of data items through calculation range, so as to prevent the increase of calculation complexity caused by too much data, avoid the calculation expansion problem caused by Cartesian product, ensure that only relevant data participates in calculation, reduce calculation errors caused by irrelevant data interference, and improve the robustness of multi-dimensional data calculation.
[0044] Specifically, the target data item is final data that needs to be generated through calculation, for example, "subject: electricity fee" is calculated from "unit price" and "quantity". The data source item is a field or dimension combination in the multi-dimensional database that provides original input values, for example, "subject: unit price", "subject: quantity", and "organization: region 1", which represents the relationship between the unit price and the quantity of electricity fee in different regions in the multi-dimensional database. According to the attribute information of the plurality of data source items and the target data item, the plurality of data items involved in the calculation process are limited, and the target data item and the data source item are in a recursive topological relationship with each other. The calculation range is determined by limiting the boundary of the recursive topological relationship, so as to exclude the interference of irrelevant data in the multi-dimensional database and improve the overall efficiency of multi-dimensional data calculation. Through calculation range definition, effective data screening, logical path construction, and dynamic calculation of each path, the calculation of redundant data is reduced, and the performance of multi-dimensional data calculation is improved. Through independent processing of each path, the flexibility and robustness of the multi-dimensional data processing process are enhanced.
[0045] Optionally, the data source item and the target data item include a hierarchical relationship or a business logic relationship, and the hierarchical relationship and the business logic relationship are obtained through system preset.
[0046] Optionally, the calculation range automatically identifies high-frequency dimension combinations based on data distribution, and the high-frequency dimension combinations are included in the calculation range. The high-frequency dimension threshold is determined by the average value of the number of occurrences of all data items in the multi-dimensional database. When the number of occurrences of a data item exceeds the high-frequency dimension threshold, it is determined that the data item and the data item associated with the data item are a high-frequency dimension combination.
[0047] Optionally, the calculation result supports multi-format output, for example, table, visual chart, and lightweight data exchange format (JavaScript Object Notation, JSON).
[0048] Optionally, in a case where a plurality of multi-dimensional data calculation results are determined, the plurality of multi-dimensional data calculation results are automatically summarized according to the topological relationship, and the plurality of multi-dimensional data calculation results are rechecked after being summarized, error items are determined and marked for deletion.
[0049] In some embodiments, optionally, as Figure 2As shown, the calculation range is determined according to the data source item and the target data item, including: Step S1020: attribute information of the plurality of data items is determined. Step S1022: hierarchical relationship information of the data source item and the target data item is determined according to the attribute information. Step S1024: the calculation range is determined according to the hierarchical relationship information.
[0050] In this embodiment, the attribute information is the inherent characteristics of the data items, including data type, dimension information and business label. According to the data type, dimension information and business label in the attribute information, the membership or aggregation relationship between the plurality of data items is determined, and the hierarchical relationship information between the data source item and the target data item is determined according to the membership or aggregation relationship. The recursive topological relationship between the target data item and the data source item is determined through the hierarchical relationship information, the boundary of the recursive topological relationship is taken as the boundary of the calculation range, and the calculation range corresponding to the target data item in the multidimensional database is determined.
[0051] It can be understood that by determining the attribute information and the hierarchical relationship information of the plurality of data items, the matching rule of the data source item and the target data item is determined, cross-level or cross-type errors are avoided, and the robustness in the automatic calculation process of the system is improved.
[0052] Further, through the progressive logic of attribute definition, hierarchical association and range screening, the associated data of the target data item in the multidimensional database is determined, which can be applied to various different business scenarios or multidimensional data calculation types, improves the adaptability of multidimensional data calculation, and can flexibly adapt to the calculation requirements of different business scenarios.
[0053] Specifically, the attribute information is preset information of the system, and each dimension of the dimension information in the attribute information represents a dimension used to analyze the target data item. For example, in the regional dimension, a province includes a plurality of cities, A city and B city belong to S province, and the corresponding hierarchical relationship is a recursive topological relationship. The time dimension includes attributes such as day, week and month. In the process of processing the target data item of “electricity fee” of “B city”, not only the subject “unit price” and the subject “quantity” are data source items, but also the data items related to the time dimension are data source items, which are used to determine the “unit price” and “quantity” corresponding to “electricity fee” in a period of time.
[0054] Exemplarily, the data type includes numerical type, text type and other data types; the dimension information includes time, organization, product and other dimension information; and the business label includes cost item, income item and other business labels.
[0055] Optionally, after determining the hierarchical relationship information of the target data item and the data source item, a recursive topological relationship graph is determined according to the recursive topological relationship between the target data item and the data source item, and the calculation range is displayed in the recursive topological relationship graph.
[0056] In some embodiments, as shown in FIG. 12, the calculation range is determined according to the hierarchical relationship information, including: Figure 3 Step S10240: determining the association path of the target data item and the data source item according to the hierarchical relationship information. Step S10242: determining the calculation range according to the plurality of association paths.
[0057] In this embodiment, the membership or aggregation relationship between the plurality of data items is determined according to the data type, the dimension information and the business label in the attribute information, and the hierarchical relationship information between the data source item and the target data item is determined according to the membership or aggregation relationship. By defining the membership logic of the data source item to the target data item, a structured basis is provided for the generation of the association path. Based on the hierarchical relationship information, the specific mapping path of the data source item to the target data item, i.e., the association path, is determined. Through the association path, the calculation dependency relationship between the data source item and the target data item can be clearly determined, the logical link of data flow is limited, and the calculation range is determined, thereby reducing the data processing amount in the multidimensional data calculation database and the calculation omission problem caused by the hierarchical confusion in multidimensional calculation, and improving the robustness of multidimensional data calculation.
[0058] Optionally, the recursive topological relationship is determined through the association path between the target data item and the plurality of data source items, i.e., the recursive topological relationship includes the association path between the target data item and the data source item.
[0059] Further, the boundary of the recursive topological relationship is determined through the determination of the association path between the target data item and the plurality of data source items. That is, the boundary of the recursive topological relationship is determined by determining the maximum value of the association path in the same dimension information, and the calculation range of the target data item in the multidimensional database is determined according to the boundary of the recursive topological relationship.
[0060] Further, after the system obtains the plurality of data items, the mapping relationship between each field in the data item and the dimension information, the data type and the business label is automatically established. For example, in the case of the data item being electricity fee, the regional dimension and the time dimension related information are determined according to the data source corresponding to the data item, and the data type is determined as numerical type and the business label is determined as expenditure item. After determining the mapping relationship between each field in the data item and the dimension information, the data type and the business label, the data item is stored in the multidimensional database, providing an information basis for subsequent determination of the association path and the calculation range.
[0061] Further, by determining the way of calculating the range of the target data item in the multidimensional database, the effective data related to the target data item is screened out, that is, the effective data related to the target data item is in the calculation range, and the data items outside the calculation range are irrelevant data. By screening and filtering the multidimensional data, the situation of calculation expansion caused by too much data is avoided, the irrelevant data in the calculation process is removed, the calculation error caused by irrelevant data interference is reduced, and the robustness of multidimensional data calculation is improved.
[0062] Optionally, the association path between the target data item and the data source item includes a plurality of association nodes, the association nodes are determined as secondary data source items of the target data item, and the plurality of association nodes are marked.
[0063] Optionally, the association between the target data item and the data source item is a parent-child membership relationship, cross-level or reverse association is prohibited, the target data item is a parent node, the data source item is a child node, the same child node is associated with a plurality of parent nodes, and a mesh hierarchical structure is formed.
[0064] Optionally, when a closed loop appears in the association path between the target data item and the data source item, the calculation of the association path is interrupted and an alarm is marked.
[0065] In some embodiments, as shown in FIG. 10, the logical calculation path of the data source item to the target data item in the effective data set is determined, including: Figure 4 Step S1060: determining the target calculation logic corresponding to the target data item according to the attribute information and the hierarchical relationship information; Step S1062: determining a plurality of target calculation sequences according to the target calculation logic; Step S1064: determining the target data source item corresponding to the plurality of target calculation sequences in the calculation range; Step S1066: determining the logical calculation path according to the target data source item, the target data item and the target calculation logic.
[0066] In this embodiment, the attribute information is the inherent characteristics of the data item, including data type, dimension information and business label, and the attribute information is the basis for providing the calculation logic, for example, the target data of the "cost item" can only be generated by the source data of the "cost item"; the attribute information of the target data item "electricity fee" is: numerical type, dimension = "account", business label = "cost item". The hierarchical relationship information is determined by the recursive topological relationship between the data items, ensuring that the multi-dimensional data calculation process is always within the calculation range and will not cross the hierarchy or cross-type calculation. The target calculation logic from the multiple data source items to the target data item is determined by the attribute information and the hierarchical relationship information, and the target calculation logic includes mathematical formulas or business rules such as formulas, aggregation methods or conditional expressions. Each association path corresponds to a target calculation logic. The target calculation sequence is a distributed calculation order decomposed based on the target calculation logic, and the purpose is to split the association path between the target data item and the multiple data source items into independent executable calculation operations, and to sort the multiple calculation operations to determine the logical calculation path according to the sorting order. The logical calculation path is a complete calculation link from the target data item to the multiple data source items, and the logical calculation path includes data input, calculation logic, output target and calculation order. The logical calculation path supports non-contrast slicing, for example, only calculating part of the hierarchical path, which is used to adapt to different business needs.
[0067] It can be understood that the way of determining the target calculation logic corresponding to the target data item through the attribute information and the hierarchical relationship information, explicitly specifies the mathematical formula or business rule used by each association path, and determines the calculation order according to the hierarchical relationship, that is, the target calculation sequence. According to the way of determining the logical calculation path according to the target calculation sequence and the multiple data items, it is clear how the target data is calculated by the source data, the calculation method of the target data is determined, and the complex multi-dimensional calculation is divided into a standardized and configurable process, improving the accuracy and flexibility of multi-dimensional data calculation, and laying the foundation for subsequent dynamic adjustment and data cleaning.
[0068] Optionally, the target calculation logic and the logical calculation path of the high-frequency calculation sequence are cached, and in the case that the target data item and the target data item corresponding to the high-frequency calculation sequence match, the cached data is used as a preset value.
[0069] Optionally, the calculation result corresponding to the logical calculation path is continuously abnormal, for example: the variance exceeds the threshold, temporarily disable the abnormal logical calculation path, and mark the data source item corresponding to the logical calculation path.
[0070] In some embodiments, as shown in Figure 5 Before the multiple logical calculation paths are calculated and the multi-dimensional data calculation result is determined, the method further includes: Step S1070: determining a target source parameter corresponding to the target data source item; Step S1072: determining the data type of the target data source item according to the target source parameter; Step S1074: determining that the logical calculation path corresponding to the second data type is a hollow path.
[0071] In this embodiment, the target source parameter corresponds to the attribute information of the target data source item, and the target source parameter is used to determine whether the data item is a hollow data. Specifically, the first data type is a valid data source item meeting the preset parameter requirement, and the second data type is a data source item not meeting the preset parameter requirement, including a hollow value, a data item exceeding a reasonable range, or an undefined data item. The first data type indicates that the data of the corresponding data source item is available, and the second data type indicates that the corresponding data source item is empty. When the system detects the data source item of the second data type, it is determined that the logical calculation path generated by the invalid data source item is a hollow path.
[0072] It can be understood that, by distinguishing between valid data and invalid data, a classification basis is provided for subsequent path processing, invalid data or hollow data is avoided from participating in multi-dimensional data calculation, calculation resource waste is reduced, and the efficiency and practicality of multi-dimensional data calculation are improved.
[0073] For example, when the data source item "unit price=-10", it is determined that the corresponding data type is the second data type, and the logical calculation path corresponding to the target data item "electricity charge" = "unit price x quantity" is marked as a hollow path.
[0074] For example, when the data source item "unit price=null", it is determined that the corresponding data type is the second data type, and the logical calculation path corresponding to the target data item "electricity charge" = "unit price x quantity" is marked as a hollow path.
[0075] Further, the hollow path is marked and deleted in the plurality of logical calculation paths, so as to avoid the error results of hollow data mixed into the logical calculation process, and to avoid the occurrence of subsequent logical calculation errors.
[0076] Optionally, the system includes backup data, and when the second data type is a hollow value data, the hollow value data is completed from the backup data or the associated path corresponding to the data source item, to realize automatic repair of the hollow path.
[0077] Optionally, a prediction model is trained through historical data and a linear regression equation, the prediction model can predict high-frequency hollow paths and mark the corresponding data source items, to remind the user to supplement the data of the data source items.
[0078] Optionally, the data type and classification rule of the target data source item are dynamically adjusted according to the business requirement. For example, in the enterprise promotion scenario, "unit price =-10" is a promotion discount gift, which is used for bundled sale at a discount, and the corresponding data type is the first data type. That is, the first data type includes the second data type, and the number of data source items of the first data type can be adjusted by adjusting the rule corresponding to the second data type.
[0079] In some embodiments, as shown in FIG. 10, Figure 6 The method comprises the following steps: Step S1080: determining the execution calculation sequence corresponding to the target data item according to the target calculation sequence and the hollow path; Step S1082: calculating the multiple logical calculation paths according to the execution calculation sequence to determine the multidimensional data calculation result.
[0080] In this embodiment, after determining the hollow path, the original target calculation sequence is adjusted, that is, at least one hollow path is deleted from the target calculation sequence to determine the execution calculation sequence. The original calculation order is adjusted, the execution calculation order is determined by the execution calculation sequence, the calculation results of the multiple logical calculation paths are determined, and the multidimensional data calculation result is determined according to the execution calculation order and the multiple calculation results.
[0081] It can be understood that by eliminating the hollow path, only the effective calculation path is executed, and the invalid calculation amount is reduced. After deleting at least one hollow path, the original calculation order is dynamically adjusted to cope with data abnormalities or missing, and the accuracy and efficiency of multidimensional data calculation are improved.
[0082] Optionally, when the load of the calculation node is too high, part of the execution calculation sequence is moved to the idle calculation node, and the high-frequency access path is preferentially executed.
[0083] Optionally, during the calculation of the multiple logical calculation paths according to the execution calculation sequence, if the calculation result of the logical calculation path conflicts with the calculation result of the associated path corresponding thereto, an alarm is triggered and the calculation of the corresponding multiple associated paths is suspended. For example, according to the calculation result of the multiple logical calculation paths, it is determined that the "branch sales" is greater than the "national sales", and the associated path corresponding to the "branch sales" is suspended and an alarm is triggered.
[0084] Optionally, the user can manually cancel the calculation disablement of at least one hollow path during the system calculation process.
[0085] In one specific embodiment, the multidimensional data calculation method comprises the following steps: Step One: Scope Definition - The purpose is to clarify the data range and target of the entire calculation process, ensuring that all relevant data sources and targets are included, while excluding irrelevant data.
[0086] Identify Data Sources (Data Source Items) and Targets (Target Data Items): First, clarify which data items will be used for calculation (Data Sources) and the data that needs to be generated in the end (Targets).
[0087] Define Scope: Incorporate data sources and targets into a well-defined calculation scope.
[0088] For example: Scope( ‘Organization’ : [‘Region One’, ‘Region Two’, ‘Region Three’, ‘Region Four’], ‘Subject’ : [‘Unit Price’, ‘Quantity’], ); Within the scope, the target and source data will be managed and calculated together.
[0089] Through scope definition, ensure that all relevant data is included, avoiding omissions and repetitions; limit data range, reduce unnecessary calculations, and improve overall efficiency; ensure that all relevant data is considered, improving the accuracy of the calculation results.
[0090] Step Two: Preliminary Filtering - The purpose is to further filter out effective data related to the target and source, avoiding the problem of calculation expansion caused by excessive data.
[0091] Identify Relevant Data: According to the definition of the target and source, identify the data items related to them.
[0092] Apply Filtering Rules: According to the target and source, filter out the existing multi-dimensional data paths in the existing multi-dimensional data, and remove invalid data.
[0093] Through preliminary filtering, remove irrelevant data, significantly reduce the amount of data to be processed, and improve calculation efficiency; prevent the increase in calculation complexity caused by excessive data, avoid the problem of calculation expansion caused by Cartesian product; ensure that only relevant data participates in the calculation, reducing calculation errors caused by irrelevant data interference.
[0094] Step Three: Build Target Path - The purpose is to clarify the specific calculation path from data sources to target data, ensuring that the path needs to be calculated in the calculation process.
[0095] Define Calculation Logic: Clarify how the target data is calculated from the source data. For example, the target data “Subject: Electricity” may be the product of “Subject: Unit Price” and “Subject: Quantity”.
[0096] Explicit calculation logic: By constructing target paths, the calculation method of target data is determined.
[0097] Step four: Calculate each target path independently to dynamically determine the calculation results and behavior on the right side, ensuring the accuracy and flexibility of the calculation results.
[0098] Execute calculation logic: According to the definition of the target path, perform specific calculation operations. For example, dynamically calculate the "electricity fee" value for each target path.
[0099] Dynamic adjustment of calculation behavior: dynamically adjust the calculation behavior according to the situation encountered during the calculation process, ensuring the flexibility and adaptability of the calculation results.
[0100] Through the way of calculating each piece, the problem of asymmetric slice calculation is solved; when the source data is empty, the target data has the problem of cleaning the target data with numbers.
[0101] Through the multi-dimensional data calculation method, not only the efficiency of multi-dimensional data calculation is improved, but also the practicality in different scenarios is enhanced, which is suitable for various multi-dimensional data calculation application scenarios.
[0102] Exemplarily, Scope( ‘Organization’ : [‘Region One’, ‘Region Two’, ‘Region Three’, ‘Region Four’], ‘Subject’ : [‘Unit Price’, ‘Quantity’], ) ; ‘Subject’ : ‘Electricity Fee’ = { $(‘Subject’ : ‘Unit Price’) × $(‘Subject’ : ‘Quantity’), }; endScope(); 1. Target scope: ‘Subject’ : ‘Electricity Fee’; 2. Source scope: ‘Subject’ : [‘Unit Price’, ‘Quantity’]; 3. Valid data: determine the multi-dimensional data with numerical values in the target scope; 4. Target path: combination of target multi-dimensional data.
[0103] Table 1
[0104] As shown in Table 1, the organization includes: region one, region two, region three and region four, the subject includes: unit price and quantity, and the electricity fee is the target. Wherein, the unit price corresponding to region one is 2, the quantity is 2, and the electricity fee is 4; the unit price corresponding to region two is 5, the quantity is 5, and the electricity fee is 25; the unit price corresponding to region three is "empty", the quantity is "empty", and the electricity fee corresponding to region three is emptied; the unit price corresponding to region four is "empty", the quantity is "empty", and the unit price is "empty", so the electricity fee corresponding to region four does not participate in the calculation.
[0105] As shown in Table 1, the organization includes: region one, region two, region three and region four, the subject includes: unit price and quantity, and the electricity fee is the target. Wherein, the unit price corresponding to region one is 2, the quantity is 2, and the electricity fee is 4; the unit price corresponding to region two is 5, the quantity is 5, and the electricity fee is 25; the unit price corresponding to region three is "empty", the quantity is "empty", and the electricity fee corresponding to region three is emptied; the unit price corresponding to region four is "empty", the quantity is "empty", and the unit price is "empty", so the electricity fee corresponding to region four does not participate in the calculation. Figure 7 As shown in Table 1, the organization includes: region one, region two, region three and region four, the subject includes: unit price and quantity, and the electricity fee is the target. Wherein, the unit price corresponding to region one is 2, the quantity is 2, and the electricity fee is 4; the unit price corresponding to region two is 5, the quantity is 5, and the electricity fee is 25; the unit price corresponding to region three is "empty", the quantity is "empty", and the electricity fee corresponding to region three is emptied; the unit price corresponding to region four is "empty", the quantity is "empty", and the unit price is "empty", so the electricity fee corresponding to region four does not participate in the calculation.
[0106] The multi-dimensional data computing device 900 provided by the application calculates the target data item in the multi-dimensional database, determines all data source items related to the target data item in the multi-dimensional database, and includes the plurality of data source items and the target data item in the calculation range. The calculation range formed by the plurality of data source items and the target data item is preliminarily filtered, and the effective data related to the target data item and the data source item in the multi-dimensional database is further screened to determine the effective data set, thereby avoiding the problem of calculation expansion caused by excessive data. After determining the effective data set, the specific calculation path from the data source item to the target data item is determined, the logical calculation path is constructed, the path that needs to be calculated in the calculation process is ensured, and the target data item is calculated through the data source item through the logical calculation path, that is, the calculation method of the target data item is determined. And the plurality of logical calculation paths are independently calculated, according to the definition of the logical calculation path, the calculation operation corresponding to each logical calculation path is executed, and in the actual calculation process, the calculation behavior is dynamically adjusted to determine the multi-dimensional data calculation result corresponding to the target data item. The multi-dimensional data computing device 900 realizes the multi-dimensional data computing method, and improves the overall efficiency and robustness of multi-dimensional data calculation.
[0107] Specifically, the determining module 902 is configured to accept a user instruction, determine a target data item corresponding to the user instruction in a plurality of data items and a plurality of data source items associated with the target data item, the target data item being final data to be generated by calculation, and the data source item being a field or dimension combination in the multidimensional data providing an original input value. The range module 904 is configured to determine a calculation range, determine a membership or aggregation relationship between the plurality of data items, and determine hierarchical relationship information between the data source item and the target data item according to the membership or aggregation relationship. A recursive topological relationship between the target data item and the data source item is determined through the hierarchical relationship information, a boundary of the recursive topological relationship is taken as a boundary of the calculation range, and a calculation range corresponding to the target data item in the multidimensional database is determined. The filtering module 906 is configured to filter the plurality of data items according to the calculation range. The path module 908 is configured to determine a target calculation logic from the plurality of data source items to the target data item through the attribute information and the hierarchical relationship information, the target calculation logic including a mathematical formula or a business rule such as a formula, an aggregation method or a conditional expression, and each associated path corresponding to a target calculation logic. The target calculation sequence is a distributed calculation order decomposed based on the target calculation logic, and the purpose is to split the associated path between the target data item and the plurality of data source items into independent executable calculation operations, and to sort the plurality of calculation operations to determine a logical calculation path according to the sorting order. The calculation module 910 is configured to adjust the original target calculation sequence after determining the hollow path, that is, delete at least one hollow path in the target calculation sequence, and determine an execution calculation sequence. The original calculation sequence is adjusted, the execution calculation sequence is determined by executing the execution calculation sequence, the calculation results of the plurality of logical calculation paths are determined, and the multidimensional data calculation result is determined according to the execution calculation sequence and the plurality of calculation results.
[0108] As shown in Figure 8 The embodiment of the application also provides an electronic device 1000, which comprises a processor 1110, a memory 1109, a program or instruction stored on the memory 1109 and executable on the processor 1110. When the program or instruction is executed by the processor 1110, the processes of the above-mentioned embodiment of the multidimensional data calculation method are implemented, and the same technical effects are achieved. To avoid repetition, details are not described here.
[0109] Optionally, the processor 1110 is configured to determine a plurality of data items in the multidimensional data, the data items including data source items and a target data item. Optionally, the processor 1110 is further configured to determine a calculation range according to the data source items and the target data item. Optionally, the processor 1110 is further configured to filter a plurality of the data items according to the calculation range to determine an effective data set. Optionally, the processor 1110 is further configured to determine a logical computing path of the data source item to the target data item in the effective data set. Optionally, the processor 1110 is further configured to determine a multi-dimensional data computing result by computing the plurality of logical computing paths.
[0110] The memory 1109 can be configured to store software programs and various data. The memory 1109 can mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area can store an operating system, application programs or instructions required by at least one function (such as a sound playing function, an image playing function, etc.), and the like. In addition, the memory 1109 can include a volatile memory or a non-volatile memory, or the memory 1109 can include both a volatile memory and a non-volatile memory. The non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM), a Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDR SDRAM), an Enhanced SDRAM (ESDRAM), a Synch link DRAM (SLDRAM), and a Direct Rambus RAM (DRRAM). The memory 1109 in the embodiments of the present application includes but is not limited to these and any other suitable types of memories.
[0111] The embodiments of the present application further provide a readable storage medium, and the readable storage medium stores programs or instructions, which are executed by a processor to implement various processes of the above multi-dimensional data computing method embodiments and achieve the same technical effects. To avoid repetition, details are not described herein. In addition, the readable storage medium improves the data storage capacity and data processing speed of the multi-dimensional data computing method in the present application.
[0112] The readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media, or electrical signals transmitted through a wire.
[0113] The processor is a processor in the electronic device in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like.
[0114] The chip provided by the embodiment of the present application includes a processor and a communication interface. The communication interface is coupled with the processor. The processor is used to run programs or instructions to realize the processes of the above multi-dimensional data calculation method embodiments and achieve the same technical effects. To avoid repetition, details are not described herein. In addition, the chip improves the data processing speed of the multi-dimensional data calculation method in the present application.
[0115] It should be understood that the chip mentioned in the embodiments of the present application can also be referred to as a system-level chip, a system chip, a chip system, or a system-on-chip, etc.
[0116] In the present application, the terms "first", "second", "third" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance; the term "multiple" refers to two or more, unless otherwise explicitly limited. The terms "mounting", "connecting", "connecting", "fixing" and the like should be understood in a broad sense, for example, "connecting" can be fixed connection, or detachable connection, or integrally connected; "connected" can be directly connected, or indirectly connected through an intermediate medium. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0117] In the description of the application, it should be understood that the terms "upper", "lower", "left", "right", "front", "rear", and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the purpose of facilitating the description of the application and simplifying the description, and do not indicate or imply that the device or unit referred to must have a particular direction, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the application.
[0118] In the description of the present application, the description of the terms "one embodiment", "some embodiments", "a specific embodiment" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present application, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0119] The above is only the preferred embodiment of the present application, and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A multidimensional data calculation method, characterized in that: include: Determining a plurality of data items in the multidimensional data, wherein the data items include data source items and target data items; Determine a calculation range according to the data source item and the target data item; Screening the plurality of data items according to the calculation range to determine a valid data set; Determining a logical calculation path from the data source item to the target data item in the valid data set; The plurality of logical calculation paths are calculated one by one to determine a multi-dimensional data calculation result.
2. The multidimensional data calculation method according to claim 1, characterized in that: The determining of the calculation range according to the data source item and the target data item includes: determining attribute information of a plurality of the data items; Determining hierarchical relationship information between the data source item and the target data item according to the attribute information; The calculation range is determined according to the hierarchical relationship information.
3. The multidimensional data calculation method according to claim 2, characterized in that: The determining of the calculation range according to the hierarchical relationship information includes: Determine an association path between the target data item and the data source item according to the hierarchical relationship information; A calculation scope is determined according to the plurality of associated paths.
4. The multidimensional data calculation method according to claim 2, characterized in that: Determining a logical calculation path from the data source item to the target data item in the valid data set includes: determining a target calculation logic corresponding to the target data item according to the attribute information and the hierarchical relationship information; determining a plurality of target calculation sequences according to the target calculation logic; determining target data source items corresponding to a plurality of target calculation sequences within the calculation range; A logical calculation path is determined according to the target data source item, the target data item, and the target calculation logic.
5. The multidimensional data calculation method according to claim 4, characterized in that: Before calculating the plurality of logical calculation paths one by one to determine the multidimensional data calculation result, the method further includes: determining a target source parameter corresponding to the target data source item; Determine a data type of the target data source item according to the target source parameter, where the data type includes a first data type and a second data type; Determine that the logical calculation path corresponding to the second data type is a hollow path.
6. The multidimensional data calculation method according to claim 5, characterized in that: The step of calculating the plurality of logical calculation paths one by one to determine a multi-dimensional data calculation result includes: Determine an execution calculation sequence corresponding to the target data item according to the target calculation sequence and the hole path; Calculate the plurality of logic calculation paths according to the execution calculation sequence to determine a multi-dimensional data calculation result.
7. A multidimensional data computing device, characterized in that: include: A determination module, configured to determine a plurality of data items in the multidimensional data, wherein the data items include data source items and target data items; A range module, configured to determine a calculation range based on the data source item and the target data item; A filtering module, configured to filter the plurality of data items according to the calculation range to determine a valid data set; A path module, configured to determine a logical calculation path from the data source item to the target data item in the valid data set; The calculation module is used to calculate the plurality of logical calculation paths one by one to determine the multi-dimensional data calculation results.
8. An electronic device, characterized in that: The method comprises a processor, a memory and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the multidimensional data calculation method according to any one of claims 1 to 6.
9. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the multi-dimensional data calculation method according to any one of claims 1 to 6 are implemented.
10. A chip, characterized in that: The chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the steps of the multi-dimensional data calculation method according to any one of claims 1 to 6.
Citation Information
Cited By
A storage controller and data pattern detection system, method thereof
CN122511329A