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

By obtaining the validity identifier of the dimension combination key in the multi-dimensional database for pre-filtering and validity judgment, the problem of low query efficiency and mistaken data deletion of large-scale data sets is solved, and efficient query and data security are achieved.

WO2024187780A1PCT designated stage expired Publication Date: 2024-09-19KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/129284
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-14
Filing Date
2023-11-02
Publication Date
2024-09-19

AI Technical Summary

Technical Problem

In multi-dimensional databases, when dealing with large-scale data set queries, existing technologies lead to low query efficiency, and traditional technologies require manual deletion of invalid data, which can easily lead to accidental deletion of data and affect business operations.

Method used

By obtaining the validity identifier of the dimension combination keys stored in the multidimensional database, pre-filtering invalid dimension combination keys reduces the amount of query data, and performs validity judgment before saving the data to avoid accidental deletion of data.

Benefits of technology

It improves the data query efficiency of multi-dimensional databases, improves performance, enhances data security, and avoids accidental deletion of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023129284_19092024_PF_FP_ABST
    Figure CN2023129284_19092024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to a multi-dimensional database query method and apparatus, a device, and a storage medium. The method comprises: in response to a query request, acquiring dimensional composite state identifiers respectively corresponding to a plurality of dimensional composite keys stored in a multi-dimensional database, the dimensional composite state identifiers being used for representing the validity of the corresponding dimensional composite keys; determining a valid dimensional composite key from among the plurality of dimensional composite keys, the valid dimensional composite key being a dimensional composite key corresponding to a valid composite state identifier among the dimensional composite state identifiers; and querying the valid dimensional composite key and a metric value corresponding to the valid dimensional composite key to obtain a query result.
Need to check novelty before this filing date? Find Prior Art

Description

Multidimensional database query method, device, computer equipment and storage medium Related Applications This application claims priority to Chinese patent application number 2023102861818, filed on March 14, 2023, entitled “Multidimensional Database Query Method, Device, Computer Equipment and Storage Medium”, the entire text of which is hereby incorporated by reference. Technical Field The present application relates to the field of database technology, and in particular to a multidimensional database query method, device, computer equipment and storage medium. Background Art In the information society, making full and effective use of various data resources is a prerequisite for decision-making management, among which database technology is the core part of various information systems. At present, multidimensional databases are applied to business management systems, which use multidimensional databases to realize information query and perform data processing and calculation. When dealing with large-scale data set queries, it is very important to improve query efficiency. Summary of the invention In a first aspect, the present application provides a multidimensional database query method. The method comprises: In response to the query request, dimension combination state identifiers corresponding to a plurality of dimension combination keys stored in the multidimensional database are obtained; the dimension combination state identifiers are used to characterize the validity of the corresponding dimension combination keys; Determine a valid dimension combination key from the multiple dimension combination keys; the valid dimension combination key is a dimension combination key corresponding to the valid combination state identifier in the dimension combination state identifier; Query the valid dimension combination key and the measure value corresponding to the valid dimension combination key to obtain the query result. In a second aspect, the present application also provides a multidimensional database query device. The device comprises: An acquisition module, used for acquiring, in response to a query request, dimension combination state identifiers respectively corresponding to a plurality of dimension combination keys stored in a multidimensional database; the dimension combination state identifiers are used for indicating the validity of the corresponding dimension combination keys; A determination module, used to determine a valid dimension combination key from multiple dimension combination keys; the valid dimension combination key is a dimension combination key corresponding to the valid combination state identifier in the dimension combination state identifier; The query module is used to query the valid dimension combination keys and the measurement values ​​corresponding to the valid dimension combination keys to obtain the query results. In some embodiments, the multidimensional database query device also includes an identification module, which is used to respond to a rule creation request and determine a valid dimension combination rule that matches the rule creation request; and to judge the validity of multiple dimension combination keys according to the valid dimension combination rule to determine the dimension combination state identifications corresponding to the multiple dimension combination keys. In some embodiments, the multidimensional database query device also includes a saving module, which is used to determine the first dimension combination key and the corresponding first measurement value to be saved; judge the validity of the first dimension combination key according to the valid dimension combination rule; if the first dimension combination key is valid, perform corresponding saving processing according to the first dimension combination key and the corresponding first measurement value. In some embodiments, the saving module is also used to, when the first dimension combination key is valid, compare the first dimension combination key with multiple dimension combination keys stored in the multidimensional database to obtain a comparison result; when the comparison result indicates that the first dimension combination key and the multiple dimension combination keys are different, the first dimension combination key and the corresponding first measurement value are newly saved to the multidimensional database, and the dimension combination state identifier corresponding to the first dimension combination key is set to a valid combination state identifier. In some embodiments, the saving module is further configured to update a second metric value corresponding to the second dimensional combination key according to the first metric value when the comparison result indicates that the first dimensional combination key is the same as a second dimensional combination key among the multiple dimensional combination keys. In some embodiments, the multidimensional database query device further includes a deletion module, which is used to determine, in response to a deletion request, a third metric value corresponding to the third dimension combination key targeted by the deletion request from the multidimensional database; and clear the third metric value. In some embodiments, dimension combination status identifiers corresponding to multiple dimension combination keys are stored in a dimension combination status bitmap; the multidimensional database query device also includes a reconstruction module, which is used to respond to a rule change request and determine the changed effective dimension combination rule; when the amount of stored data in the multidimensional database is not zero, the dimension combination status bitmap is reconstructed according to the changed effective dimension combination rule. In some embodiments, the multidimensional database query device provided by the present application may also include: a data validity rule module, a data validity index module and a data query module, wherein the data validity rule module defines the corresponding valid data rules by the business, providing a basis for establishing a data validity index; the data validity index module is used to generate the corresponding data validity index according to the defined valid data rules, and provide retrieval for the query engine; the data query module is used for the query engine to use the data validity index for pre-filtering, invalid data will not be output, efficient filtering and better performance. In some embodiments, the determination module is also used to determine a valid combination state identifier used to characterize the validity of a corresponding dimension combination key from multiple dimension combination state identifiers stored in the dimension combination state bitmap; and to query a valid dimension combination key having a mapping relationship with the valid combination state identifier from multiple dimension combination keys. In a third aspect, the present application further provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the above-mentioned multidimensional database query method when executing the computer program. In a fourth aspect, the present application further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned multidimensional database query method are implemented. In a fifth aspect, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned multidimensional database query method are implemented. The details of one or more embodiments of the present application are set forth in the following drawings and description. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions are briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application, and ordinary technicians in this field can obtain other drawings based on the disclosed drawings without paying any creative work. FIG1 is a schematic diagram of an application environment of a multidimensional database query method in some embodiments; FIG2 is a schematic diagram of a flow chart of a multidimensional database query method in some embodiments; FIG3 is a schematic diagram of the relationship between dimensions of a multidimensional database in some embodiments; FIG4 is a schematic diagram of the relationship between a multidimensional database and a business application terminal in some embodiments; FIG5 is a diagram showing the relationship between dimension combination keys, metric values, and dimension combination status bitmaps in some embodiments; FIG6 is a schematic diagram of using a dimension combination state bitmap for querying in some embodiments; FIG7 is a structural block diagram of a multidimensional database query device in some embodiments; FIG8 is a diagram of the internal structure of a computer device in some embodiments; FIG. 9 is a diagram showing the internal structure of a computer device in some other embodiments. DETAILED DESCRIPTION In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. When dealing with large-scale data set queries, the applicant is aware of an information query method in which the business application obtains the corresponding query data set from the multidimensional database according to the query conditions, reads each item of data in the query data set one by one, and iteratively determines whether each item of data is valid data that meets the business requirements. However, the applicant has found that when dealing with large-scale data set queries, the query efficiency of the multidimensional database is very low. The multidimensional database query method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. Among them, the multidimensional database 102 can communicate with the business application terminal 104 through the network. The multidimensional database 102 receives the query request sent by the business application terminal 104, and obtains the dimension combination state identifiers corresponding to the multiple dimension combination keys stored in the multidimensional database 102; the dimension combination state identifier is used to characterize the validity of the corresponding dimension combination key. The multidimensional database 102 determines the valid dimension combination key corresponding to the valid combination state identifier in the dimension combination state identifier from the multiple dimension combination keys, and queries the valid dimension combination key and the metric value corresponding to the valid dimension combination key to obtain the query result. Among them, the business application terminal 104 can be but is not limited to various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. In some embodiments, as shown in FIG2 , a multidimensional database query method is provided, and the method is applied to a multidimensional database as an example for explanation. In this embodiment, the method includes but is not limited to the following steps: Step 202: in response to the query request, obtain dimension combination state identifiers respectively corresponding to a plurality of dimension combination keys stored in the multidimensional database. Among them, a multidimensional database (MDD) is composed of many objects similar to multidimensional arrays and is a database that directly stores multidimensional data. It should be noted that a multidimensional database stores at least one dimension combination key and at least one metric value corresponding to each dimension combination key. A dimension combination key is a combination of dimension members under at least one dimension defined by the multidimensional database, and a metric value is a specific data value corresponding to the dimension combination key. In some embodiments, assuming that there are only dimension members under two dimensions in a multidimensional database, 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, that is, [dimension 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 measurement value. For ease of understanding, let's take an example. Assume that the multidimensional database includes only two dimensions, namely the region dimension and the product dimension, and the measure value is sales. There are three items of data stored in the multidimensional database, namely [Africa, mobile phone 1, 100], [Africa, mobile phone 2, 200], and [Asia, mobile phone 1, 300]. Then [Africa, mobile phone 1], [Africa, mobile phone 2], and [Asia, mobile phone 1] are all dimension combination keys stored in the multidimensional database.

[0100] ,

[0200] and

[0300] are the measure values ​​corresponding to the dimension combination keys, respectively indicating that the sales corresponding to the dimension combination keys [Africa, Mobile 1] is 100, the sales corresponding to [Africa, Mobile 2] is 200, and the sales corresponding to [Asia, Mobile 1] is 300. In some embodiments, the multidimensional database includes multiple business systems, each of which is independent of the other, and each business system stores data related to a specific business. In each business system, the dimension combination key and the corresponding measurement value are also stored as a data item. In fact, querying data on the multidimensional database can also be querying multiple data items stored in a specified business system in the multidimensional database. For ease of understanding, an example is given. Assume that the multidimensional database includes two business systems, including a business system related to financial expenditure and a business system related to commodity sales. Among them, the business system related to financial expenditure can be shown in Figure 3, which specifically includes three dimensions, namely, the date dimension, the expenditure account dimension, and the family member dimension. It can be understood that the dimension members of the date dimension include week, Monday, Tuesday, and Wednesday, the dimension members of the expenditure account dimension include daily necessities, food expenses, and beverages, and the family dimension members include family, family member X, and family member Y. It should be noted that each cube in Figure 3 can be understood as a measure value stored corresponding to a certain dimension combination key. For example, when 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 family member X, the dimension combination key [Monday, daily necessities, family member X] can be formed. If the measure value stored in the cube pointed to by the arrow is 40, it means that the expenditure of family member X on buying daily necessities on Monday is 40. In some embodiments, each of the multiple dimension combination keys stored in the multidimensional database corresponds to a 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 does not sell them in Asia. Then, in the corresponding multidimensional database, the dimension combination status identifiers corresponding to the dimension combination keys [Africa, Mobile Phone 1] and [Africa, Mobile Phone 2] are the same, and the dimension combination status identifier characterizes that the dimension combination keys [Africa, Mobile Phone 1] and [Africa, Mobile Phone 2] are valid, indicating that it is a dimension combination that is valid for the business. However, the dimension combination key [Asia, Mobile Phone 1] is different from the dimension combination status identifiers corresponding to the above two dimension combination keys, and its corresponding dimension combination status identifier characterizes that the dimension combination key [Asia, Mobile Phone 1] is invalid, indicating that the dimension combination has no corresponding business semantics. Specifically, the business application terminal sends a query request to the multidimensional database, and the multidimensional database responds to the query request sent by the business application terminal and obtains dimension combination status identifiers corresponding to multiple dimension combination keys stored therein and used to identify the validity of each dimension combination key. Step 204: determine a valid dimension combination key from the multiple dimension combination keys. Among them, the valid dimension combination key is the dimension combination key corresponding to the valid combination state identifier in the dimension combination state identifier, that is, the valid dimension combination key is the dimension combination key that is valid for the business. The invalid dimension combination key is the dimension combination key corresponding to the invalid combination state identifier in the dimension combination state identifier. It should be noted that the invalid dimension combination key does not exist in a specific business scenario and has no specific business semantics. Specifically, the multidimensional database can directly determine a valid dimension combination key from the multiple dimension combination keys. Alternatively, the multidimensional database can also filter out invalid dimension combination keys from the multiple dimension combination keys to obtain a valid dimension combination key. In actual applications, since the dimension combination key and the corresponding measurement value are stored as one of the data in the multidimensional database, the validity judgment of each data in the multidimensional database can also be performed on the validity of each dimension combination key and the corresponding measurement value in the multidimensional database to determine whether each dimension combination key and the corresponding measurement value are valid. It should be noted that since invalid dimension combination keys have no specific business semantics, in the specific data query process, the multidimensional database needs to filter out invalid dimension combination keys and the measurement values ​​corresponding to the invalid dimension combination keys in advance, and only query the valid dimension combination keys and the measurement values ​​corresponding to the valid dimension combination keys that are valid for the business. Step 206: query the valid dimension combination key and the metric value corresponding to the valid dimension combination key to obtain a query result. Specifically, the multidimensional database may query the valid dimension combination keys and the metric values ​​corresponding to the valid dimension combination keys according to the query conditions to obtain query results that meet the query conditions. In some embodiments, query conditions are divided into empty filter condition query and filter condition query. The empty filter condition means directly outputting the valid dimension combination key and the metric value corresponding to the valid dimension combination key in the multidimensional database during data query, while the filter condition query further filters and screens the valid dimension combination key and the metric value corresponding to the valid dimension combination key in the multidimensional database to query the valid dimension combination key and the metric value corresponding to the valid dimension combination key that meet the requirements. It should be noted that, whether it is an empty filter condition query or a filter query, if the business sets the corresponding valid dimension combination rules, the corresponding dimension combination identifier will be established in the multidimensional database, and the query engine will use the dimension combination identifier to filter and select the valid dimension combination key and the corresponding measurement value data to obtain the query results that meet the query conditions. For ease of understanding, let's take an example. Assume that the multidimensional database stores the following two-dimensional data items: [Africa, mobile phone 1, 100], [Africa, mobile phone 2, 200], and [Asia, mobile phone 1, 300]. According to business requirements, the dimension combination key including Asia is an invalid dimension combination key, so [Asia, mobile phone 1] is an invalid dimension combination key, and the data item [Asia, mobile phone 1, 300] is invalid. Therefore, before querying, it is necessary to pre-filter the data item [Asia, mobile phone 1, 300], that is, to prevent it from participating in subsequent query output. When the query condition is an empty filter condition, the multidimensional database directly queries and outputs the valid dimension combination key and the corresponding metric value, that is, directly queries and outputs [Africa, mobile phone 1, 100] and [Africa, mobile phone 2, 200]. When the query condition is a query with filtering conditions, for example, only filtering out data including mobile phone 1, the multidimensional database filters the two valid data [Africa, mobile phone 1, 100] and [Africa, mobile phone 2, 200] to query and output [Africa, mobile phone 1, 100]. It should be noted that if invalid dimension combination keys are not pre-filtered before querying the multidimensional database, invalid data [Asia, mobile phone 1, 300] will be queried out, which is not in line with actual business. Therefore, it is necessary to use the method of this application to pre-filter invalid data in advance, and query data based on valid data to make the queried data meet actual business. The above-mentioned multidimensional database query method obtains the dimension combination status identifiers corresponding to the multiple dimension combination keys stored in the multidimensional database in response to the query request; wherein the dimension combination status identifier is used to characterize the validity of the corresponding dimension combination key; and determines the valid dimension combination key corresponding to the valid combination status identifier in the dimension combination status identifier from the multiple dimension combination keys, and can also implement pre-filtering of invalid dimension combination keys without having to judge whether each combination key is valid one by one, thereby reducing the amount of data queried. On this basis, the multidimensional database only queries the valid dimension combination keys that meet the business requirements and the metric values ​​corresponding to the valid dimension combination keys to obtain the query results. In other words, the present application can implement efficient filtering of invalid dimension combination keys before data query, thereby greatly improving the data query efficiency of the multidimensional database and improving performance at the same time. In addition, in the traditional technology, when maintaining the database, users are required to manually delete invalid data from the multidimensional database, but it is easy for users to manually delete valid data by mistake, which will have serious consequences for the multidimensional database and directly affect the operation of the business. Before performing data query, the present application can directly obtain the valid dimension combination key that matches the query request from the multiple dimension combination keys stored in the multidimensional database through the combination status identifiers of each dimension, so as to realize the pre-filtering of invalid dimension combination keys, and query the valid data based on the determination of the valid dimension combination key, without deleting the invalid dimension combination key and the corresponding measurement value, thus avoiding the accidental deletion of data and improving the data security of the multidimensional database. In some embodiments, before step 202, the multidimensional database query method of the present application specifically also includes but is not limited to: in response to a rule creation request, determining a valid dimension combination rule that matches the rule creation request; judging the validity of 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. The rule creation request is a request sent by the business application end for the multidimensional database to create a valid dimension combination rule. The valid dimension combination rule is used to indicate whether each dimension combination key is valid. Specifically, the business application end sends a rule creation request to the multidimensional database according to the corresponding business needs. After receiving the rule creation request sent by the business application end, the multidimensional database determines the valid dimension combination rule that matches the rule creation request. The multidimensional database judges the validity of multiple dimension combination keys according to the valid dimension combination rule. If the dimension combination key is determined to be valid, the corresponding dimension combination state identifier is set to the valid combination state identifier; if the dimension combination key is determined to be invalid, the corresponding dimension state identifier is set to the invalid combination state identifier. The multidimensional database can determine the dimension combination state identifier of each dimension combination key in the above manner, so that in the subsequent query process, the invalid dimension combination key with the dimension combination state identifier as the invalid combination state identifier can be filtered out, and only the valid dimension combination key with the dimension combination state identifier as the valid combination state identifier and the metric value corresponding to the valid dimension combination key are queried, thereby obtaining a query result that meets the business requirements and also improves the data query efficiency. In addition, the above manner does not require the deletion of invalid data from the multidimensional database, ensuring that all data can be safely stored in the multidimensional database, thereby improving the security of data storage. In some embodiments, the step of "responding to a rule creation request, determining a valid dimension combination rule that matches the rule creation request" specifically includes but is not limited to: responding to the rule creation request, obtaining the valid dimension combination semantics carried by the rule creation request; parsing the valid dimension combination semantics to generate a corresponding valid dimension combination rule. The valid dimension combination semantics are generated according to the preset 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. The corresponding valid dimension combination semantics can limit the dimension members under the region dimension to Africa, and the dimension members under the product dimension to mobile phone 1 and mobile phone 2. Specifically, the multidimensional database responds to the rule creation request sent by the business application end, and obtains the valid dimension combination semantics carried in the rule creation request for indicating whether the dimension combination key satisfies the validity. The multidimensional database parses the valid dimension combination semantics to generate corresponding valid dimension combination rules, which are used to characterize which dimension members under each dimension are valid, so that it is convenient to judge whether the dimension combination key is valid in the future, so as to pre-filter invalid dimension combination keys. In some embodiments, the business application end of the present application and the multidimensional database can use data in JavaScript Object Notation (JSON) format for data exchange, and the multidimensional database parses the data in JSON format and obtains valid dimension combination rules after performing corresponding processing. Among them, JSON is a lightweight, text-based, open data exchange format. In some embodiments, after the multidimensional database has formulated the valid dimension combination rules, the validity of multiple dimension combination keys is judged respectively. For each dimension combination key, it is judged whether each dimension member under the dimension combination key hits the valid dimension combination rule. If so, it means that the dimension combination key is valid and is a valid dimension combination key; if not, it means that the dimension combination key is invalid and is an invalid dimension combination key. In some embodiments, the valid dimension combination rule includes valid dimension member information under each dimension. For each dimension combination key that needs to be judged for validity, if all dimension members under each dimension of the dimension combination key satisfy the corresponding valid dimension member information, 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, the dimension combination key is invalid. For ease of understanding, an example is given. As shown in FIG4 , the business application end and the multidimensional database can communicate with each other. Assume that the valid dimension combination rule generated by the multidimensional database according to the instruction sent by the business application end is in the following form: region in (Africa) and product in (mobile phone 1, mobile phone 2), which includes the valid dimension member information corresponding to the region dimension and the product dimension, that is, the dimension member under the region dimension is Africa, and the dimension member under the product dimension is mobile phone 1 or mobile phone 2. The dimension combination key corresponding to the valid dimension combination key is valid. The multidimensional database determines the data set of the valid cube (i.e., valid data) according to the valid dimension combination rule. Then, the multidimensional database can perform data query on the determined valid data to obtain the data set of the query cube (i.e., query data). When the business application end needs to obtain the query data, the multidimensional database can use the query data as the data of the return cube and return it to the business application end. In some embodiments, if the valid dimension combination rule is in the following form: 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], the validity of these three dimension combination keys can be judged in the following ways. Since the dimension member under the region dimension of the first dimension combination key is Africa, it satisfies 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, which satisfies the valid dimension member information corresponding to the product dimension, so the first dimension combination key is valid. Since the dimension member under the region dimension of the second dimension combination key is Africa, it satisfies 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, which satisfies the valid dimension member information corresponding to the product dimension, so the second dimension combination key is valid. Since the dimension member under the region dimension of the third dimension combination key is Asia, it does not satisfy the valid dimension member information corresponding to the region dimension, so the third dimension combination key is invalid. In some embodiments, the multidimensional database query method of the present application specifically also includes but is not limited to: determining the first dimension combination key and the corresponding first measurement value to be saved; judging the validity of the first dimension combination key according to the valid dimension combination rules; and if the first dimension combination key is valid, performing corresponding saving processing according to the first dimension combination key and the corresponding first measurement value. In some embodiments, after querying the valid data in the multidimensional database, calculations can be performed on the queried valid data to generate corresponding data, and the data generated during the calculation process needs to be newly saved or updated, and the data generated during the calculation process is the first dimension combination key and the corresponding first measurement value. In some embodiments, the business application end may also send a save request to the multidimensional database, where the save request is used to indicate that the multidimensional data needs to add or update the data it carries. The data carried by the save request may also be the first dimension combination key and the corresponding first measurement value. Specifically, the multidimensional database determines the first dimension combination key and the corresponding first measurement value to be newly saved or updated, and makes a validity judgment on the first dimension combination key according to the established valid dimension combination rule to determine whether the first dimension combination key is valid. In the case where the multidimensional database determines that the first dimension combination key is valid, the first dimension combination key and the corresponding first measurement value are newly saved according to the first dimension combination key and the corresponding first measurement value, or only the first measurement value is updated and saved. In the case where the multidimensional database determines that the first dimension combination key is invalid, the first dimension combination key and the first measurement value are not saved. By performing a validity judgment before saving the data, the present application can ensure that the data saved in the multidimensional database is valid data, thereby reducing the waste of storage space and meeting actual business needs. In some embodiments, the step of "if the first dimension combination key is valid, then perform corresponding saving processing according to the first dimension combination key and the corresponding first measurement value" specifically includes but is not limited to: if the first dimension combination key is valid, compare the first dimension combination key with multiple dimension combination keys stored in the multidimensional database to obtain a comparison result; if the comparison result indicates that the first dimension combination key is different from the multiple dimension combination keys, then save the first dimension combination key and the corresponding first measurement value to the multidimensional database, and set the dimension combination state identifier corresponding to the first dimension combination key to the valid combination state identifier. Specifically, when the first dimension combination key is valid, the multidimensional database compares the first dimension combination key with the stored multiple dimension combination keys to obtain a comparison result. When the comparison result indicates that the first dimension combination key is different from the stored multiple dimension combination keys, it means that the first dimension combination key is a newly added dimension combination key. At this time, it is necessary to perform a new save process, that is, the first dimension combination key and the corresponding first metric value are newly saved in the multidimensional database. Since the first dimension combination key newly added to the multidimensional database is valid, it is necessary to set the dimension combination state flag corresponding to the first dimension combination key to a valid combination state flag. In some embodiments, the dimension combination state identifier can be further optimized, and its default value can be set to a valid combination state identifier, so as to represent that the corresponding dimension combination key is valid by default. In this case, after the first dimension combination key and the corresponding first metric value are added to the multidimensional database, the default dimension combination state of the first dimension combination key is a valid combination state identifier, and there is no need to set a dimension combination state identifier for it separately. In this way, it is not necessary to maintain each dimension combination state identifier, thereby reducing resource waste. In some embodiments, the multidimensional database query method of the present application specifically also includes but is not limited to: 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, the second measurement value corresponding to the second dimension combination key is updated according to the first measurement value. Specifically, when the first dimension combination key is valid, the multidimensional database compares the first dimension combination key with the stored multiple dimension combination keys to obtain a comparison result. When the comparison result indicates that the first dimension combination key is the same as one of the dimension combination keys in the stored multidimensional combination keys, that is, the second combination key, it means that the first dimension combination key is not a newly added dimension combination key, and an update and save process is required at this time, that is, only the second metric value corresponding to the second dimension combination key needs to be updated according to the first metric value, and there is no need to update the dimension combination key unnecessarily. In some embodiments, the multidimensional database query method of the present application specifically includes but is not limited to: in response to a deletion request, determining from the multidimensional database a third metric value corresponding to the third dimension combination key targeted by the deletion request; and clearing the third metric value. Specifically, the business application end can send a deletion request to the multidimensional database to request the deletion of one or more data. The multidimensional database responds to the deletion request sent by the business application end, and determines the third dimension combination key and the corresponding third measurement value targeted by the deletion request from the multidimensional database according to the one or more data carried in the deletion request. In order to ensure the integrity of data storage, the multidimensional database does not allow the entire data to be deleted directly, that is, the third dimension combination key and the corresponding third measurement value are not allowed to be deleted. At this time, the third measurement value can be cleared first to ensure that the third measurement value does not participate in the query and calculation process. In some embodiments, when the third dimension combination key and the third metric value need to be deleted, the third metric value can be set to NULL first to indicate that it is empty, that is, there is no data. For example, the third dimension combination key and the third metric value can be [Asia, Mobile 1]->300. When the multidimensional database performs the deletion process, [Asia, Mobile 1]->300 can be set to NULL first, that is, [Asia, Mobile 1]->NULL, and then all NULL data can be cleared. In this process, the multidimensional database will be rebuilt. In the process of reconstruction, the multidimensional database will regenerate the dimension combination state identifier corresponding to each dimension combination key according to the existing valid dimension combination rules. In some embodiments, the multidimensional database query method of the present application specifically also includes but is not limited to: responding to a rule change request, determining the changed effective dimension combination rule; when the amount of stored data in the multidimensional database is not zero, rebuilding the dimension combination status bitmap according to the changed effective dimension combination rule. The rule change request is sent by the business application end to instruct the multidimensional database to change the effective dimension combination rule. In some embodiments, the dimension combination state identifiers corresponding to the multiple dimension combination keys are stored in the dimension combination state bitmap. The present application can facilitate the subsequent update of the dimension combination state bitmap by adopting the storage method of the dimension combination state bitmap. In addition, the present application pre-establishes the dimension combination state bitmap, and uses each dimension combination state identifier in the dimension combination bitmap as an index, which can achieve efficient filtering during data query and better performance. In some embodiments, as shown in FIG5 , the two columns of data on the left side of the arrow are the dimension combination keys and the metric values ​​corresponding to the dimension combination keys. According to the validity of the dimension combination keys in the two columns of data, the data in the third column on the right side of the arrow can be constructed, that is, the dimension combination state bitmap. The data stored in the dimension combination state bitmap is the dimension combination state identifier of each dimension combination key, wherein the dimension combination state identifier includes 0 and 1, wherein 0 represents a valid combination state identifier and 1 represents an invalid combination state identifier. Assuming that dimension combination key 1, dimension combination key 3, dimension combination key 4, dimension combination key 6 and dimension combination key 7 are valid, the dimension combination state identifiers corresponding to the first position, the third position, the fourth position, the sixth position and the seventh position of the dimension combination state bitmap are 0 respectively. Assuming that dimension combination key 2 and dimension combination key 5 are invalid, the dimension combination state identifiers corresponding to the second position and the fifth position of the dimension combination state bitmap are 1 respectively. Before performing data query calculation, you can refer to the dimension combination status identifiers stored in the dimension combination status bitmap shown in Figure 6 to filter out the dimension combination status identifier with a value of 1, that is, filter out the dimension status identifiers corresponding to the 2nd position and the 5th position, indicating 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 do not participate in the subsequent query calculation process. Specifically, the business application end sends a rule change request to the multidimensional database, and the multidimensional database regenerates the valid dimension combination rule in response to the rule change request. If the regenerated valid dimension combination rule is consistent with the previous valid dimension combination rule, it means that the rule has not changed and subsequent processing is not performed. If the valid dimension combination rule regenerated by the multidimensional database is inconsistent with the previous valid dimension combination rule, it means that the rule has changed, and the regenerated valid dimension combination rule is the changed valid dimension combination rule. When the amount of stored data in the multidimensional database is not zero, the dimension combination status bitmap is rebuilt according to the changed valid dimension combination rule. When the amount of stored data in the multidimensional database is zero, only the valid dimension combination rule is updated, and the corresponding dimension combination status bitmap is not processed. 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. In some embodiments, step 204 specifically includes but is not limited to: determining a valid combination state identifier used to characterize the validity of a corresponding dimension combination key from multiple dimension combination state identifiers stored in a dimension combination state bitmap; and querying a valid dimension combination key having a mapping relationship with the valid combination state identifier from multiple dimension combination keys. Specifically, before performing data query, the multidimensional database needs to determine the valid combination state identifier used to characterize the corresponding dimension combination key from the multiple dimension combination state identifiers stored in the dimension combination state bitmap, thereby filtering out the invalid combination state identifier used to characterize the corresponding dimension combination key as invalid. Then, the multidimensional database queries the dimension combination key with a mapping relationship with the valid combination state identifier from the stored multiple dimension combination keys as the valid dimension combination key, and can also pre-filter the invalid dimension combination key without having to judge whether each dimension combination key is valid one by one, thereby reducing the amount of data to be queried and improving data query efficiency. In some embodiments, the multidimensional database query method of the present application further includes but is not limited to the following steps: (1) The multidimensional database responds to the rule creation request sent by the business application end and obtains the valid dimension combination semantics carried in the rule creation request. (2) The multidimensional database parses the semantics of valid dimension combinations to generate corresponding valid dimension combination rules. (3) The multidimensional database judges the validity of multiple dimension combination keys according to the valid dimension combination rules to determine the dimension combination state identifiers corresponding to the multiple dimension combination keys and store them in the dimension combination state bitmap. (4) In response to the query request sent by the business application, the multidimensional database obtains dimension combination status identifiers corresponding to the multiple dimension combination keys stored in the multidimensional database from the dimension combination status bitmap. (5) The multidimensional database determines a valid combination state identifier from multiple dimension combination state identifiers to represent that the corresponding dimension combination key is valid. (6) The multidimensional database searches for valid dimension combination keys that have a mapping relationship with the valid combination state identifier from multiple dimension combination keys. (7) The multidimensional database queries the valid dimension combination keys and the measurement values ​​corresponding to the valid dimension combination keys to obtain query results. It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps. Based on the same inventive concept, the embodiment of the present application also provides a multidimensional database query device for implementing the multidimensional database query method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more multidimensional database query device embodiments provided below can refer to the limitations on the multidimensional database query method above, and will not be repeated here. In some embodiments, as shown in FIG. 7 , a multidimensional database query device is provided, including: an acquisition module 702 , a determination module 704 , and a query module 706 , wherein: The acquisition module 702 is used to obtain, in response to a query request, dimension combination state identifiers corresponding to a plurality of dimension combination keys stored in the multidimensional database; the dimension combination state identifier is used to indicate the validity of the corresponding dimension combination key; The determination module 704 is used to determine a valid dimension combination key from the plurality of dimension combination keys; the valid dimension combination key is a dimension combination key corresponding to the valid combination state identifier in the dimension combination state identifier; The query module 706 is used to query the valid dimension combination keys and the metric values ​​corresponding to the valid dimension combination keys to obtain query results. The above-mentioned multidimensional database query device obtains the dimension combination status identifiers corresponding to the multiple dimension combination keys stored in the multidimensional database in response to the query request; wherein the dimension combination status identifier is used to characterize the validity of the corresponding dimension combination key; and determines the valid dimension combination key corresponding to the valid combination status identifier in the dimension combination status identifier from the multiple dimension combination keys, and can also pre-filter the invalid dimension combination keys without having to judge whether each dimension combination key is valid one by one, thereby reducing the amount of data to be queried. On this basis, the multidimensional database only queries the valid dimension combination keys that meet the business requirements and the metric values ​​corresponding to the valid dimension combination keys to obtain the query results. In other words, the present application can achieve efficient filtering of invalid dimension combination keys during data query, thereby improving data query efficiency. In some embodiments, the multidimensional database query device also includes an identification module, which is used to respond to a rule creation request and determine a valid dimension combination rule that matches the rule creation request; and to judge the validity of multiple dimension combination keys according to the valid dimension combination rule to determine the dimension combination state identifications corresponding to the multiple dimension combination keys. In some embodiments, the identification module is also used to respond to a rule creation request and determine a valid dimension combination rule that matches the rule creation request; and to judge the validity of multiple dimension combination keys respectively according to the valid dimension combination rule to determine the dimension combination status identifications corresponding to the multiple dimension combination keys respectively. In some embodiments, the multidimensional database query device also includes a saving module, which is used to determine the first dimension combination key and the corresponding first measurement value to be saved; judge the validity of the first dimension combination key according to the valid dimension combination rule; if the first dimension combination key is valid, perform corresponding saving processing according to the first dimension combination key and the corresponding first measurement value. In some embodiments, the saving module is also used to, when the first dimension combination key is valid, compare the first dimension combination key with multiple dimension combination keys stored in the multidimensional database to obtain a comparison result; when the comparison result indicates that the first dimension combination key and the multiple dimension combination keys are different, the first dimension combination key and the corresponding first measurement value are newly saved to the multidimensional database, and the dimension combination state identifier corresponding to the first dimension combination key is set to a valid combination state identifier. In some embodiments, the saving module is further configured to update a second metric value corresponding to the second dimensional combination key according to the first metric value when the comparison result indicates that the first dimensional combination key is the same as a second dimensional combination key among the multiple dimensional combination keys. In some embodiments, the multidimensional database query device further includes a deletion module, which is used to determine, in response to a deletion request, a third metric value corresponding to the third dimension combination key targeted by the deletion request from the multidimensional database; and clear the third metric value. In some embodiments, dimension combination status identifiers corresponding to multiple dimension combination keys are stored in a dimension combination status bitmap; the multidimensional database query device also includes a reconstruction module, which is used to respond to a rule change request and determine the changed effective dimension combination rule; when the amount of stored data in the multidimensional database is not zero, the dimension combination status bitmap is reconstructed according to the changed effective dimension combination rule. In some embodiments, the determination module 704 is also used to determine a valid combination state identifier used to characterize the validity of a corresponding dimension combination key from multiple dimension combination state identifiers stored in the dimension combination state bitmap; and to query a valid dimension combination key having a mapping relationship with the valid combination state identifier from multiple dimension combination keys. Each module in the multidimensional database query device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module. In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data related to a multidimensional database. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a multidimensional database query method is implemented. In some embodiments, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG9. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a multidimensional database query method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse. Those skilled in the art will understand that the structures shown in FIGS. 8 and 9 are merely block diagrams of partial structures related to the scheme of the present application, and do not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than those shown in the figures, or combine certain components, or have a different arrangement of components. In some embodiments, a computer device is further provided. The computer device includes a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the steps in the above method embodiments are implemented. In some embodiments, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented. 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, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present 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), magnetoresistive 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto. The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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. [Corrected 08.12.2023 according to Rule 26] The above-mentioned embodiments only express several implementation methods of the present application, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present application. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present application, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be based on the attached claims.

Claims

1. A multidimensional database query method, the method comprising: In response to the query request, obtaining dimension combination state identifiers respectively corresponding to a plurality of dimension combination keys stored in the multidimensional database; The dimension combination state identifier is used to characterize the validity of the corresponding dimension combination key; Determining a valid dimension combination key from the multiple dimension combination keys; the valid dimension combination key is a dimension combination key corresponding to a valid combination state identifier in the dimension combination state identifier; and The valid dimension combination key and the metric value corresponding to the valid dimension combination key are queried to obtain a query result.

2. The method according to claim 1, wherein: Before obtaining the dimension combination state identifiers respectively corresponding to the plurality of dimension combination keys stored in the multidimensional database in response to the query request, the method further includes: In response to a rule creation request, determining a valid dimension combination rule that matches the rule creation request; and The validity of the multiple dimension combination keys is judged respectively according to the valid dimension combination rule to determine the dimension combination state identifiers respectively corresponding to the multiple dimension combination keys.

3. The method according to claim 2, wherein: The step of determining, in response to the rule creation request, a valid dimension combination rule matching the rule creation request includes: In response to a rule creation request, obtaining valid dimension combination semantics carried in the rule creation request; the valid dimension combination semantics is generated according to preset business requirements; and The valid dimension combination semantics are parsed to generate corresponding valid dimension combination rules.

4. The method according to claim 2, wherein: The method further comprises: Determine a first dimension combination key and a corresponding first metric value to be saved; determine the validity of the first dimension combination key according to the valid dimension combination rule; and When the first dimension combination key is valid, corresponding saving processing is performed according to the first dimension combination key and the corresponding first metric value.

5. The method according to claim 4, wherein: In the case where the first dimension combination key is valid, performing corresponding saving processing according to the first dimension combination key and the corresponding first metric value, including: If the first dimensional combination key is valid, comparing the first dimensional combination key with a plurality of dimensional combination keys stored in the multidimensional database to obtain a comparison result; and When the comparison result indicates that the first dimension combination key is different from the multiple dimension combination keys, the first dimension combination key and the corresponding first measurement value are newly saved in the multidimensional database, and the dimension combination state identifier corresponding to the first dimension combination key is set to a valid combination state identifier.

6. The method according to claim 5, wherein: The method further comprises: If the comparison result indicates that the first dimensional combination key is the same as a second dimensional combination key among the multiple dimensional combination keys, a second metric value corresponding to the second dimensional combination key is updated according to the first metric value.

7. The method according to any one of claims 1 to 6, wherein: The dimension combination state identifiers respectively corresponding to the multiple dimension combination keys are stored in a dimension combination state bitmap, and determining a valid dimension combination key from the multiple dimension combination keys includes: Determine, from the plurality of dimension combination state identifiers stored in the dimension combination state bitmap, a valid combination state identifier for indicating that the corresponding dimension combination key is valid; and A valid dimension combination key having a mapping relationship with the valid combination state identifier is searched from the multiple dimension combination keys.

8. The method according to claim 2, wherein: The method further comprises: In response to the rule change request, determining a changed effective dimension combination rule; and When the amount of stored data in the multidimensional database is not zero, the dimension combination state bitmap is rebuilt according to the changed effective dimension combination rule.

9. A multidimensional database query device, the device comprising: An acquisition module, used for acquiring, in response to a query request, dimension combination state identifiers respectively corresponding to a plurality of dimension combination keys stored in a multidimensional database; The dimension combination state identifier is used to characterize the validity of the corresponding dimension combination key; A determination module, configured to determine a valid dimension combination key from the plurality of dimension combination keys; the valid dimension combination key is a dimension combination key corresponding to a valid combination state identifier in the dimension combination state identifier; as well as The query module is used to query the valid dimension combination key and the metric value corresponding to the valid dimension combination key to obtain a query result.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 8 when executing the computer program.

11. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Entity disambiguation method and device, computer equipment and storage medium

    CN110457680A

  • Index generation method and device based on Hbase

    CN110704436A

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

    CN111460241A

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

    CN116226202A