Multidimensional model convolution calculation method, device, readable storage medium and electronic device
By determining dimension tables and fact tables on the relational database and generating convolution weight precalculation tables, convolutional calculations of multi-dimensional models are solved, and the high cost and technical difficulty problems of enterprises are solved when processing multi-dimensional business data, and the different Data processing requirements for dimensions.
Patent Information
- Application Number
- CN202111348191.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-15
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2041-11-15
AI Technical Summary
In the prior art, it is difficult for enterprises to effectively support the design of multidimensional data models when processing multidimensional business data, resulting in high cost and technical difficulty. The main data archives in relational databases and multidimensional business data are highly correlated, which is difficult to separate, affecting the data. Aggregation processing on different dimensions.
Provide a multi-dimensional model convolution calculation method, determine dimension tables and fact tables through the storage structure of the relational database, generate convolution weight pre-calculation tables based on the aggregation level relationship, and realize convolution calculations of multi-dimensional models without reconstructing the multi-dimensional database. Meet data processing needs in different dimensions.
It reduces the investment cost of processing multi-dimensional business data, simplifies the difficulty of technological improvement, realizes multi-dimensional model calculation on the original relational database, and meets users' aggregation processing needs for data in different dimensions.
Smart Images

Figure CN114064646B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a multi-dimensional model convolution calculation method, device, readable storage medium and electronic device. Background Art
[0002] In the existing technology, enterprises pay more attention to the multidimensional attributes of business data and hope to aggregate and process the data from multiple angles. Therefore, the underlying data structure of business data is required to support the design concept of multidimensional data model. At the same time, the aggregation processing of data in different dimensions is very urgent.
[0003] The use of a multidimensional database will incur additional costs from procurement to operation and maintenance management, and requires a high level of technical content; at the same time, the master data files and multidimensional business data in the enterprise's relational database are usually highly correlated and difficult to separate, making it inconvenient to establish a multidimensional database. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art or related art.
[0005] To this end, a first aspect of the present invention is to provide a multi-dimensional model convolution calculation method;
[0006] A second aspect of the present invention is to provide a multi-dimensional model convolution computing device;
[0007] A third aspect of the present invention is to provide a readable storage medium;
[0008] A fourth aspect of the present invention provides an electronic device.
[0009] In view of this, according to a first aspect of the present invention, a multidimensional model convolution calculation method is provided, including: determining a dimension table and a fact table of a multidimensional model according to a storage structure of a relational database, wherein the relational database is a database used by users to store data; determining a convolution weight pre-calculation table according to an aggregation hierarchical relationship of multiple members in the dimension table, wherein the aggregation hierarchical relationship is used to indicate a superior-subordinate relationship and a first weight of multiple members in the dimension table; determining, according to a first instruction, first data for performing convolution calculation based on the fact table, and determining second data for performing convolution based on the convolution weight pre-calculation table; performing convolution calculation based on the first data and the second data to obtain a multidimensional model convolution calculation result.
[0010] The multidimensional model convolution calculation method provided by the present invention first obtains a relational database, which is a database used by users to store business data, and then determines the dimension table and fact table of the multidimensional model according to the storage structure of the relational database. Specifically, the relational database usually contains a master data table and a business data table. The master data table in the relational database is used as the dimension table, and the business data table in the relational database is used as the fact table to ensure that the storage structure of the original master data table and the business data table is not affected. The above-mentioned multidimensional model is generally set to a star structure, that is, the fact table is in the middle, and multiple dimension tables are connected along the radius, which is convenient for business personnel to perform multidimensional analysis on the members in the dimension table.
[0011] Further, according to the aggregation hierarchical relationship of multiple members in the dimension table, a convolution weight pre-calculation table is determined. Specifically, the aggregation hierarchical relationship is used to indicate the superior-subordinate relationship and the first weight of multiple members in the dimension table. It can be understood that the association relationship of multiple members in the dimension table can be understood according to the superior-subordinate relationship, such as: member A is the superior of member B, member C is the last level of member A, etc.; the first weight is determined based on the needs of the user, and is used to indicate the proportion of the contribution of the subordinate member to the superior member. For example: member A is the superior of member B, member B is 10, when determining member A, the contribution ratio is 0.4, and the value contributed by member B to member A is 10 times 0.4. The contribution ratio value 0.4 here is the above-mentioned first weight. The convolution weight pre-calculation table determined according to the superior-subordinate relationship and the first weight of multiple members in the dimension table can accurately determine the association relationship of multiple members in the dimension table and the contribution ratio between different members with an association relationship.
[0012] Further, according to the first instruction, the first data for performing the convolution calculation is determined based on the fact table, and the second data for performing the convolution is determined based on the convolution weight pre-calculation table. Specifically, the first instruction is used to indicate the calculation logic for performing the convolution calculation of the multidimensional model, which includes the target member to be calculated and the dimensions on which the convolution calculation is performed on the target member. Specifically, the first data is determined based on the target member in combination with the fact table, and the second data is determined based on the target member in combination with the convolution weight pre-calculation table.
[0013] Furthermore, a convolution calculation is performed based on the first data and the second data to obtain a multi-dimensional model convolution calculation result.
[0014] It should be noted that the first instruction may include multiple target members that need to be calculated. When the first instruction includes multiple target members, the first data set used to perform the convolution calculation is determined according to the fact table, and the second data set used to perform the convolution is determined according to the convolution weight pre-calculation table. Specifically, the convolution calculation is performed according to the first data set and the second data set, and a multi-dimensional model convolution calculation result set is obtained, which realizes that the multi-dimensional model convolution calculation results of multiple target members can be obtained according to one instruction.
[0015] The multidimensional model convolution calculation method provided by the present invention does not require the reconstruction of the multidimensional database, and can realize the calculation of multidimensional model convolution based on the original relational database, thereby meeting the user's needs to process data in different dimensions, while reducing the difficulty of technical improvement and reducing the user's investment cost in processing multidimensional business data.
[0016] In addition, the multi-dimensional model convolution calculation method provided by the above technical solution of the present invention also has the following additional technical features:
[0017] In the above technical scheme, the convolution calculation result of the multidimensional model specifically includes: first result information, the first result information is used to indicate the specific value of the target member among multiple members in the dimensional table in the multidimensional model; second result information, the second result information is used to indicate the dimension information of the first result information in the multidimensional model.
[0018] In this technical solution, the convolution calculation result of the multidimensional model includes first result information and second result information, wherein the first result information is used to indicate the specific value of the target member among multiple members in the dimensional table in the multidimensional model, that is, the required specific value of the target member, and the second result information is used to indicate the dimensional information of the first result information in the multidimensional model, so that the user can understand the dimensional information of the target member based on the convolution calculation result of the multidimensional model.
[0019] In the above technical solution, the superior-subordinate relationship includes a first association relationship and a second association relationship. The step of determining the convolution weight pre-calculation table according to the aggregation level relationship of multiple members in the dimension table specifically includes: generating an aggregation structure additional table according to the first association relationship and the first weight, wherein the first weight is set based on user needs, and the first association relationship is used to indicate the relationship between any group of superior members and subordinate members in the dimension table; determining the convolution weight pre-calculation table according to the second association relationship and the aggregation structure additional table, wherein the second association relationship is used to indicate the relationship between any group of target members and the last-level members in the dimension table.
[0020] In this technical solution, the superior-subordinate relationship includes a first association relationship and a second association relationship. Specifically, the first association relationship is used to indicate the relationship between any group of superior members and subordinate members in the dimension table, and the second association relationship is used to indicate the relationship between any group of target members and the last member in the dimension table.
[0021] Furthermore, based on the first association relationship and the first weight, an aggregation structure additional table is constructed. Specifically, the upper and lower members with a relationship are filled into the aggregation structure additional table, and then the first weight set according to user needs is filled into the corresponding position to generate the aggregation structure additional table.
[0022] Furthermore, according to the second association relationship and the aggregation structure additional table, a convolution weight pre-calculation table is determined. Specifically, according to the second association relationship, the target member and the corresponding last-level member are filled into the convolution weight pre-calculation table, and then the members corresponding to the target member and the last-level member are screened out from the aggregation structure additional table, and multiple first weights corresponding to them are determined. The multiple first weights are processed to determine the proportion of the contribution of the last-level member to the target member, so as to determine the convolution weight pre-calculation table.
[0023] In the above technical solution, the step of determining the convolution weight pre-calculation table according to the second association relationship and the aggregation structure additional table specifically includes: generating a structure tree according to the aggregation structure additional table, wherein the structure tree includes multiple first paths, each first path includes at least one second path, the first path is a path composed of a target member and a last-level member, the second path is a path composed of any group of upper members and lower members in the dimension table, and the second path corresponds to a first weight; determining the second weight according to the first weight corresponding to the second path in the first path; and determining the convolution weight pre-calculation table according to the second association relationship and the second weight.
[0024] In this technical solution, a structure tree is constructed according to the aggregation structure additional table. According to the structure tree combined with the second association relationship, the first path consisting of the target member and the last-level member can be clearly determined, and the second path consisting of the upper-level member and the lower-level member included in the first path can be determined. Each first path corresponds to a first weight.
[0025] Specifically, a second weight is determined according to a first weight corresponding to at least one second path included in the first path, and the second weight is a proportional value of the contribution of the last-level member to the target member.
[0026] Further, according to the second association relationship, the target member and the corresponding last-level member are determined and filled into the convolution weight pre-calculation table, and then the second weight is filled into the corresponding position to determine the convolution weight pre-calculation table.
[0027] In the above technical solution, the step of determining the second weight according to the first weight corresponding to the second path in the first path specifically includes: judging whether there is a secondary member of the same level in the first path; based on the absence of secondary members of the same level in the first path, using a third weight as the second weight, wherein the third weight is the product of the second weights corresponding to all second paths in the first path; based on the presence of secondary members of the same level in the first path, using a fourth weight as the second weight, wherein the fourth weight is the sum of the products of the first weights corresponding to two second paths associated with each secondary member of the same level in the first path multiplied by the product of the first weights corresponding to the other second paths.
[0028] In this technical solution, it is determined whether there are members of the same level in the first path. When there are no members of the same level in the first path, the product of the second weights corresponding to all second paths in the first path is calculated as the second weight; when there are members of the same level in the first path, the sum of the products of the first weights corresponding to two second paths associated with the members of the same level in the first path and the product of the first weights corresponding to the other second paths are calculated as the second weight.
[0029] In the above technical solution, before generating the aggregate structure additional table according to the first association relationship and the first weight, the multidimensional model convolution calculation method also includes: judging the superior-subordinate relationship of multiple members in the dimension table; not generating the aggregate structure additional table based on the fact that all members in the dimension table are at the same level; generating the aggregate structure additional table based on the fact that multiple members in the dimension table have a superior-subordinate relationship.
[0030] In this technical solution, it is first judged whether there is a hierarchical relationship among multiple members in the dimension table, and then it is determined whether it is necessary to generate an aggregate structure additional table corresponding to the dimension table based on the judgment result. Specifically, if all members in the dimension table are at the same level, the aggregate structure additional table is not generated; if multiple members in the dimension table have a hierarchical relationship, the aggregate structure additional table is generated.
[0031] Specifically, in a relational database, there may be multiple dimension tables without hierarchical relationships between members. Through this technical solution, it is avoided to generate too many useless aggregation structure additional tables based on the above dimension tables, thereby avoiding the waste of storage resources.
[0032] In the above technical solution, the first data is the specific value of the last-level member corresponding to the target member in the dimension table.
[0033] In this technical solution, the first data is the specific value of the last-level member corresponding to the target member in the dimension table. Generally speaking, the data in the fact table is only valid for the last-level member, and the data of non-last-level members is generated in real time by performing convolution calculations on the target member corresponding to the last-level data.
[0034] According to a second aspect of the present invention, a multidimensional model convolution calculation device is provided, including: an acquisition unit, the acquisition unit is used to acquire a relational database and receive a first instruction; a processing unit, the processing unit is used to determine the dimension table and fact table of the multidimensional model according to the storage structure of the relational database, wherein the relational database is a database used by users to store data; according to the aggregation level relationship of multiple members in the dimension table, a convolution weight pre-calculation table is determined; according to the first instruction, first data for performing convolution calculation is determined based on the fact table, and second data for performing convolution is determined based on the convolution weight pre-calculation table; a calculation unit, the calculation unit is used to perform convolution calculation according to the first data and the second data to obtain a multidimensional model convolution calculation result.
[0035] The multidimensional model convolution computing device provided by the present invention obtains a relational database through an acquisition unit. The relational database is a database used by users to store business data. The processing unit is used to determine the dimension table and fact table of the multidimensional model according to the storage structure of the relational database. Specifically, the relational database usually contains a master data table and a business data table. The master data table in the relational database is used as the dimension table, and the business data table in the relational database is used as the fact table to ensure that the storage structure of the original master data table and the business data table is not affected. The above-mentioned multidimensional model is generally set to a star structure, that is, the fact table is in the middle, and multiple dimension tables are connected along the radius, so that business personnel can perform multidimensional analysis on the members in the dimension table.
[0036] The multi-dimensional model convolution calculation device provided by the present invention, the processing unit is also used to determine the convolution weight pre-calculation table according to the aggregation level relationship of multiple members in the dimensional table.
[0037] Specifically, the aggregation hierarchical relationship is used to indicate the superior-subordinate relationship and the first weight of multiple members in the dimension table. It can be understood that the association relationship of multiple members in the dimension table can be understood based on the superior-subordinate relationship, such as: member A is the superior of member B, member C is the last member of member A, etc.; the first weight is determined based on the needs of the user, and is used to indicate the proportion of the contribution of the subordinate member to the superior member. For example: member A is the superior of member B, member B is 10, when determining member A, the contribution ratio is 0.4, and the value contributed by member B to member A is 10 times 0.4. The contribution ratio value 0.4 here is the above-mentioned first weight. The convolution weight pre-calculation table determined based on the superior-subordinate relationship of multiple members in the dimension table and the first weight can accurately determine the association relationship of multiple members in the dimension table and the contribution ratio value between different members with an association relationship.
[0038] Specifically, the superior-subordinate relationship includes a first association relationship and a second association relationship. The first association relationship is used to indicate the relationship between any group of superior members and subordinate members in the dimension table, and the second association relationship is used to indicate the relationship between any group of target members and the last member in the dimension table.
[0039] Furthermore, the processing unit constructs an aggregation structure additional table according to the first association relationship and the first weight, fills the upper and lower members with the relationship into the aggregation structure additional table, and then fills the corresponding positions according to the first weight set by the user to generate the aggregation structure additional table.
[0040] Further, the processing unit generates a structure tree according to the aggregation structure appended table, wherein the structure tree includes multiple first paths, each first path includes at least one second path, the first path is a path composed of a target member and a last-level member, the second path is a path composed of any group of upper-level members and lower-level members in the dimension table, and the second path corresponds to a first weight; the second weight is determined according to the first weight corresponding to the second path in the first path; and the convolution weight pre-calculation table is determined according to the second association relationship and the second weight.
[0041] Specifically, according to the structure tree combined with the second association relationship, the first path consisting of the target member and the last-level member can be clearly determined, and the second path consisting of the upper-level member and the lower-level member included in the first path can be determined, and each first path corresponds to a first weight.
[0042] Furthermore, the processing unit determines a second weight according to a first weight corresponding to at least one second path included in the first path, where the second weight is a proportional value of the contribution of the last-level member to the target member.
[0043] Specifically, determine whether there are secondary members of the same level in the first path; based on the absence of secondary members of the same level in the first path, use the third weight as the second weight, wherein the third weight is the product of the second weights corresponding to all second paths in the first path; based on the existence of secondary members of the same level in the first path, use the fourth weight as the second weight, wherein the fourth weight is the sum of the products of the first weights corresponding to two second paths associated with each secondary member of the same level in the first path multiplied by the product of the first weights corresponding to the other second paths.
[0044] Further, the processing unit determines the target member and the corresponding last-level member according to the second association relationship, fills in the convolution weight pre-calculation table, and then fills the second weight into the corresponding position to determine the convolution weight pre-calculation table.
[0045] The multidimensional model convolution calculation device provided by the present invention, the processing unit is also used to determine the first data for performing convolution calculation based on the fact table according to the first instruction received by the acquisition unit, and determine the second data for performing convolution based on the convolution weight pre-calculation table.
[0046] Specifically, the first instruction is used to indicate the calculation logic of performing multidimensional model convolution calculation, which includes the target member to be calculated and the dimensions on which the convolution calculation is performed on the target member. Specifically, the first data is determined based on the target member in combination with the fact table, and the second data is determined based on the target member in combination with the convolution weight pre-calculation table.
[0047] The multidimensional model convolution calculation device provided by the present invention comprises a calculation unit used to perform convolution calculation according to first data and second data determined by a processing unit to obtain a multidimensional model convolution calculation result.
[0048] It should be noted that the first instruction received by the acquisition unit may include multiple target members that need to be calculated. When the first instruction includes multiple target members, the processing unit determines the first data set for performing the convolution calculation based on the fact table, and determines the second data set for performing the convolution based on the convolution weight pre-calculation table. Specifically, the calculation unit performs the convolution calculation based on the first data set and the second data set, and obtains a multidimensional model convolution calculation result set, which realizes that the multidimensional model convolution calculation results of multiple target members can be obtained according to one instruction.
[0049] The multidimensional model convolution calculation device provided by the present invention can realize the calculation of multidimensional model convolution based on the original relational database without rebuilding the multidimensional database, which meets the user's needs to process data in different dimensions, while reducing the difficulty of technical improvement and reducing the user's investment cost in processing multidimensional business data.
[0050] According to the third aspect of the present invention, a readable storage medium is provided, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the multidimensional model convolution calculation method in any technical solution in the first aspect are implemented. Therefore, all the beneficial technical effects of the multidimensional model convolution calculation method in any technical solution in the first aspect are obtained, and no further details are given here.
[0051] According to the fourth aspect of the present invention, an electronic device is proposed, comprising the multidimensional model convolution calculation device proposed in the second aspect and the readable storage medium proposed in the third aspect, and thus has all the beneficial technical effects of the second and third aspects, which will not be elaborated herein.
[0052] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0054] Figure 1 One of the schematic flow charts of the multi-dimensional model convolution calculation method in the first embodiment of the present invention is shown;
[0055] Figure 2 The second schematic flow chart of the multi-dimensional model convolution calculation method in the first embodiment of the present invention is shown;
[0056] Figure 3 The third schematic flow chart of the multi-dimensional model convolution calculation method in the first embodiment of the present invention is shown;
[0057] Figure 4 A fourth schematic flow chart of the multi-dimensional model convolution calculation method in the first embodiment of the present invention is shown;
[0058] Figure 5 A fifth schematic flow chart of the multi-dimensional model convolution calculation method in the first embodiment of the present invention is shown;
[0059] Figure 6 A schematic block diagram of a multi-dimensional model convolution computing device in a second embodiment of the present invention is shown;
[0060] Figure 7 A schematic block diagram of an electronic device in a fourth embodiment of the present invention is shown;
[0061] Figure 8 A schematic diagram of the multi-dimensional model structure in the first embodiment of the present invention is shown;
[0062] Fig. 9 A schematic diagram of a structure tree in a first embodiment of the present invention is shown;
[0063] in, Figure 6 Figure 7 The corresponding relationship between the reference numerals and component names in the figure is:
[0064] 600 multi-dimensional model convolution calculation device, 602 acquisition unit, 604 processing unit, 606 calculation unit, 700 electronic device, 702 readable storage medium. DETAILED DESCRIPTION
[0065] In order to more clearly understand the above aspects, features and advantages of the present invention, the present invention is further described in detail below in conjunction 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.
[0066] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0067] Refer to the following Figures 1 to 9 , a clear and complete description is given of the multi-dimensional model convolution calculation method, device, readable storage medium, and electronic device of some embodiments of the present invention.
[0068] Embodiment 1
[0069] like Figure 1 As shown, the first embodiment of the present invention provides a multi-dimensional model convolution calculation method. The multi-dimensional model convolution calculation method includes:
[0070] Step S102, determining the dimension table and fact table of the multidimensional model according to the storage structure of the relational database;
[0071] Step S104, determining a convolution weight pre-calculation table according to the aggregation level relationship of multiple members in the dimension table;
[0072] Step S106, according to the first instruction, determining first data for performing convolution calculation based on the fact table, and determining second data for performing convolution calculation based on the convolution weight pre-calculation table;
[0073] Step S108, performing convolution calculation according to the first data and the second data to obtain a multi-dimensional model convolution calculation result.
[0074] The multidimensional model convolution calculation method provided in this embodiment first obtains a relational database, which is a database used by users to store business data. Then, according to the storage structure of the relational database, the dimension table and fact table of the multidimensional model are determined. Specifically, the relational database usually contains a master data table and a business data table. The master data table is used to define several kinds of master data (for example, organizational archives, subject archives, project archives, personnel archives, etc.). The structure of the master data table is usually shown in Table 1. The business data table is associated with the master data table. The structure of the business data table is usually shown in Table 2. The master data table in the relational database is used as the dimension table, and the business data table in the relational database is used as the fact table. The above multidimensional model is generally set as follows Figure 8 The star structure shown has a fact table in the middle and multiple dimension tables connected along the radius, which makes it convenient for business personnel to perform multidimensional analysis on the members in the dimension tables.
[0075] Table 1
[0076] Primary Key coding name Property 1 Property 2... 000001 A1 XX xxx xxx …… …… …… …… ……
[0077] Table 2
[0078] ID Master Data A Master Data B Master Data C Business data value 000010 A1 B1 C1 120.3 …… …… …… …… ……
[0079] Further, according to the aggregation hierarchical relationship of multiple members in the dimension table, a convolution weight pre-calculation table is determined. Specifically, the aggregation hierarchical relationship is used to indicate the superior-subordinate relationship and the first weight of multiple members in the dimension table. It can be understood that the association relationship of multiple members in the dimension table can be understood according to the superior-subordinate relationship, for example: member A is the superior of member B, member C is the last level of member A, etc.; the first weight is determined based on the needs of the user, and is used to indicate the proportion of the contribution of the subordinate member to the superior member, for example: member A is the superior of member B, member B is 10, when determining member A, the contribution proportion value is 0.4, and the value contributed by member B to member A is 10 times 0.4, and the contribution proportion value 0.4 here is the above-mentioned first weight. The convolution weight pre-calculation table determined according to the superior-subordinate relationship and the first weight of multiple members in the dimension table can accurately determine the association relationship of multiple members in the dimension table and the contribution proportion value between different members with an association relationship.
[0080] Further, according to the first instruction, the first data for performing the convolution calculation is determined based on the fact table, and the second data for performing the convolution is determined based on the convolution weight pre-calculation table. Specifically, the first instruction is used to indicate the calculation logic for performing the convolution calculation of the multidimensional model, which includes the target member to be calculated and the dimensions on which the convolution calculation is performed on the target member. Specifically, the first data is determined based on the target member in combination with the fact table, and the second data is determined based on the target member in combination with the convolution weight pre-calculation table.
[0081] Furthermore, a convolution calculation is performed based on the first data and the second data to obtain a multi-dimensional model convolution calculation result.
[0082] It should be noted that the first instruction may include multiple target members that need to be calculated. When the first instruction includes multiple target members, the first data set used to perform the convolution calculation is determined according to the fact table, and the second data set used to perform the convolution is determined according to the convolution weight pre-calculation table. Specifically, the convolution calculation is performed according to the first data set and the second data set, and a multi-dimensional model convolution calculation result set is obtained, which realizes that the multi-dimensional model convolution calculation results of multiple target members can be obtained according to one instruction.
[0083] The multidimensional model convolution calculation method provided in this embodiment does not require the reconstruction of the multidimensional database. The multidimensional model convolution calculation can be implemented based on the original relational database, which meets the needs of users to process data in different dimensions. At the same time, it reduces the difficulty of technical improvement and reduces the user's investment cost in processing multidimensional business data.
[0084] In addition, the multidimensional model convolution calculation method provided in this embodiment also has the following additional technical features:
[0085] In the above embodiment, the convolution calculation result of the multidimensional model specifically includes: first result information, the first result information is used to indicate the specific value of the target member among multiple members in the dimensional table in the multidimensional model; second result information, the second result information is used to indicate the dimension information of the first result information in the multidimensional model.
[0086] In this embodiment, the convolution calculation result of the multidimensional model includes first result information and second result information, wherein the first result information is used to indicate the specific value of the target member among multiple members in the dimensional table in the multidimensional model, that is, the required specific value of the target member, and the second result information is used to indicate the dimensional information of the first result information in the multidimensional model, so that the user can understand the dimensional information of the target member based on the convolution calculation result of the multidimensional model.
[0087] Figure 2 A schematic diagram showing a flow chart of a multi-dimensional model convolution calculation method proposed in another embodiment of the present invention is shown. Figure 1 ,like Figure 2 As shown, the above step S104 specifically includes:
[0088] Step S202, generating an aggregation structure additional table according to the first association relationship and the first weight;
[0089] Step S204: determining a convolution weight pre-calculation table according to the second association relationship and the aggregation structure additional table.
[0090] In this embodiment, the superior-subordinate relationship includes a first association relationship and a second association relationship. Specifically, the first association relationship is used to indicate the relationship between any group of superior members and subordinate members in the dimension table, and the second association relationship is used to indicate the relationship between any group of target members and bottom members in the dimension table.
[0091] Furthermore, based on the first association relationship and the first weight, an aggregate structure additional table is constructed. Specifically, the upper-level members and lower-level members with a relationship are filled into the aggregate structure additional table, and then the first weight set according to user needs is filled into the aggregate structure additional table to generate an aggregate structure additional table, wherein the structure of the aggregate structure additional table is shown in Table 3.
[0092] Table 3
[0093] Subordinate members Senior Member First weight A1.1 A1 0.5 A1.2 A1 1 A1.3 A1 0.7 A1.3.3 A1 0.4 A1.1.1 A1.1 0.6 A1.1.2 A1.1 1 A1.3.1 A1.1 1 A1.3.1 A1.3 1 A1.3.2 A1.3 1 A1.3.3 A1.3 1 A1.3.1.1 A1.3.1 1 A1.3.1.2 A1.3.1 0.8
[0094] Furthermore, according to the second association relationship and the aggregation structure additional table, a convolution weight pre-calculation table is determined. Specifically, according to the second association relationship, the target member and the corresponding last-level member are filled into the convolution weight pre-calculation table, and then the members corresponding to the target member and the last-level member are screened out from the aggregation structure additional table, and multiple first weights corresponding to them are determined. The multiple first weights are processed to determine the proportion of the contribution of the last-level member to the target member, so as to determine the convolution weight pre-calculation table.
[0095] Figure 3 A schematic diagram showing a flow chart of a multi-dimensional model convolution calculation method proposed in another embodiment of the present invention is shown. Figure 1 ,like Figure 3 As shown, the above step S204 specifically includes:
[0096] Step S302, generating a structure tree according to the aggregation structure additional table, the structure tree including a plurality of first paths, each of which includes at least one second path;
[0097] Step S304, determining a second weight according to the first weight corresponding to the second path in the first path;
[0098] Step S306: Determine a convolution weight pre-calculation table according to the second association relationship and the second weight.
[0099] In this embodiment, the step of determining the convolution weight pre-calculation table according to the second association relationship and the aggregation structure additional table specifically includes: generating a structure tree according to the aggregation structure additional table, wherein the structure tree includes multiple first paths, each first path includes at least one second path, the first path is a path composed of a target member and a final member, the second path is a path composed of any group of upper members and lower members in the dimension table, and the second path corresponds to a first weight; determining the second weight according to the first weight corresponding to the second path in the first path; determining the convolution weight pre-calculation table according to the second association relationship and the second weight, wherein the schematic diagram of the structure tree generated according to Table 3 is as shown in FIG. Fig. 9 shown.
[0100] Specifically, a structure tree is constructed according to the aggregation structure additional table. According to the structure tree combined with the second association relationship, the first path consisting of the target member and the last-level member can be accurately determined, and the second path consisting of the upper-level member and the lower-level member included in the first path can be determined. Each first path corresponds to a first weight.
[0101] Furthermore, a second weight is determined according to a first weight corresponding to at least one second path included in the first path, and the second weight is a proportional value of the contribution of the last-level member to the target member.
[0102] Further, according to the second association relationship, the target member and the corresponding last-level member are determined, and the convolution weight pre-calculation table is filled in, and then the second weight is filled in the corresponding position to determine the convolution weight pre-calculation table, wherein, according to Table 3 and Fig. 9 (Schematic diagram of the structure tree) The structure of the determined convolution weight pre-calculation table is shown in Table 4.
[0103] Table 4
[0104] Target members The last member Second weight A1 A1.1.1 0.3 A1 A1.1.2 0.5 A1 A1.2 1 A1 A1.3.1.1 1.2 A1 A1.3.1.2 0.96 A1 A1.3.2 0.7 A1 A1.3.3 0.7 A1.1 A1.1.1 0.6 A1.1 A1.1.2 1 A1.1 A1.3.1.1 1 A1.1 A1.3.1.2 0.8 A1.3 A1.3.1.1 1 A1.3 A1.3.1.2 0.8 A1.3 A1.3.2 1 A1.3 A1.3.3 1 A1.3.1 A1.3.1.1 1 A1.3.1 A1.3.1.2 0.8 A1.1.1 A1.1.1 1 A1.1.2 A1.1.2 1 A1.2 A1.2 1 A1.3.1.1 A1.3.1.1 1 A1.3.1.2 A1.3.1.2 1 A1.3.2 A1.3.2 1 A1.3.3 A1.3.3 1
[0105] Figure 4 A schematic diagram showing a flow chart of a multi-dimensional model convolution calculation method proposed in another embodiment of the present invention is shown. Figure 3 ,like Figure 4 As shown, the above step S304 specifically includes:
[0106] Step S402, determining whether there is a secondary member of the same level in the first path;
[0107] Specifically, if the judgment is no, execute step S404, and if the judgment is yes, execute step S406.
[0108] Step S404, based on the absence of a secondary member of the same level in the first path, using the third weight as the second weight;
[0109] Step S406: Based on the existence of the secondary member of the same level in the first path, the fourth weight is used as the second weight.
[0110] In this embodiment, the step of determining the second weight according to the first weight corresponding to the second path in the first path specifically includes: judging whether there is a secondary member of the same level in the first path; based on the absence of secondary members of the same level in the first path, using a third weight as the second weight, wherein the third weight is the product of the second weights corresponding to all second paths in the first path; based on the presence of secondary members of the same level in the first path, using a fourth weight as the second weight, wherein the fourth weight is the sum of the products of the first weights corresponding to two second paths associated with each secondary member of the same level in the first path multiplied by the product of the first weights corresponding to the other second paths.
[0111] Specifically, it is determined whether there are members of the same level in the first path. When there are no members of the same level in the first path, the product of the second weights corresponding to all second paths in the first path is calculated as the second weight. When there are members of the same level in the first path, the sum of the products of the first weights corresponding to two second paths associated with the members of the same level in the first path and the product of the first weights corresponding to other second paths are calculated as the second weight. Fig. 9In the structure tree diagram shown, when the target member is A1 and the last member is A1.1.1, there is no same-level member in the first path formed by A1 and A1.1.1. In this case, the second weight is equal to 0.5×0.6. When the target member is A1 and the last member is A1.3.1.1, there are same-level members A1.1 and A1.3 in the first path formed by A1 and A1.3.1.1. In this case, the second weight is equal to (0.5×1+0.7×1)×1.
[0112] Figure 5 A schematic diagram showing a flow chart of a multi-dimensional model convolution calculation method proposed in another embodiment of the present invention is shown. Figure 2 ,like Figure 5 As shown, before executing the above step S202, the following steps are also executed:
[0113] Step S502, determining whether there is a superior-subordinate relationship among multiple members in the dimension table;
[0114] Specifically, if the judgment is no, execute step S504, and if the judgment is yes, execute step S506.
[0115] Step S504, based on the fact that all members in the dimension table are at the same level, no aggregation structure additional table is generated;
[0116] Step S506: Generate an aggregation structure additional table based on the existence of a superior-subordinate relationship between multiple members in the dimension table.
[0117] In this embodiment, it is first determined whether there is a hierarchical relationship among multiple members in the dimension table, and then it is determined whether it is necessary to generate an aggregate structure additional table corresponding to the dimension table based on the determination result. Specifically, if all members in the dimension table are at the same level, the aggregate structure additional table is not generated; if multiple members in the dimension table have a hierarchical relationship, the aggregate structure additional table is generated.
[0118] Specifically, in a relational database, there may be multiple dimension tables without hierarchical relationships between members. Through this technical solution, it is avoided to generate too many useless aggregation structure additional tables based on the above dimension tables, thereby avoiding the waste of storage resources.
[0119] In a possible embodiment, the first data is a specific value of a last-level member corresponding to the target member in the dimension table.
[0120] In this embodiment, the first data is the specific value of the last-level member corresponding to the target member in the dimension table. Generally speaking, the data in the fact table is only valid for the last-level member, and the data of non-last-level members is generated in real time by performing convolution calculations on the target member corresponding to the last-level data.
[0121] Embodiment 2
[0122] like Figure 6 As shown, in the second embodiment of the present invention, a multidimensional model convolution calculation device 600 is provided, including: an acquisition unit 602, the acquisition unit 602 is used to acquire a relational database and receive a first instruction; a processing unit 604, the processing unit 604 is used to determine the dimension table and fact table of the multidimensional model according to the storage structure of the relational database, wherein the relational database is a database used by users to store data; according to the aggregation level relationship of multiple members in the dimension table, a convolution weight pre-calculation table is determined; according to the first instruction, the first data for performing the convolution calculation is determined based on the fact table, and the second data for performing the convolution is determined based on the convolution weight pre-calculation table; a calculation unit 606, the calculation unit 606 is used to perform the convolution calculation according to the first data and the second data to obtain the multidimensional model convolution calculation result.
[0123] The multidimensional model convolution computing device 600 provided in this embodiment obtains a relational database through an acquisition unit 602. The relational database is a database used by users to store business data. The processing unit 604 is used to determine the dimension table and fact table of the multidimensional model according to the storage structure of the relational database. Specifically, the relational database usually includes a master data table and a business data table. The master data table in the relational database is used as the dimension table, and the business data table in the relational database is used as the fact table. The above-mentioned multidimensional model is generally set to a star structure, that is, the fact table is in the middle, and multiple dimension tables are connected along the radius, so as to facilitate business personnel to perform multidimensional analysis on the members in the dimension table.
[0124] The multi-dimensional model convolution computing device 600 provided in this embodiment, the processing unit 604 is also used to determine the convolution weight pre-calculation table according to the aggregation level relationship of multiple members in the dimensional table.
[0125] Specifically, the aggregation hierarchical relationship is used to indicate the superior-subordinate relationship and the first weight of multiple members in the dimension table. It can be understood that the association relationship of multiple members in the dimension table can be understood based on the superior-subordinate relationship, such as: member A is the superior of member B, member C is the last level of member A, etc.; the first weight is determined based on the needs of the user, and is used to indicate the proportion of the contribution of the subordinate member to the superior member. For example: member A is the superior of member B, member B is 10, when determining member A, the contribution ratio is 0.4, and the value contributed by member B to member A is 10 times 0.4. Here, the contribution ratio value 0.4 is the first weight. The convolution weight pre-calculation table determined according to the superior-subordinate relationship of multiple members in the dimension table and the first weight can accurately determine the association relationship of multiple members in the dimension table and the first weight between different members with an association relationship.
[0126] Specifically, the superior-subordinate relationship includes a first association relationship and a second association relationship. The first association relationship is used to indicate the relationship between any group of superior members and subordinate members in the dimension table, and the second association relationship is used to indicate the relationship between any group of target members and the last member in the dimension table.
[0127] Furthermore, the processing unit 604 constructs an aggregate structure additional table according to the first association relationship and the first weight, fills the upper and lower members with the relationship into the aggregate structure additional table, and then fills the aggregate structure additional table according to the first weight set by the user to generate the aggregate structure additional table.
[0128] Further, the processing unit 604 generates a structure tree according to the aggregation structure appended table, wherein the structure tree includes multiple first paths, each first path includes at least one second path, the first path is a path composed of a target member and a last-level member, the second path is a path composed of any group of upper-level members and lower-level members in the dimension table, and the second path corresponds to a first weight; the second weight is determined according to the first weight corresponding to the second path in the first path; and the convolution weight pre-calculation table is determined according to the second association relationship and the second weight.
[0129] Specifically, according to the structure tree combined with the second association relationship, the first path consisting of the target member and the last-level member can be clearly determined, and the second path consisting of the upper-level member and the lower-level member included in the first path can be determined, and each first path corresponds to a first weight.
[0130] Further, the processing unit 604 determines a second weight according to a first weight corresponding to at least one second path included in the first path, where the second weight is a ratio of the contribution of the last-level member to the target member.
[0131] Specifically, determine whether there are secondary members of the same level in the first path; based on the absence of secondary members of the same level in the first path, use the third weight as the second weight, wherein the third weight is the product of the second weights corresponding to all second paths in the first path; based on the existence of secondary members of the same level in the first path, use the fourth weight as the second weight, wherein the fourth weight is the sum of the products of the first weights corresponding to two second paths associated with each secondary member of the same level in the first path multiplied by the product of the first weights corresponding to the other second paths.
[0132] Further, the processing unit 604 determines the target member and the corresponding last-level member according to the second association relationship, fills in the convolution weight pre-calculation table, and then fills the second weight into the corresponding position to determine the convolution weight pre-calculation table.
[0133] The multidimensional model convolution computing device 600 provided in this embodiment, the processing unit 604 is also used to determine the first data for performing convolution computing based on the fact table according to the first instruction received by the acquisition unit 602, and determine the second data for performing convolution based on the convolution weight pre-calculation table.
[0134] Specifically, the first instruction is used to indicate the calculation logic of performing multidimensional model convolution calculation, which includes the target member to be calculated and the dimensions on which the convolution calculation is performed on the target member. Specifically, the first data is determined based on the target member in combination with the fact table, and the second data is determined based on the target member in combination with the convolution weight pre-calculation table.
[0135] The multi-dimensional model convolution calculation device 600 provided in this embodiment, the calculation unit 606 is used to perform convolution calculation according to the first data and the second data determined by the processing unit 604 to obtain the multi-dimensional model convolution calculation result.
[0136] It should be noted that the first instruction received by the acquisition unit 602 may include multiple target members that need to be calculated. When the first instruction includes multiple target members, the processing unit 604 determines the first data set for performing the convolution calculation according to the fact table, and determines the second data set for performing the convolution according to the convolution weight pre-calculation table. Specifically, the calculation unit 606 performs the convolution calculation according to the first data set and the second data set, and obtains a multi-dimensional model convolution calculation result set, which realizes that the multi-dimensional model convolution calculation results of multiple target members can be obtained according to one instruction.
[0137] The multidimensional model convolution computing device 600 provided in this embodiment can realize the calculation of multidimensional model convolution based on the original relational database without rebuilding the multidimensional database, thereby meeting the user's needs to process data in different dimensions, while reducing the difficulty of technical improvement and reducing the user's investment cost in processing multidimensional business data.
[0138] Embodiment 3
[0139] In the third embodiment of the present invention, a readable storage medium is provided, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the multidimensional model convolution calculation method in the above-mentioned embodiment 1 are implemented. Therefore, all the beneficial technical effects of the multidimensional model convolution calculation method in the above-mentioned embodiment 1 are obtained, and no further details are given here.
[0140] Embodiment 4
[0141] like Figure 7 As shown, in the fourth embodiment of the present invention, an electronic device 700 is proposed, including the multidimensional model convolution calculation device 600 proposed in the above-mentioned embodiment 2 and the readable storage medium 702 proposed in the embodiment 3, and thus has all the beneficial technical effects of the above-mentioned embodiments 2 and 3, and will not be elaborated herein.
[0142] In the description of the present invention, the term "plurality" refers to two or more than two. Unless otherwise clearly defined, the orientation or positional relationship indicated by the terms "upper" and "lower" is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention. The terms "connection", "installation", "fixation", etc. should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected or indirectly connected through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0143] In the description of the present invention, the description of the terms "one embodiment", "some embodiments", "specific embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in multiple embodiments or examples of the present invention. In the present invention, the schematic representation 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.
[0144] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A multi-dimensional model convolution calculation method, characterized in that: include: Determine the dimension table and fact table of the multidimensional model according to the storage structure of the relational database, wherein the relational database is a database used by the user to store data; Determine a convolution weight pre-calculation table according to the aggregation level relationship of the multiple members in the dimension table, wherein the aggregation level relationship is used to indicate the superior-subordinate relationship and the first weight of the multiple members in the dimension table; According to the first instruction, the first instruction is used to instruct the calculation logic of performing the multi-dimensional model convolution calculation, which includes the target member to be calculated and the dimension of the convolution calculation for the target member; Determine first data for performing convolution calculation based on the target member in combination with the fact table, and determine second data for performing convolution based on the target member in combination with the convolution weight pre-calculation table; The convolution calculation is performed according to the first data and the second data to obtain a multi-dimensional model convolution calculation result.
2. The multi-dimensional model convolution calculation method according to claim 1, characterized in that: The multi-dimensional model convolution calculation results specifically include: first result information, where the first result information is used to indicate a specific value of a target member among the multiple members in the dimension table in the multidimensional model; Second result information, where the second result information is used to indicate dimension information of the first result information in the multi-dimensional model.
3. The multi-dimensional model convolution calculation method according to claim 1, characterized in that: The superior-subordinate relationship includes a first association relationship and a second association relationship. The step of determining a convolution weight pre-calculation table according to the aggregation level relationship of multiple members in the dimension table specifically includes: Generate an aggregation structure additional table according to the first association relationship and the first weight, wherein the first weight is set based on user requirements, and the first association relationship is used to indicate a relationship between any group of upper-level members and lower-level members in the dimension table; The convolution weight pre-calculation table is determined according to the second association relationship and the aggregation structure additional table, wherein the second association relationship is used to indicate the relationship between any group of target members and the last-level members in the dimension table.
4. The multi-dimensional model convolution calculation method according to claim 3, characterized in that: The step of determining the convolution weight pre-calculation table according to the second association relationship and the aggregation structure additional table specifically includes: Generate a structure tree according to the aggregation structure additional table, wherein the structure tree includes a plurality of first paths, each first path includes at least one second path, the first path is a path formed by the target member and the last member, the second path is a path formed by any group of upper-level members and lower-level members in the dimension table, and the second path corresponds to the first weight; determining a second weight according to a first weight corresponding to the second path in the first path; Determine the convolution weight pre-calculation table according to the second association relationship and the second weight.
5. The multi-dimensional model convolution calculation method according to claim 4, characterized in that: The step of determining the second weight according to the first weight corresponding to the second path in the first path specifically includes: Determine whether there is a secondary member of the same level in the first path; Based on the absence of a secondary member of the same level in the first path, using a third weight as the second weight, wherein the third weight is the product of the first weights corresponding to all second paths in the first path; Based on the existence of a same-level secondary member in the first path, a fourth weight is used as the second weight, wherein the fourth weight is the product of the sum of the first weights corresponding to two second paths associated with each same-level secondary member in the first path multiplied by the product of the first weights corresponding to the other second paths.
6. The multi-dimensional model convolution calculation method according to claim 3, characterized in that: Before generating the aggregation structure additional table according to the first association relationship and the first weight, the multidimensional model convolution calculation method further includes: Determine the hierarchical relationship between multiple members in the dimension table; Based on the fact that all members in the dimension table are at the same level, the aggregation structure additional table is not generated; Based on the existence of a superior-subordinate relationship among multiple members in the dimension table, the aggregation structure additional table is generated.
7. The multi-dimensional model convolution calculation method according to any one of claims 1 to 6, characterized in that: The first data refers to the specific value of the last-level member corresponding to the target member in the dimension table.
8. A multi-dimensional model convolution computing device, characterized in that: include: An acquisition unit, the acquisition unit being used to acquire a relational database and receive a first instruction; A processing unit, the processing unit is used to determine the dimension table and fact table of the multidimensional model according to the storage structure of the relational database, wherein the relational database is a database used by the user to store data; determine the convolution weight pre-calculation table according to the aggregation level relationship of multiple members in the dimension table; according to the first instruction, the first instruction is used to indicate the calculation logic of the multidimensional model convolution calculation, which includes the target member to be calculated and the dimension of the convolution calculation for the target member; Determine first data for performing convolution calculation based on the target member in combination with the fact table, and determine second data for performing convolution based on the target member in combination with the convolution weight pre-calculation table; A computing unit, wherein the computing unit is used to perform convolution calculation according to the first data and the second data to obtain a multi-dimensional model convolution calculation result.
9. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, which, when executed by a processor, implements the steps of the multi-dimensional model convolution calculation method as described in any one of claims 1 to 7.
10. An electronic device, characterized in that: include: The multi-dimensional model convolution computing device as claimed in claim 8; and / or The readable storage medium as claimed in claim 9.
