CN107016001B - Data query method and device - Google Patents

Data query method and device Download PDF

Info

Publication number
CN107016001B
CN107016001B CN201610060241.4A CN201610060241A CN107016001B CN 107016001 B CN107016001 B CN 107016001B CN 201610060241 A CN201610060241 A CN 201610060241A CN 107016001 B CN107016001 B CN 107016001B
Authority
CN
China
Prior art keywords
data
query
data set
identification information
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610060241.4A
Other languages
Chinese (zh)
Other versions
CN107016001A (en
Inventor
陈飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201610060241.4A priority Critical patent/CN107016001B/en
Publication of CN107016001A publication Critical patent/CN107016001A/en
Application granted granted Critical
Publication of CN107016001B publication Critical patent/CN107016001B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data query method and a data query device, which are applied to ROLAP based on a relational database, and the method comprises the following steps: receiving a data query request, determining identification information of data to be queried corresponding to the data query request, determining a query path corresponding to the identification information in a pre-established multidimensional data relation model according to the determined identification information, and performing data query according to the query path and the identification information to generate a query result. Different from the prior art, the method does not need the user to know the specific data table or the specific field where the data to be inquired is located, and also does not need the user to define the format of the data table, the user only needs to provide the data to be inquired and has the relevance, and the server can inquire the data in the pre-established data relation model according to the data provided by the user, so that the user operation is facilitated, and the excessively complicated operation in the existing inquiring method is effectively reduced.

Description

Data query method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data query method and apparatus.
Background
With the development of information technology, database systems are widely applied, and the storage capacity of data is increasing day by day. The query demand of users on data in databases is more and more complex, and the query or operation is not only related to querying or operating one or more records in one data relation table, but also to performing data analysis and information synthesis on a large amount of data (i.e. multidimensional data) in a plurality of data relation tables.
Currently, a method called Online analytical processing (OLAP) is widely used in the process of querying multidimensional data. Wherein, OLAP includes two specific ways: a MOLAP based on a multidimensional database and a ROLAP based on a relational database. In the case of both MOLAP and ROLAP, when data is queried, the data in the database is constructed into a multidimensional dataset (also called Cube, which is a multidimensional view displayed in a Cube) for query analysis. However, the way of performing query analysis with only one Cube may result in poor extensibility of the analysis result in some complex query analysis services in practical applications.
In the prior art, in order to increase the ductility of the analysis result, a plurality of cubes with different data sources are generally used for association, and the association includes two ways.
One of the methods is as follows: the method for mapping the dimension table association model is adopted to pre-model the dimension table (the data table used for storing the dimension value in the database) to be associated and configure the dimension table into the multi-dimensional data set model. Then, in the query process, the query can be performed according to the association relationship between the dimension table and the data set.
The other mode is as follows: the method adopts a method of directly configuring the relational metadata, which is to perform association when creating a data table structure of the database to form a fixed data table structure and perform the query of the associated data by using the metadata of the fixed data table structure. Such as: if the user wants to query the relationship between the "region" and the "total sales", the user needs to construct a data table containing two dimensions of the "region" and the "total sales".
However, for the two ways, in the first way, the user needs to know the data table (or the field in the data table) where the data to be queried is stored, and define the corresponding physical model according to the data table; in the second approach, the user needs to create a fixed data table structure in advance according to the data he is interested in. Obviously, both of the two methods need to define the association relationship of the physical model in advance, which is too cumbersome for the user and inconvenient for the user to operate.
Disclosure of Invention
The embodiment of the application provides a data query method, which is used for solving the problem of complex operation in the process of querying multidimensional data in the prior art.
The data query method provided by the embodiment of the application is applied to ROLAP based on a relational database, and comprises the following steps:
receiving a data query request;
determining identification information of the data to be queried corresponding to the data query request;
determining a query path corresponding to the identification information in a pre-established multidimensional data relation model according to the determined identification information;
and performing data query according to the query path and the identification information to generate a query result.
The data query device provided by the embodiment of the application is applied to ROLAP based on a relational database, and comprises the following components:
the receiving module is used for receiving a data query request;
the determining module is used for determining the identification information of the data to be queried corresponding to the data query request;
the query path module is used for determining a query path corresponding to the identification information in a pre-established multidimensional data relation model according to the determined identification information;
and the query processing module is used for carrying out data query according to the query path and the identification information to generate a query result.
According to the data query method and device, after a server receives a data query request sent by a user, the dimensionality or the measurement of data to be queried by the user is further determined according to the data query request, and a pre-established data relation model which accords with the dimensionality or the measurement is determined in a corresponding database according to the dimensionality or the measurement, wherein the data relation model comprises a plurality of multi-dimensional data sets which are related to each other, so that various data which are related to the dimensionality or the measurement can be determined in the multi-dimensional data sets in the data relation model according to the dimensionality or the measurement of the data to be queried by the user. Obviously, different from the prior art, for the user, the above-mentioned method does not need the user to know the specific data table or the specific field where the data to be queried is located, and likewise, does not need the user to define the format of the data table by himself, and the user only needs to provide the data to be queried with the association, and the server can query the data in the pre-established data relation model according to the data provided by the user, thereby facilitating the user operation and effectively reducing the excessively tedious operations in the existing query method.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a data query process provided by an embodiment of the present application;
FIG. 2 is a diagram illustrating fact tables and associated data tables provided in an embodiment of the present application;
FIG. 3 is a schematic diagram of a data relationship model provided by an embodiment of the present application;
fig. 4 is a schematic structural diagram of a data query device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The data query method provided by the embodiment of the application is based on a ROLAP model of a relational database, wherein the data for query belong to analytical data, a corresponding server acquires the data from the relational database, and the server is associated with the relational database.
In one mode of the application, the server receives a query request from a user, and obtains corresponding data from the relational database and feeds the data back to the user.
In another mode, the server provides data query services in a service platform mode for different users (either individual users or enterprise users) to use, and of course, different users may provide their respective data to the service platform for other users to query. And are not to be construed as limiting the application herein.
Specifically, the data query method provided in the embodiment of the present application, as shown in fig. 1, specifically includes the following steps:
s101, receiving a data query request.
When a user needs to query data, a corresponding query request can be sent out, and in practical application, the query request includes data to be queried by the user and/or information (such as dimensions) related to the data, for example: specific data such as income data of 201X years, sales data of the last half year of the company and the like, which are required to be inquired by the user, for example: the dimension information such as commodity category, production capacity in a certain area and the like which are required to be inquired by the user.
In one mode of the embodiment of the present application, the dimension is similar to a key and may include information such as a user name, a gender, a user type, a sales amount, a region, and the like, which are used to divide different types of data.
It should be noted that, in an actual application scenario, a corresponding server is associated with a database and can provide a data query function, and at a user side, a user may access the query function provided by the server through a corresponding browser, or the user may obtain the query function provided by the server through a client. And are not to be construed as limiting the application herein.
And S102, determining the identification information of the data to be queried corresponding to the data query request.
In this embodiment of the present application, the identification information of the data to be queried includes: the dimension to be queried and its corresponding metric value, or dimension. Wherein the metric value may be considered a specific data value. In other words, when a user queries data, the user may query for a specific data value in a certain dimension, such as: the user can inquire about the dimension 'date' and the metric value '10 months'; queries can also be made for a single dimension, such as: the user may query for the dimension "product number". And are not to be construed as limiting the application herein.
When the server receives a data query request sent by a user, the server determines the identification information of the data to be queried corresponding to the data query request, so as to query the data according to the identification information.
Of course, in practical applications, the user may input the corresponding query request through an interface such as a browser or a client interface. And are not to be construed as limiting the application herein.
S103, determining the query path corresponding to the identification information in a pre-established multidimensional data relation model according to the determined identification information.
In view of the practical requirements of complex queries where a user needs as many query results as possible to fully and clearly reflect the state of an event, the data in a multidimensional data set (e.g., Cube) may be difficult to provide fully comprehensive query results. Therefore, in the embodiment of the present application, the server may pre-establish a corresponding multidimensional data relationship model, where the relationship between the multidimensional data sets in the multidimensional data relationship model includes: the parent-child relationship, i.e., the multidimensional data relationship model, includes a parent multidimensional data set (hereinafter referred to as a master data set) and a child multidimensional data set (hereinafter referred to as a child data set). The multidimensional data relation model comprises a plurality of correlated multidimensional data sets, and comprehensive data can be provided for the user from a plurality of angles based on the multidimensional data relation model so as to meet the complex query requirement of the user.
Based on this, the query path mentioned in the embodiment of the present application specifically refers to a relationship chain between data sets in the multidimensional data relationship model, where the data sets have an association relationship with a database corresponding to the identification information of the user.
Through the query path, different data having an association relationship with the data to be queried by the user can be queried, and specifically, the following step S104 is performed.
And S104, performing data query according to the query path and the identification information to generate a query result.
According to the query path, at least one multi-dimensional data set can be determined, and the data corresponding to the identification information is queried in the determined multi-dimensional data set, so that the multi-dimensional data which are associated with each other and have an association relation with the identification information in the multi-dimensional data set are obtained.
For example: the user inquires about sales data of a company all year round, and assumes that a data table (i.e., a multidimensional data set a) recording sales data and a data table (i.e., a multidimensional data set B) recording sales data are associated with each other in a database, and a parent-child relationship is provided between the data table recording sales data and the data table recording sales data, then a relational link (i.e., an inquiry path) between the multidimensional data sets a to B can be determined, and then, for the user, sales data and corresponding sales data are finally obtained.
Obviously, such query results can provide the user with associated data more comprehensively, so that the user can obtain sufficient data to perform subsequent operations (data analysis, data decision, etc.).
Through the steps, after the server receives a data query request sent by a user, the server further determines the dimensionality or the measurement of the data to be queried by the user according to the data query request, and accordingly determines a pre-established data relation model which accords with the dimensionality or the measurement in a corresponding database, wherein the data relation model comprises a plurality of multi-dimensional data sets which are associated with each other, so that various data which have an association relation with the dimensionality or the measurement can be determined in the plurality of multi-dimensional data sets in the data relation model according to the dimensionality or the measurement of the data to be queried by the user. Obviously, different from the prior art, for the user, the above-mentioned method does not need the user to know the specific data table or the specific field where the data to be queried is located, and likewise, does not need the user to define the format of the data table by himself, and the user only needs to provide the data to be queried with the association, and the server can query the data in the pre-established data relation model according to the data provided by the user, thereby facilitating the user operation and effectively reducing the excessively tedious operations in the existing query method.
In practical application, the process of the server for establishing the multidimensional data relation model in advance specifically comprises the following steps: pre-selecting a fact table in a database, taking the selected fact table as a main data set, determining each attribute information in the main data set, and determining each associated data table corresponding to each attribute information in the database according to each attribute information, wherein each associated data table comprises a fact table and/or a dimension table; and taking each determined associated data table as a sub data set, and establishing a data relationship between each sub data set and the main data set to form the multi-dimensional data relationship model.
It should be noted that, in the multidimensional data relationship model according to the embodiment of the present application, the main data set is not formed by the sub data sets, but the main data set and the sub data sets have a dependency relationship therebetween, and this does not constitute a limitation of the present application.
In an actual application scenario, the fact table as a main data set may be formed by a data instruction provided by a user, and the server summarizes corresponding data according to the data instruction of the user to generate the fact table, and determines the fact table as the main data set, where of course, the fact table does not form a limitation to the present application.
The dimension table may be a data table used for storing dimensions in a database, and the dimension table usually has no specific metric value and only includes different dimensions, for example: a dimension table with the date as the dimension can contain further subdivided sub-dimensions of day, month, year and the like.
After the main data set is determined, the server determines each associated data table (i.e., the sub data set) according to each attribute information (i.e., the dimension of the data) in the main data set. Here, the associated data table in the embodiment of the present application is a data table having an associated relationship with a fact table as a main data set.
Specifically, according to the attribute information, determining each associated data table corresponding to each attribute information in the database, specifically including: and for each attribute information, determining each data table containing the attribute information in the database, and taking each determined data table as an associated data table.
It can be seen that, for each data table in the database, if some attribute information (i.e. dimension) in the fact table is included, the data table may be determined as an associated data table having an association relationship with the fact table.
For example: as shown in FIG. 2, a fact table (i.e., a master data set) in a database and associated data tables having an association relationship with the fact table are displayed.
The data table a in fig. 2 is a fact table (hereinafter referred to as a fact table a, where the fact table a includes both different dimensions and measurement values under each dimension, and the measurement values serve as examples and are not limited to the present application), and the fact table a may be used as a main data set. It can be seen that the fact table a contains a plurality of dimensions (i.e., the above-mentioned attribute information): i.e. order number, salesman number, customer number, product number, date identification, area name, quantity, total price. According to different dimensions, associated data tables containing the dimensions, such as the data tables B1-B6 shown in FIG. 2, can be determined in the database. Obviously, for the data tables B1-B6, each of them contains a certain dimension of the fact table a, so that the data tables B1-B6 can be determined to be the associated data tables having the association relation with the fact table a.
Of course, unlike the prior art, in the embodiment of the present application, the associated data table may be a dimension table or a fact table, in other words, for the associated data tables B1 to B6 shown in fig. 2, not only the dimensions in the fact table a but also specific metric values in different dimensions may be included (the specific metric values in the associated data tables B1 to B6 are not shown in fig. 2, and do not limit the present application).
In practical applications, different sub data sets (i.e., associated data tables) may have their own sub data sets, and in such a case, the server may determine a complete data relationship model, specifically, establish a data relationship between each sub data set and the main data set, which specifically includes: determining each associated data table containing the attribute information as a primary sub data set associated with the main data set;
and determining each level of sub-data set of the main data set by adopting the following method: determining sub-attribute information contained in each level of sub-data set, determining each associated data table containing the sub-attribute information, and taking each associated data table containing the sub-attribute information as a next level of sub-data set of the first level of sub-data set until the associated data table cannot be determined according to the sub-attribute information.
For example: as shown in fig. 3, the complete data relationship model determined for the server includes a main data set and 5 sub data sets, and the sub data set 1 itself has two subsets: subdata sets 2 and 3; the sub data set 4 itself has a subset: the sub data set 5.
On the basis of determining the complete data relation model, the data required by the user can be queried. If the identification information falls into a plurality of data sets, determining a query path to which the identification information belongs, specifically comprising: determining each data set in which the identification information falls, determining a common superior data set of each data set in which the identification information falls in the multi-dimensional data relation model, determining each path from each data set in which the identification information falls to the common superior data set, and taking each determined path as a query path to which the identification information belongs.
Still taking fig. 3 as an example for explanation, assuming that the dimensions to be queried by the user are stored in the sub data sets 2 and 3, respectively, when the server queries data, it first determines the sub data set in which the data is located, i.e. the sub data sets 2 and 3, and then traces back to the common higher level data set of the two sub data sets, i.e. the sub data set 1 in fig. 3. Therefore, the query path of the data to be queried by the user at this time can be determined as follows: subdata set 1-subdata set 2, and subdata set 1-subdata set 3.
In another example, assuming that the dimension to be queried by the user falls in the sub data set 2 and the sub data set 5, when the server queries data, the sub data set 2 and the sub data set 5 are first determined, and are traced back to the upper layer relationship until being traced back to the common upper layer data set, as can be seen from fig. 3, the common upper layer data set of the sub data set 2 and the sub data set 5 is the main data set. Therefore, the query path of this time is: main data set-sub data set 1-sub data set 2, and main data set-sub data set 4-sub data set 5.
Based on this, after the query path is determined, the query process specifically includes: performing data query according to the query path and the identification information, specifically including: determining each data set corresponding to the query path according to the query path; and querying data corresponding to the identification information according to the identification information in the determined data sets. Thus, the queried data is data with an association relationship.
Continuing with the above example, with reference to the data relationship model shown in fig. 3, assuming that the dimensions M and N to be queried by the user fall into the sub data set 2 and the sub data set 5, respectively, the query path determined by the server is: the method comprises the steps that a main data set, a sub data set 1, a sub data set 2 and a main data set, a sub data set 4, a sub data set 5 are obtained, then data relevant to the dimension M are obtained from the main data set, the sub data set 1 and the sub data set 2 respectively, and meanwhile data relevant to the dimension N are obtained from the main data set, the sub data set 4 and the sub data set 5 respectively. In this way, the data of the associated dimensions M and N are eventually queried.
Of course, in a manner in this embodiment of the application, the server generates a corresponding Structured Query Language (SQL) according to the determined Query path, and completes querying the data required by the user according to the identification information.
In practical applications, when a user performs data query, the display modes of the required data results may be different, for example: some users want to display the queried sales and sales data in a column, and time data in a row, etc.
Based on this, in order for the user to obtain the data result he wants, therefore, the method further comprises: and receiving a display instruction sent by a user, and converting the format of the data contained in the query result into a data format corresponding to the display instruction according to the display instruction.
Wherein, the data format corresponding to the display instruction comprises: at least one of a graphical presentation format, a multi-dimensional list format. Among them, the graphic presentation format includes but is not limited to: pie charts, bar charts, line charts, cube charts, etc. have a view of the graphical structure.
That is to say, in the embodiment of the present application, the user may define the display mode of the data result required by the user, and send the corresponding definition setting (that is, the display instruction) to the server, so that the server may process the queried data according to the display mode required by the user. And finally returned to the user.
In summary, in the embodiment of the present application, through the association relationship between the multidimensional data sets, a manner of performing physical modeling (for example, constructing a specific data table format, etc.) on data in a database in the prior art is avoided, so that a user does not need to know a storage manner of specific data, and a specific data table or field in which the data is stored. On one hand, the use threshold of the user is reduced, and on the other hand, when application scenes such as data interconnection are involved, the flexibility is greatly improved. In addition, because the associated multidimensional data set in the data relation model is a duplicate copy, the subsequent metadata configuration changes such as dimension/measurement and the like can not affect each other, and the stability of the logic model is maintained.
Based on the same idea, the embodiment of the present application further provides a data query device, as shown in fig. 4.
In fig. 4, the data querying device includes: a receiving module 401, a determining module 402, a query path module 403, and a query processing module 404, wherein,
the receiving module 401 is configured to receive a data query request.
The determining module 402 is configured to determine identification information of the data to be queried corresponding to the data query request.
The detecting module 403 is configured to determine, according to the determined identification information, a query path corresponding to the identification information in a pre-established multidimensional data relationship model.
And the query processing module 404 is configured to perform data query according to the query path and the identification information, and generate a query result.
In an embodiment of the present application, the apparatus further includes: the data relation module is used for pre-selecting a fact table in a database, taking the selected fact table as a main data set, determining each attribute information in the main data set, and determining each associated data table corresponding to each attribute information in the database according to each attribute information, wherein each associated data table comprises a fact table and/or a dimension table; and taking each determined associated data table as a sub data set, and establishing a data relationship between each sub data set and the main data set to form the multi-dimensional data relationship model.
Further, the data relationship module is specifically configured to determine, for each attribute information, each data table including the attribute information in the database, and use each determined data table as an associated data table.
Based on this, the data relationship module is specifically configured to determine each associated data table including the attribute information as a primary sub data set associated with the main data set; and determining each level of sub data set of the main data set by performing the following operations:
determining sub-attribute information contained in each level of sub-data set, determining each associated data table containing the sub-attribute information, and taking each associated data table containing the sub-attribute information as a next level of sub-data set of the first level of sub-data set until the associated data table cannot be determined according to the sub-attribute information.
In an embodiment, if the identification information falls into multiple data sets, the query processing module 404 is specifically configured to determine each data set into which the identification information falls, determine, in the multidimensional data relationship model, a common higher-level data set of each data set into which the identification information falls, determine each path from each data set into which the identification information falls to the common higher-level data set, and determine each path as the query path to which the identification information belongs.
The query processing module 404 is specifically configured to determine, according to the query path, each data set corresponding to the query path, and query, in each determined data set, data corresponding to the identification information according to the identification information.
Furthermore, the apparatus further comprises: a data format processing module 405, configured to receive a display instruction sent by a user, perform format conversion on data included in the query result according to the display instruction, and convert the data into a data format corresponding to the display instruction, where the data format corresponding to the display instruction includes: at least one of a graphical presentation format, a multi-dimensional list format.
In this embodiment of the application, the identification information of the data to be queried includes: the dimension to be queried and its corresponding metric value, or dimension.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (14)

1. A data query method is applied to ROLAP based on a relational database and applied to a server, and comprises the following steps:
receiving a data query request;
determining identification information of the data to be queried corresponding to the data query request;
determining a query path corresponding to the identification information in a pre-established multidimensional data relation model according to the determined identification information, wherein the query path is a relation chain between data sets which have an incidence relation with a database corresponding to the identification information in the multidimensional data relation model, and the multidimensional data relation model comprises a plurality of mutually associated multidimensional data sets;
performing data query according to the query path and the identification information to generate a query result, including:
determining each data set corresponding to the query path according to the query path;
and querying data corresponding to the identification information according to the identification information in the determined data sets.
2. The method of claim 1, wherein pre-building a multidimensional data relationship model specifically comprises:
pre-selecting a fact table in a database;
taking the selected fact table as a main data set, and determining each attribute information in the main data set;
determining each associated data table corresponding to each attribute information in the database according to each attribute information, wherein each associated data table comprises a fact table and/or a dimension table;
and taking each determined associated data table as a sub data set, and establishing a data relationship between each sub data set and the main data set to form the multi-dimensional data relationship model.
3. The method according to claim 2, wherein determining, according to the attribute information, each associated data table corresponding to each attribute information in the database specifically includes:
and for each attribute information, determining each data table containing the attribute information in the database, and taking each determined data table as an associated data table.
4. The method of claim 3, wherein establishing a data relationship between each sub data set and the main data set specifically comprises:
determining each associated data table containing the attribute information as a primary sub data set associated with the main data set;
and determining each level of sub-data set of the main data set by adopting the following method:
determining sub attribute information contained in each level of sub data set;
determining each associated data table containing the sub-attribute information;
and taking each associated data table containing the sub-attribute information as a next-level sub-data set of the first-level sub-data set until the associated data table cannot be determined according to the sub-attribute information.
5. The method according to claim 4, wherein if the identification information falls into a plurality of data sets, determining the query path to which the identification information belongs specifically includes:
determining each data set in which the identification information falls;
determining a common superior data set of each data set in which the identification information falls in the multidimensional data relation model;
respectively determining each path from each data set in which the identification information falls to the common superior data set;
and determining each path as a query path to which the identification information belongs.
6. The method of claim 1, wherein the method further comprises:
receiving a display instruction sent by a user;
according to the display instruction, format conversion is carried out on the data contained in the query result, and the data are converted into a data format corresponding to the display instruction;
wherein, the data format corresponding to the display instruction comprises: at least one of a graphical presentation format, a multi-dimensional list format.
7. The method according to any one of claims 1 to 6, wherein the identification information of the data to be queried comprises: the dimension to be queried and its corresponding metric value, or dimension.
8. A data query device is applied to ROLAP based on a relational database and applied to a server, and comprises the following components:
the receiving module is used for receiving a data query request;
the determining module is used for determining the identification information of the data to be queried corresponding to the data query request;
the query path module is used for determining a query path corresponding to the identification information in a pre-established multidimensional data relation model according to the determined identification information, wherein the query path is a relation chain between data sets which have an incidence relation with a database corresponding to the identification information in the multidimensional data relation model, and the multidimensional data relation model comprises a plurality of mutually associated multidimensional data sets;
the query processing module is used for carrying out data query according to the query path and the identification information to generate a query result;
the query processing module is specifically configured to determine, according to the query path, each data set corresponding to the query path, and query, in the determined each data set, data corresponding to the identification information according to the identification information.
9. The apparatus according to claim 8, wherein the apparatus further comprises a data relationship module, configured to pre-select a fact table in a database, use the selected fact table as a main data set, determine attribute information in the main data set, and determine, according to the attribute information, associated data tables corresponding to the attribute information in the database, where the associated data tables include a fact table and/or a dimension table; and taking each determined associated data table as a sub data set, and establishing a data relationship between each sub data set and the main data set to form the multi-dimensional data relationship model.
10. The apparatus according to claim 9, wherein the data relationship module is specifically configured to determine, for each attribute information, each data table in the database that includes the attribute information, and use the determined data tables as the associated data table.
11. The apparatus of claim 10, wherein the data relationship module is specifically configured to determine each associated data table containing the attribute information as a primary data set associated with the primary data set; and determining each level of sub data set of the main data set by performing the following operations:
determining sub-attribute information contained in each level of sub-data set, determining each associated data table containing the sub-attribute information, and taking each associated data table containing the sub-attribute information as a next level of sub-data set of the first level of sub-data set until the associated data table cannot be determined according to the sub-attribute information.
12. The apparatus according to claim 11, wherein if the identification information falls into a plurality of data sets, the query processing module is specifically configured to determine each data set into which the identification information falls, determine, in the multidimensional data relationship model, a common higher-level data set of each data set into which the identification information falls, determine each path from each data set into which the identification information falls to the common higher-level data set, and determine each path as the query path to which the identification information belongs.
13. The apparatus of claim 8, wherein the apparatus further comprises: a data format processing module, configured to receive a display instruction sent by a user, perform format conversion on data included in the query result according to the display instruction, and convert the data into a data format corresponding to the display instruction, where the data format corresponding to the display instruction includes: at least one of a graphical presentation format, a multi-dimensional list format.
14. The apparatus according to any one of claims 8 to 13, wherein the identification information of the data to be queried comprises: the dimension to be queried and its corresponding metric value, or dimension.
CN201610060241.4A 2016-01-28 2016-01-28 Data query method and device Active CN107016001B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610060241.4A CN107016001B (en) 2016-01-28 2016-01-28 Data query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610060241.4A CN107016001B (en) 2016-01-28 2016-01-28 Data query method and device

Publications (2)

Publication Number Publication Date
CN107016001A CN107016001A (en) 2017-08-04
CN107016001B true CN107016001B (en) 2020-10-16

Family

ID=59439112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610060241.4A Active CN107016001B (en) 2016-01-28 2016-01-28 Data query method and device

Country Status (1)

Country Link
CN (1) CN107016001B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107992511A (en) * 2017-10-18 2018-05-04 东软集团股份有限公司 Index establishing method, device, storage medium and the electronic equipment of medical data table
CN107886313A (en) * 2017-12-28 2018-04-06 山东开创云软件有限公司 A kind of expansible enterprise resource planning
CN114780630A (en) * 2018-03-22 2022-07-22 创新先进技术有限公司 Data display method, device and equipment
CN108763389B (en) * 2018-05-18 2023-10-17 上海数据交易中心有限公司 Data integration method and device, storage medium and terminal
CN108804639A (en) * 2018-06-04 2018-11-13 平安科技(深圳)有限公司 Method for exhibiting data, electronic equipment and computer readable storage medium
CN109144997A (en) * 2018-06-11 2019-01-04 玖富金科控股集团有限责任公司 Data correlation method, device and storage medium
CN109086354A (en) * 2018-07-17 2018-12-25 于果鑫 A kind of big data analysis processing system based on extended node cluster
CN109325063B (en) * 2018-09-25 2022-03-15 奇瑞汽车股份有限公司 Data management method and device
CN109284326A (en) * 2018-11-26 2019-01-29 北京中创碳投科技有限公司 A kind of data bank access method and device
CN110009514B (en) * 2019-03-07 2024-03-08 平安科技(深圳)有限公司 Data extraction method, device, terminal and computer readable storage medium
CN110489427A (en) * 2019-08-26 2019-11-22 杭州城市大数据运营有限公司 A kind of data query method, apparatus, computer equipment and storage medium
CN111063447B (en) * 2019-12-17 2024-05-03 北京懿医云科技有限公司 Query and text processing method and device, electronic equipment and storage medium
CN112818007B (en) * 2021-02-03 2021-10-19 中科驭数(北京)科技有限公司 Data processing method and device and readable storage medium
CN113343072A (en) * 2021-05-07 2021-09-03 深圳市酷开网络科技股份有限公司 Label query method, device, equipment and storage medium
CN113761036A (en) * 2021-09-07 2021-12-07 国网福建省电力有限公司经济技术研究院 Power grid statistics professional index multidimensional association table query display method
CN115062068A (en) * 2022-07-12 2022-09-16 中国科学院大学 Correlation search and multistage relation query method
CN116701719B (en) * 2023-07-28 2024-01-02 腾讯科技(深圳)有限公司 Data processing method, device, computer equipment and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102243658A (en) * 2011-07-08 2011-11-16 百度在线网络技术(北京)有限公司 Method and equipment for performing data spreading operation on multilayer structured data
CN102929987A (en) * 2012-10-19 2013-02-13 华为技术有限公司 Search method and search device based on identifier combination
CN104794221A (en) * 2015-04-29 2015-07-22 苏州国云数据科技有限公司 Multi-dimensional data analyzing system based on service objects

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080021887A1 (en) * 2006-01-19 2008-01-24 Intelliscience Corporation Data product search using related concepts

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102243658A (en) * 2011-07-08 2011-11-16 百度在线网络技术(北京)有限公司 Method and equipment for performing data spreading operation on multilayer structured data
CN102929987A (en) * 2012-10-19 2013-02-13 华为技术有限公司 Search method and search device based on identifier combination
CN104794221A (en) * 2015-04-29 2015-07-22 苏州国云数据科技有限公司 Multi-dimensional data analyzing system based on service objects

Also Published As

Publication number Publication date
CN107016001A (en) 2017-08-04

Similar Documents

Publication Publication Date Title
CN107016001B (en) Data query method and device
US11755575B2 (en) Processing database queries using format conversion
US11537635B2 (en) Hadoop OLAP engine
CN110674228B (en) Data warehouse model construction and data query method, device and equipment
US10242016B2 (en) Systems and methods for management of data platforms
US10747762B2 (en) Automatic generation of sub-queries
US7698349B2 (en) Dimension member sliding in online analytical processing
US20160328432A1 (en) System and method for management of time series data sets
US20150356123A1 (en) Systems and methods for management of data platforms
US9747349B2 (en) System and method for distributing queries to a group of databases and expediting data access
JP6434154B2 (en) Identifying join relationships based on transaction access patterns
TW201600985A (en) Data query method and apparatus
US20180018402A1 (en) Dynamic hierarchy generation based on graph data
Bhaskara et al. Data warehouse implemantation to support batik sales information using MOLAP
CN112052252A (en) Data query method and device based on associated database
US20080027966A1 (en) Dynamic creation of star-schema database structures and cubes
CN100422991C (en) System and method for expressing and calculating a relationship between measures
CN116561181A (en) Data query method, device, computer equipment and computer readable storage medium
WO2009006028A2 (en) Explaining changes in measures thru data mining
CN115658680A (en) Data storage method, data query method and related device
JP2001216307A (en) Relational database management system and storage medium stored with same
US11886485B1 (en) Computer-implemented visual query matching methods, and systems for implementing thereof
Singh NoSQL: A new horizon in big data
Dedic et al. MLED_BI: a new BI design approach to support multilingualism in business intelligence
CN116561074A (en) Method, device, computer equipment and storage medium for grouping resource data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20200917

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200917

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant