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

By obtaining dimension combination status identifiers from a multidimensional database, determining valid combination keys, and performing pre-filtering, the problems of low query efficiency and poor data security in traditional multidimensional databases are solved, achieving efficient querying and secure storage.

CN116226202BActive Publication Date: 2026-11-20KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310286181.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-14
Publication Date
2026-11-20
Estimated Expiration
2043-03-14

AI Technical Summary

Technical Problem

Traditional multidimensional databases are inefficient when querying large-scale datasets and struggle to effectively filter invalid data, impacting business operations and data security.

Method used

By obtaining the dimension combination status identifiers stored in the multidimensional database, valid dimension combination keys are determined, and invalid data is pre-filtered before querying, thereby reducing the amount of data queried and improving query efficiency and data security.

Benefits of technology

It enables efficient filtering of invalid data without checking the validity of each dimension key combination, thereby improving the query efficiency and data security of multidimensional databases and preventing the accidental deletion of invalid data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116226202B_ABST
    Figure CN116226202B_ABST
Patent Text Reader

Abstract

The application relates to a multi-dimensional database query method, device and equipment and a storage medium, and relates to the technical field of databases.The method comprises the following steps: in response to a query request, acquiring dimension combination state identifiers corresponding to a plurality of dimension combination keys stored in a multi-dimensional database; the dimension combination state identifiers are used to represent the validity of the corresponding dimension combination keys; determining valid dimension combination keys from the plurality of dimension combination keys; the valid dimension combination keys are dimension combination keys corresponding to valid combination state identifiers in the dimension combination state identifiers; and querying the valid dimension combination keys and the metric values corresponding to the valid dimension combination keys to obtain a query result.The method can improve data query efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In an information society, making full and effective use of various data resources is a prerequisite for decision-making and management, and database technology is the core component of various information systems.

[0003] Currently, multidimensional databases are used in business management systems to enable information retrieval and to perform data processing and calculations.

[0004] Traditional information retrieval methods involve the application retrieving the corresponding query dataset from a multidimensional database based on query conditions, reading each data item in the dataset one by one, and iteratively determining whether each data item is valid and meets the business requirements. However, when dealing with large-scale dataset queries, this leads to very low query efficiency for multidimensional databases. Summary of the Invention

[0005] Therefore, it is necessary to provide a multidimensional database query method, apparatus, computer equipment, and storage medium that can improve query efficiency in response to the above-mentioned technical problems.

[0006] Firstly, this application provides a multidimensional database query method. The method includes:

[0007] In response to a query request, retrieve the dimension combination status identifiers corresponding to the multiple dimension combination keys stored in the multidimensional database; the dimension combination status identifiers are used to characterize the validity of the corresponding dimension combination keys.

[0008] Determine the valid dimension combination key from multiple dimension combination keys; the valid dimension combination key is the dimension combination key that corresponds to the valid combination status identifier in the dimension combination status identifier;

[0009] The query returns the results by querying the valid dimension key and the corresponding measure.

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

[0011] The acquisition module is used to respond to query requests and retrieve the dimension combination status identifiers corresponding to the multiple dimension combination keys stored in the multidimensional database; the dimension combination status identifiers are used to characterize the validity of the corresponding dimension combination keys;

[0012] The determination module is used to determine the valid dimension combination key from multiple dimension combination keys; the valid dimension combination key is the dimension combination key that corresponds to the valid combination status identifier in the dimension combination status identifier;

[0013] The query module is used to query the valid dimension key and the corresponding measure value to obtain the query results.

[0014] In some embodiments, the multidimensional database query device further includes an identification module, which is used to determine, in response to a rule creation request, a valid dimension combination rule that matches the rule creation request; and to perform validity judgment on multiple dimension combination keys according to the valid dimension combination rules, so as to determine the dimension combination status identifiers corresponding to the multiple dimension combination keys respectively.

[0015] In some embodiments, the multidimensional database query apparatus further includes a storage module, which is used to determine the first dimension key and the corresponding first measure value to be stored; to determine the validity of the first dimension key according to the valid dimension key combination rules; and to perform the corresponding storage process according to the first dimension key and the corresponding first measure value if the first dimension key is valid.

[0016] In some embodiments, the saving module is further configured to, when the first dimension key is valid, compare the first dimension key with multiple dimension keys stored in the multidimensional database to obtain a comparison result; when the comparison result indicates that the first dimension key is different from multiple dimension keys, the first dimension key and the corresponding first metric value are added and saved to the multidimensional database, and the dimension combination status identifier corresponding to the first dimension key is set as a valid combination status identifier.

[0017] In some embodiments, the storage module is further configured to update the second metric value corresponding to the second metric value according to the first metric value if the comparison result characterizes the first dimension combination key as being the same as the second dimension combination key among multiple dimension combination keys.

[0018] In some embodiments, the multidimensional database query apparatus further includes a deletion module, which, in response to a deletion request, determines from the multidimensional database the third measure value corresponding to the third dimension key targeted by the deletion request; and clears the third measure value.

[0019] In some embodiments, the dimension combination status identifiers corresponding to the multiple dimension combination keys are stored in the dimension combination status bitmap; the multidimensional database query device further includes a reconstruction module, which is used to determine the changed valid dimension combination rules in response to a rule change request; if the amount of stored data in the multidimensional database is not zero, the dimension combination status bitmap is reconstructed according to the changed valid dimension combination rules.

[0020] In some embodiments, the multidimensional database query apparatus provided in this application may further include: a data validity rule module, a data validity index module, and a data query module. The data validity rule module defines corresponding valid data rules by business logic, providing a basis for establishing a data validity index. The data validity index module generates a corresponding data validity index based on the defined valid data rules, providing retrieval for the query engine. The data query module is used by the query engine to perform pre-filtering using the data validity index, ensuring that invalid data is not output, resulting in efficient filtering and better performance.

[0021] In some embodiments, the determining module is further configured to determine a valid combination state identifier for characterizing the validity of the corresponding dimension combination key from multiple dimension combination state identifiers stored in the dimension combination state bitmap; and query a valid dimension combination key that has a mapping relationship with the valid combination state identifier from multiple dimension combination keys.

[0022] Thirdly, this application also provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described multidimensional database query method.

[0023] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in the above-described multidimensional database query method.

[0024] Fifthly, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps in the above-described multidimensional database query method.

[0025] The aforementioned multidimensional database query method, apparatus, computer equipment, storage medium, and computer program product, in response to a query request, obtain dimension combination status identifiers corresponding to multiple dimension combination keys stored in the multidimensional database. These dimension combination status identifiers characterize the validity of the corresponding dimension combination keys. By determining the valid dimension combination keys corresponding to the valid combination status identifiers from among the multiple dimension combination keys, and without needing to check the validity of each dimension combination key individually, it can also pre-filter invalid dimension combination keys, reducing the amount of data queried. Based on this, the multidimensional database only queries valid dimension combination keys that meet business requirements and the corresponding metrics, obtaining the query results. In other words, this application can achieve efficient filtering of invalid dimension combination keys before data querying, thereby significantly improving the data query efficiency of the multidimensional database. Attached Figure Description

[0026] Figure 1 This is a schematic diagram illustrating the application environment of the multidimensional database query method in some embodiments;

[0027] Figure 2 This is a flowchart illustrating the multidimensional database query method in some embodiments;

[0028] Figure 3 This is a schematic diagram illustrating the relationships between the dimensions of a multidimensional database in some embodiments;

[0029] Figure 4 This is a schematic diagram illustrating the relationship between the multidimensional database and the business application in some embodiments;

[0030] Figure 5 This is a diagram showing the relationship between the dimension combination keys, metric values, and dimension combination state bitmaps in some embodiments;

[0031] Figure 6 This is a schematic diagram illustrating the use of a dimension-combined state bitmap for querying in some embodiments;

[0032] Figure 7 This is a structural block diagram of a multidimensional database query device in some embodiments;

[0033] Figure 8 These are internal structural diagrams of the computer device in some embodiments;

[0034] Figure 9 This is an internal structural diagram of a computer device in some other embodiments. Detailed Implementation

[0035] 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.

[0036] The multidimensional database query method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, the multidimensional database 102 can communicate with the business application terminal 104 via a network. The multidimensional database 102 receives query requests from the business application terminal 104 and obtains the dimension combination status identifiers corresponding to the multiple dimension combination keys stored in the multidimensional database 102; the dimension combination status identifiers are used to characterize the validity of the corresponding dimension combination keys. The multidimensional database 102 determines the valid dimension combination key corresponding to the valid combination status identifier from the multiple dimension combination keys, and queries the valid dimension combination key and the corresponding metric value to obtain the query results. The business application terminal 104 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices.

[0037] In some embodiments, such as Figure 2 As shown, a multidimensional database query method is provided, which is illustrated using a multidimensional database as an example. In this embodiment, the method includes, but is not limited to, the following steps:

[0038] Step 202: In response to the query request, obtain the dimension combination status identifiers corresponding to the multiple dimension combination keys stored in the multidimensional database.

[0039] A multidimensional database (MDD) is composed of many objects similar to multidimensional arrays and is a type of database that directly stores multidimensional data. It's important to note that a multidimensional database stores at least one dimension key and at least one measure corresponding to that dimension key. The dimension key is a combination of dimension members defined by the multidimensional database, while the measure is the specific data value corresponding to the dimension key.

[0040] In some embodiments, assuming that the multidimensional database has only two dimension members, namely dimension member a under dimension A and dimension member b under dimension B, then the combination of dimension member a and dimension member b, i.e. [dimensional member a, dimension member b], can be understood as one of the dimension combination keys, and the specific data value corresponding to the dimension combination key is the measure value.

[0041] To facilitate understanding, let's illustrate with an example. Suppose a multidimensional database contains only two dimensions: region and product. The measure is sales revenue. This multidimensional database stores three data items: [Africa, Mobile 1, 100], [Africa, Mobile 2, 200], and [Asia, Mobile 1, 300]. Then, [Africa, Mobile 1], [Africa, Mobile 2], and [Asia, Mobile 1] are dimension combination keys stored in this multidimensional database.

[100] ,

[200] , and

[300] are the measure values ​​corresponding to the dimension combination keys, representing that the sales revenue corresponding to the dimension combination key [Africa, Mobile 1] is 100, [Africa, Mobile 2] is 200, and [Asia, Mobile 1] is 300.

[0042] In some embodiments, a multidimensional database includes multiple business systems, each independent of the others, and each storing data related to a specific business. Within each business system, the dimension key and its corresponding measure are stored as a single data item. Data queries on a multidimensional database can also involve querying multiple data items stored within a specified business system.

[0043] To facilitate understanding, let's illustrate with an example. Suppose a multidimensional database includes two business systems: one related to financial expenditures and the other to product sales. The financial expenditures-related business system can be described as follows: Figure 3 As shown, it specifically includes three dimensions: date, expenditure account, and family member. The date dimension includes the day of the week (Monday, Tuesday, and Wednesday); the expenditure account dimension includes daily necessities, food expenses, and beverages; and the family dimension includes the family, Zhang San, and Li Si. It should be noted that... Figure 3 Each cube in the diagram can be understood as a stored metric value corresponding to a certain dimension combination key. For example, if the dimension member of the date dimension is Monday, the dimension member of the expenditure account dimension is daily necessities, and the dimension member of the family member dimension is Zhang San, then the dimension combination key [Monday, daily necessities, Zhang San] can be formed. If the dimension combination key [Monday, daily necessities, Zhang San] stores a metric value of 40 at the cube pointed to by the arrow, it means that Zhang San spent 40 on daily necessities on Monday.

[0044] In some embodiments, multiple dimension combination keys stored in a multidimensional database each have a corresponding dimension combination status identifier, which is used to characterize the validity of the corresponding dimension combination key. For example, in a certain business scenario, a company only sells mobile phone 1 and mobile phone 2 in Africa and not in Asia. In the corresponding multidimensional database, the dimension combination key [Africa, Mobile Phone 1] and the dimension combination key [Africa, Mobile Phone 2] have the same dimension combination status identifier, and this identifier indicates that the dimension combination keys [Africa, Mobile Phone 1] and [Africa, Mobile Phone 2] are valid, representing a valid dimension combination for the business. However, the dimension combination key [Asia, Mobile Phone 1] has a different dimension combination status identifier than the above two, and its corresponding identifier indicates that the dimension combination key [Asia, Mobile Phone 1] is invalid, meaning that this dimension combination has no corresponding business semantics.

[0045] Specifically, the business application sends a query request to the multidimensional database. In response to the query request, the multidimensional database obtains the dimension combination status identifiers that correspond to the multiple dimension combination keys it stores and are used to identify the validity of each dimension combination key.

[0046] Step 204: Determine the valid dimension combination keys from multiple dimension combination keys.

[0047] Valid dimension combination keys are those corresponding to the valid combination status identifier in the dimension combination status identifier; that is, valid dimension combination keys are valid for the business logic. Invalid dimension combination keys are those corresponding to the invalid combination status identifier in the dimension combination status identifier. It should be noted that invalid dimension combination keys do not exist in specific business scenarios and have no specific business semantics.

[0048] Specifically, a multidimensional database can directly determine the valid dimension key from multiple dimension key combinations. Alternatively, a multidimensional database can also filter out invalid dimension key combinations from multiple dimension key combinations to obtain the valid dimension key combinations.

[0049] In practical applications, since the dimension key and its corresponding measure are stored as one of the data items in a multidimensional database, the validity judgment of each data item in the multidimensional database can also be performed on the validity judgment of each dimension key and its corresponding measure in the multidimensional database to determine whether each dimension key and its corresponding measure is valid.

[0050] It should be noted that since invalid dimension key combinations do not have specific business semantics, in the actual data query process, multidimensional databases need to filter out invalid dimension key combinations and their corresponding measures in advance, and only query valid dimension key combinations and their corresponding measures that are valid in the business context.

[0051] Step 206: Query the valid dimension key and the corresponding measure value to obtain the query results.

[0052] Specifically, a multidimensional database can query the valid dimension key and the corresponding measure value based on the query conditions to obtain query results that meet the query conditions.

[0053] In some embodiments, query conditions are divided into empty filter condition queries and filtered condition queries. An empty filter condition means that the valid dimension key combination and its corresponding measure value are directly output during data querying. A filtered condition query, on the other hand, further filters and selects the valid dimension key combination and its corresponding measure value from the multidimensional database to retrieve the valid dimension key combination and its corresponding measure value that meet the requirements.

[0054] It should be noted that, regardless of whether it is a query with empty filter conditions or a query with filters, if the business sets the corresponding valid dimension combination rules, the corresponding dimension combination identifier will be established in the multidimensional database. The query engine will use the dimension combination identifier to filter and select the valid dimension combination key and the corresponding measure value data, and obtain the query results that meet the query conditions.

[0055] To facilitate understanding, let's illustrate with an example. Suppose a multidimensional database stores two-dimensional data items in the following format: [Africa, Mobile 1, 100], [Africa, Mobile 2, 200], and [Asia, Mobile 1, 300]. According to business requirements, the dimension key including "Asia" is an invalid dimension key. Therefore, [Asia, Mobile 1] is an invalid dimension key, and the data item [Asia, Mobile 1, 300] is invalid. Thus, before performing a query, the data item [Asia, Mobile 1, 300] needs to be pre-filtered, meaning it shouldn't participate in the subsequent query output. When the query condition is an empty filter condition, the multidimensional database directly queries and outputs the valid dimension key and its corresponding measure value, which means it directly queries and outputs [Africa, Mobile 1, 100] and [Africa, Mobile 2, 200]. When the query condition is a filtered query, such as only filtering out data that includes mobile phone 1, the multidimensional database will filter the two valid data items [Africa, mobile phone 1, 100] and [Africa, mobile phone 2, 200] to output [Africa, mobile phone 1, 100].

[0056] It should be noted that if invalid dimension key combinations are not pre-filtered before querying a multidimensional database, invalid data such as [Asia, Mobile 1, 300] will be retrieved, which does not conform to actual business requirements. Therefore, the method described in this application is required to pre-filter invalid data and then query the data based on valid data, so that the retrieved data conforms to actual business requirements.

[0057] The aforementioned multidimensional database query method, in response to a query request, obtains dimension combination status identifiers corresponding to multiple dimension combination keys stored in the multidimensional database. These dimension combination status identifiers characterize the validity of the corresponding dimension combination keys. The method then determines the valid dimension combination keys corresponding to the valid combination status identifiers from among the multiple dimension combination keys. This pre-filtering of invalid dimension combination keys, without requiring a step-by-step evaluation of each combination key's validity, reduces the amount of data queried. Based on this, the multidimensional database only queries valid dimension combination keys that meet business requirements and their corresponding metrics to obtain the query results. In other words, this application can efficiently filter invalid dimension combination keys before data querying, thereby significantly improving the data query efficiency of the multidimensional database and enhancing performance.

[0058] Furthermore, traditional technologies require users to manually delete invalid data from the multidimensional database during database maintenance. However, this easily leads to accidental deletion of valid data, which can have serious consequences for the multidimensional database and directly impact business operations. This application, before data querying, can directly retrieve valid dimension combination keys matching the query request from multiple dimension combination keys stored in the multidimensional database using the combination status identifiers of each dimension. This pre-filters invalid dimension combination keys, allowing for the query of valid data once the valid dimension combination keys are identified. This eliminates the need to delete invalid dimension combination keys and their corresponding measures, avoiding accidental data deletion and improving the data security of the multidimensional database.

[0059] In some embodiments, prior to step 202, the multidimensional database query method of this application further includes, but is not limited to: responding to a rule creation request, determining a valid dimension combination rule that matches the rule creation request; and performing validity judgments on multiple dimension combination keys according to the valid dimension combination rules to determine the dimension combination status identifiers corresponding to the multiple dimension combination keys respectively.

[0060] The rule creation request is a request sent by the business application to enable the multidimensional database to create valid dimension combination rules. Valid dimension combination rules are used to characterize whether the combination keys of each dimension are valid.

[0061] Specifically, the business application sends a rule creation request to the multidimensional database based on its business requirements. Upon receiving the request, the multidimensional database determines the valid dimension combination rules that match the request. It then checks the validity of each dimension combination key according to these rules. If a dimension combination key is found to be valid, its corresponding dimension combination status is set to valid; otherwise, it is set to invalid. By determining the dimension combination status of each key, the multidimensional database can filter out invalid dimension combination keys with invalid status during subsequent queries. It only queries valid dimension combination keys with valid status and their corresponding measures, thus obtaining query results that meet business requirements and improving data query efficiency. Furthermore, this method eliminates the need to delete invalid data from the multidimensional database, ensuring secure storage and enhancing data security.

[0062] In some embodiments, the step "in response to a rule creation request, determine a valid dimension combination rule that matches the rule creation request" specifically includes, but is not limited to: in response to a rule creation request, obtaining the valid dimension combination semantics carried in the rule creation request; parsing the valid dimension combination semantics to generate the corresponding valid dimension combination rule.

[0063] The effective dimension combination semantics are generated based on pre-defined business requirements. For example, in a certain business scenario, a company only sells mobile phone 1 and mobile phone 2 in Africa and not in Asia. In this case, the effective dimension combination semantics can be defined as follows: the dimension member under the region dimension is Africa, and the dimension members under the product dimension are mobile phone 1 and mobile phone 2.

[0064] Specifically, in response to a rule creation request sent by a business application, the multidimensional database retrieves the valid dimension combination semantics carried in the rule creation request, which indicates whether the dimension combination key satisfies the validity requirement. The multidimensional database parses the valid dimension combination semantics to generate corresponding valid dimension combination rules. These rules characterize which dimension members under each dimension are valid, thus facilitating subsequent judgments on the validity of dimension combination keys and pre-filtering invalid dimension combination keys.

[0065] In some embodiments, the business application and the multidimensional database of this application can interact using JavaScript Object Notation (JSON) format. The multidimensional database then parses the JSON data and performs corresponding processing to obtain effective dimension combination rules. JSON is a lightweight, text-based, and open data exchange format.

[0066] In some embodiments, after the rules for valid dimension combinations are defined in the multidimensional database, the validity of multiple dimension combination keys is determined separately. For each dimension combination key, it is determined whether each dimension member under that dimension combination key matches the valid dimension combination rules. If so, the dimension combination key is valid; otherwise, it is invalid.

[0067] In some embodiments, the valid dimension combination rule includes valid dimension member information for each dimension. For each dimension combination key that needs to be validated, if all dimension members under each dimension of the dimension combination key satisfy the corresponding valid dimension member information, then the dimension combination key is valid; if there are dimension members under the dimension combination key that do not satisfy the corresponding valid dimension information, then the dimension combination key is invalid.

[0068] To make it easier to understand, an example is given below. For example... Figure 4 As shown, the business application and the multidimensional database can communicate with each other. Assume the valid dimension combination rule generated by the multidimensional database based on the instructions sent by the business application is in the following form: Region in (Africa) and Product in (Mobile Phone 1, Mobile Phone 2). This includes the valid dimension member information corresponding to the region and product dimensions. That is, the dimension member under the region dimension is Africa, and the dimension member under the product dimension is the dimension combination key corresponding to Mobile Phone 1 or Mobile Phone 2. The multidimensional database then determines the dataset of the valid cube (i.e., valid data) based on the valid dimension combination rule. Next, the multidimensional database can perform a data query on the determined valid data to obtain the dataset of the query cube (i.e., the query data). When the business application needs to obtain the query data, the multidimensional database can return the query data as the data of the return cube to the business application.

[0069] In some embodiments, if the valid dimension combination rule is in the form of: Region in (Africa) and Product in (Mobile Phone 1, Mobile Phone 2), and there are three dimension combination keys in the multidimensional database, namely [Africa, Mobile Phone 1], [Africa, Mobile Phone 2], and [Asia, Mobile Phone 1], then the validity of these three dimension combination keys can be determined in the following ways: Since the dimension member under the Region dimension of the first dimension combination key is Africa, satisfying the valid dimension member information corresponding to the Region dimension, and the dimension member under the Product dimension of the first dimension combination key is Mobile Phone 1, satisfying the valid dimension member information corresponding to the Product dimension, the first dimension combination key is valid. Since the dimension member under the Region dimension of the second dimension combination key is Africa, satisfying the valid dimension member information corresponding to the Region dimension, and the dimension member under the Product dimension of the second dimension combination key is Mobile Phone 2, satisfying the valid dimension member information corresponding to the Product dimension, the second dimension combination key is valid. Since the dimension member under the Region dimension of the third dimension combination key is Asia, not satisfying the valid dimension member information corresponding to the Region dimension, the third dimension combination key is invalid.

[0070] In some embodiments, the multidimensional database query method of this application further includes, but is not limited to: determining the first dimension combination key to be saved and the corresponding first measure value; judging the validity of the first dimension combination key according to the valid dimension combination rules; and performing the corresponding saving process according to the first dimension combination key and the corresponding first measure value if the first dimension combination key is valid.

[0071] In some embodiments, after querying valid data in a multidimensional database, calculations can be performed on the retrieved valid data to generate corresponding data. The data generated during the calculation process needs to be added and saved or updated and saved. The data generated during the calculation process consists of the first dimension combination key and the corresponding first measure value.

[0072] In some embodiments, the business application can also send a save request to the multidimensional database. The save request is used to indicate that the multidimensional database needs to add or update the data it carries. The data carried in the save request can also be the first dimension key and the corresponding first measure value.

[0073] Specifically, the multidimensional database determines the first dimension key and its corresponding first measure value to be added or updated. It then performs a validity check on the first dimension key based on established valid dimension combination rules. If the multidimensional database determines the first dimension key is valid, it adds or updates the first dimension key and its corresponding first measure value. If the multidimensional database determines the first dimension key is invalid, it does not save the first dimension key and its first measure value. This application, by performing a validity check before saving data, ensures that the data saved by the multidimensional database is valid, reducing storage space waste and meeting actual business needs.

[0074] In some embodiments, the step "if the first dimension key is valid, then perform the corresponding saving process according to the first dimension key and the corresponding first measure value" specifically includes, but is not limited to, the following: if the first dimension key is valid, compare the first dimension key with multiple dimension keys stored in the multidimensional database to obtain the comparison result; if the comparison result indicates that the first dimension key is different from multiple dimension keys, then add and save the first dimension key and the corresponding first measure value to the multidimensional database, and set the dimension combination status identifier corresponding to the first dimension key as a valid combination status identifier.

[0075] Specifically, if the first dimension key is valid, the multidimensional database compares it with each of the stored dimension keys to obtain the comparison results. If the comparison results indicate that the first dimension key is different from all the stored dimension keys, it means that the first dimension key is a newly added dimension key. In this case, an addition and saving process is required, that is, the first dimension key and its corresponding first measure value are added and saved to the multidimensional database. Since the first dimension key added to the multidimensional database is valid, the dimension combination status flag corresponding to the first dimension key needs to be set to a valid combination status flag.

[0076] In some embodiments, the dimension combination status identifier can be further optimized by setting its default value to a valid combination status identifier, which by default represents that the corresponding dimension combination key is valid. In this case, after adding the first dimension combination key and the corresponding first measure value to the multidimensional database, the default dimension combination status of the first dimension combination key is a valid combination status identifier, without the need to set a separate dimension combination status identifier for it. This approach eliminates the need to maintain the dimension combination status identifiers for each dimension, thereby reducing resource waste.

[0077] In some embodiments, the multidimensional database query method of this application further includes, but is not limited to, updating the second metric value corresponding to the second metric value based on the first metric value when the comparison result indicates that the first dimension combination key is the same as the second dimension combination key among multiple dimension combination keys.

[0078] Specifically, if the first dimension key is valid, the multidimensional database compares it with each of the stored dimension keys to obtain the comparison results. If the comparison results indicate that the first dimension key matches one of the stored multidimensional keys (i.e., the second key), then the first dimension key is not a newly added dimension key. In this case, an update and save process is required; that is, only the second measure corresponding to the second dimension key needs to be updated based on the first measure value, without unnecessary updates to the dimension key itself.

[0079] In some embodiments, the multidimensional database query method of this application further includes, but is not limited to: in response to a deletion request, determining from the multidimensional database the third measure value corresponding to the third dimension combination key targeted by the deletion request; and clearing the third measure value.

[0080] Specifically, business applications can send delete requests to the multidimensional database to request the deletion of one or more data items. The multidimensional database responds to the delete request by determining the third-dimensional key and corresponding third-dimensional measure value targeted by the deletion request based on the one or more data items carried in the request. To ensure data integrity, the multidimensional database does not allow direct deletion of entire data entries; that is, it does not allow the deletion of the third-dimensional key and its corresponding third-dimensional measure value. In this case, the third-dimensional measure value can be cleared first to ensure that it is not involved in the query and calculation process.

[0081] In some embodiments, when it is necessary to delete the third dimension key and the third measure, the third measure can be set to NULL first to indicate that it is empty, that is, there is no data. For example, the third dimension key and the third measure can be [Asia, Mobile 1]->300. When the multidimensional database performs the deletion process, it can first set [Asia, Mobile 1]->300 to NULL, that is, [Asia, Mobile 1]->NULL, and then clear all NULL data. During this process, the multidimensional database will be rebuilt. During the reconstruction process, the multidimensional database will regenerate the dimension combination status identifier corresponding to each dimension key according to the existing valid dimension combination rules.

[0082] In some embodiments, the multidimensional database query method of this application further includes, but is not limited to: in response to a rule change request, determining the changed valid dimension combination rules; and, if the amount of stored data in the multidimensional database is not zero, reconstructing the dimension combination state bitmap according to the changed valid dimension combination rules.

[0083] The rule change request is sent by the business application and is used to instruct the multidimensional database to change the rules for effective dimension combination.

[0084] In some embodiments, the dimension combination status identifiers corresponding to multiple dimension combination keys are stored in a dimension combination status bitmap. By adopting the dimension combination status bitmap storage method, this application can facilitate subsequent updates to the dimension combination status bitmap. In addition, this application pre-builds a dimension combination status bitmap and uses each dimension combination status identifier in the dimension combination bitmap as an index, which enables efficient filtering during data querying and improves performance.

[0085] In some embodiments, such as Figure 5 As shown, the two columns of data to the left of the arrow represent the dimension key and the corresponding measure value. Based on the validity of each dimension key in these two columns, the data in the third column to the right of the arrow can be constructed, namely the dimension combination status bitmap. This bitmap stores the dimension combination status identifiers for each dimension key. The dimension combination status identifiers include 0 and 1, where 0 represents a valid combination status identifier and 1 represents an invalid combination status identifier. Assuming dimension keys 1, 3, 4, 6, and 7 are valid, their corresponding dimension combination status identifiers at positions 1, 3, 4, 6, and 7 of the bitmap are 0, respectively. Assuming dimension keys 2 and 5 are invalid, their corresponding dimension combination status identifiers at positions 2 and 5 of the bitmap are 1, respectively. Before performing data query calculations, you can refer to... Figure 6 The dimension combination status bitmap displayed in the image stores the dimension combination status identifiers. Dimension combination status identifiers with a value of 1 are filtered out, that is, the dimension status identifiers corresponding to the 2nd and 5th positions are filtered out. This indicates that the dimension combination keys corresponding to these two dimension status identifiers, namely dimension combination key 2 and dimension combination key 5, are invalid and need to be pre-filtered and will not participate in the subsequent query calculation process.

[0086] Specifically, the application sends a rule change request to the multidimensional database. The multidimensional database responds by regenerating valid dimension combination rules. If the regenerated valid dimension combination rules are consistent with the previous ones, it means the rules have not changed, and no further processing is performed. If the regenerated valid dimension combination rules are inconsistent with the previous ones, it means the rules have changed, and the regenerated valid dimension combination rules are the changed valid dimension combination rules. If the multidimensional database has a non-zero amount of stored data, the dimension combination state bitmap is reconstructed based on the changed valid dimension combination rules. If the multidimensional database has zero stored data, only the valid dimension combination rules are updated, and the corresponding dimension combination state bitmap is not processed.

[0087] In some embodiments, if it is necessary to clear the valid dimension combination rules of the multidimensional database, it is necessary to delete the valid dimension combination rules stored in the metadata and simultaneously delete the dimension combination status bitmap established according to the valid dimension combination rules.

[0088] In some embodiments, step 204 specifically includes, but is not limited to: determining a valid combination state identifier from a plurality of dimension combination state identifiers stored in the dimension combination state bitmap to characterize the validity of the corresponding dimension combination key; and querying a valid dimension combination key from a plurality of dimension combination keys that has a mapping relationship with the valid combination state identifier.

[0089] Specifically, before performing a data query, a multidimensional database needs to determine the valid combination status identifiers from multiple dimension combination status identifiers stored in the dimension combination status bitmap, thereby filtering out invalid combination status identifiers that indicate the invalidity of the corresponding dimension combination keys. Next, the multidimensional database queries the stored multiple dimension combination keys for dimension combination keys that have a mapping relationship with the valid combination status identifiers. These are then used as valid dimension combination keys. This process, without needing to check the validity of each dimension combination key individually, also pre-filters invalid dimension combination keys, reducing the amount of data queried and improving data query efficiency.

[0090] In some embodiments, the multidimensional database query method of this application further includes, but is not limited to, the following steps:

[0091] (1) The multidimensional database responds to the rule creation request sent by the business application and obtains the valid dimension combination semantics carried in the rule creation request.

[0092] (2) The multidimensional database parses the semantics of effective dimension combinations to generate corresponding effective dimension combination rules.

[0093] (3) The multidimensional database performs validity checks on multiple dimension combination keys according to the valid dimension combination rules, so as to determine the dimension combination status identifiers corresponding to the multiple dimension combination keys and store them in the dimension combination status bitmap.

[0094] (4) In response to the query request sent by the business application, the multidimensional database obtains the dimension combination status identifiers corresponding to the multiple dimension combination keys stored in the multidimensional database from the dimension combination status bitmap.

[0095] (5) The multidimensional database determines the valid combination state identifiers from multiple dimension combination state identifiers to represent the validity of the corresponding dimension combination key.

[0096] (6) The multidimensional database queries the valid dimension combination keys that have a mapping relationship with the valid combination status identifier from multiple dimension combination keys.

[0097] (7) The multidimensional database queries the effective dimension key and the corresponding measure value to obtain the query results.

[0098] 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.

[0099] Based on the same inventive concept, this application also provides a multidimensional database query apparatus for implementing the multidimensional database query 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 query apparatus provided below can be found in the limitations of the multidimensional database query method described above, and will not be repeated here.

[0100] In some embodiments, such as Figure 7 As shown, a multidimensional database query device is provided, including: an acquisition module 702, a determination module 704, and a query module 706, wherein:

[0101] The acquisition module 702 is used to respond to a query request and acquire the dimension combination status identifiers corresponding to the multiple dimension combination keys stored in the multidimensional database; the dimension combination status identifiers are used to characterize the validity of the corresponding dimension combination keys;

[0102] The determination module 704 is used to determine the valid dimension combination key from multiple dimension combination keys; the valid dimension combination key is the dimension combination key corresponding to the valid combination status identifier in the dimension combination status identifier;

[0103] The query module 706 is used to query the valid dimension key and the corresponding measure value to obtain the query results.

[0104] The aforementioned multidimensional database query device, in response to a query request, obtains dimension combination status identifiers corresponding to multiple dimension combination keys stored in the multidimensional database. These dimension combination status identifiers characterize the validity of the corresponding dimension combination keys. It determines the valid dimension combination keys corresponding to the valid combination status identifiers from among the multiple dimension combination keys. This allows for pre-filtering of invalid dimension combination keys without needing to check the validity of each individual dimension combination key, thus reducing the amount of data queried. Based on this, the multidimensional database only queries valid dimension combination keys that meet business requirements and their corresponding metrics to obtain the query results. In other words, this application can efficiently filter invalid dimension combination keys during data querying, thereby improving data query efficiency.

[0105] In some embodiments, the multidimensional database query device further includes an identification module, which is used to determine, in response to a rule creation request, a valid dimension combination rule that matches the rule creation request; and to perform validity judgment on multiple dimension combination keys according to the valid dimension combination rules, so as to determine the dimension combination status identifiers corresponding to the multiple dimension combination keys respectively.

[0106] In some embodiments, the identification module is further configured to, in response to a rule creation request, determine a valid dimension combination rule that matches the rule creation request; and perform validity checks on multiple dimension combination keys according to the valid dimension combination rules to determine the dimension combination status identifiers corresponding to the multiple dimension combination keys respectively.

[0107] In some embodiments, the multidimensional database query apparatus further includes a storage module, which is used to determine the first dimension key and the corresponding first measure value to be stored; to determine the validity of the first dimension key according to the valid dimension key combination rules; and to perform the corresponding storage process according to the first dimension key and the corresponding first measure value if the first dimension key is valid.

[0108] In some embodiments, the saving module is further configured to, when the first dimension key is valid, compare the first dimension key with multiple dimension keys stored in the multidimensional database to obtain a comparison result; when the comparison result indicates that the first dimension key is different from multiple dimension keys, the first dimension key and the corresponding first metric value are added and saved to the multidimensional database, and the dimension combination status identifier corresponding to the first dimension key is set as a valid combination status identifier.

[0109] In some embodiments, the storage module is further configured to update the second metric value corresponding to the second metric value according to the first metric value if the comparison result characterizes the first dimension combination key as being the same as the second dimension combination key among multiple dimension combination keys.

[0110] In some embodiments, the multidimensional database query apparatus further includes a deletion module, which, in response to a deletion request, determines from the multidimensional database the third measure value corresponding to the third dimension key targeted by the deletion request; and clears the third measure value.

[0111] In some embodiments, the dimension combination status identifiers corresponding to the multiple dimension combination keys are stored in the dimension combination status bitmap; the multidimensional database query device further includes a reconstruction module, which is used to determine the changed valid dimension combination rules in response to a rule change request; if the amount of stored data in the multidimensional database is not zero, the dimension combination status bitmap is reconstructed according to the changed valid dimension combination rules.

[0112] In some embodiments, the determining module 704 is further configured to determine a valid combination state identifier for characterizing the validity of the corresponding dimension combination key from multiple dimension combination state identifiers stored in the dimension combination state bitmap; and query a valid dimension combination key that has a mapping relationship with the valid combination state identifier from multiple dimension combination keys.

[0113] Each module in the aforementioned multidimensional database query 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 operations corresponding to each module.

[0114] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data related to a multidimensional database. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a multidimensional database query method.

[0115] In some embodiments, 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 executed by the processor, the computer program implements a multidimensional database query 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.

[0116] Those skilled in the art will understand that Figure 8 and 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.

[0117] In some embodiments, a computer device is also provided, the computer device including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps in the above method embodiments.

[0118] In some embodiments, a computer program product is provided, which includes a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0119] 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.

[0120] 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.

[0121] 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.

[0122] 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 query method, characterized in that, The method includes: In response to a rule creation request, a valid dimension combination rule matching the rule creation request is determined; the valid dimension combination rule is generated after parsing the valid dimension combination semantics, which is generated according to preset business requirements. The validity of multiple dimension combination keys is determined according to the valid dimension combination rules, so as to determine the dimension combination status identifier corresponding to each of the multiple dimension combination keys and store it in the dimension combination status bitmap. In response to a query request, the dimension combination status identifiers corresponding to the multiple dimension combination keys stored in the multidimensional database are obtained from the dimension combination status bitmap; the dimension combination status identifiers are used to characterize the validity of the corresponding dimension combination keys. Valid dimension combination keys are determined from the plurality of dimension combination keys; the valid dimension combination key is the dimension combination key corresponding to the valid combination status identifier in the dimension combination status identifier; the valid dimension combination key refers to the dimension combination key that is valid for the business, and the invalid dimension combination key is the dimension combination key that has no corresponding business semantics; The query results are obtained by querying the valid dimension key and the corresponding metric.

2. The method according to claim 1, characterized in that, The step of determining a valid dimension combination rule that matches the rule creation request in response to the rule creation request includes: In response to a rule creation request, obtain the valid dimension combination semantics carried by the rule creation request; The semantics of the effective dimension combinations are parsed to generate corresponding effective dimension combination rules.

3. The method according to claim 1, characterized in that, The method further includes: Determine the first dimension key and its corresponding first metric value to be saved; determine the validity of the first dimension key according to the valid dimension combination rules. If the first dimension key is valid, then the corresponding saving process is performed based on the first dimension key and the corresponding first metric value.

4. The method according to claim 3, characterized in that, If the first dimension key is valid, then the corresponding saving process is performed based on the first dimension key and the corresponding first metric value, including: If the first dimension key is valid, the first dimension key is compared with multiple dimension keys stored in the multidimensional database to obtain the comparison results. If the comparison result indicates that the first dimension combination key is different from all the multiple dimension combination keys, then the first dimension combination key and the corresponding first metric value are newly saved to the multidimensional database, and the dimension combination status identifier corresponding to the first dimension combination key is set as a valid combination status identifier.

5. The method according to claim 4, characterized in that, The method further includes: If the comparison result indicates that the first dimension key is the same as the second dimension key among the plurality of dimension keys, then the second metric value corresponding to the second dimension key is updated according to the first metric value.

6. The method according to any one of claims 1 to 5, characterized in that, The dimension combination status identifiers corresponding to the plurality of dimension combination keys are stored in a dimension combination status bitmap. Determining a valid dimension combination key from the plurality of dimension combination keys includes: Valid combination state identifiers that characterize the validity of the corresponding dimension combination key are determined from the multiple dimension combination state identifiers stored in the dimension combination state bitmap. Query the valid dimension combination keys that have a mapping relationship with the valid combination status identifier from the multiple dimension combination keys.

7. The method according to claim 1, characterized in that, The method further includes: In response to a rule change request, determine the effective combination of dimensions rules after the change; If the amount of stored data in the multidimensional database is not zero, the dimension combination state bitmap is reconstructed according to the changed effective dimension combination rules.

8. A multidimensional database query device, characterized in that, The device includes: The acquisition module is used to, in response to a rule creation request, determine a valid dimension combination rule that matches the rule creation request; the valid dimension combination rule is generated after parsing the valid dimension combination semantics, which is generated according to preset business requirements; perform validity judgment on multiple dimension combination keys according to the valid dimension combination rule to determine the dimension combination status identifiers corresponding to the multiple dimension combination keys respectively, and store them in a dimension combination status bitmap; in response to a query request, retrieve the dimension combination status identifiers corresponding to the multiple dimension combination keys stored in the multidimensional database from the dimension combination status bitmap; the dimension combination status identifiers are used to characterize the validity of the corresponding dimension combination key; The determining module is used to determine a valid dimension combination key from the plurality of dimension combination keys; the valid dimension combination key is the dimension combination key corresponding to the valid combination status identifier in the dimension combination status identifier; the valid dimension combination key refers to the dimension combination key that is valid for business, and the invalid dimension combination key is the dimension combination key that has no corresponding business semantics; The query module is used to query the valid dimension key and the corresponding metric value to obtain the query results.

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

  • Data analysis method and device and storage medium

    CN109471874A

  • Method and device for preventing cache service breakdown, computer equipment and storage medium

    CN111339148A

  • Data query method and device, storage medium and electronic equipment

    CN112487032A

  • Rule-based data authority control method and system, electronic equipment and medium

    CN115186289A