CN106682180B - Data query method and device - Google Patents

Data query method and device Download PDF

Info

Publication number
CN106682180B
CN106682180B CN201611245727.1A CN201611245727A CN106682180B CN 106682180 B CN106682180 B CN 106682180B CN 201611245727 A CN201611245727 A CN 201611245727A CN 106682180 B CN106682180 B CN 106682180B
Authority
CN
China
Prior art keywords
dimension
sub
layer
target
information
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
CN201611245727.1A
Other languages
Chinese (zh)
Other versions
CN106682180A (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.)
Guangzhou Huaduo Network Technology Co Ltd
Original Assignee
Guangzhou Huaduo Network Technology 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 Guangzhou Huaduo Network Technology Co Ltd filed Critical Guangzhou Huaduo Network Technology Co Ltd
Priority to CN201611245727.1A priority Critical patent/CN106682180B/en
Publication of CN106682180A publication Critical patent/CN106682180A/en
Application granted granted Critical
Publication of CN106682180B publication Critical patent/CN106682180B/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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/283Multi-dimensional databases or data warehouses, e.g. MOLAP or ROLAP
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6227Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries

Abstract

The invention discloses a data query method and device, and belongs to the technical field of information processing. The method comprises the following steps: when a data query instruction of a target multi-dimensional model is detected, determining a first user account, wherein the target multi-dimensional model is any one of a plurality of stored multi-dimensional models, the data query instruction carries first dimension information to be queried and a first measurement, and the first user account is a user account of current query data; acquiring second dimension information and a plurality of second dimensions from a stored authority list of the target multi-dimensional model based on the first user account and the first dimension information; and querying corresponding data from the target multi-dimensional model based on the first dimension information, the first measurement, the second dimension information and the plurality of second measurements. When a user queries the data of the target multidimensional model, the query authority of the user can be determined according to the authority list, and the corresponding data can be queried from the target multidimensional model according to the query authority, so that the safety of the data is improved.

Description

Data query method and device
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a data query method and apparatus.
Background
With the rapid development of information processing technology, the capability of data storage of information processing devices such as terminals and servers is increasingly improved, and users can acquire a large amount of data from the information processing devices, and then perform service analysis or service management according to the acquired data. In practical application, the terminal can store data through the multidimensional model, so that the requirement of a user for inquiring and analyzing the data from multiple angles and multiple layers can be met.
The data is stored through the multidimensional model, namely the data is divided into data with different dimensions and different measurements for storage. For example, one sale data may correspond to a plurality of aspects such as a sale time, a sale place, a product, and the like, each dimension may include a plurality of sub-dimensions, and the plurality of sub-dimensions may belong to different levels, for example, the sale time dimension may include a plurality of time sub-dimensions, and each time sub-dimension may belong to any one of three levels such as year, quarter, month, and the like. The measure is the actual meaning represented by each data, e.g., one data may represent sales, inventory, order quantity, etc.
Generally, in the multidimensional model, all data is open to all users, that is, any user can query all data in the multidimensional model, so that the security of the data is greatly reduced.
Disclosure of Invention
In order to improve the security of data in a multidimensional model, the embodiment of the invention provides a data query method and a data query device. The technical scheme is as follows:
in one aspect, a data query method is provided, where the method includes:
when a data query instruction of a target multi-dimensional model is detected, determining a first user account, wherein the target multi-dimensional model is any one of a plurality of stored multi-dimensional models, the data query instruction carries first dimension information and first measurement to be queried, and the first user account is a user account of current query data;
acquiring second dimension information and a plurality of second metrics from a stored authority list of the target multi-dimensional model based on the first user account and the first dimension information, wherein the authority list is used for storing dimension information and metrics of each user account having data query authority in the target multi-dimensional model;
and querying corresponding data from the target multi-dimensional model based on the first dimension information, the first measurement, the second dimension information and the plurality of second measurements.
Optionally, the querying, based on the first dimension information, the first metric, the second dimension information, and the plurality of second metrics, corresponding data from the target multidimensional model includes:
determining a first dimension corresponding to the first dimension information and the layer times of each layer of sub-dimension included in the first dimension to obtain a first layer time;
determining a second dimension corresponding to the second dimension information and the number of layers of each layer of sub-dimension included in the second dimension to obtain a second number of layers;
and when the first layer times and the second layer times are equal, the lowest layer sub-dimension included by the first dimension is the same as the lowest layer sub-dimension included by the second dimension, and the plurality of second metrics include the first metric, querying data corresponding to the first dimension information and the first metric from the target multi-dimensional model.
Optionally, after determining a second dimension corresponding to the second dimension information and the number of layers of each sub-dimension included in the second dimension, and obtaining the second number of layers, the method further includes:
when the first layer times is greater than the second layer times, judging whether a lowest layer sub-dimension included in the second dimension is the same as a first target sub-dimension, wherein the first target sub-dimension is a sub-dimension which belongs to the same level as the lowest layer sub-dimension included in the second dimension in the sub-dimensions included in the first dimension;
and when the lowest-layer sub-dimension included in the second dimension is the same as the first target sub-dimension and the plurality of second metrics include the first metric, querying data corresponding to the first dimension information and the first metric from the target multi-dimensional model.
Optionally, after determining a second dimension corresponding to the second dimension information and the number of layers of each sub-dimension included in the second dimension, and obtaining the second number of layers, the method further includes:
when the first layer times is smaller than the second layer times, judging whether the lowest layer sub-dimension included in the first dimension is the same as a second target sub-dimension, wherein the second target sub-dimension is a sub-dimension which belongs to the same layer as the lowest layer sub-dimension included in the first dimension in the sub-dimensions included in the second dimension;
and when the lowest-layer sub-dimension included in the first dimension is the same as the second target sub-dimension and the plurality of second measures include the first measure, querying data corresponding to the second dimension information and the first measure from the target multi-dimensional model.
Optionally, the method further comprises:
when an authority application instruction of the target multi-dimensional model is detected, determining a second user account, wherein the second user account is a user account currently applying for the authority;
and when an authority application agreement instruction is detected, storing the second user account and the multiple dimension information and the multiple metrics carried by the authority application instruction in an authority list of the target multi-dimensional model.
In another aspect, a data query apparatus is provided, the apparatus including:
the device comprises a first determining module, a second determining module and a third determining module, wherein the first determining module is used for determining a first user account when a data query instruction of a target multi-dimensional model is detected, the target multi-dimensional model is any one of a plurality of stored multi-dimensional models, the data query instruction carries first dimension information and first measurement to be queried, and the first user account is a user account of current query data;
an obtaining module, configured to obtain second dimension information and a plurality of second metrics from a stored authority list of the target multidimensional model based on the first user account and the first dimension information, where the authority list is used to store dimension information and metrics of each user account having a data query authority in the target multidimensional model;
and the query module is used for querying corresponding data from the target multi-dimensional model based on the first dimension information, the first measurement, the second dimension information and the plurality of second measurements.
Optionally, the query module includes:
a first determining unit, configured to determine a first dimension corresponding to the first dimension information and a layer number of each layer of sub-dimensions included in the first dimension, to obtain a first layer number;
a second determining unit, configured to determine a second dimension corresponding to the second dimension information and a number of layers of each layer of sub-dimensions included in the second dimension, to obtain a second number of layers;
a first query unit, configured to query, when the first-layer number is equal to the second-layer number, a lowest-layer sub-dimension included in the first dimension is the same as a lowest-layer sub-dimension included in the second dimension, and the plurality of second metrics include the first metric, data corresponding to the first dimension information and the first metric from the target multi-dimensional model.
Optionally, the query module further includes:
a first determining unit, configured to determine whether a lowest-layer sub-dimension included in the second dimension is the same as a first target sub-dimension when the first layer number is greater than the second layer number, where the first target sub-dimension is a sub-dimension of a same layer as a lowest-layer sub-dimension included in the second dimension among the sub-dimensions included in the first dimension;
a second query unit, configured to query, when a lowest-layer sub-dimension included in the second dimension is the same as the first target sub-dimension and the plurality of second metrics include the first metric, data corresponding to the first dimension information and the first metric from the target multidimensional model.
Optionally, the query module further includes:
a second determining unit, configured to determine whether a lowest-layer sub-dimension included in the first dimension is the same as a second target sub-dimension when the first layer number is smaller than the second layer number, where the second target sub-dimension is a sub-dimension of the second dimension that belongs to the same layer as the lowest-layer sub-dimension included in the first dimension;
and a third query unit, configured to query, when a lowest-layer sub-dimension included in the first dimension is the same as the second target sub-dimension, and the plurality of second metrics include the first metric, data corresponding to the second dimension information and the first metric from the target multidimensional model.
Optionally, the apparatus further comprises:
the second determining module is used for determining a second user account when the permission application instruction of the target multi-dimensional model is detected, wherein the second user account is a user account currently applying permission;
and the storage module is used for storing the second user account and the multiple dimension information and the multiple metrics carried by the permission application instruction in a permission list of the target multi-dimensional model when the permission application agreement instruction is detected.
The technical scheme provided by the embodiment of the invention has the following beneficial effects: in the embodiment of the invention, first, when a data query instruction of a target multi-dimensional model is detected, a first user account is determined, then, based on the first user account and first dimension information, second dimension information and a plurality of second dimensions are obtained from a stored authority list of the target multi-dimensional model, that is, dimension information and measurement of the first user account having data query authority in the target multi-dimensional model are obtained, and then, based on the first dimension information, the first measurement, the second dimension information and the plurality of second dimensions, corresponding data is queried from the target multi-dimensional model instead of directly querying data required by a user from the target multi-dimensional model, so that the security of the data in the target multi-dimensional model is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart of a data query method provided by an embodiment of the present invention;
FIG. 2 is a flow chart of another data query method provided by the embodiment of the invention;
FIG. 3A is a block diagram of a data query device according to an embodiment of the present invention;
FIG. 3B is a block diagram of a query module provided by an embodiment of the invention;
FIG. 3C is a block diagram of another query module provided by embodiments of the present invention;
FIG. 3D is a block diagram of a third query module provided by embodiments of the present invention;
fig. 3E is a block diagram of another data query device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Before explaining the embodiments of the present invention in detail, an application scenario of the embodiments of the present invention will be described. The administrator may establish a multidimensional model database in the information processing device, and create a plurality of multidimensional models in the multidimensional model database, where the multidimensional models may store data suitable for different business requirements, for example, in an enterprise, the administrator may create and store a plurality of multidimensional models such as a sales multidimensional model, a warehousing multidimensional model, and the like in a device such as a server or a terminal, and these multidimensional models may provide data required for analyzing and processing businesses for sales staff, warehousing staff, and the like of the enterprise. Each employee in the enterprise can apply for accessing the user account of the multidimensional model, and the employee can log in the database of the multidimensional model through the user account of the employee, and then can query, add, delete and the like the data of the multidimensional model. Due to different levels of employees in the enterprise, it is not desirable from the perspective of the enterprise administrator that all employees have access to all data in the multidimensional model, which results in greatly reduced security of the data. As another example, for a school, it is not desirable that the data of the score query multidimensional model be open to all teachers and students. Therefore, in order to meet the requirements of organizations such as enterprises and schools, the embodiments of the present disclosure provide a data query method, which can query corresponding data from a multidimensional model based on the authority of each user account.
An embodiment of the present invention provides a data query method, and referring to fig. 1, the method includes:
step 101: when a data query instruction of a target multi-dimensional model is detected, a first user account is determined, the target multi-dimensional model is any one of a plurality of stored multi-dimensional models, the data query instruction carries first dimension information to be queried and a first measurement, and the first user account is a user account for querying data currently.
Step 102: and acquiring second dimension information and a plurality of second metrics from a stored authority list of the target multi-dimensional model based on the first user account and the first dimension information, wherein the authority list is used for storing the dimension information and the metrics of the data query authority of each user account in the target multi-dimensional model.
Step 103: and querying corresponding data from the target multi-dimensional model based on the first dimension information, the first measurement, the second dimension information and the plurality of second measurements.
In the embodiment of the invention, first, when a data query instruction of a target multi-dimensional model is detected, a first user account is determined, then, based on the first user account and first dimension information, second dimension information and a plurality of second dimensions are obtained from a stored authority list of the target multi-dimensional model, that is, dimension information and measurement of the first user account having data query authority in the target multi-dimensional model are obtained, and then, based on the first dimension information, the first measurement, the second dimension information and the plurality of second dimensions, corresponding data is queried from the target multi-dimensional model instead of directly querying data required by a user from the target multi-dimensional model, so that the security of the data in the target multi-dimensional model is improved.
Optionally, querying corresponding data from the target multidimensional model based on the first dimension information, the first metric, the second dimension information, and the plurality of second metrics includes:
determining a first dimension corresponding to the first dimension information and the layer times of each layer of sub-dimensions included in the first dimension to obtain a first layer time;
determining a second dimension corresponding to the second dimension information and the number of layers of each layer of sub-dimension included in the second dimension to obtain a second number of layers;
and when the first layer times and the second layer times are equal, the lowest-layer sub-dimension included by the first dimension is the same as the lowest-layer sub-dimension included by the second dimension, and the plurality of second metrics include the first metric, querying data corresponding to the first dimension information and the first metric from the target multi-dimensional model.
Optionally, determining a second dimension corresponding to the second dimension information and the number of layers of each sub-dimension included in the second dimension, and after obtaining the second number of layers, further including:
when the first layer times is greater than the second layer times, judging whether the lowest-layer sub-dimension included in the second dimension is the same as a first target sub-dimension, wherein the first target sub-dimension is a sub-dimension which belongs to the same layer as the lowest-layer sub-dimension included in the second dimension in the sub-dimensions included in the first dimension;
and when the lowest-layer sub-dimension included by the second dimension is the same as the first target sub-dimension and the plurality of second metrics include the first metric, querying data corresponding to the first dimension information and the first metric from the target multi-dimensional model.
Optionally, determining a second dimension corresponding to the second dimension information and the number of layers of each sub-dimension included in the second dimension, and after obtaining the second number of layers, further including:
when the first layer times is less than the second layer times, judging whether the lowest layer sub-dimension included in the first dimension is the same as a second target sub-dimension, wherein the second target sub-dimension is a sub-dimension which belongs to the same layer as the lowest layer sub-dimension included in the first dimension in the sub-dimensions included in the second dimension;
and when the lowest-layer sub-dimension included by the first dimension is the same as the second target sub-dimension and the plurality of second measures include the first measure, querying data corresponding to the second dimension information and the first measure from the target multi-dimensional model.
Optionally, the method further comprises:
when an authority application instruction of the target multi-dimensional model is detected, determining a second user account, wherein the second user account is a user account currently applying for the authority;
and when an authority application agreement instruction is detected, storing the plurality of dimension information and the plurality of metrics carried by the second user account and the authority application instruction in an authority list of the target multi-dimensional model.
Optionally, the method further comprises:
when an authority application instruction of target sharing dimension information is detected, determining a third user account, wherein the third user account is a user account currently applying authority of the target sharing dimension information, the target sharing dimension information is any one of a plurality of stored sharing dimension information, and each piece of sharing dimension information is the same dimension information included in at least two multi-dimensional models in the multi-dimensional models;
and when an authority application approval instruction is detected, storing the third user account and the target sharing dimension information in an authority list corresponding to each multidimensional model comprising the target sharing dimension information.
Optionally, the method further comprises:
when an authority application instruction of a target measurement group is detected, determining a fourth user account, wherein the fourth user account is a user account currently applying for authority of the target measurement group, the target measurement group is any one of a plurality of stored measurement groups, and each measurement group comprises at least two measurements;
and when an authority application agreement instruction is detected, storing the fourth user account and the target metric in the target metric group in an authority list corresponding to the multidimensional model comprising the target metric, wherein the target metric is any one of at least two metrics in the target metric group.
All the above optional technical solutions can be combined arbitrarily to form an optional embodiment of the disclosure, which is not described in detail in the embodiments of the present invention.
An embodiment of the present invention provides a data query method, which is used in an information processing device, where the information processing device may be a server, a terminal, and the like, and referring to fig. 2, the method includes:
step 201: when a data query instruction of a target multi-dimensional model is detected, a first user account is determined, the target multi-dimensional model is any one of a plurality of stored multi-dimensional models, the data query instruction carries first dimension information to be queried and first measurement, and the first user account is a user account of current query data.
When the device used by the user to currently log in the multidimensional model database is the information processing device for storing the multidimensional model, after the information processing device detects the data query instruction, the user account currently logging in the multidimensional model database can be determined, and the user account currently logging in the multidimensional model database is determined as the first user account, that is, the user account currently logging in the multidimensional model database is determined as the user account used by the user who needs to query data currently. When the device used by the user to currently log in the multidimensional model database is not the information processing device for storing the multidimensional model, that is, the information processing device can be used as a server for other users to access, at this time, the data query instruction can carry the first user account.
The information processing device can display a dimension information list and a measurement list of the target multi-dimensional model, when a user needs to inquire data, dimension information and measurement can be selected from the dimension information list and the measurement list of the target multi-dimensional model, the selected dimension information is first dimension information, the selected measurement is first measurement, and when the information processing device detects a data inquiry instruction, namely when a first dimension information selection operation and a first measurement selection operation are detected, data corresponding to the first dimension information and the first measurement can be inquired from the target multi-dimensional model.
It should be noted that the data query instruction is used for querying data from the target multidimensional model, and the data query instruction may be triggered by a user through a specified operation, where the specified operation may be a dimension information option of a dimension information list of the target multidimensional model, a click operation of a measurement option in the measurement list, a sliding operation of a preset track, a voice operation, and so on.
In addition, the dimension information includes a dimension and sub-dimensions of each layer included in the dimension, and the information processing apparatus may represent the dimension information by a preset format, for example, the preset format may be a statement format of MDX (Multi-dimensional Expressions) by which the dimension information may be represented as [ region ] - [ hua dong ] - [ shanghai ], where [ region ] is a dimension, [ huadong ] is a first-layer sub-dimension included in the [ region ] dimension, and [ shanghai ] is a second-layer sub-dimension included in the [ region ] dimension.
Step 202: and acquiring second dimension information and a plurality of second metrics from a stored authority list of the target multi-dimensional model based on the first user account and the first dimension information, wherein the authority list is used for storing the dimension information and the metrics of the data query authority of each user account in the target multi-dimensional model.
The information processing device can acquire a plurality of pieces of dimension information and a plurality of pieces of measurement corresponding to the first user account from the authority list of the stored target multi-dimensional model, determine second dimension information from the plurality of pieces of dimension information based on the first dimension information, and determine the plurality of pieces of measurement as a plurality of second measurements.
Wherein, the information processing device may determine, based on the first dimension information, the second dimension information from the plurality of dimension information by: determining a first dimension corresponding to the first dimension information; obtaining a dimension corresponding to each dimension information from a plurality of dimension information corresponding to the first user account; and comparing the first dimension with the dimension corresponding to each dimension information, and determining the dimension information as second dimension information when the first dimension is consistent with the dimension corresponding to the dimension information.
For example, the first dimension information may be [ region ] - [ hua dong ] - [ shanghai ], the plurality of dimension information corresponding to the first user account may be [ region ] - [ hua dong ] - [ shanghai ] and [ time ] - [2016 year ] - [ third quarter ], the information processing device may determine that the first dimension corresponding to the first dimension information [ region ] - [ hua dong ] - [ shanghai ] is [ region ], then obtain, from the plurality of dimension information [ region ] - [ hua dong ] - [ shanghai ] and [ time ] - [2016 year ] - [ third quarter ] corresponding to the first user account, the dimension corresponding to each dimension information, that is, [ region ] and [ time ], compare the first dimension [ region ] with the dimensions [ region ] and [ time ] corresponding to each dimension information, wherein the first dimension [ region ] and the dimensions [ region ] corresponding to the dimension [ huadong ] - [ shanghai ] are consistent, then, the dimension information [ region ] [ east of china ] [ shanghai ] is determined as second dimension information.
It should be noted that the multiple pieces of dimension information and the multiple pieces of metrics corresponding to the user accounts stored in the authority list may be obtained by the information processing device in the following two ways.
The first mode is as follows: when the authority setting instruction is detected, storing a user account carried by the authority setting instruction, a plurality of dimension information corresponding to the user account and a plurality of metrics in an authority list of the target multi-dimensional model.
The administrator can store the user account used by each user and the authority information of the target multidimensional model corresponding to the user account in the information processing equipment in advance according to the identity of each user, so that an authority list of the target multidimensional model is obtained. And then, the administrator can modify, add, delete and the like the authority list of the target multidimensional model, so that the authority list is updated, the problem that the user with changed identity inquires the data corresponding to the previous authority can be avoided, and the safety of the data in the target multidimensional model is further ensured.
The second mode is as follows: when an authority application instruction of the target multi-dimensional model is detected, determining a second user account, wherein the second user account is a user account currently applying for the authority; and when an authority application agreement instruction is detected, storing the plurality of dimension information and the plurality of metrics carried by the second user account and the authority application instruction in an authority list of the target multi-dimensional model.
When a user has data to be inquired but does not have the authority to inquire the data, a trigger operation of authority application can be executed, so that an authority application instruction of a target multi-dimensional model is sent to the information processing equipment, namely, the authority to inquire the data is applied to an administrator, when the administrator logs in an account and receives the authority application of the target multi-dimensional model, a plurality of dimension information and a plurality of metrics carried by a second user account and the authority application instruction can be stored in an authority list of the target multi-dimensional model, and therefore the user can inquire the corresponding data. The permission list is set and stored in a user application mode, so that the flexibility of the control permission can be increased, and the query requirement of a user is met.
Certainly, in practical application, the permission list may be stored by combining the two manners, that is, the administrator may preset a part of user accounts and corresponding permissions in advance, and then add the user accounts and the corresponding permissions according to the application of the user, so that efficiency and flexibility of permission setting can be considered.
Further, the multiple pieces of dimension information corresponding to each user account stored in the authority list may also be obtained by the information processing device in the following manner, including: when an authority application instruction of target sharing dimension information is detected, determining a third user account, wherein the third user account is a user account currently applying authority of the target sharing dimension information, the target sharing dimension information is any one of a plurality of stored sharing dimension information, and each piece of sharing dimension information is the same dimension information included in at least two multi-dimensional models in the multi-dimensional models; and when an authority application approval instruction is detected, storing the third user account and the target sharing dimension information in an authority list corresponding to each multidimensional model comprising the target sharing dimension information.
For some dimension information, the dimension information may exist in a plurality of multi-dimensional models stored in the information processing apparatus, such as dimension information [ region ] [ east of china ] [ shanghai ] may exist in multiple multidimensional models such as sales and warehousing, therefore, in order to enable the user not to repeatedly apply for the same dimension information authority in a plurality of multidimensional models, the administrator can count a plurality of pieces of shared dimension information in advance and store the plurality of pieces of shared dimension information in the information processing device, so that the user can directly apply for any one of the plurality of sharing dimension information, and after the administrator agrees to the application, the information processing device may store the user account of the user and the sharing dimension information applied by the user in the authority list corresponding to each multidimensional model including the sharing dimension information, therefore, the user has the inquiry authority of the data corresponding to the shared dimension information in the multi-dimensional models. Because the user does not need to apply for the authority of each multidimensional model comprising the shared dimension information one by one, the convenience and the efficiency of the user for applying the authority can be improved.
Further, the multiple metrics corresponding to each user account stored in the authority list may also be obtained by the information processing device in the following manner, including: when an authority application instruction of a target measurement group is detected, determining a fourth user account, wherein the fourth user account is a user account currently applying for authority of the target measurement group, the target measurement group is any one of a plurality of stored measurement groups, and each measurement group comprises at least two measurements; and when an authority application agreement instruction is detected, storing the fourth user account and the target metric in the target metric group in an authority list corresponding to the multidimensional model comprising the target metric, wherein the target metric is any one of at least two metrics in the target metric group.
Some metrics in the multi-dimensional models may have a certain correlation, for example, the sales metric and the sales metric may be considered as metrics related to sales, and the warehousing quantity metric, the ex-warehousing quantity metric and the inventory quantity metric may be considered as metrics related to inventory, so that, in order to avoid the user from repeatedly applying for the measurement authority having the correlation in the multi-dimensional models, an administrator may count a plurality of measurement groups in advance and store a measurement group list including the name of each measurement group and a plurality of metrics corresponding to each measurement group in the information processing device, for example, the measurement group list may be a list shown in table 1 below, so that the user may directly apply for any measurement group in the plurality of measurement groups, and after the administrator approves the application, the information processing device may store the user account of the user and the target metric applied by the user in an authority list corresponding to the multi-dimensional model including the target metric, so that the user has a plurality of query rights for data corresponding to the measure of relevance. Because the user does not need to apply for the authority to the multidimensional models comprising the metrics in the metric group one by one, the convenience and the efficiency of the user for applying the authority can be improved.
TABLE 1
Metric group name Measurement of
Sales class [ sales amount][ sales volume ]]
Stocks class [ amount of warehousing][ amount of warehouse-out][ inventory amount ]]
…… ……
Step 203: and querying corresponding data from the target multi-dimensional model based on the first dimension information, the first measurement, the second dimension information and the plurality of second measurements.
The implementation manner of this step may be: determining a first dimension corresponding to the first dimension information and the layer times of each layer of sub-dimensions included in the first dimension to obtain a first layer time; determining a second dimension corresponding to the second dimension information and the number of layers of each layer of sub-dimension included in the second dimension to obtain a second number of layers; and when the first layer times and the second layer times are equal, the lowest-layer sub-dimension included by the first dimension is the same as the lowest-layer sub-dimension included by the second dimension, and the plurality of second metrics include the first metric, querying data corresponding to the first dimension information and the first metric from the target multi-dimensional model.
When the first layer number and the second layer number are equal, the information processing apparatus may determine only whether a lowest layer sub-dimension included in the first dimension is the same as a lowest layer sub-dimension included in the second dimension. When the lowest-layer sub-dimension included by the first dimension is the same as the lowest-layer sub-dimension included by the second dimension, the information processing device can directly determine that the first dimension information is completely the same as the second dimension information without judging whether each layer of sub-dimension before the lowest-layer sub-dimension of the first dimension and the second dimension is the same or not, so that the efficiency of querying data can be greatly improved.
When the lowest-layer sub-dimension included by the first dimension is different from the lowest-layer sub-dimension included by the second dimension, the information processing device can directly determine that the first dimension information is different from the second dimension information, and then the information processing device can end the operation, or display a prompt message to prompt the user that the user does not have the authority corresponding to the currently queried data, and also whether each layer of sub-dimension before the lowest-layer sub-dimension of the first dimension and the second dimension is the same or not does not need to be judged, so that the efficiency of querying the data can be greatly improved. Certainly, in practical application, the prompt message may further include an authority application operation to prompt the user to apply for the authority through the authority application operation.
Further, when the first layer number is not equal to the second layer number, there are two cases that the first layer number is greater than the second layer number, and the first layer number is less than the second layer number, and under these two different cases, the data query mode of the information processing apparatus is different.
The first mode is as follows: when the first layer times is greater than the second layer times, judging whether the lowest-layer sub-dimension included in the second dimension is the same as a first target sub-dimension, wherein the first target sub-dimension is a sub-dimension which belongs to the same layer as the lowest-layer sub-dimension included in the second dimension in the sub-dimensions included in the first dimension; and when the lowest-layer sub-dimension included by the second dimension is the same as the first target sub-dimension and the plurality of second metrics include the first metric, querying data corresponding to the first dimension information and the first metric from the target multi-dimensional model.
When the lowest-layer sub-dimension included in the second dimension is the same as the first target sub-dimension, it may be determined that the dimension information range corresponding to the data currently queried by the user belongs to the dimension information range of the user in the authority list, that is, it is determined that the data currently queried by the user is within the query authority of the user, and at this time, the information processing device may query the first dimension information and the data corresponding to the first dimension from the target multi-dimensional model. When the lowest-layer sub-dimension included in the second dimension is different from the first target sub-dimension, it may be determined that the data currently queried by the user is not within the query authority of the user, and then the information processing device may end the operation, or display a prompt message to prompt the user that the authority corresponding to the currently queried data does not exist.
The second mode is as follows: when the first layer times is less than the second layer times, judging whether the lowest layer sub-dimension included in the first dimension is the same as a second target sub-dimension, wherein the second target sub-dimension is a sub-dimension which belongs to the same layer as the lowest layer sub-dimension included in the first dimension in the sub-dimensions included in the second dimension; and when the lowest-layer sub-dimension included by the first dimension is the same as the second target sub-dimension and the plurality of second measures include the first measure, querying data corresponding to the second dimension information and the first measure from the target multi-dimensional model.
When the lowest-layer sub-dimension included in the first dimension is the same as the second target sub-dimension, it may be determined that the dimension information range of the user in the authority list belongs to the dimension information range corresponding to the data currently queried by the user, that is, it is determined that, in the data currently queried by the user, a part of the data is in the query authority of the user, and another part of the data is not in the query authority of the user, at this time, the information processing device may query the data corresponding to the second dimension information and the first dimension from the target multi-dimensional model, that is, query the data in the query authority of the user from the target multi-dimensional model. When the lowest-layer sub-dimension included in the first dimension is different from the second target sub-dimension, it may be determined that the dimension information corresponding to the data currently queried by the user is inconsistent with the dimension information in the authority of the user, that is, it is determined that the user does not have the authority corresponding to the currently queried data, at this time, the information processing device may also end the operation, or display a prompt message to prompt the user that the user does not have the authority corresponding to the currently queried data.
Optionally, when the number of the first layer is smaller than the number of the second layer, the information processing device may determine that the range of the dimension information corresponding to the data currently queried by the user is larger than the range of the dimension information in the authority corresponding to the user, at this time, the information processing device may directly end the operation, or display a prompt message to prompt that the user does not have the authority corresponding to the currently queried data, without performing the step of determining whether the lowest-layer sub-dimension included in the first dimension is the same as the second target sub-dimension, and the step after the step, thereby reducing the load of the information processing device and improving the efficiency of the information processing device in providing data query services for a plurality of users.
Step 204: and displaying the data obtained by the query.
After the information processing equipment inquires the data from the target multi-dimensional model, the inquired data can be displayed, so that after the data is observed by a user, the data can be analyzed, and related services can be processed.
In the embodiment of the invention, first, when a data query instruction of a target multi-dimensional model is detected, a first user account is determined, then, based on the first user account and first dimension information, second dimension information and a plurality of second dimensions are obtained from a stored authority list of the target multi-dimensional model, that is, dimension information and measurement of the first user account having data query authority in the target multi-dimensional model are obtained, and then, based on the first dimension information, the first measurement, the second dimension information and the plurality of second dimensions, corresponding data is queried from the target multi-dimensional model instead of directly querying data required by a user from the target multi-dimensional model, so that the security of the data in the target multi-dimensional model is improved.
Referring to fig. 3A, an embodiment of the present invention provides a data query apparatus 300, including: a first determination module 301, an acquisition module 302 and a query module 303.
The first determining module 301 is configured to determine a first user account when a data query instruction of a target multidimensional model is detected, where the target multidimensional model is any one of a plurality of stored multidimensional models, the data query instruction carries first dimension information and first metric to be queried, and the first user account is a user account of currently queried data;
an obtaining module 302, configured to obtain, based on a first user account and first dimension information, second dimension information and a plurality of second metrics from a permission list of a stored target multidimensional model, where the permission list is used to store dimension information and metrics of each user account having a data query permission in the target multidimensional model;
the query module 303 is configured to query corresponding data from the target multidimensional model based on the first dimension information, the first metric, the second dimension information, and the plurality of second metrics.
Optionally, referring to fig. 3B, the query module 303 includes:
a first determining unit 3031, configured to determine a first dimension corresponding to the first dimension information and a layer number of each layer of sub-dimensions included in the first dimension, to obtain a first layer number;
a second determining unit 3032, configured to determine a second dimension corresponding to the second dimension information and the number of layers of each sub-dimension included in the second dimension, to obtain a second number of layers;
the first querying unit 3033 is configured to query, when the first layer number is equal to the second layer number, the lowest layer sub-dimension included in the first dimension is the same as the lowest layer sub-dimension included in the second dimension, and the plurality of second measures include the first measure, data corresponding to the first dimension information and the first measure from the target multi-dimensional model.
Optionally, referring to fig. 3C, the query module 303 further includes:
a first determining unit 3034, configured to determine whether a lowest-layer sub-dimension included in the second dimension is the same as a first target sub-dimension when the first layer number is greater than the second layer number, where the first target sub-dimension is a sub-dimension of the same level as a lowest-layer sub-dimension included in the second dimension in the sub-dimensions included in the first dimension;
a second querying unit 3035, configured to query, when the lowest-layer sub-dimension included in the second dimension is the same as the first target sub-dimension and the plurality of second metrics includes the first metric, data corresponding to the first dimension information and the first metric from the target multi-dimensional model.
Optionally, referring to fig. 3D, the query module 303 further includes:
a second determining unit 3036, configured to determine whether a lowest-layer sub-dimension included in the first dimension is the same as a second target sub-dimension when the first layer number is smaller than the second layer number, where the second target sub-dimension is a sub-dimension of the same layer as the lowest-layer sub-dimension included in the first dimension in the sub-dimensions included in the second dimension;
a third querying unit 3037, configured to query, when the lowest-layer sub-dimension included in the first dimension is the same as the second target sub-dimension and the plurality of second metrics includes the first metric, data corresponding to the second dimension information and the first metric from the target multidimensional model.
Optionally, referring to fig. 3E, the apparatus further comprises:
a second determining module 304, configured to determine a second user account when an authority application instruction of the target multidimensional model is detected, where the second user account is a user account currently applying for an authority;
the storage module 305 is configured to, when an authority application agreement instruction is detected, store the multiple dimension information and the multiple metrics carried by the second user account and the authority application instruction in an authority list of the target multidimensional model.
In summary, in the embodiment of the present invention, first, when a data query instruction of a target multidimensional model is detected, a first user account is determined, then, based on the first user account and first dimension information, second dimension information and a plurality of second dimensions are obtained from a stored authority list of the target multidimensional model, that is, dimension information and measurements that the first user account has a data query authority in the target multidimensional model are obtained, and then, based on the first dimension information, the first measurements, the second dimension information, and the plurality of second dimensions, corresponding data is queried from the target multidimensional model, instead of directly querying data required by a user from the target multidimensional model, so that security of data in the target multidimensional model is improved.
It should be noted that: in the data query apparatus provided in the above embodiment, when querying data, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the data query apparatus and the data query method provided in the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (8)

1. A method for data query, the method comprising:
when a data query instruction of a target multi-dimensional model is detected, determining a first user account, wherein the target multi-dimensional model is any one of a plurality of stored multi-dimensional models, the data query instruction carries first dimension information and first measurement to be queried, and the first user account is a user account of current query data;
acquiring second dimension information and a plurality of second metrics from a stored authority list of the target multi-dimensional model based on the first user account and the first dimension information, wherein the authority list is used for storing dimension information and metrics of each user account having data query authority in the target multi-dimensional model;
querying corresponding data from the target multi-dimensional model based on the first dimension information, the first metric, the second dimension information and the plurality of second metrics;
the querying, based on the first dimension information, the first metric, the second dimension information, and the plurality of second metrics, corresponding data from the target multidimensional model includes: determining a first dimension corresponding to the first dimension information and the layer times of each layer of sub-dimension included in the first dimension to obtain a first layer time; determining a second dimension corresponding to the second dimension information and the number of layers of each layer of sub-dimension included in the second dimension to obtain a second number of layers; and when the first layer times and the second layer times are equal, the lowest layer sub-dimension included by the first dimension is the same as the lowest layer sub-dimension included by the second dimension, and the plurality of second metrics include the first metric, querying data corresponding to the first dimension information and the first metric from the target multi-dimensional model.
2. The method of claim 1, wherein after determining a second dimension corresponding to the second dimension information and a layer number of each layer of sub-dimensions included in the second dimension, and obtaining the second layer number, the method further comprises:
when the first layer times is greater than the second layer times, judging whether a lowest layer sub-dimension included in the second dimension is the same as a first target sub-dimension, wherein the first target sub-dimension is a sub-dimension which belongs to the same level as the lowest layer sub-dimension included in the second dimension in the sub-dimensions included in the first dimension;
and when the lowest-layer sub-dimension included in the second dimension is the same as the first target sub-dimension and the plurality of second metrics include the first metric, querying data corresponding to the first dimension information and the first metric from the target multi-dimensional model.
3. The method according to claim 1 or 2, wherein the determining a second dimension corresponding to the second dimension information and the number of layers of each sub-dimension included in the second dimension, and after obtaining the second number of layers, further includes:
when the first layer times is smaller than the second layer times, judging whether the lowest layer sub-dimension included in the first dimension is the same as a second target sub-dimension, wherein the second target sub-dimension is a sub-dimension which belongs to the same layer as the lowest layer sub-dimension included in the first dimension in the sub-dimensions included in the second dimension;
and when the lowest-layer sub-dimension included in the first dimension is the same as the second target sub-dimension and the plurality of second measures include the first measure, querying data corresponding to the second dimension information and the first measure from the target multi-dimensional model.
4. The method of claim 1, wherein the method further comprises:
when an authority application instruction of the target multi-dimensional model is detected, determining a second user account, wherein the second user account is a user account currently applying for the authority;
and when an authority application agreement instruction is detected, storing the second user account and the multiple dimension information and the multiple metrics carried by the authority application instruction in an authority list of the target multi-dimensional model.
5. A data query apparatus, characterized in that the apparatus comprises:
the device comprises a first determining module, a second determining module and a third determining module, wherein the first determining module is used for determining a first user account when a data query instruction of a target multi-dimensional model is detected, the target multi-dimensional model is any one of a plurality of stored multi-dimensional models, the data query instruction carries first dimension information and first measurement to be queried, and the first user account is a user account of current query data;
an obtaining module, configured to obtain second dimension information and a plurality of second metrics from a stored authority list of the target multidimensional model based on the first user account and the first dimension information, where the authority list is used to store dimension information and metrics of each user account having a data query authority in the target multidimensional model;
a query module, configured to query corresponding data from the target multidimensional model based on the first dimension information, the first metric, the second dimension information, and the plurality of second metrics;
the query module comprises: a first determining unit, configured to determine a first dimension corresponding to the first dimension information and a layer number of each layer of sub-dimensions included in the first dimension, to obtain a first layer number; a second determining unit, configured to determine a second dimension corresponding to the second dimension information and a number of layers of each layer of sub-dimensions included in the second dimension, to obtain a second number of layers; a first query unit, configured to query, when the first-layer number is equal to the second-layer number, a lowest-layer sub-dimension included in the first dimension is the same as a lowest-layer sub-dimension included in the second dimension, and the plurality of second metrics include the first metric, data corresponding to the first dimension information and the first metric from the target multi-dimensional model.
6. The apparatus of claim 5, wherein the query module further comprises:
a first determining unit, configured to determine whether a lowest-layer sub-dimension included in the second dimension is the same as a first target sub-dimension when the first layer number is greater than the second layer number, where the first target sub-dimension is a sub-dimension of a same layer as a lowest-layer sub-dimension included in the second dimension among the sub-dimensions included in the first dimension;
a second query unit, configured to query, when a lowest-layer sub-dimension included in the second dimension is the same as the first target sub-dimension and the plurality of second metrics include the first metric, data corresponding to the first dimension information and the first metric from the target multidimensional model.
7. The apparatus of claim 5 or 6, wherein the query module further comprises:
a second determining unit, configured to determine whether a lowest-layer sub-dimension included in the first dimension is the same as a second target sub-dimension when the first layer number is smaller than the second layer number, where the second target sub-dimension is a sub-dimension of the second dimension that belongs to the same layer as the lowest-layer sub-dimension included in the first dimension;
and a third query unit, configured to query, when a lowest-layer sub-dimension included in the first dimension is the same as the second target sub-dimension, and the plurality of second metrics include the first metric, data corresponding to the second dimension information and the first metric from the target multidimensional model.
8. The apparatus of claim 5, wherein the apparatus further comprises:
the second determining module is used for determining a second user account when the permission application instruction of the target multi-dimensional model is detected, wherein the second user account is a user account currently applying permission;
and the storage module is used for storing the second user account and the multiple dimension information and the multiple metrics carried by the permission application instruction in a permission list of the target multi-dimensional model when the permission application agreement instruction is detected.
CN201611245727.1A 2016-12-29 2016-12-29 Data query method and device Active CN106682180B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611245727.1A CN106682180B (en) 2016-12-29 2016-12-29 Data query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611245727.1A CN106682180B (en) 2016-12-29 2016-12-29 Data query method and device

Publications (2)

Publication Number Publication Date
CN106682180A CN106682180A (en) 2017-05-17
CN106682180B true CN106682180B (en) 2020-02-21

Family

ID=58873380

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611245727.1A Active CN106682180B (en) 2016-12-29 2016-12-29 Data query method and device

Country Status (1)

Country Link
CN (1) CN106682180B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108932257B (en) * 2017-05-25 2021-10-08 北京国双科技有限公司 Multi-dimensional data query method and device
CN107784091B (en) * 2017-10-12 2020-05-29 中国平安财产保险股份有限公司 Operation authority query method and terminal device
CN109543073A (en) * 2018-10-17 2019-03-29 深圳壹账通智能科技有限公司 Enterprise's supply and marketing relation map generation method, device and computer equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000078002A2 (en) * 1999-06-11 2000-12-21 Microsoft Corporation Multi-dimensional authoritative names registry in pervasive computing
CN102426523A (en) * 2010-10-21 2012-04-25 微软公司 Multi-dimensional objects
CN104462434A (en) * 2014-12-15 2015-03-25 北京国双科技有限公司 Data inquiring method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402653A (en) * 2010-09-16 2012-04-04 金蝶软件(中国)有限公司 Method, system and terminal for controlling authority of data among different kinds of application
CN103761323B (en) * 2014-01-28 2017-08-01 北京国双科技有限公司 Database permission control method and device
CN103853818B (en) * 2014-02-12 2017-04-12 博易智软(北京)技术股份有限公司 Multidimensional data processing method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000078002A2 (en) * 1999-06-11 2000-12-21 Microsoft Corporation Multi-dimensional authoritative names registry in pervasive computing
CN102426523A (en) * 2010-10-21 2012-04-25 微软公司 Multi-dimensional objects
CN104462434A (en) * 2014-12-15 2015-03-25 北京国双科技有限公司 Data inquiring method and device

Also Published As

Publication number Publication date
CN106682180A (en) 2017-05-17

Similar Documents

Publication Publication Date Title
US7523133B2 (en) Data model and applications
CN110427434B (en) Multidimensional data query method and device
US20200356688A1 (en) Data access authority management method, apparatus, terminal device and storage medium
CN110221982B (en) Performance test method, device and equipment of business system and readable storage medium
US10248674B2 (en) Method and apparatus for data quality management and control
US9875277B1 (en) Joining database tables
CN106682180B (en) Data query method and device
CN111339171B (en) Data query method, device and equipment
CN109981569B (en) Network system access method, device, computer equipment and readable storage medium
CN112667697A (en) Method and device for acquiring real estate information by combining RPA and AI
US9158786B1 (en) Database selection system and method to automatically adjust a database schema based on an input data
CN111414410A (en) Data processing method, device, equipment and storage medium
US9037609B1 (en) Method for determining access of queries
CN110737706A (en) Data management method, device, equipment and computer readable storage medium
US20140006592A1 (en) Model Entity Network for Analyzing a Real Entity Network
CN106469175A (en) Data processing method and device
CN105117333A (en) Method and system for management of test cases
WO2023078078A1 (en) Unified data security labeling framework
CN113434588B (en) Data mining analysis method and device based on mobile communication ticket
CN109582676B (en) Power data processing method and device, computer equipment and storage medium
CN113868141A (en) Data testing method and device, electronic equipment and storage medium
CN110781191B (en) Processing method of layout data and server
US20140129459A1 (en) Method and system for social media integration into business applications
CN106126539B (en) User behavior data processing method and device
CN115757526B (en) Metadata management method, device, equipment and computer storage medium

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
GR01 Patent grant
GR01 Patent grant