Multidimensional data analysis method, device, equipment and computer-readable storage medium
By building a data cube and self-service combining dimensions and indicators based on user query requests, the problem of inefficiency of existing multidimensional data analysis methods is solved, flexible and efficient multidimensional data analysis is achieved, and the user experience is enhanced.
Patent Information
- Application Number
- CN202110849478.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-27
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2041-07-27
AI Technical Summary
The execution efficiency of existing multidimensional data analysis methods is low, making it difficult to realize self-service multidimensional analysis by users.
By building a data cube, self-combining business-level dimensions and indicators based on user query requests, a structured query statement is generated and analysed in the target data cube, and query results are obtained.
It realizes the flexibility and efficiency of query, improves user experience, and enhances the self-service nature of multi-dimensional data analysis.
Smart Images

Figure CN113553341B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of data processing technology, and specifically to a multidimensional data analysis method, device, equipment and computer-readable storage medium. Background Art
[0002] At present, with the advancement of digitalization, the amount of accumulated data continues to grow. The demand for multi-dimensional analysis of massive data is becoming more and more valuable. However, traditional OLAP (online analytical processing) technology is difficult to meet the needs of efficiency and ease of use. The data analysis system in the existing technology can generally perform multi-dimensional data analysis queries through OLAP online analytical processing, mainly calculating the results through MapReduce, importing them into MySQL, Oracle, SQL Server, etc., to realize interactive query of data indicators. Another way is to rely on multi-dimensional analysis and calculation tools, such as Kylin, Durid, etc., to realize user interactive data analysis through SQL interface, which requires writing SQL for multi-dimensional analysis.
[0003] The inventors have found that the existing multidimensional data analysis methods have low execution efficiency and are difficult to implement self-service multidimensional analysis. Summary of the invention
[0004] In view of the above problems, the embodiments of the present invention provide a multidimensional data analysis method, device, equipment and computer-readable storage medium to solve the technical problems existing in the prior art that user self-service multi-analysis cannot be realized and the execution efficiency is low.
[0005] According to one aspect of an embodiment of the present invention, a multidimensional data analysis method is provided, which is applied to a multidimensional data analysis device. The method includes:
[0006] Receive a query request from a user; the query request includes the subject, dimension, and indicator of the business data to be queried;
[0007] Determine a target data cube and a structured query statement according to the query request; the multidimensional data analysis device includes at least one data cube, and the at least one data cube is obtained by pre-processing the business data according to the business subject's requirements for dimensions and indicators;
[0008] Query and analyze the target data cube according to the structured query statement to obtain a query result;
[0009] The query result is returned to the user.
[0010] In an optional manner, determining the target data cube and the structured query statement according to the query request includes:
[0011] Determine, from the at least one data cube, a data cube whose business subject matches the business subject of the query request as a target data cube;
[0012] Determining target dimension column information in the target data cube according to the dimension of the query request;
[0013] Determining target metric column information in the target data cube according to the index of the query request;
[0014] The structured query statement is generated according to the business subject, target dimension column information and target metric column information of the target data cube.
[0015] In an optional manner, querying and analyzing the target data cube according to the structured query statement to obtain the query result includes:
[0016] Determine the dimension value of the target dimension column in the target data cube and the index value of the target metric column under the target dimension column according to the target dimension column information and the target metric column information respectively;
[0017] A query result is generated according to the target dimension column information, the target metric column information, the dimension value of the target dimension column and the indicator value of the target metric column.
[0018] In an optional manner, the query result includes a result list; after returning the query result to the user, the method further includes:
[0019] Receive paging and sorting requests from users;
[0020] Paging and sorting the data results in the result list according to the paging and sorting request to obtain a processed result list;
[0021] The processed result list is returned to the user.
[0022] In an optional manner, before receiving the query request from the user, the method includes:
[0023] Collect source data;
[0024] Processing the source data to obtain a fact table and multiple dimension tables; the fact table includes foreign keys and fact data of the dimension table; the dimension table includes at least one dimension table dimension;
[0025] Obtain the business topics required by the user and the dimension and indicator requirement information corresponding to the business topics;
[0026] Associating the fact table with the dimension table to construct a data model corresponding to each of the business topics;
[0027] According to the dimension and indicator requirement information, dimension columns and metric columns are configured on the data model;
[0028] According to the dimension table corresponding to the business subject and the associated fact table, determine the index value of the metric column under the combination of all dimension columns to obtain a data cube;
[0029] The data cube, dimension column and metric column are respectively mapped to the subject, dimension and indicator defined in the non-relational database.
[0030] According to another aspect of an embodiment of the present invention, there is provided a multidimensional data analysis device, comprising:
[0031] A receiving module, used to receive a query request from a user; the query request includes the subject, dimension and index of the business data to be queried;
[0032] A determination module, used to determine a target data cube and a structured query statement according to the query request; the multidimensional data analysis device includes at least one data cube, and the at least one data cube is obtained by pre-processing the business data according to the business subject's requirements for dimensions and indicators;
[0033] An analysis module, used to query and analyze the target data cube according to the structured query statement to obtain a query result;
[0034] The returning module is used to return the query result to the user.
[0035] In an optional manner, querying and analyzing the target data cube according to the structured query statement to obtain the query result includes:
[0036] Determine the dimension value of the target dimension column in the target data cube and the index value of the target metric column under the target dimension column according to the target dimension column information and the target metric column information respectively;
[0037] A query result is generated according to the target dimension column information, the target metric column information, the dimension value of the target dimension column and the indicator value of the target metric column.
[0038] In an optional manner, determining the target data cube and the structured query statement according to the query request includes:
[0039] Determine, from the at least one data cube, a data cube whose business subject matches the business subject of the query request as a target data cube;
[0040] Determining target dimension column information in the target data cube according to the dimension of the query request;
[0041] Determining target metric column information in the target data cube according to the index of the query request;
[0042] The structured query statement is generated according to the business subject, target dimension column information and target metric column information of the target data cube.
[0043] According to another aspect of an embodiment of the present invention, a multidimensional data analysis device is provided, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the operation of the above-mentioned multidimensional data analysis method.
[0044] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein at least one executable instruction is stored in the storage medium. When the executable instruction is executed on a multidimensional data analysis device, the multidimensional data analysis device executes the operation of the multidimensional data analysis method described above.
[0045] The embodiment of the present invention constructs a data cube according to business data according to business themes, and determines the business dimension columns and measure columns in the data cube according to the dimensions and indicators corresponding to the business themes, so that the dimensions and indicators at the business level can be self-service combined according to the query request input by the user to query and analyze in the data cube, thereby achieving query flexibility, improving query efficiency, and enhancing user experience.
[0046] The above description is only an overview of the technical solution of the embodiment of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:
[0048] Figure 1 A schematic diagram of a multidimensional data analysis method provided by an embodiment of the present invention is shown;
[0049] Figure 2 A schematic diagram showing the structure of a multidimensional data analysis device provided by an embodiment of the present invention is shown;
[0050] Figure 3A schematic diagram of the structure of a multidimensional data analysis device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0051] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0052] First, technical terms appearing in the embodiments of the present invention are explained.
[0053] Data cube: A multidimensional space constructed by dimensions, which contains all the basic data (source data) to be analyzed. All aggregate data operations are performed on the data cube. Data cube is just a figurative term for multidimensional model. Multidimensional model is not limited to three-dimensional model, and more dimensions can be combined.
[0054] Dimension: It is an angle to observe data. One dimension corresponds to multiple dimension tables.
[0055] Metrics: The data to be analyzed and displayed, i.e. indicators. Multidimensional analysis can be performed on metric columns.
[0056] Fact table: The central table of a dimensional database is called a fact table. Its rows represent facts. The core content of the fact table is the measurement of different instances of an activity or event. It also stores fact values and foreign keys to dimension tables. All analytical data ultimately comes from the fact table.
[0057] Dimension table: Dimension table puts facts into context. It represents things such as time, product, customer and location. It can be time dimension table, product dimension table, customer dimension table, location dimension table and so on.
[0058] SQL (Structured Query Language) is referred to as SQL, which refers to structured query language. It is a database query and programming language used to access data as well as query, update and manage relational database systems.
[0059] Figure 1 The flowchart of the multidimensional data analysis method provided by the embodiment of the present invention is shown, and the method is executed by a multidimensional data analysis device. The multidimensional data analysis device can be a computer device, a terminal, a distributed device, etc. Figure 1 As shown, the method comprises the following steps:
[0060] Step 110: Receive a user's query request.
[0061] In an embodiment of the present invention, the query request includes the subject, dimension and index of the business data. The query request can be input by a user in a preset query interface. The query request also includes a business dimension filtering condition, which is used to determine the business logic tag.
[0062] Step 120: Determine the target data cube and structured query statement according to the query request; the multidimensional data analysis device includes at least one data cube, and the at least one data cube is obtained by pre-processing the business data according to the business subject's requirements for dimensions and indicators.
[0063] The corresponding target data cube is determined according to the business subject in the query request. The target data cube is constructed by processing the source data in advance according to the requirements of the business subject on dimensions and indicators.
[0064] In an embodiment of the present invention, the multidimensional data analysis device includes multiple data cubes, each of which corresponds to a business theme. All data cubes are constructed by processing the source data in advance according to the business theme's requirements for dimensions and indicators. The target data cube is one of the multiple data cubes.
[0065] The structured query statement may be an SQL statement, which includes target dimension column information and target metric column information.
[0066] In an embodiment of the present invention, determining a target data cube and a structured query statement according to the query request includes:
[0067] A data cube whose business subject matches the business subject of the query request is determined from the at least one data cube as the target data cube; wherein the data cube whose business subject matches the business subject of the query request means that there is the same business subject or there is a certain mapping relationship, for example, the business subject field in the query request is the same as the business subject field corresponding to the data cube in the multidimensional data analysis device, or the ID corresponding to the subject in the query request is determined, and the ID corresponding to the data cube in the multidimensional data analysis device is determined according to the ID, thereby determining the target data cube;
[0068] Determining target dimension column information in the target data cube according to the dimension of the query request;
[0069] Determining target metric column information in the target data cube according to the index of the query request;
[0070] The structured query statement is generated according to the business subject, target dimension column information and target metric column information of the target data cube.
[0071] In the embodiment of the present invention, the process of constructing a data cube is as follows:
[0072] S1: Collect source data. Collect source data according to preset data specifications; wherein the preset data specifications may be corresponding settings made by those skilled in the art according to business scenarios.
[0073] S2: Process the source data to obtain a fact table and a dimension table. The fact table includes the foreign key and fact data of the dimension table; the dimension table includes at least one dimension table dimension. The process of processing the source data includes the process of extracting, verifying, and converting the data. Specifically, when obtaining data in a fact table, extract the value in the fact table, verify the value, such as whether there is obvious erroneous data, etc., and then convert the source data into the required fact table and dimension table format according to the preset conversion rules. There are multiple dimension tables, which can be a date dimension table, a user type dimension table, etc.
[0074] S3: Obtain the business themes required by the user and the dimension and indicator requirement information corresponding to the business themes. The business themes required by the user and the business themes' requirements for dimensions and indicators are set according to actual needs, and the embodiment of the present invention does not specifically limit this. It can be understood that the business theme corresponds to multiple dimensions, and the multiple dimensions correspond to the dimensions in the corresponding dimension table.
[0075] S4: Associate the fact table and the dimension table to construct a data model corresponding to the business subject. Specifically, the fact table and the dimension table can be associated according to the business subject to obtain a data model. For example, in the field of communications, business subjects may include user subjects, billing subjects, video ringtone subjects, etc.; for user subjects, a fact table related to the user subject and at least one dimension table related to the user subject in multiple dimension tables can be obtained, and the related fact table and at least one dimension table can be associated to form a data model corresponding to the user subject; for billing subjects, a fact table related to the billing subject and at least one dimension table related to the billing subject in multiple dimension tables can be obtained, and the two can be associated to form a data model corresponding to the billing subject, and so on, thereby constructing multiple data models for different business subjects.
[0076] S4: According to the dimension and indicator requirement information, dimension columns and measure columns are configured on the data model. Taking the user theme as an example, the dimensions to be configured include date, company, client, login type, user type, channel, province and other dimensions, and the measures include the number of users, number of views and the like. According to the dimension table corresponding to the user theme and the associated fact table, the indicator values of the measures such as the number of users and number of views are counted under each dimension, and the indicator value can be queried from the fact table and calculated according to the corresponding fact value. Among them, the dimensions and measures configured on the data model are determined according to the business theme's requirements for dimensions and indicators. The business theme's requirements for dimensions and indicators are set by the user according to the specific business theme. By obtaining the dimension and indicator requirement information corresponding to the business theme, the target dimension column and target measure column are configured on the data model according to the dimension and indicator requirement information and the dimension table and fact table corresponding to the business theme. Specifically, the Kylin multidimensional analysis engine can be relied on to set the dimension fields and measure fields of the data model according to the dimension and indicator requirements of the user theme. Apache Kylin is an open source, distributed analytical data warehouse that provides SQL query interfaces and multidimensional analysis (OLAP) capabilities on Hadoop / Spark to support ultra-large-scale data.
[0077] S5: According to the dimension table corresponding to the business subject and the associated fact table, determine the index value of the metric column under the combination of all dimension columns to obtain a data cube.
[0078] When building a data cube based on Kylin's multidimensional analysis engine, taking the user's subject's requirements for dimensions and metrics (indicators) as an example, date, company, client, login_type, user_type, channel, and province are set as dimension columns of the data cube, and user_id (number of users), pv (number of views), and other fields are set as metric columns of the data cube. The combination of each dimension column constitutes a dimension of the data cube. In the process of building the data cube, the indicator value of the metric column under the combination of all dimension columns is calculated and saved, that is, the "date, company, client, login_type, user_type, channel, and province" dimension columns are combined respectively to obtain the corresponding metric column and the corresponding value of the metric column, and the corresponding value of the metric column is stored in the corresponding fact table. At this point, the multidimensional data cube configuration is completed, and the data can be analyzed in seconds by writing SQL queries. The target data cube is any data cube in the multidimensional data cube.
[0079] S6: Map the data cube, dimension column and metric column to the subject, dimension and indicator defined in the non-relational database. Further, after the data cube is constructed, map the target data cube, target dimension column and target metric column to the business subject, business dimension and business indicator respectively:
[0080] In the embodiment of the present invention, after the data cube is constructed, the data cube Cube is abstractly defined as a business subject in the non-relational database: since one business subject corresponds to one data cube, the data cube Cube is abstractly defined as a subject object, and the subject object includes the following attributes: subject ID, subject name, Chinese name, subject SQL, subject sequence Index, subject description, etc., so that the business subject object queried by the user through the interface corresponds to the data cube Cube one by one. Among them, the non-relational database is a NoSQL database.
[0081] In the embodiment of the present invention, after the data cube is constructed, the dimension columns of the data cube Cube are abstractly defined as the dimensions of the business subject: each dimension column of the data cube Cube is defined as a dimension object of the business subject, and the dimension object includes the following attributes: dimension ID, dimension name, dimension Chinese, dimension column, dimension value, dimension sequence Index, dimension description, etc. The business subject dimension queried by the user interface corresponds to the dimension column of the data cube. For example, if the user selects the query of "province" under the user subject in the interface, then "province" is the user subject dimension corresponding to the user interface, corresponding to the dimension column "province" of the data cube.
[0082] In an embodiment of the present invention, after constructing a data cube, the metric column of the data cube Cube is abstractly defined as an indicator of the business subject: the metric column of the data cube Cube is defined as an indicator of the business subject, and the indicator object includes the following attributes: indicator ID, indicator name, indicator Chinese, metric SQL, filter SQL, indicator sequence Index, indicator caliber description, SQL pseudocode, indicator description, etc. Through such a setting, the indicator input in the interface corresponds to the calculation result of the metric column in the data cube. For example, the user selects the "number of active users" indicator of the user subject in the interface, and the corresponding metric column SQL of the data cube is Count(distinct user_id). Among them, the filtering SQL is used to distinguish the business logic labels of the Cube, such as identifying the user type as active or new.
[0083] Through the above settings, the data cube, the dimension column of the data cube, and the metric column of the data cube are mapped to the business subject, business dimension, and business indicator defined by the configurable NoSQL (non-relational database). That is, the user inputs a query request in the interface, including the business subject, business dimension, and business indicator, so that the corresponding data cube, the dimension column of the data cube, and the metric column of the data cube can be determined, and the corresponding structured query statement is generated according to the target dimension column information and the target metric column information. The structured query statement is a structured request statement for statistical analysis based on the target dimension column and the target metric column in the target data cube.
[0084] The generation process of the structured query statement is as follows: using the target data cube corresponding to the business subject, the From segment of SQL is generated. For example, if the target data cube Cube of the query is user_subject (user subject), the From segment of the corresponding generated SQL statement is from user_subject; using the target dimension column of the target data cube corresponding to the business dimension of the query, the Select segment and Group by segment of SQL are generated. For example, if the business dimension of the query is company name and province, the corresponding dimension columns in the target data cube are Company and Province, the Select segment of the corresponding generated SQL statement is select Company, Province, and the Group by segment of the generated SQL statement is group by Company, Province; using the target metric column of the target data cube corresponding to the business indicator of the query, the statistical value of SQL is generated. For example, if the business indicator is the number of users, the metric column of the corresponding target data cube is user_id, and the statistical value of the corresponding generated SQL statement is count(distinct user_id). The above generated SQL segments are assembled into a complete SQL statement to obtain a structured query statement.
[0085] Step 130: query and analyze the target data cube according to the structured query statement to obtain a query result.
[0086] Among them, after the structured query statement is determined, the structured query statement is executed in the data analysis engine, and the target dimension column and the target metric column in the target data cube can be determined according to the target dimension column information and the target metric column information, thereby determining the dimension value of the target dimension column and the index value of the target metric column under the target dimension column. Specifically, according to the structured query statement, the fact table of the target data cube is queried to obtain the index value of the target metric column under the target dimension column.
[0087] Among them, the query result is generated according to the target dimension column information, the target metric column information, the dimension value of the target dimension column and the indicator value of the target metric column.
[0088] In the embodiment of the present invention, the data structure of the query result is a semi-structured JSON data format, including dimension column header information, indicator column header information and data list. Among them, the dimension column header information contains the dimension information of this query, including dimension name, Chinese name, dimension ID, dimension Index, etc.; the indicator headhunting information contains the indicator information of this query, including label name, Chinese name, indicator ID, indicator Index, etc.; the result list contains the data results of this query, and each result object contains all dimension values and indicator values of this query.
[0089] Step 140: Return the query result to the user.
[0090] When a user queries multiple business indicators, the query results include query results corresponding to the multiple business indicators.
[0091] In an embodiment of the present invention, a user's request for paging and sorting of query results is received, and a result list in the returned query results is sorted and paged according to the paging and sorting request. Specifically, a user's request for paging and sorting is received; according to the paging and sorting request, data results in the result list are paging and sorted to obtain a processed result list; and the processed result list is returned to the user.
[0092] In the embodiment of the present invention, the implementation of steps 110 to 130 is encapsulated through SDK (generally referring to a software development kit. Software development kits are generally a collection of development tools used by software engineers to build application software for specific software packages, software frameworks, hardware platforms, operating systems, etc.), exposing a unique data query interface to the outside world, unifying and standardizing the data query method, and making the calls to the data query by each system consistent.
[0093] The embodiment of the present invention constructs a data cube according to business themes for business data, determines business dimension columns and measure columns in the data cube according to the dimensions and indicators corresponding to the business themes, and abstractly defines the multidimensional analysis data model Cube as themes, dimensions, and indicators, so that business-level dimensions and indicators can be self-service combined according to the query requests input by users to perform query and analysis in the data cube, thereby achieving query flexibility, improving query efficiency, and enhancing user experience.
[0094] Figure 2 FIG. 2 shows a schematic diagram of the structure of a multidimensional data analysis device provided by an embodiment of the present invention. Figure 2 As shown, the device 200 includes:
[0095] Receiving module 210, used to receive a user's query request;
[0096] A determination module 220, configured to determine a target data cube and a structured query statement according to the query request;
[0097] An analysis module 230, configured to query and analyze the target data cube according to the structured query statement to obtain a query result;
[0098] The returning module 240 is used to return the query result to the user.
[0099] In an optional manner, determining the target data cube and the structured query statement according to the query request includes:
[0100] Determine, from the at least one data cube, a data cube whose business subject matches the business subject of the query request as a target data cube;
[0101] Determining target dimension column information in the target data cube according to the dimension of the query request;
[0102] Determining target metric column information in the target data cube according to the index of the query request;
[0103] The structured query statement is generated according to the business subject, target dimension column information and target metric column information of the target data cube.
[0104] In an optional manner, querying and analyzing the target data cube according to the structured query statement to obtain the query result includes:
[0105] Determine the dimension value of the target dimension column in the target data cube and the index value of the target metric column under the target dimension column according to the target dimension column information and the target metric column information respectively;
[0106] A query result is generated according to the target dimension column information, the target metric column information, the dimension value of the target dimension column and the indicator value of the target metric column.
[0107] In an optional manner, the query result includes a result list; after returning the query result to the user, the method further includes:
[0108] Receive paging and sorting requests from users;
[0109] Paging and sorting the data results in the result list according to the paging and sorting request to obtain a processed result list;
[0110] The processed result list is returned to the user.
[0111] In an optional manner, before receiving the query request from the user, the method includes:
[0112] Collect source data;
[0113] Processing the source data to obtain a fact table and multiple dimension tables; the fact table includes foreign keys and fact data of the dimension table; the dimension table includes at least one dimension table dimension;
[0114] Obtain the business topics required by the user and the dimension and indicator requirement information corresponding to the business topics;
[0115] Associating the fact table with the dimension table to construct a data model corresponding to each of the business topics;
[0116] According to the dimension and indicator requirement information, dimension columns and metric columns are configured on the data model;
[0117] According to the dimension table corresponding to the business subject and the associated fact table, determine the index value of the metric column under the combination of all dimension columns to obtain a data cube;
[0118] The data cube, dimension column and metric column are respectively mapped to the subject, dimension and indicator defined in the non-relational database.
[0119] The working process of the multidimensional data analysis device in the embodiment of the present invention is consistent with the specific steps of the multidimensional data analysis method described above, and will not be repeated here.
[0120] The embodiment of the present invention constructs a data cube according to business themes for business data, determines business dimension columns and measure columns in the data cube according to the dimensions and indicators corresponding to the business themes, and abstractly defines the multidimensional analysis data model Cube as themes, dimensions, and indicators, so that business-level dimensions and indicators can be self-service combined according to the query requests input by users to perform query and analysis in the data cube, thereby achieving query flexibility, improving query efficiency, and enhancing user experience.
[0121] Figure 3 The schematic diagram of the structure of the multidimensional data analysis device provided by the embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the multidimensional data analysis device.
[0122] like Figure 3 As shown, the multi-dimensional data analysis device may include: a processor (processor) 302 , a communication interface (Communications Interface) 304 , a memory (memory) 306 , and a communication bus 308 .
[0123] The processor 302, the communication interface 304, and the memory 306 communicate with each other via the communication bus 308. The communication interface 304 is used to communicate with other devices such as a client or other server network elements. The processor 302 is used to execute the program 310, which can specifically execute the relevant steps in the above-mentioned embodiment of the multi-dimensional data analysis method.
[0124] Specifically, the program 310 may include program code including computer executable instructions.
[0125] The processor 302 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiment of the present invention. The one or more processors included in the multidimensional data analysis device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.
[0126] The memory 306 is used to store the program 310. The memory 306 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0127] The program 310 can be specifically called by the processor 302 to enable the multidimensional data analysis device to perform the following operations:
[0128] Receive a query request from a user; the query request includes the subject, dimension, and indicator of the business data to be queried;
[0129] Determine a target data cube and a structured query statement according to the query request; the multidimensional data analysis device includes at least one data cube, and the at least one data cube is obtained by pre-processing the business data according to the business subject's requirements for dimensions and indicators;
[0130] Query and analyze the target data cube according to the structured query statement to obtain a query result;
[0131] The query result is returned to the user.
[0132] In an optional manner, determining the target data cube and the structured query statement according to the query request includes:
[0133] Determine, from the at least one data cube, a data cube whose business subject matches the business subject of the query request as a target data cube;
[0134] Determining target dimension column information in the target data cube according to the dimension of the query request;
[0135] Determining target metric column information in the target data cube according to the index of the query request;
[0136] The structured query statement is generated according to the business subject, target dimension column information and target metric column information of the target data cube.
[0137] In an optional manner, querying and analyzing the target data cube according to the structured query statement to obtain the query result includes:
[0138] Determine the dimension value of the target dimension column in the target data cube and the index value of the target metric column under the target dimension column according to the target dimension column information and the target metric column information respectively;
[0139] A query result is generated according to the target dimension column information, the target metric column information, the dimension value of the target dimension column and the indicator value of the target metric column.
[0140] In an optional manner, the query result includes a result list; after returning the query result to the user, the method further includes:
[0141] Receive paging and sorting requests from users;
[0142] Paging and sorting the data results in the result list according to the paging and sorting request to obtain a processed result list;
[0143] The processed result list is returned to the user.
[0144] In an optional manner, before receiving the query request from the user, the method includes:
[0145] Collect source data;
[0146] Processing the source data to obtain a fact table and multiple dimension tables; the fact table includes foreign keys and fact data of the dimension table; the dimension table includes at least one dimension table dimension;
[0147] Obtain the business topics required by the user and the dimension and indicator requirement information corresponding to the business topics;
[0148] Associating the fact table with the dimension table to construct a data model corresponding to each of the business topics;
[0149] According to the dimension and indicator requirement information, dimension columns and metric columns are configured on the data model;
[0150] According to the dimension table corresponding to the business subject and the associated fact table, determine the index value of the metric column under the combination of all dimension columns to obtain a data cube;
[0151] The data cube, dimension column and metric column are respectively mapped to the subject, dimension and indicator defined in the non-relational database.
[0152] The embodiment of the present invention constructs a data cube according to business data according to business themes, and determines the business dimension columns and measure columns in the data cube according to the dimensions and indicators corresponding to the business themes, so that the dimensions and indicators at the business level can be self-service combined according to the query request input by the user to query and analyze in the data cube, thereby achieving query flexibility, improving query efficiency, and enhancing user experience.
[0153] An embodiment of the present invention provides a computer-readable storage medium storing at least one executable instruction. When the executable instruction is executed on a multidimensional data analysis device, the multidimensional data analysis device executes the multidimensional data analysis method in any of the above method embodiments.
[0154] The executable instructions may be specifically used to enable the multidimensional data analysis device to perform the following operations:
[0155] Receive a query request from a user; the query request includes the subject, dimension, and indicator of the business data to be queried;
[0156] Determine a target data cube and a structured query statement according to the query request; the multidimensional data analysis device includes at least one data cube, and the at least one data cube is obtained by pre-processing the business data according to the business subject's requirements for dimensions and indicators;
[0157] Query and analyze the target data cube according to the structured query statement to obtain a query result;
[0158] The query result is returned to the user.
[0159] In an optional manner, determining the target data cube and the structured query statement according to the query request includes:
[0160] Determine, from the at least one data cube, a data cube whose business subject matches the business subject of the query request as a target data cube;
[0161] Determining target dimension column information in the target data cube according to the dimension of the query request;
[0162] Determining target metric column information in the target data cube according to the index of the query request;
[0163] The structured query statement is generated according to the business subject, target dimension column information and target metric column information of the target data cube.
[0164] In an optional manner, querying and analyzing the target data cube according to the structured query statement to obtain the query result includes:
[0165] Determine the dimension value of the target dimension column in the target data cube and the index value of the target metric column under the target dimension column according to the target dimension column information and the target metric column information respectively;
[0166] A query result is generated according to the target dimension column information, the target metric column information, the dimension value of the target dimension column and the indicator value of the target metric column.
[0167] In an optional manner, the query result includes a result list; after returning the query result to the user, the method further includes:
[0168] Receive paging and sorting requests from users;
[0169] Paging and sorting the data results in the result list according to the paging and sorting request to obtain a processed result list;
[0170] The processed result list is returned to the user.
[0171] In an optional manner, before receiving the query request from the user, the method includes:
[0172] Collect source data;
[0173] Processing the source data to obtain a fact table and multiple dimension tables; the fact table includes foreign keys and fact data of the dimension table; the dimension table includes at least one dimension table dimension;
[0174] Obtain the business topics required by the user and the dimension and indicator requirement information corresponding to the business topics;
[0175] Associating the fact table with the dimension table to construct a data model corresponding to each of the business topics;
[0176] According to the dimension and indicator requirement information, dimension columns and metric columns are configured on the data model;
[0177] According to the dimension table corresponding to the business subject and the associated fact table, determine the index value of the metric column under the combination of all dimension columns to obtain a data cube;
[0178] The data cube, dimension column and metric column are respectively mapped to the subject, dimension and indicator defined in the non-relational database.
[0179] The embodiment of the present invention constructs a data cube according to business data according to business themes, and determines the business dimension columns and measure columns in the data cube according to the dimensions and indicators corresponding to the business themes, so that the dimensions and indicators at the business level can be self-service combined according to the query request input by the user to query and analyze in the data cube, thereby achieving query flexibility, improving query efficiency, and enhancing user experience.
[0180] An embodiment of the present invention provides a multidimensional data analysis device, which is used to execute the multidimensional data analysis method.
[0181] An embodiment of the present invention provides a computer program, which can be called by a processor to enable a multidimensional data analysis device to execute the multidimensional data analysis method in any of the above method embodiments.
[0182] An embodiment of the present invention provides a computer program product, which includes a computer program stored on a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed on a computer, the computer executes the multidimensional data analysis method in any of the above method embodiments.
[0183] The algorithm or display provided herein is not inherently related to any particular computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the embodiment of the present invention is not directed to any specific programming language yet. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description made to specific languages above is for disclosing the best mode of the present invention.
[0184] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0185] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed invention requires more features than those expressly recited in each claim.
[0186] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0187] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.
Claims
1. A multidimensional data analysis method, characterized in that: Applied to a multidimensional data analysis device, the method comprises: Receive a query request from a user; the query request includes the subject, dimension, and indicator of the business data to be queried; Determine the target data cube and the structured query statement according to the query request; the multidimensional data analysis device includes at least one data cube, and the at least one data cube is obtained by pre-processing the business data according to the business subject's requirements for dimensions and indicators. The process of generating the structured query statement is: using the target data cube corresponding to the business subject to generate the From segment of the structured query statement, using the target dimension column of the target data cube corresponding to the queried business dimension to generate the Select segment and Group by segment of the structured query statement, using the target metric column of the target data cube corresponding to the queried business indicator to generate the statistical value of the structured query statement, thereby obtaining the structured query statement; Among them, the business data is constructed into a data cube according to the business theme. After the data cube is constructed, the data cube is abstractly defined as a business theme, one business theme corresponds to one data cube, and the data cube is abstractly defined as a theme object. The theme object includes the following attributes: theme ID, theme name, Chinese name, theme SQL, theme sequence Index, theme description, so that the business theme object queried by the user through the interface corresponds to the data cube one by one; and the dimension column of the data cube is abstractly defined as the dimension of the business theme, so that the business theme dimension queried in the user interface corresponds to the dimension column of the data cube; and the measurement column of the data cube is abstractly defined as the indicator of the business theme, so that the indicator input in the interface corresponds to the calculation result of the measurement column in the data cube; Query and analyze the target data cube according to the structured query statement to obtain a query result; The query result is returned to the user.
2. The method according to claim 1, characterized in that The step of determining a target data cube and a structured query statement according to the query request includes: Determine, from the at least one data cube, a data cube whose business subject matches the business subject of the query request as a target data cube; Determining target dimension column information in the target data cube according to the dimension of the query request; Determining target metric column information in the target data cube according to the index of the query request; The structured query statement is generated according to the business subject, target dimension column information and target metric column information of the target data cube.
3. The method according to claim 2, characterized in that The querying and analyzing in the target data cube according to the structured query statement to obtain the query result includes: Determine the dimension value of the target dimension column in the target data cube and the index value of the target metric column under the target dimension column according to the target dimension column information and the target metric column information respectively; A query result is generated according to the target dimension column information, the target metric column information, the dimension value of the target dimension column and the indicator value of the target metric column.
4. The method according to claim 1, characterized in that: The query result includes a result list; after returning the query result to the user, the method includes: Receive paging and sorting requests from users; Paging and sorting the data results in the result list according to the paging and sorting request to obtain a processed result list; The processed result list is returned to the user.
5. The method according to any one of claims 1 to 4, characterized in that: Before receiving the query request from the user, the method includes: Collect source data; Processing the source data to obtain a fact table and multiple dimension tables; the fact table includes foreign keys and fact data of the dimension table; the dimension table includes at least one dimension table dimension; Obtain the business topics required by the user and the dimension and indicator requirement information corresponding to the business topics; Associating the fact table with the dimension table to construct a data model corresponding to each of the business topics; According to the dimension and indicator requirement information, dimension columns and metric columns are configured on the data model; According to the dimension table corresponding to the business subject and the associated fact table, determine the index value of the measurement column under the combination of all dimension columns to obtain a data cube; The data cube, dimension column and metric column are respectively mapped to the subject, dimension and indicator defined in the non-relational database.
6. A multidimensional data analysis device, characterized in that: The device comprises: A receiving module, used to receive a user's query request; the query request includes the subject, dimension and index of the business data to be queried; A determination module is used to determine a target data cube and a structured query statement according to the query request; the multidimensional data analysis device includes at least one data cube, and the at least one data cube is obtained by pre-processing the business data according to the business subject's requirements for dimensions and indicators. The process of generating the structured query statement is: using the target data cube corresponding to the business subject to generate a From segment of the structured query statement, using the target dimension column of the target data cube corresponding to the queried business dimension to generate a Select segment and a Group by segment of the structured query statement, using the target metric column of the target data cube corresponding to the queried business indicator to generate a statistical value of the structured query statement, thereby obtaining the structured query statement; Among them, the business data is constructed into a data cube according to the business theme. After the data cube is constructed, the data cube is abstractly defined as a business theme, one business theme corresponds to one data cube, and the data cube is abstractly defined as a theme object. The theme object includes the following attributes: theme ID, theme name, Chinese name, theme SQL, theme sequence Index, theme description, so that the business theme object queried by the user through the interface corresponds to the data cube one by one; and the dimension column of the data cube is abstractly defined as the dimension of the business theme, so that the business theme dimension queried in the user interface corresponds to the dimension column of the data cube; and the measurement column of the data cube is abstractly defined as the indicator of the business theme, so that the indicator input in the interface corresponds to the calculation result of the measurement column in the data cube; An analysis module, used to query and analyze the target data cube according to the structured query statement to obtain a query result; The returning module is used to return the query result to the user.
7. The device according to claim 6, characterized in that The step of determining a target data cube and a structured query statement according to the query request includes: Determine, from the at least one data cube, a data cube whose business subject matches the business subject of the query request as a target data cube; Determining target dimension column information in the target data cube according to the dimension of the query request; Determining target metric column information in the target data cube according to the index of the query request; The structured query statement is generated according to the business subject, target dimension column information and target metric column information of the target data cube.
8. The device according to claim 7, characterized in that The querying and analyzing in the target data cube according to the structured query statement to obtain the query result includes: Determine the dimension value of the target dimension column in the target data cube and the index value of the target metric column under the target dimension column according to the target dimension column information and the target metric column information respectively; A query result is generated according to the target dimension column information, the target metric column information, the dimension value of the target dimension column and the indicator value of the target metric column.
9. A multidimensional data analysis device, characterized in that: include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of the multidimensional data analysis method as described in any one of claims 1-5.
10. A computer-readable storage medium, characterized in that: The storage medium stores at least one executable instruction. When the executable instruction is executed on the multidimensional data analysis device, the multidimensional data analysis device performs the operation of the multidimensional data analysis method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Multi-dimensional data analysis method and system based on hybrid engine
CN112286954A