Sandbox data query method, device and equipment in multidimensional database

By merging the data trees of the first storage unit and the second storage unit in the multi-dimensional database, a persistable data structure and target root node are generated, and the efficiency reduction caused by a large number of conflicts in sandbox data queries is solved, and more efficient data query and aggregation calculation are achieved.

CN114625733BActive Publication Date: 2025-02-28BEIJING YUANIAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210128284.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-11
Publication Date
2025-02-28
Estimated Expiration
2042-02-11

AI Technical Summary

Technical Problem

In sandbox data query in multidimensional databases, the prior art leads to waste of space and reduced query efficiency when handling a large number of conflicting cells.

Method used

By merging the data trees of the first storage unit and the second storage unit in the multi-dimensional database, a persistable data structure and target root node are generated, and the data traversal and aggregation calculation process is optimized.

Benefits of technology

Improves the efficiency of sandbox data query, avoids conflict problems with the same cell multiple times, and supports stronger traversal capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present application provides a method, device and equipment for querying sandbox data in a multidimensional database. The method includes: receiving a data query request sent by a user; determining the query range of the data to be queried according to the data query request; if the query range is a preset query range, determining the number of aggregated cells and non-aggregated cells in the query range; if the number of aggregated cells and non-aggregated cells meets the preset first condition, merging the latest readable version of the data tree of the first storage unit in the multidimensional database with the latest readable version of the data tree of the second storage unit to generate a persistent data structure, and generating a target root node for data query; according to the query range, traversing the data through the target root node to obtain the target cell value; returning the target cell value to the user as the result set of the query range. According to the embodiment of the present application, the efficiency of sandbox data query in a multidimensional database can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of database processing, and in particular, relates to a sandbox data query method, device and equipment in a multidimensional database. Background Art

[0002] In the database field, sandbox is used to provide an independent workspace for isolating data reading and writing. In multidimensional databases, sandbox is usually used to provide an independent work environment for isolating multidimensional cube data reading and writing.

[0003] The cube data in the multidimensional database sandbox can be divided into two storage units, wherein the first storage unit can store one or more changes to the baseline data, and the second storage unit is used to store the baseline data. Moreover, the first storage unit and the second storage unit store non-aggregate cells.

[0004] At present, when querying sandbox data and performing aggregate calculations, the principle of querying data from storage units is usually: if the Cell value exists in the first storage unit, then use the Cell value of the first storage unit; or, if the Cell value does not exist in the first storage unit, then use the Cell value of the second storage unit; or, if the Cell value does not exist in both the first and second storage units, then the Cell value is empty. Among them, the Cells obtained from the storage unit can be used for aggregate calculations or directly returned to the user.

[0005] In related technologies, there are two main ways to query sandbox data:

[0006] Method 1: Perform sandbox data query according to the user's data query range, that is, query data from the first storage unit and the second storage unit respectively, then merge the query data and handle conflicts; then, perform aggregate calculation using the merged data.

[0007] Method 2: When the data of the first storage unit and the second storage unit are stored in two data trees respectively, the two data trees of the first storage unit and the second storage unit are traversed at the same time, and node conflicts are handled during the traversal, and aggregation calculations are performed at the same time to reduce space complexity. During aggregation calculations, each time a Cell is obtained from a storage unit, it is directly added to the final aggregation result through calculation to reduce the space complexity to O(1).

[0008] However, when using the above method 1, if a large number of values ​​need to be obtained from the sandbox, and there are a large number of conflicting cells in the first storage unit and the second storage unit (that is, the first storage unit and the second storage unit have multiple identical cells at the same time), it may cause space waste and affect the query efficiency. In addition, when using the above method 2, since conflicts must be handled during each traversal when traversing two data trees at the same time, if a batch of cell values ​​is to be obtained, they must be obtained in order from small to large according to the lexicographic order of the cell paths of this batch, and then one of the cells in the batch is randomly obtained, which will affect the query efficiency.

[0009] Therefore, how to improve the query efficiency of sandbox data in a multidimensional database is a technical problem that technical personnel in this field need to solve urgently. Summary of the invention

[0010] Embodiments of the present application provide a method, apparatus, device, and computer-readable storage medium for querying sandbox data in a multidimensional database, which can improve the efficiency of querying sandbox data in a multidimensional database.

[0011] In a first aspect, an embodiment of the present application provides a method for querying sandbox data in a multidimensional database, the method comprising:

[0012] Receiving a data query request sent by a user, wherein the data query request includes information for representing a query scope of the data to be queried;

[0013] Determine the query scope of the data to be queried according to the data query request;

[0014] If the query range is the preset query range, the number of aggregated cells and non-aggregated cells in the query range is determined;

[0015] If the number of aggregated cells and non-aggregated cells meets a preset first condition, a persistent data structure is generated by merging the latest readable version of the data tree of the first storage unit and the latest readable version of the data tree of the second storage unit in the multidimensional database, and a target root node for data query is generated;

[0016] According to the query range, traverse the data through the target root node to obtain the target cell value;

[0017] The target cell value is returned to the user as a result set of the query range.

[0018] Optionally, the method also includes: if the number of aggregated cells and non-aggregated cells does not meet a preset first condition, determining whether the number of aggregated cells is 1, or whether the query range includes at least one entry cell; if the number of aggregated cells is 1, decomposing the aggregated cell into multiple sub-cells, and traversing the two data trees of the first storage unit and the second storage unit respectively to generate a result set of the query range.

[0019] Optionally, the method further includes: if the query range includes at least one input cell, traversing the two data trees, storing the cell values ​​obtained by the traversal into a final result set, and generating a result set of the query range.

[0020] Optionally, merging the latest readable version of the data tree of the first storage unit and the latest readable version of the data tree of the second storage unit in the multidimensional database to generate a persistent data structure and generating a target root node for data query includes:

[0021] Obtain a first root node of the latest readable version of a data tree of a first storage unit in a multidimensional database;

[0022] Obtain a second root node of the latest readable version of the data tree of the second storage unit in the multidimensional database;

[0023] Based on the first root node and the second root node, traverse the data tree of the first storage unit and the data tree of the second storage unit at the same time, detect conflicts and merge them;

[0024] Based on the persistent data structure generated by the merge, a target root node for data query is generated.

[0025] Optionally, the method further includes: marking the connected nodes generated when the persistent data structure is generated by merging; and splitting the persistent data structure according to the marks.

[0026] Optionally, split the persistable data structure based on tags, including:

[0027] According to the target root node and the mark, traverse to find the nodes that are connected;

[0028] For the nodes that are connected, according to the records during the merging, the pointer of the sub-item node pointer to the second storage unit is set to null, so as to realize the splitting of the persistent data structure.

[0029] Optionally, the method further includes: when traversing to find the nodes that generate connections, when traversing to the first node that does not generate connections, backtracking.

[0030] In a second aspect, an embodiment of the present application provides a sandbox data query device in a multidimensional database, the device comprising:

[0031] A request receiving module, used to receive a data query request sent by a user, wherein the data query request includes information used to characterize a query range of the data to be queried;

[0032] A scope determination module, used to determine the query scope of the data to be queried according to the data query request;

[0033] A quantity determination module, used for determining the number of aggregated cells and non-aggregated cells in the query range if the query range is a preset query range;

[0034] A node generation module, configured to merge the latest readable version of the data tree of the first storage unit and the latest readable version of the data tree of the second storage unit in the multidimensional database to generate a persistent data structure if the number of aggregated cells and non-aggregated cells meets a preset first condition, and generate a target root node for data query;

[0035] The acquisition module is used to traverse the data through the target root node according to the query range and obtain the target cell value;

[0036] The return module is used to return the target cell value as the result set of the query range to the user.

[0037] Optionally, the device is also used for:

[0038] If the number of aggregated cells and non-aggregated cells does not meet the preset first condition, determine whether the number of aggregated cells is 1, or whether the query range includes at least one input cell;

[0039] If the number of aggregated cells is 1, the aggregated cell is decomposed into multiple sub-cells, and the two data trees of the first storage unit and the second storage unit are traversed respectively to generate a result set of the query range.

[0040] Optionally, the device is also used for:

[0041] If the query range includes at least one input cell, two data trees are traversed, and the cell values ​​obtained by the traversal are stored in the final result set to generate a result set of the query range.

[0042] Optional, node generation module, specifically used for:

[0043] Obtain a first root node of the latest readable version of a data tree of a first storage unit in a multidimensional database;

[0044] Obtain a second root node of the latest readable version of the data tree of the second storage unit in the multidimensional database;

[0045] Based on the first root node and the second root node, traverse the data tree of the first storage unit and the data tree of the second storage unit at the same time, detect conflicts and merge them;

[0046] Based on the persistent data structure generated by the merge, a target root node for data query is generated.

[0047] Optionally, the device further comprises:

[0048] The node marking module is used to mark the connected nodes when merging to generate a persistent data structure;

[0049] Splitting module, used to split persistable data structures according to tags.

[0050] Optionally, split modules are used to:

[0051] According to the target root node and the mark, traverse to find the nodes that are connected;

[0052] For the nodes that are connected, according to the records during the merging, the pointer of the sub-item node pointer to the second storage unit is set to null, so as to realize the splitting of the persistent data structure.

[0053] Optionally, the device further comprises:

[0054] When traversing to find the nodes that produce connections, when traversing to the first non-connected node, backtracking is performed.

[0055] In a third aspect, an embodiment of the present application provides a sandbox data query device in a multidimensional database, the device comprising: a processor and a memory storing computer program instructions;

[0056] When the processor executes the computer program instructions, it implements the sandbox data query method in the multidimensional database as described in the first aspect.

[0057] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implements the sandbox data query method in a multidimensional database as described in the first aspect.

[0058] The sandbox data query method, device, equipment and computer-readable storage medium in the multidimensional database of the embodiment of the present application can merge the latest readable version of the data tree of the first storage unit and the latest readable version of the data tree of the second storage unit into a persistent data structure and generate a target root node. In this way, in subsequent traversal searches, the target root node can be used directly for traversal, and all conflicting nodes of the data tree can be processed at one time, thereby avoiding the problem of multiple processing of conflicts in the same Cell in related technologies, thereby improving the efficiency of sandbox data queries in the multidimensional database.

[0059] On the other hand, the persistent data structure generated by the merger can break the limitation that multiple sub-cells need to be traversed in lexicographic order of paths during aggregate calculations, and can support more powerful traversal capabilities, thereby improving the efficiency of sandbox data queries in multidimensional databases. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0061] Figure 1 It is a flowchart of a sandbox data query method in a multidimensional database provided by an embodiment of the present application;

[0062] Figure 2 It is a flowchart of a method for merging to generate a persistent data structure and generating a target root node for data query provided by an embodiment of the present application;

[0063] Figure 3 is a schematic diagram of a cube data tree of a first storage unit provided by an embodiment of the present application;

[0064] Figure 4 is a schematic diagram of a cube data tree of a second storage unit provided by an embodiment of the present application;

[0065] Figure 5 is a schematic diagram of a persistent data structure generated by merging provided by an embodiment of the present application;

[0066] Figure 6 It is a schematic diagram of a split persistent data structure provided by an embodiment of the present application;

[0067] Figure 7 It is a structural diagram of a sandbox data query device in a multidimensional database provided by an embodiment of the present application;

[0068] Figure 8 It is a structural diagram of a sandbox data query device in a multidimensional database provided by an embodiment of the present application. DETAILED DESCRIPTION

[0069] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0070] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0071] In order to solve the problems of the prior art, the embodiments of the present application provide a method, device, equipment and computer-readable storage medium for querying sandbox data in a multidimensional database. The following first introduces the method for querying sandbox data in a multidimensional database provided by the embodiments of the present application.

[0072] The sandbox data query method in a multidimensional database provided by the present application includes: receiving a data query request sent by a user, wherein the data query request includes information for characterizing the query range of the data to be queried; determining the query range of the data to be queried according to the data query request; if the query range is a preset query range, determining the number of aggregated cells and non-aggregated cells in the query range; if the number of aggregated cells and non-aggregated cells meets a preset first condition, merging the latest readable version of the data tree of the first storage unit in the multidimensional database with the latest readable version of the data tree of the second storage unit to generate a persistent data structure, and generating a target root node for data query; traversing the data through the target root node according to the query range to obtain a target cell value; and returning the target cell value to the user as a result set of the query range.

[0073] Figure 1 FIG. 1 is a flow chart showing a method for querying sandbox data in a multidimensional database provided by an embodiment of the present application. Figure 1 As shown,

[0074] S001. Receive a data query request sent by a user, where the data query request includes information for representing a query scope of data to be queried.

[0075] In an embodiment of the present application, when a user needs to query data, he can send a data query request to the pre-built multidimensional library Tabase. After Tabase receives the data query request sent by the user, it can execute subsequent operations S002 to S006 to return the query results to the user.

[0076] The query scope of the data to be queried, for example, a Cell path, a slice, or a block.

[0077] Optionally, before executing S001, the present application can also pre-create a sandbox for the multidimensional library based on the multidimensional library service, and enter data in the sandbox and the baseline data layer according to business needs. Secondly, enter data into the Cube in the sandbox, and the data is stored in the first storage unit. It should be noted that data is directly entered into the Cube without specifying a sandbox, and the data is stored in the second storage unit (baseline data layer).

[0078] S002. Determine a query scope of the data to be queried according to the data query request.

[0079] In the embodiment of the present application, after Tabase receives the data query request sent by the user, it can determine the query scope of the data to be queried according to the information contained in the data query request and used to characterize the query scope of the data to be queried.

[0080] S003: If the query range is a preset query range, determine the number of aggregated cells and non-aggregated cells in the query range.

[0081] In the embodiment of the present application, the preset query range may include slices or blocks.

[0082] For example, taking the preset query range as a slice (or a block) as an example, if the query range is a slice (or a block), it is considered that the query range is the preset query range.

[0083] S004. If the number of aggregated cells and non-aggregated cells meets a preset first condition, a persistent data structure is generated based on the latest readable version of the data tree of the first storage unit and the latest readable version of the data tree of the second storage unit in the multidimensional database, and a target root node for data query is generated.

[0084] The preset first condition includes that the number of aggregated cells in the query range is greater than 1, or there are both aggregated cells and recorded cells in the query range. For example, taking the query range as a slice (or block) as an example, that is, the number of aggregated cells in the slice (or block) is greater than 1, or there are both aggregated cells and recorded cells in the slice (or block).

[0085] Continuing with the above example, taking the query range as a slice (or block) as an example, when the number of aggregated cells in the slice (or block) is greater than 1, or there are both aggregated cells and input cells in the slice (or block), it is considered that the number of aggregated cells and non-aggregated cells meets the preset first condition.

[0086] For example, assuming that the query range is a slice, and the number of aggregated cells in the slice is 3, it is considered that the number of aggregated cells and non-aggregated cells meets the preset first condition. Alternatively, assuming that the query range is a slice, and there are both aggregated cells and input cells in the slice, it is considered that the number of aggregated cells and non-aggregated cells meets the preset first condition.

[0087] The target root node may be represented as TmpRoot, and may refer to a new version of the root node generated after synthesizing the persistent data structure for optimizing the query.

[0088] In one embodiment, Figure 2 As shown, according to the latest readable version of the data tree of the first storage unit and the latest readable version of the data tree of the second storage unit in the multidimensional database, a persistent data structure is generated and a target root node for data query is generated, including:

[0089] S021. Obtain a first root node of the latest readable version of a data tree of a first storage unit in a multidimensional database.

[0090] like Figure 3 , which is a schematic diagram of the cube data tree of the first storage unit in an embodiment of the present application. Wherein, root represents the first root node of the latest readable version of the data tree of the first storage unit. e1, e2 and e3 are child nodes of the first root node.

[0091] S022. Obtain a second root node of the latest readable version of the data tree of the second storage unit in the multidimensional database.

[0092] like Figure 4 FIG. 1 is a schematic diagram of a cube data tree of a second storage unit in an embodiment of the present application, wherein root represents the first root node of the latest readable version of the data tree of the first storage unit, and e1 and e2 are child nodes of the second root node.

[0093] S023. Based on the first root node and the second root node, traverse the data tree of the first storage unit and the data tree of the second storage unit at the same time, detect conflicts and merge them.

[0094] In the embodiment of the present application, based on the first root node and the second root node, the data tree of the first storage unit and the data tree of the second storage unit can be depth-first traversed simultaneously to detect conflicts and merge them.

[0095] When deep traversal is used to handle conflicts, backtracking is performed when the first non-conflicting node is encountered. Based on this, when the number of conflicting nodes in two trees is m, the time complexity of merging to generate a persistent data structure is O(m) and the space complexity is O(1). When merging, the nodes that generate the connection relationship are recorded.

[0096] S024. Generate a target root node for data query based on the persistent data structure generated by the merger.

[0097] Optionally, in this application, when merging to generate a persistent data structure, the nodes that are connected can be marked. Then, the persistent data structure is split according to the marks. If there are n connected points, the time complexity of the split is O(n). Figure 5 As shown, it is a schematic diagram of a persistent data structure generated by merging provided in an embodiment of the present application, wherein the connected nodes are generated, namely Figure 5 The nodes marked with the letter "c" in Figure 5 The nodes marked with the letter “a” in the figure represent conflicting nodes; Figure 5 The node marked with the letter "b" represents a common node of the original second storage unit; Figure 5 The node marked with the letter "d" represents a common node of the original first storage unit. Figure 5The "root" node on the right in the figure represents the target root node of the new version (ie, the root node of the original first storage unit).

[0098] It should be noted that if Figure 5 The nodes in the data tree shown can have multiple sub-items; secondly, for Figure 5 For each connected node, when merging, it can also record which sub-items come from the second storage unit, for example: the e2 sub-item of the root node; the e2 sub-item in the e1 node.

[0099] In an optional embodiment, splitting the persistent data structure according to the tag includes:

[0100] According to the target root node and the mark, traverse to find the nodes that are connected;

[0101] For the nodes that are connected, according to the records during the merging, the pointer of the sub-item node pointer to the second storage unit is set to null, so as to realize the splitting of the persistent data structure.

[0102] In the embodiment of the present application, if the number of nodes that conflict and generate connections is n, the time complexity of splitting is O(n).

[0103] like Figure 6 , which is a schematic diagram of a split persistent data structure provided in an embodiment of the present application. Figure 6 The node marked with the letter "b" represents a common node of the original second storage unit; Figure 6 The node marked with the letter "d" represents a common node of the original first storage unit.

[0104] In one embodiment, if the number of aggregated cells and non-aggregated cells does not meet the preset first condition, the solution further includes: determining whether the number of aggregated cells is 1, or whether the query range includes at least one entry cell; if the number of aggregated cells is 1, the aggregated cell is decomposed into multiple sub-cells, and the two data trees of the first storage unit and the second storage unit are traversed respectively to generate a result set of the query range. Alternatively, if the query range includes at least one entry cell, the two data trees are traversed, and the cell values ​​obtained by the traversal are stored in the final result set to generate a result set of the query range.

[0105] For example, in actual applications, the following two situations may occur in the query scope:

[0106] Case 1: There is only one aggregate cell in the query range;

[0107] Case 2: There is one or more entry cells in the query range.

[0108] For situation one, in the present application, the aggregate cell can be decomposed into multiple sub-cells, and the two data trees of the first storage unit and the second storage unit can be traversed at the same time. Node conflicts are handled during the traversal, and calculations are performed at the same time to generate a result set.

[0109] For situation 2, in the present application, the data tree of the first storage unit and the data tree of the second storage unit can be traversed at the same time, node conflicts can be handled during traversal, and the traversed cell values ​​can be stored in the final result set to generate a result set.

[0110] S005. According to the query range, traverse the data through the target root node to obtain the target cell value.

[0111] In the embodiment of the present application, the target root node TmpRoot can be used to traverse the data according to the query range to obtain the corresponding cell value. It should be noted that when querying the aggregate cell value, the sub-cells can be traversed in batches, and each traversal directly adds the sub-cell value to the final result of the aggregate cell. In addition, when obtaining cell values ​​in batches, there is no need to traverse from small to large in the lexicographic order of the batch cell path.

[0112] S006. Return the target cell value as a result set of the query range to the user.

[0113] The sandbox data query method in the multidimensional database of the embodiment of the present application can merge the latest readable version of the data tree of the first storage unit and the latest readable version of the data tree of the second storage unit into a persistent data structure, and generate a target root node. In this way, in subsequent traversal searches, the target root node can be used directly for traversal, and all conflicting nodes of the data tree can be processed at one time, thereby avoiding the problem of needing to process conflicts of the same Cell multiple times in related technologies, thereby improving the efficiency of sandbox data queries in the multidimensional database.

[0114] On the other hand, the persistent data structure generated by the merger can break the limitation that multiple sub-cells need to be traversed in lexicographic order of paths during aggregate calculations, and can support more powerful traversal capabilities, thereby improving the efficiency of sandbox data queries in multidimensional databases.

[0115] Figure 7 FIG. 1 is a schematic diagram showing the structure of a sandbox data query device in a multidimensional database provided by an embodiment of the present application. Figure 7 As shown, the device comprises:

[0116] The request receiving module 701 is used to receive a data query request sent by a user, wherein the data query request includes information for representing a query range of the data to be queried;

[0117] A range determination module 702 is used to determine the query range of the data to be queried according to the data query request;

[0118] A quantity determination module 703, configured to determine the quantity of aggregated cells and non-aggregated cells in the query range if the query range is a preset query range;

[0119] A node generation module 704 is configured to generate a persistent data structure by merging the latest readable version of the data tree of the first storage unit and the latest readable version of the data tree of the second storage unit in the multidimensional database if the number of aggregated cells and non-aggregated cells meets a preset first condition, and generate a target root node for data query;

[0120] The acquisition module 705 is used to traverse the data through the target root node according to the query range and obtain the target cell value;

[0121] The return module 706 is used to return the target cell value as a result set of the query range to the user.

[0122] In one embodiment, the device is also used to:

[0123] If the number of aggregated cells and non-aggregated cells does not meet the preset first condition, determine whether the number of aggregated cells is 1, or whether the query range includes at least one input cell;

[0124] If the number of aggregated cells is 1, the aggregated cell is decomposed into multiple sub-cells, and the two data trees of the first storage unit and the second storage unit are traversed respectively to generate a result set of the query range.

[0125] In one embodiment, the device is also used to:

[0126] If the query range includes at least one input cell, two data trees are traversed, and the cell values ​​obtained by the traversal are stored in the final result set to generate a result set of the query range.

[0127] In one embodiment, the node generation module 704 is specifically configured to:

[0128] Obtain a first root node of the latest readable version of a data tree of a first storage unit in a multidimensional database;

[0129] Obtain a second root node of the latest readable version of the data tree of the second storage unit in the multidimensional database;

[0130] Based on the first root node and the second root node, traverse the data tree of the first storage unit and the data tree of the second storage unit at the same time, detect conflicts and merge them;

[0131] Based on the persistent data structure generated by the merge, a target root node for data query is generated.

[0132] In one embodiment, the apparatus further comprises:

[0133] The node marking module is used to mark the connected nodes when merging to generate a persistent data structure;

[0134] Splitting module, used to split persistable data structures according to tags.

[0135] Optionally, split modules are used to:

[0136] According to the target root node and the mark, traverse to find the nodes that are connected;

[0137] For the nodes that are connected, according to the records during the merging, the pointer of the sub-item node pointer to the second storage unit is set to null, so as to realize the splitting of the persistent data structure.

[0138] In one embodiment, the apparatus further comprises:

[0139] When traversing to find the nodes that produce connections, when traversing to the first non-connected node, backtracking is performed.

[0140] Figure 7 Each module / unit in the device shown has the function of realizing Figure 1 The functions of each step in the process can achieve the corresponding technical effects, which will not be described in detail here for the sake of brevity.

[0141] Figure 8 A structural schematic diagram of a sandbox data query device in a multidimensional database provided in an embodiment of the present application is shown.

[0142] The sandbox data query device in the multidimensional database may include a processor 801 and a memory 802 storing computer program instructions.

[0143] Specifically, the processor 801 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0144] The memory 802 may include a large capacity memory for data or instructions. For example, but not limitation, the memory 802 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 802 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 802 may be inside or outside a sandbox data query device in a multidimensional database. In a specific embodiment, the memory 802 may be a non-volatile solid-state memory.

[0145] In one embodiment, the memory 802 may be a read-only memory (ROM). In one embodiment, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or a flash memory, or a combination of two or more of these.

[0146] The processor 801 implements any one of the sandbox data query methods in the multidimensional database in the above embodiments by reading and executing the computer program instructions stored in the memory 802 .

[0147] In one example, the sandbox data query device in the multidimensional database may further include a communication interface 803 and a bus 810. Figure 8 As shown, the processor 801, the memory 802, and the communication interface 803 are connected via a bus 810 and communicate with each other.

[0148] The communication interface 803 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0149] Bus 810 includes hardware, software or both, and the parts of the sandbox data query device in the multidimensional database are coupled to each other. For example, but not limitation, the bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 810 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.

[0150] In addition, in combination with the sandbox data query method in the multidimensional database in the above embodiment, the embodiment of the present application can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the sandbox data query methods in the multidimensional database in the above embodiment is implemented.

[0151] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0152] The functional modules shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. Programs or code segments can be stored in machine-readable media, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable media" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0153] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0154] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.

[0155] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A sandbox data query method in a multidimensional database, characterized in that: include: Receiving a data query request sent by a user, wherein the data query request includes information for characterizing a query scope of the data to be queried; Determining a query scope of the data to be queried according to the data query request; If the query range is a preset query range, determining the number of aggregated cells and non-aggregated cells in the query range; If the number of the aggregated cells and the non-aggregated cells meets a preset first condition, merging the latest readable version of the data tree of the first storage unit and the latest readable version of the data tree of the second storage unit in the multidimensional database to generate a persistent data structure, and generating a target root node for data query; According to the query range, traverse the data through the target root node to obtain the target cell value; Returning the target cell value as a result set of the query range to the user; If the number of the aggregated cells and the non-aggregated cells does not satisfy the preset first condition, determining whether the number of the aggregated cells is 1; If the number of the aggregated cell is 1, the aggregated cell is decomposed into a plurality of sub-cells, and the two data trees of the first storage unit and the second storage unit are traversed respectively to generate a result set of the query range.

2. The sandbox data query method according to claim 1, characterized in that: If the number of the aggregated cells and the non-aggregated cells does not satisfy the preset first condition, the method further includes: Determining whether the query range includes at least one non-aggregate cell; If the query range includes at least one non-aggregate cell, the two data trees are traversed, and the cell values ​​obtained by the traversal are stored in a final result set to generate a result set for the query range.

3. The sandbox data query method according to claim 1, characterized in that: The method of merging the latest readable version of the data tree of the first storage unit and the latest readable version of the data tree of the second storage unit in the multidimensional database to generate a persistent data structure and generating a target root node for data query includes: Obtain a first root node of a latest readable version of a data tree of the first storage unit in the multidimensional database; Obtain a second root node of the latest readable version of the data tree of the second storage unit in the multidimensional database; Based on the first root node and the second root node, traverse the data tree of the first storage unit and the data tree of the second storage unit at the same time, detect conflicts and merge them; The target root node for data query is generated according to the persistent data structure generated by the merger.

4. The sandbox data query method according to claim 3, characterized in that: The method further comprises: When merging to generate a persistent data structure, mark the connected nodes; The persistable data structure is split according to the tag.

5. The sandbox data query method according to claim 4, characterized in that: The step of splitting the persistent data structure according to the tag includes: According to the target root node and the mark, traverse and search for nodes that are connected; For the nodes to be connected, according to the records during merging, the pointer of the sub-item node pointer to the second storage unit is set to null, so as to realize the splitting of the persistent data structure.

6. The sandbox data query method according to claim 5, characterized in that: The method further comprises: When traversing to find the nodes that generate the connection, when traversing to the first node that does not generate the connection, backtracking is performed.

7. A sandbox data query device in a multidimensional database, characterized in that: The device comprises: A request receiving module, used to receive a data query request sent by a user, wherein the data query request includes information used to characterize a query scope of the data to be queried; A range determination module, used to determine the query range of the data to be queried according to the data query request; a quantity determination module, configured to determine the quantity of aggregated cells and non-aggregated cells in the query range if the query range is a preset query range; a node generation module, configured to merge a latest readable version of the data tree of the first storage unit and a latest readable version of the data tree of the second storage unit in the multidimensional database to generate a persistent data structure if the number of the aggregated cells and the non-aggregated cells meets a preset first condition, and generate a target root node for data query; An acquisition module, used to traverse data through the target root node according to the query range to acquire a target cell value; A return module, used for returning the target cell value as a result set of the query range to the user; The node generation module is also used to determine whether the number of aggregated cells is 1 if the number of aggregated cells and non-aggregated cells does not meet a preset first condition; if the number of aggregated cells is 1, the aggregated cell is disassembled into multiple sub-cells, and the two data trees of the first storage unit and the second storage unit are traversed respectively to generate a result set of the query range.

8. A sandbox data query device in a multidimensional database, characterized in that: The sandbox data query device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the sandbox data query method in the multidimensional database is implemented as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the sandbox data query method in the multidimensional database according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • System and method for sandboxing support in multidimensional database environment

    CN107533569A

  • Index method for massive multidimensional numerical value data range query

    CN108182242A