Multi-dimensional database updating method and device, computer device and storage medium

CN116204541BActive Publication Date: 2026-08-07KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
KINGDEE SOFTWARE(CHINA) CO LTD
Filing Date
2023-03-14
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0003]传统技术中,如果对多维数据库中一个单元格的数据进行了修改,则需要对多维数据库中的每个单元格的数据进行分析,以判断该单元格的数据是否需要进行更新,整个过程复杂繁琐,导致多维数据库更新效率低下

Benefits of technology

[0057] The aforementioned multidimensional database update method, apparatus, computer equipment, storage medium, and computer program product acquire the hierarchical structure corresponding to the multidimensional database and the target value corresponding to the target cell identifier. Based on the target value, the value in the target cell corresponding to the target cell identifier is updated. Based on the hierarchical structure and the target cell identifier, the target non-detail block corresponding to the target cell identifier is determined. The cell identifier to be updated in the target non-detail block is determined, and the value in the cell to be updated corresponding to the cell identifier to be updated is updated. By dividing the multidimensional database into multiple detailed blocks and non-detailed blocks, and using a hierarchical structure to represent the relationships between detailed blocks and non-detailed blocks, the target non-detailed block to which the cells to be updated affected by the target cell belong can be quickly determined based on the target cell identifier and the hierarchical structure. Then, the identifier of the cells to be updated in each target non-detailed block is determined, improving the efficiency of determining the identifier of the cells to be updated. Based on the identifier of the cells to be updated, the cells to be updated are determined from the target non-detailed blocks, and the values ​​in the cells to be updated are updated. The target non-detailed blocks only store the values ​​of some cells in the multidimensional data, which improves the determination speed of the cells to be updated and the efficiency of updating the values ​​in the cells to be updated, thereby improving the update efficiency of the multidimensional database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116204541B_ABST
    Figure CN116204541B_ABST
Patent Text Reader

Abstract

The application relates to a multi-dimensional database updating method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: acquiring a hierarchical structure corresponding to a multi-dimensional database and a target value corresponding to a target cell identifier; based on the target value, updating the numerical value in a target cell corresponding to the target cell identifier; based on the hierarchical structure and the target cell identifier, determining a target non-detailed block corresponding to the target cell identifier; determining a to-be-updated cell identifier in the target non-detailed block, and updating the numerical value in a to-be-updated cell corresponding to the to-be-updated cell identifier. The method can improve the updating efficiency of the multi-dimensional database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer device, storage medium, and computer program product for updating a multidimensional database. Background Technology

[0002] With the development of computer technology, multidimensional databases are used to store large amounts of data with relationships, enabling drill-down and summarization operations on the data in a multidimensional form to meet the needs of multi-level and multi-angle data analysis.

[0003] In traditional techniques, if the data in a cell of a multidimensional database is modified, the data in every cell of the multidimensional database needs to be analyzed to determine whether the data in that cell needs to be updated. The whole process is complex and cumbersome, resulting in low efficiency in updating multidimensional databases. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for updating multidimensional databases that can improve update efficiency in response to the above-mentioned technical problems.

[0005] Firstly, this application provides a method for updating a multidimensional database. The method includes:

[0006] Obtain the hierarchical structure of the multidimensional database and the target value corresponding to the target cell identifier;

[0007] Based on the target value, the value in the target cell corresponding to the target cell identifier is updated;

[0008] Based on the hierarchical structure and the target cell identifier, determine the target non-detail block corresponding to the target cell identifier;

[0009] Determine the identifier of the cell to be updated in the target non-detail block, and update the value in the cell corresponding to the identifier.

[0010] In one embodiment, the multidimensional database update method further includes:

[0011] Generate an updated version number;

[0012] Obtain the first version number and the second version number corresponding to the target non-detail block, and update the first version number to the updated version number;

[0013] After updating the values ​​in the cells corresponding to all the cells to be updated in the target non-detail block, the second version number is updated to the updated version number.

[0014] In one embodiment, determining the target non-detail block corresponding to the target cell identifier based on the hierarchical structure and the target cell identifier includes:

[0015] Obtain the detail block identifier corresponding to the detail block in the hierarchical structure;

[0016] Based on the inclusion relationship between the target cell identifier and the detail block identifier, the target detail block corresponding to the target cell identifier is determined;

[0017] The grandparent non-detail block of the target detail block in the hierarchical structure is determined as the target non-detail block corresponding to the target cell identifier; the grandparent non-detail block refers to the parent node non-detail block of the target detail block, and the parent node non-detail block of the parent node non-detail block.

[0018] In one embodiment, determining the target detail block corresponding to the target cell identifier based on the inclusion relationship between the target cell identifier and the detail block identifier includes:

[0019] The dimension values ​​in the detail block identifier are compared with the dimension values ​​in the target cell identifier; the detail block identifier includes at least one dimension value, and the target cell identifier contains multiple dimension values.

[0020] If the target cell identifier contains all the dimension values ​​of the detail block identifier, then the detail block corresponding to the detail block identifier is determined as the target detail block corresponding to the target cell identifier.

[0021] In one embodiment, updating the value in the cell corresponding to the cell identifier to be updated includes:

[0022] An asynchronous task is generated based on the target value and the identifier of the cell to be updated;

[0023] Based on the asynchronous task, the value in the cell corresponding to the cell identifier to be updated is updated.

[0024] In one embodiment, determining the identifier of the cell to be updated in the target non-detail block includes:

[0025] Obtain the target detail block identifier of the target cell identifier;

[0026] The dimension values ​​in the target cell identifier that differ from those in the target detail block identifier are determined as the difference dimension values;

[0027] Obtain the tree structure of the dimensions corresponding to the difference dimension values, and determine the difference dimension values ​​and the grandfather dimension values ​​corresponding to the difference dimension values ​​in the tree structure as the set of difference dimension values ​​corresponding to the difference dimension values; the grandfather dimension value refers to the parent node dimension value of the difference dimension value and the parent node dimension value of the parent node dimension value.

[0028] The dimension value in the target non-detail block identifier is combined with a dimension value in each set of difference dimension values ​​to obtain the cell identifier to be updated in the target non-detail block.

[0029] In one embodiment, the multidimensional database update method further includes:

[0030] Get the identifier of the cell to be queried;

[0031] Based on the identifier of the cell to be queried, determine the non-detail block to be queried corresponding to the identifier of the cell to be queried;

[0032] Obtain the first version number and the second version number corresponding to the non-detailed block being queried. If the first version number and the second version number are the same, then the value of the cell corresponding to the cell identifier to be queried is used as the query result.

[0033] Secondly, this application also provides a multidimensional database update apparatus. The apparatus includes:

[0034] The acquisition module is used to obtain the hierarchical structure corresponding to the multidimensional database, as well as the target value corresponding to the target cell identifier;

[0035] The first update module is used to update the value in the target cell corresponding to the target cell identifier based on the target value;

[0036] The determination module is used to determine the target non-detail block corresponding to the target cell identifier based on the hierarchical structure and the target cell identifier;

[0037] The second update module is used to determine the identifier of the cell to be updated in the target non-detail block, and update the value in the cell to be updated corresponding to the identifier of the cell to be updated.

[0038] Obtain the hierarchical structure of the multidimensional database and the target value corresponding to the target cell identifier;

[0039] Based on the target value, the value in the target cell corresponding to the target cell identifier is updated;

[0040] Based on the hierarchical structure and the target cell identifier, determine the target non-detail block corresponding to the target cell identifier;

[0041] Determine the identifier of the cell to be updated in the target non-detail block, and update the value in the cell corresponding to the identifier.

[0042] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0043] Obtain the hierarchical structure of the multidimensional database and the target value corresponding to the target cell identifier;

[0044] Based on the target value, the value in the target cell corresponding to the target cell identifier is updated;

[0045] Based on the hierarchical structure and the target cell identifier, determine the target non-detail block corresponding to the target cell identifier;

[0046] Determine the identifier of the cell to be updated in the target non-detail block, and update the value in the cell corresponding to the identifier.

[0047] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0048] Obtain the hierarchical structure of the multidimensional database and the target value corresponding to the target cell identifier;

[0049] Based on the target value, the value in the target cell corresponding to the target cell identifier is updated;

[0050] Based on the hierarchical structure and the target cell identifier, determine the target non-detail block corresponding to the target cell identifier;

[0051] Determine the identifier of the cell to be updated in the target non-detail block, and update the value in the cell corresponding to the identifier.

[0052] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0053] Obtain the hierarchical structure of the multidimensional database and the target value corresponding to the target cell identifier;

[0054] Based on the target value, the value in the target cell corresponding to the target cell identifier is updated;

[0055] Based on the hierarchical structure and the target cell identifier, determine the target non-detail block corresponding to the target cell identifier;

[0056] Determine the identifier of the cell to be updated in the target non-detail block, and update the value in the cell corresponding to the identifier.

[0057] The aforementioned multidimensional database update method, apparatus, computer equipment, storage medium, and computer program product acquire the hierarchical structure corresponding to the multidimensional database and the target value corresponding to the target cell identifier. Based on the target value, the value in the target cell corresponding to the target cell identifier is updated. Based on the hierarchical structure and the target cell identifier, the target non-detail block corresponding to the target cell identifier is determined. The cell identifier to be updated in the target non-detail block is determined, and the value in the cell to be updated corresponding to the cell identifier to be updated is updated. By dividing the multidimensional database into multiple detailed blocks and non-detailed blocks, and using a hierarchical structure to represent the relationships between detailed blocks and non-detailed blocks, the target non-detailed block to which the cells to be updated affected by the target cell belong can be quickly determined based on the target cell identifier and the hierarchical structure. Then, the identifier of the cells to be updated in each target non-detailed block is determined, improving the efficiency of determining the identifier of the cells to be updated. Based on the identifier of the cells to be updated, the cells to be updated are determined from the target non-detailed blocks, and the values ​​in the cells to be updated are updated. The target non-detailed blocks only store the values ​​of some cells in the multidimensional data, which improves the determination speed of the cells to be updated and the efficiency of updating the values ​​in the cells to be updated, thereby improving the update efficiency of the multidimensional database. Attached Figure Description

[0058] Figure 1 This is an application environment diagram of a multidimensional database update method in one embodiment;

[0059] Figure 2 This is a flowchart illustrating a multidimensional database update method in one embodiment;

[0060] Figure 3 This is a flowchart illustrating the version number update steps for a target non-detail block in one embodiment.

[0061] Figure 4 This is a flowchart illustrating the steps for determining a target non-detailed block in one embodiment;

[0062] Figure 5 This is a schematic diagram of the hierarchical structure of a multidimensional database in one embodiment;

[0063] Figure 6 This is a flowchart illustrating the steps for determining the identifier of a cell to be updated in one embodiment;

[0064] Figure 7 This is a schematic diagram of a tree structure in one embodiment;

[0065] Figure 8 This is a structural block diagram of a multidimensional database update device in one embodiment;

[0066] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0067] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0068] The multidimensional database update method provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated on server 104 or placed on the cloud or other network servers. Both the terminal and server can be used independently to execute the multidimensional database update method provided in this embodiment. The terminal and server can also be used collaboratively to execute the multidimensional database update method provided in this embodiment. For example, a computer device obtains the hierarchical structure corresponding to the multidimensional database and the target value corresponding to the target cell identifier. Based on the target value, the value in the target cell corresponding to the target cell identifier is updated. Based on the hierarchical structure and the target cell identifier, the target non-detailed block corresponding to the target cell identifier is determined. The cell identifier to be updated in the target non-detailed block is determined, and the value in the cell to be updated corresponding to the cell identifier is updated. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart vehicle devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0069] In one embodiment, such as Figure 2 As shown, a multidimensional database update method is provided. This method can be applied to computer devices, which can be terminals or servers. The method can be executed independently by the terminal or server, or it can be implemented through interaction between the terminal and the server. This embodiment illustrates the method applied to a computer device, including steps 202 to 208.

[0070] Step 202: Obtain the hierarchical structure corresponding to the multidimensional database, and the target value corresponding to the target cell identifier.

[0071] A multidimensional database is a database composed of multiple cells with relationships between them. A cell is the smallest unit of data storage in a multidimensional database, and each cell corresponds to a dimension value. This can be understood as one cell corresponding to one combination of dimension values. For example, a multidimensional database of household expenses has three dimensions: date, expense, and member. The date dimension includes four values: quarterly, January, February, and March. The expense dimension includes three values: service expenses, purchases, and living expenses. The member dimension includes three values: family, member A, and member B. Therefore, there are 4 * 3 * 3 = 36 possible combinations of dimension values, meaning the multidimensional database has 36 cells. Each cell corresponds to one combination of dimension values, and each cell stores one value. For example, January, purchases, and member A constitute one combination of dimension values, and this cell stores one value. Hierarchical structure refers to the structure of relationships between detailed blocks and non-detailed blocks in a multidimensional database. A hierarchical structure can be represented as a multi-way tree structure. A cell identifier is a string that corresponds one-to-one with a cell. Cell identifiers can be combinations of the dimension values ​​corresponding to that cell. For example, using "January," "Purchase," and "Member A" as cell identifiers. The target value is the data to be updated in the target cell corresponding to the target cell identifier. The target value can be the actual update value or an update level value. For example, if the value in the target cell is 10 and needs to be updated to 100, the target value could be the actual update value of 100, or the update level value + 90.

[0072] For example, the computing set device obtains the hierarchical structure corresponding to the multidimensional database, and the target value corresponding to the target cell identifier in the multidimensional database.

[0073] Step 204: Based on the target value, update the value in the target cell corresponding to the target cell identifier.

[0074] Here, the numerical value refers to the data stored in the target cell.

[0075] For example, the computer device determines the target cell based on the target cell identifier, and then updates the value in the target cell according to the target value.

[0076] In one embodiment, the computer device determines the target detail block corresponding to the target cell identifier based on the target cell identifier, then determines the target cell corresponding to the target cell identifier based on the target detail block, and updates the value in the target cell based on the target value.

[0077] Step 206: Based on the hierarchical structure and target cell identifier, determine the target non-detail block corresponding to the target cell identifier.

[0078] In this context, a non-detailed block refers to a collection of multiple non-detailed cells. A non-detailed cell is a cell whose corresponding dimension value combination contains at least one non-detailed dimension value. Non-detailed dimension values ​​are dimension values ​​of non-leaf nodes, while detailed dimension values ​​are dimension values ​​of leaf nodes. Essentially, a non-detailed block is composed of multiple cells, and each cell's corresponding dimension value set contains at least one non-leaf node dimension value. For example, the date dimension includes four dimensions: Q1, January, February, and March. These four dimensions form a tree structure, where Q1 is the parent node dimension value, and January, February, and March are leaf node dimension values. Therefore, Q1 is a non-detailed dimension value, and January, February, and March are detailed dimension values. The cell corresponding to Q1, Purchase, and Member A is a non-detailed cell.

[0079] For example, the computer device determines the target non-detail block corresponding to the target cell identifier based on the hierarchical structure and the target cell identifier.

[0080] In one embodiment, the computer device determines the target detail block to which the target cell identifier belongs based on the target cell identifier, and determines the target non-detail block corresponding to the target cell identifier based on the above-mentioned hierarchical structure and the above-mentioned target detail block.

[0081] Step 208: Determine the cell identifier to be updated in the target non-detail block, and update the value in the cell corresponding to the cell identifier to be updated.

[0082] In this context, the cells to be updated refer to those whose values ​​are affected by the values ​​in the target cell. There can be one or more cells to be updated.

[0083] For example, the computer device determines the identifier of the cell to be updated in each target non-detail block, and then updates the value in the cell to be updated corresponding to the identifier of the cell to be updated in each target non-detail block.

[0084] In one embodiment, the computer device uses multithreading to simultaneously update the values ​​in the cells to be updated in multiple target non-detail blocks.

[0085] In the aforementioned multidimensional database update method, the hierarchical structure corresponding to the multidimensional database and the target value corresponding to the target cell identifier are obtained. Based on the target value, the value in the target cell corresponding to the target cell identifier is updated. Based on the hierarchical structure and the target cell identifier, the target non-detailed block corresponding to the target cell identifier is determined. The cell identifier to be updated in the target non-detailed block is determined, and the value in the cell to be updated corresponding to the cell identifier is updated. By dividing the multidimensional database into multiple detailed blocks and non-detailed blocks, and using a hierarchical structure to represent the relationship between detailed blocks and non-detailed blocks, the target non-detailed block to which the cell to be updated affected by the target cell belongs is quickly determined based on the target cell identifier and the hierarchical structure. Then, the cell identifier to be updated in each target non-detailed block is determined, improving the efficiency of determining the cell identifier to be updated. Based on the cell identifier to be updated, the cell to be updated is determined from the target non-detailed block, and the value in the cell to be updated is updated. The target non-detailed block only stores the values ​​of some cells in the multidimensional data, improving the determination speed of the cell to be updated and the efficiency of updating the values ​​in the cell to be updated, thereby improving the update efficiency of the multidimensional database.

[0086] In one embodiment, such as Figure 3 As shown, multidimensional database update methods also include:

[0087] Step 302: Generate the updated version number.

[0088] The update version number is a string used to identify the current update of the multidimensional database. The update version number can be a randomly generated number, or it can be obtained by adding 1 to the update version number of the last update of the multidimensional database. For example, 103.

[0089] For example, after performing step 204, the computer device generates an update version number.

[0090] In one embodiment, after obtaining the target value corresponding to the target cell identifier, the computer device generates an update version number.

[0091] Step 304: Obtain the first version number and the second version number corresponding to the target non-detail block, and update the first version number to the updated version number.

[0092] Here, the first version number and the second version number refer to two strings corresponding to the non-detailed block. If there are no cells to be updated in the non-detailed block, the first version number and the second version number are the same; if there are cells to be updated in the non-detailed block, the first version number and the second version number are different. The accuracy of the non-detailed block can be determined by whether the two version numbers are consistent.

[0093] For example, the computer device obtains the first version number and the second version number corresponding to the target non-detailed block based on the target non-detailed block identifier, and then updates the first version number to the updated version number.

[0094] Step 306: After updating the values ​​in the cells corresponding to all the cells to be updated in the target non-detail block, update the second version number to the updated version number.

[0095] For example, for each target non-detail block, if the values ​​in the cells to be updated corresponding to all the cell identifiers to be updated in the target non-detail block have been updated, then the second version number corresponding to the target non-detail block is updated to the updated version number.

[0096] In this embodiment, by updating the first version number of the target non-detailed block, which is now an updated version number and different from the second version number, it indicates that there are cells to be updated in the target non-detailed block. After all cells to be updated in the target non-detailed block have been updated, the second version number of the target non-detailed block is updated. At this point, both the first and second version numbers of the target non-detailed block are updated version numbers. The first and second version numbers being the same indicates that there are no cells to be updated in the target non-detailed block, ensuring that all cells to be updated in the target non-detailed block are updated, thus improving the accuracy of the target non-detailed block update. Furthermore, by checking whether the first and second version numbers corresponding to the non-detailed block are the same, it can be determined whether there are cells to be updated in the non-detailed block. Even if there are cells to be updated in the multidimensional database, data can still be read from cells in non-detailed blocks with the same first and second version numbers, achieving synchronous update and reading of the multidimensional database.

[0097] In one embodiment, such as Figure 4 As shown, based on the hierarchical structure and target cell identifier, the target non-detail blocks corresponding to the target cell identifier are determined to include:

[0098] Step 402: Obtain the detail block identifier corresponding to the detail block in the hierarchical structure.

[0099] In this context, a detail block refers to a collection of multiple detail cells. Each detail cell within a detail block contains its own detail block identifier within its cell identifier. A detail cell is a cell whose dimension value set contains detail dimension values ​​for each of its corresponding dimension values. A detail block is the lowest-level block in the hierarchical structure. It can be understood as a block composed of multiple cells, where each cell's corresponding dimension value set contains leaf node dimension values. The hierarchical structure contains multiple detail blocks. Detail blocks within a hierarchical structure can be divided according to actual needs. A detail block identifier is a string that corresponds one-to-one with a detail block. Detail block identifiers can be represented using dimension values ​​or combinations of dimension values. For example, ... Figure 5 The hierarchical structure shown includes six detailed blocks: {January, Purchases}, {February, Purchases}, {March, Purchases}, {January, Living Expenses}, {February, Living Expenses}, and {March, Living Expenses}; and three non-detailed blocks: {First Quarter, Purchases}, {First Quarter, Living Expenses}, and {First Quarter, Expenses}. Each detailed block contains multiple cells; for example, {January, Purchases} includes {January, Purchases, Member A} and {January, Purchases, Member B}. Each non-detailed block also contains multiple cells; for example, {First Quarter, Purchases} includes {First Quarter, Purchases, Member A}, {First Quarter, Purchases, Member B}, and {First Quarter, Purchases, Family}.

[0100] For example, a computer device acquires multiple detail block identifiers in a hierarchical structure.

[0101] Step 404: Based on the inclusion relationship between the target cell identifier and the detail block identifier, determine the target detail block corresponding to the target cell identifier.

[0102] Among them, the target detail block refers to the detail block that contains the target cell identifier corresponding to the target cell.

[0103] For example, the computer device obtains the current detail block identifier from multiple detail block identifiers, compares the current detail block identifier with the target cell identifier, and if the target cell identifier does not include the current detail block identifier, it obtains the next detail block identifier from the multiple detail block identifiers as the current detail block identifier and repeats the above steps; if the target cell identifier includes the current detail block identifier, it determines the detail block corresponding to the current detail block identifier as the target detail block corresponding to the target cell identifier.

[0104] Step 406: Determine the grandparent non-detail block of the target detail block in the hierarchical structure as the target non-detail block corresponding to the target cell identifier; the grandparent non-detail block refers to the parent node non-detail block of the target detail block, and the parent node non-detail block of the parent node non-detail block.

[0105] Here, a parent node non-detailed block refers to a non-detailed block in the hierarchy that is associated with a detailed block at the level above the level of the detailed block, or a non-detailed block in the hierarchy that is associated with a non-detailed block at the level above the level of the non-detailed block. For example, ... Figure 5 In the hierarchical structure shown, the parent node of the detail block {January, Purchase} is the non-detail block {Quarterly, Purchase}, and the parent node of the non-detail block {Quarterly, Purchase} is the non-detail block {Quarterly, Expenditure}. Therefore, the grandparent non-detail blocks of the detail block {January, Purchase} include {Quarterly, Purchase} and {Quarterly, Expenditure}.

[0106] For example, the computer device obtains the parent node non-detailed blocks of the target detail block, and the parent node non-detailed blocks of the parent node non-detailed blocks, up to the root node non-detailed block in the above-mentioned hierarchical structure, based on the hierarchical structure, and determines the above-mentioned multiple parent node non-detailed blocks as the target non-detailed blocks corresponding to the target cell identifier.

[0107] In this embodiment, the target detail block corresponding to the target cell identifier is determined based on the inclusion relationship between the target cell identifier and the detail block identifier. Then, the target non-detail block corresponding to the target cell identifier is determined based on the association relationship between detail blocks and non-detail blocks in the hierarchical structure, thereby improving the efficiency of determining the target non-detail block.

[0108] In one embodiment, the target detail block corresponding to the target cell identifier is determined based on the inclusion relationship between the target cell identifier and the detail block identifier, including:

[0109] The dimension values ​​in the detail block identifier are compared with the dimension values ​​in the target cell identifier. The detail block identifier includes at least one dimension value, and the target cell identifier contains multiple dimension values. If the target cell identifier contains all the dimension values ​​of the detail block identifier, then the detail block corresponding to the detail block identifier is determined as the target detail block corresponding to the target cell identifier.

[0110] Here, a dimension value refers to a division range within a dimension. For example, if the date dimension is divided into four division ranges: the first quarter, January, February, and March, then each division range is a dimension value.

[0111] For example, the computer device obtains multiple dimension values ​​corresponding to the detail block identifier and multiple dimension values ​​corresponding to the target cell identifier, compares the multiple dimension values ​​corresponding to the detail block identifier with the multiple dimension values ​​corresponding to the target cell identifier, and if there is a dimension value in the multiple dimension values ​​corresponding to the target cell identifier that is the same as the multiple dimension values ​​corresponding to the detail block identifier, then the detail block identifier is determined as the target detail block identifier, and the detail block corresponding to the target detail block identifier is determined as the target detail block.

[0112] In this embodiment, the target detail block to which the target cell belongs is determined based on the target cell identifier and the detail block identifier, providing basic data for subsequently determining the target non-detail block corresponding to the target cell identifier based on the target detail block and hierarchical structure.

[0113] In one embodiment, updating the value in the cell corresponding to the cell identifier to be updated includes:

[0114] Based on the target value and the identifier of the cell to be updated, an asynchronous task is generated; based on the asynchronous task, the value in the cell corresponding to the identifier of the cell to be updated is updated.

[0115] In this context, an asynchronous task refers to a task that can be executed concurrently. It can be understood as generating an asynchronous task based on one or more target values ​​and their corresponding cell identifiers to be updated. Since there are multiple target values ​​and their corresponding cell identifiers, multiple asynchronous tasks will be generated simultaneously, and these multiple asynchronous tasks can be executed concurrently.

[0116] For example, the computer device generates an asynchronous task based on a preset number of target values ​​and the corresponding cell identifiers to be updated, obtains multiple asynchronous tasks, executes multiple asynchronous tasks simultaneously, and completes the update of the values ​​in the cells corresponding to the cell identifiers to be updated.

[0117] In this embodiment, by executing multiple asynchronous tasks, the values ​​in the cells to be updated corresponding to multiple cell identifiers to be updated are updated simultaneously, thereby improving the update rate of the values ​​in the cells to be updated.

[0118] In one embodiment, such as Figure 6 As shown, the identifiers of cells to be updated in the target non-detail block include:

[0119] Step 602: Obtain the target detail block identifier of the target cell identifier.

[0120] For example, a computer device obtains multiple detail block identifiers in a hierarchical structure and determines a target detail block identifier based on the inclusion relationship between the target cell identifier and the detail block identifier.

[0121] Step 604: Determine the dimension values ​​in the target cell identifier that are different from those in the target detail block identifier as the difference dimension values.

[0122] For example, the computer device obtains multiple dimension values ​​in the target cell identifier and multiple dimension values ​​in the target detail block, compares the multiple dimension values ​​in the target cell identifier with the multiple dimension values ​​in the target detail block, and determines the dimension values ​​that exist in the target cell identifier but do not exist in the target detail block identifier as the difference dimension values.

[0123] Step 606: Obtain the tree structure of the dimensions corresponding to the difference dimension values, and determine the difference dimension values ​​and the grandfather dimension values ​​corresponding to the difference dimension values ​​in the tree structure as the set of difference dimension values ​​corresponding to the difference dimension values; the grandfather dimension value refers to the parent node dimension value of the difference dimension value, and the parent node dimension value of the parent node dimension value.

[0124] In this context, a dimension refers to an attribute that is measured and summarized. Examples include member dimension, cost dimension, and time dimension. A tree structure refers to a binary or multi-way tree that represents the relationships between multiple dimension values ​​within the same dimension. For example, ... Figure 7 The tree structures shown are the member-dimensional tree structure, the cost-dimensional tree structure, and the time-dimensional tree structure.

[0125] For example, the computer device obtains the tree structure of the dimensions corresponding to the difference dimension values, obtains the parent node dimension value of the difference dimension value, the parent node dimension value of the parent node dimension value, and so on up to the root node dimension value from the tree structure. The above multiple parent node dimension values ​​are used as the grandparent dimension values ​​of the difference dimension values, and the difference dimension value and the grandparent dimension value are determined as the set of difference dimension values ​​corresponding to the difference dimension value.

[0126] Step 608: Combine the dimension value in the target non-detail block identifier with a dimension value in each set of difference dimension values ​​to obtain the cell identifier to be updated in the target non-detail block.

[0127] For example, the computer device combines the dimension values ​​in the target non-detail block identifiers with a dimension value in each set of difference dimension values ​​to obtain multiple cell identifiers to be updated in the target non-detail block.

[0128] In this embodiment, the identifier of the cell to be updated in the target non-detail block is determined by the above method, which provides basic data for subsequently determining the cell to be updated from the target non-detail block based on the identifier of the cell to be updated and updating the value in the cell to be updated.

[0129] In one embodiment, the multidimensional database update method further includes:

[0130] Get the identifier of the cell to be queried; based on the identifier of the cell to be queried, determine the non-detail block to be queried corresponding to the identifier of the cell to be queried; get the first version number and the second version number corresponding to the non-detail block to be queried. If the first version number and the second version number are the same, then the value of the cell corresponding to the identifier of the cell to be queried is used as the query result.

[0131] The query cell identifier is a string that corresponds one-to-one with the cell to be queried.

[0132] For example, the computer device obtains the identifier of the cell to be queried and the hierarchical structure corresponding to the multidimensional database, obtains multiple non-detailed block identifiers in the hierarchical structure, determines the query non-detailed block corresponding to the identifier of the cell to be queried based on the inclusion relationship between the identifier of the cell to be queried and the non-detailed block identifiers, obtains the first version number and the second version number corresponding to the query non-detailed block, compares the first version number and the second version number, and if the first version number and the second version number are the same, then the value of the cell corresponding to the identifier of the cell to be queried is taken as the query result.

[0133] In this embodiment, the accuracy of the query detail block is judged by comparing the first version number and the second version number of the query non-detail block. If the first version number and the second version number are the same, it means that the query non-detail block does not contain the cell to be updated, and the values ​​stored in the cells of the query non-detail block are accurate. The value of the cell corresponding to the cell to be queried is used as the query result, which ensures the accuracy of the query result. Furthermore, while the target non-detail block is modified, data can be read from the cells in other non-detail blocks, realizing the synchronous updating and querying of the multidimensional database.

[0134] In one exemplary embodiment, updating a multidimensional database includes the following steps:

[0135] Retrieve the target value corresponding to the target cell identifier in the multidimensional database, as well as the hierarchical structure of the multidimensional database. Determine the target cell based on the target cell identifier, then update the value in the target cell based on the target value, and generate an update version number after the update.

[0136] The process begins by retrieving the detailed block identifier from the hierarchical structure. The current detailed block identifier is then obtained from among multiple identifiers. This identifier is compared to the target cell identifier. If the target cell identifier does not include the current detailed block identifier, the next detailed block identifier from the multiple identifiers is used as the current identifier, and this process is repeated. If the target cell identifier includes the current detailed block identifier, the detailed block corresponding to the current identifier is identified as the target detailed block corresponding to the target cell identifier. The process then retrieves the non-detailed blocks from the parent nodes of the target detailed block, as well as the non-detailed blocks from the parent nodes, from the hierarchical structure up to the root node non-detailed block. These multiple parent node non-detailed blocks are identified as the target non-detailed blocks corresponding to the target cell identifier. Finally, the first version number and the second version number corresponding to the target non-detailed block are obtained, and the first version number is updated to the updated version number.

[0137] Obtain multiple dimension values ​​from the target cell identifier and multiple dimension values ​​from the target detail block. Compare the multiple dimension values ​​from the target cell identifier with the multiple dimension values ​​from the target detail block. Identify the dimension values ​​that exist in the target cell identifier but not in the target detail block identifier as the difference dimension values. Obtain the tree structure of the dimensions corresponding to the difference dimension values. From the tree structure, obtain the parent node dimension values ​​of the difference dimension values, the parent node dimension values ​​of the parent node dimension values, and so on, up to the root node dimension value. These multiple parent node dimension values ​​are used as the grandparent dimension values ​​of the difference dimension values. Determine the difference dimension values ​​and grandparent dimension values ​​as the set of difference dimension values ​​corresponding to the difference dimension values. Combine the dimension values ​​in the target non-detail block identifier with one dimension value from each set of difference dimension values ​​to obtain multiple cell identifiers to be updated in the target non-detail block.

[0138] Based on a preset number of target values ​​and corresponding cell identifiers to be updated, multiple asynchronous tasks are obtained corresponding to the target non-detailed blocks. These asynchronous tasks are executed simultaneously to update the values ​​in the cells corresponding to the cell identifiers to be updated. After the multiple asynchronous tasks are completed, the second version number corresponding to the target non-detailed block is updated to the updated version number.

[0139] In this embodiment, the hierarchical structure corresponding to the multidimensional database and the target value corresponding to the target cell identifier are obtained. Based on the target value, the value in the target cell corresponding to the target cell identifier is updated. Based on the hierarchical structure and the target cell identifier, the target non-detailed block corresponding to the target cell identifier is determined. The cell identifier to be updated in the target non-detailed block is determined, and the value in the cell to be updated corresponding to the cell identifier is updated. By dividing the multidimensional database into multiple detailed blocks and non-detailed blocks, and using a hierarchical structure to represent the relationship between detailed blocks and non-detailed blocks, the target non-detailed block to which the cell to be updated affected by the target cell belongs is quickly determined according to the target cell identifier and the hierarchical structure. Then, the cell identifier to be updated in each target non-detailed block is determined, which improves the efficiency of determining the cell identifier to be updated. The cell to be updated is determined from the target non-detailed block according to the cell identifier to be updated, and the value in the cell to be updated is updated. The target non-detailed block only stores the values ​​of some cells in the multidimensional data, which improves the determination speed of the cell to be updated and the efficiency of updating the value in the cell to be updated, thereby improving the update efficiency of the multidimensional database.

[0140] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0141] Based on the same inventive concept, this application also provides a multidimensional database update apparatus for implementing the multidimensional database update method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more embodiments of the multidimensional database update apparatus provided below can be found in the limitations of the multidimensional database update method described above, and will not be repeated here.

[0142] In one embodiment, such as Figure 8 As shown, a multidimensional database update device is provided, including: an acquisition module 802, a first update module 804, a determination module 806, and a second update module 808, wherein:

[0143] The acquisition module 802 is used to acquire the hierarchical structure corresponding to the multidimensional database, as well as the target value corresponding to the target cell identifier;

[0144] The first update module 804 is used to update the value in the target cell corresponding to the target cell identifier based on the target value;

[0145] Module 806 is used to determine the target non-detail block corresponding to the target cell identifier based on the hierarchical structure and the target cell identifier.

[0146] The second update module 808 is used to determine the identifier of the cell to be updated in the target non-detail block, and update the value in the cell corresponding to the identifier of the cell to be updated.

[0147] In one embodiment, the multidimensional database update device further includes a version number update module, which is used to: generate an update version number; obtain a first version number and a second version number corresponding to the target non-detail block, and update the first version number to the update version number; update the values ​​in the cells to be updated corresponding to all the cell identifiers to be updated in the target non-detail block, and then update the second version number to the update version number.

[0148] In one embodiment, the determining module 806 is further configured to: obtain the detail block identifier corresponding to the detail block in the hierarchical structure; determine the target detail block corresponding to the target cell identifier based on the inclusion relationship between the target cell identifier and the detail block identifier; determine the grandparent non-detail block of the target detail block in the hierarchical structure as the target non-detail block corresponding to the target cell identifier; the grandparent non-detail block refers to the parent node non-detail block of the target detail block, and the parent node non-detail block of the parent node non-detail block.

[0149] In one embodiment, the determining module 806 is further configured to: compare the dimension values ​​in the detail block identifier with the dimension values ​​in the target cell identifier; the detail block identifier includes at least one dimension value, and the target cell identifier contains multiple dimension values; if the target cell identifier contains all the dimension values ​​in the detail block identifier, then the detail block corresponding to the detail block identifier is determined as the target detail block corresponding to the target cell identifier.

[0150] In one embodiment, the second update module 808 is further configured to: generate an asynchronous task based on the target value and the identifier of the cell to be updated; and update the value in the cell to be updated corresponding to the identifier of the cell to be updated based on the asynchronous task.

[0151] In one embodiment, the second update module 808 is further configured to: obtain the target detail block identifier of the target detail block to which the target cell identifier belongs; determine the dimension values ​​in the target cell identifier that are different from those in the target detail block identifier as difference dimension values; obtain the tree structure of the dimensions corresponding to the difference dimension values, and determine the difference dimension values ​​and the grandparent dimension values ​​corresponding to the difference dimension values ​​in the tree structure as the set of difference dimension values ​​corresponding to the difference dimension values; the grandparent dimension value refers to the parent node dimension value of the difference dimension value and the parent node dimension value of the parent node dimension value; combine the dimension values ​​in the target non-detail block identifier with a dimension value in each set of difference dimension values ​​to obtain the cell identifier to be updated in the target non-detail block.

[0152] In one embodiment, the multidimensional database update device further includes a query module, which is used to: obtain the identifier of the cell to be queried; determine the query non-detail block corresponding to the identifier of the cell to be queried based on the identifier of the cell to be queried; obtain the first version number and the second version number corresponding to the query non-detail block; if the first version number and the second version number are the same, then take the value of the cell corresponding to the identifier of the cell to be queried as the query result.

[0153] Each module in the aforementioned multidimensional database update device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0154] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a multidimensional database update method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0155] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0156] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0157] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0158] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0159] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0160] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0161] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0162] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A multidimensional database update method, characterized in that, The method includes: Obtain the hierarchical structure of the multidimensional database and the target value corresponding to the target cell identifier; Based on the target value, the value in the target cell corresponding to the target cell identifier is updated; Obtain the detail block identifier corresponding to the detail block in the hierarchical structure; the cell identifier of each detail cell in the detail block contains the detail block identifier of the detail block; Based on the inclusion relationship between the target cell identifier and the detail block identifier, the target detail block corresponding to the target cell identifier is determined; The grandparent non-detail block of the target detail block in the hierarchical structure is determined as the target non-detail block corresponding to the target cell identifier; the grandparent non-detail block refers to the parent node non-detail block of the target detail block, and the parent node non-detail block of the parent node non-detail block. Obtain the target detail block identifier of the target cell identifier to which the target detail block identifier belongs; determine the dimension values ​​in the target cell identifier that are different from those in the target detail block identifier as difference dimension values; obtain the tree structure of the dimensions corresponding to the difference dimension values, and determine the difference dimension value and the grandfather dimension value corresponding to the difference dimension value in the tree structure as the set of difference dimension values ​​corresponding to the difference dimension value; the grandfather dimension value refers to the parent node dimension value of the difference dimension value and the parent node dimension value of the parent node dimension value; combine the dimension value in the target non-detail block identifier with one dimension value in each set of difference dimension values ​​to obtain the cell identifier to be updated in the target non-detail block, and update the value in the cell to be updated corresponding to the cell identifier to be updated.

2. The method according to claim 1, characterized in that, The method further includes: Generate an updated version number; Obtain the first version number and the second version number corresponding to the target non-detail block, and update the first version number to the updated version number; After updating the values ​​in the cells corresponding to all the cells to be updated in the target non-detail block, the second version number is updated to the updated version number.

3. The method according to claim 1, characterized in that, The multidimensional database refers to data composed of multiple cells with relationships between them.

4. The method according to claim 1, characterized in that, The step of determining the target detail block corresponding to the target cell identifier based on the inclusion relationship between the target cell identifier and the detail block identifier includes: The dimension values ​​in the detail block identifier are compared with the dimension values ​​in the target cell identifier; the detail block identifier includes at least one dimension value, and the target cell identifier contains multiple dimension values. If the target cell identifier contains all the dimension values ​​of the detail block identifier, then the detail block corresponding to the detail block identifier is determined as the target detail block corresponding to the target cell identifier.

5. The method according to claim 1, characterized in that, The step of updating the value in the cell corresponding to the cell identifier to be updated includes: An asynchronous task is generated based on the target value and the identifier of the cell to be updated; Based on the asynchronous task, the value in the cell corresponding to the cell identifier to be updated is updated.

6. The method according to claim 1, characterized in that, The step of determining the dimension values ​​in the target cell identifier that are different from those in the target detail block identifier as difference dimension values ​​includes: Obtain multiple dimension values ​​from the target cell identifier and multiple dimension values ​​from the target detail block; The multiple dimension values ​​in the target cell identifier are compared with the multiple dimension values ​​in the target detail block; The dimension values ​​that exist in the target cell identifier but not in the target detail block identifier are determined as the difference dimension values.

7. The method according to claim 1, characterized in that, The method further includes: Get the identifier of the cell to be queried; Based on the identifier of the cell to be queried, determine the non-detail block to be queried corresponding to the identifier of the cell to be queried; Obtain the first version number and the second version number corresponding to the non-detailed block being queried. If the first version number and the second version number are the same, then the value of the cell corresponding to the identifier of the cell to be queried is used as the query result.

8. A multidimensional database update device, characterized in that, The device includes: The acquisition module is used to obtain the hierarchical structure corresponding to the multidimensional database, as well as the target value corresponding to the target cell identifier; The first update module is used to update the value in the target cell corresponding to the target cell identifier based on the target value; A determination module is used to obtain the detail block identifier corresponding to the detail block in the hierarchical structure; the cell identifier of each detail cell in the detail block contains the detail block identifier of the detail block; based on the inclusion relationship between the target cell identifier and the detail block identifier, the target detail block corresponding to the target cell identifier is determined; the grandparent non-detail block of the target detail block in the hierarchical structure is determined as the target non-detail block corresponding to the target cell identifier; the grandparent non-detail block refers to the parent node non-detail block of the target detail block, and the parent node non-detail block of the parent node non-detail block; The second update module is used to obtain the target detail block identifier of the target detail block to which the target cell identifier belongs; determine the dimension values ​​in the target cell identifier that are different from those in the target detail block identifier as difference dimension values; obtain the tree structure of the dimensions corresponding to the difference dimension values, and determine the difference dimension values ​​and the grandfather dimension values ​​corresponding to the difference dimension values ​​in the tree structure as the set of difference dimension values ​​corresponding to the difference dimension values; the grandfather dimension value refers to the parent node dimension value of the difference dimension value and the parent node dimension value of the parent node dimension value; combine the dimension values ​​in the target non-detail block identifier with one dimension value in each set of difference dimension values ​​to obtain the cell identifier to be updated in the target non-detail block, and update the values ​​in the cells to be updated corresponding to the cell identifier to be updated.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Batch data updating method and device, electronic equipment and readable storage medium

    CN115495462A