CN105512528B - 业务模型中行权限的实现方法 - Google Patents

业务模型中行权限的实现方法 Download PDF

Info

Publication number
CN105512528B
CN105512528B CN201510932954.0A CN201510932954A CN105512528B CN 105512528 B CN105512528 B CN 105512528B CN 201510932954 A CN201510932954 A CN 201510932954A CN 105512528 B CN105512528 B CN 105512528B
Authority
CN
China
Prior art keywords
model
inquiry
business model
row
user
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
CN201510932954.0A
Other languages
English (en)
Other versions
CN105512528A (zh
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.)
TIANJIN NANKAI UNIVERSITY GENERAL DATA TECHNOLOGIES Co Ltd
Original Assignee
TIANJIN NANKAI UNIVERSITY GENERAL DATA 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 TIANJIN NANKAI UNIVERSITY GENERAL DATA TECHNOLOGIES Co Ltd filed Critical TIANJIN NANKAI UNIVERSITY GENERAL DATA TECHNOLOGIES Co Ltd
Priority to CN201510932954.0A priority Critical patent/CN105512528B/zh
Publication of CN105512528A publication Critical patent/CN105512528A/zh
Application granted granted Critical
Publication of CN105512528B publication Critical patent/CN105512528B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明提供一种业务模型中行权限的实现方法,包含如下步骤:1)设置业务模型的行权限;2)用户对业务模型查询时,对该查询结构添加当前用户的行权限限制。本发明具有的优点和积极效果是:使业务模型中行权限的设置简单通用,增加了数据查询的安全性。

Description

业务模型中行权限的实现方法
技术领域
本发明属于数据库技术领域,尤其是涉及业务模型中行权限的实现方法.
背景技术
业务模型是指在用户当前业务数据库的基础上对数据库中相关业务表进行关联,并对表中的相关字段进行业务名称映射,以方便相关人员理解使用和快速查。.
对业务模型的查询经常会涉及权限问题。即使是相同的查询,不同的人(职级职位不同)最终查询返回的结构也可能不同。
发明内容
本发明要解决的问题是提供一种业务模型中行权限的实现方法。
为解决上述技术问题,本发明采用的技术方案是:
一种业务模型中行权限的实现方法,包括:
1)设置业务模型的行权限;
2)用户对业务模型查询时,对该查询结构添加当前用户的行权限限制。
优选的,步骤1)中所述业务模型是将用户业务数据库表结构及关联关系利用xml进行描述,使用json字符串对每个用户进行行权限设置。
优选的,步骤2)包括以下步骤:
21)当查询业务模型时,根据对用户的行权限的设置,得到当前用户的行权限json字符串,取得对应模型的行权限设置;
22)将设置的行权限添加到用户查询的限制条件中,用语法解析去分析修改后的查询;
23)根据模型的相关设置将修改后的查询解析成sql语句并执行。
进一步的,步骤22)所述用语法解析去分析修改后的查询,包括:
221)通过语法解析,得到查询中所有用到的表名;
222)通过语法解析,得到查询中所用到的模型;
223)得到该模型后,根据该模型的关联关系,得到其涉及的各个表的关系图。
进一步的,步骤23)所述根据模型的相关设置将修改后的查询解析成sql语句并执行,包括:
231)根据查询中用到的表名和模型的表关系构造from和join关系;
232)将from schema替换成步骤231)中的from和join关系;
233)根据模型中对应的数据库映射的表名和列名,将上述查询解析成真正的sql语句并查询。
本发明采用的核心思想是:设置业务模型的行权限;当查询业务模型的时候,对该查询进行权限检测和行权限的动态添加。
本发明具有的优点和积极效果是:使业务模型中行权限的设置简单通用,增加了数据查询的安全性。
具体实施方式
下面对本发明的具体实施例做详细说明。
本发明业务模型中行权限的实现方法,包含:
步骤一:设置业务模型的行权限;
步骤二:当用户对业务模型查询时,对该查询结构添加当前用户的行权限限制。
本发明步骤一中,设置业务模型的行权限;其中业务模型是将用户业务数据库表结构及关联关系利用xml进行描述。
本发明一实施列,设置业务模型行权限.其中的业务模型描述如下:
设置行权限:
使用json字符串对每个用户进行行权限设置,形如[{"schemaId":"","limit":""},......]这样的json字符串
其中:
schemaId为模型id,比如上述的模型id:585bd89b-e111-4271-b0a5-96bd510a096b
limit为行权限限制,比如对上述模型设置的行权限:部门.部门名称=’销售部’and费用类型.类型名=’差旅费’
本发明步骤二中,当查询业务模型时,根据对用户的行权限的设置,得到当前用户的行权限json字符串,取得对应模型的行权限设置,将设置的行权限添加到用户查询的限制条件中.用语法解析去分析修改后的查询,根据模型的相关设置将修改后的查询解析成sql语句并执行.具体过程如下:
用户的查询结构为:
select
sum(费用.费用),
费用类型.类型名
from
schema 585bd89b-e111-4271-b0a5-96bd510a096b
group by
费用类型.类型名
后台得到这个查询结构后,根据当前登录的用户,得到对其设置的行权限:[{"schemaId":"…","limit":"…"},......]。
从设置的行权限中得到schemeId为585bd89b-e111-4271-b0a5-96bd510a096b的设置;{"schemaId":"585bd89b-e111-4271-b0a5-96bd510a096b","limit":"…"}.
得到行权限中的limit:部门.部门名称=’销售部’and费用类型.类型名=’差旅费’;
修改当前查询,加入行权限.修改后的查询结构为:
select
sum(费用.费用),
费用类型.类型名
from
schema 585bd89b-e111-4271-b0a5-96bd510a096b
where
部门.部门名称=’销售部’and费用类型.类型名=’差旅费’
group by
费用类型.类型名
用语法解析分析修改后的查询,并结合查询的模型schema 585bd89b-e111-4271-b0a5-96bd510a096b,构造成完整的sql.具体过程为:
1.通过语法解析,得到上述查询中所有用到的表名.例如:费用,费用类型,部门
2.通过语法解析,得到上述查询中所用到的模型.例如:schema 585bd89b-e111-4271-b0a5-96bd510a096b。
3.得到该模型,根据该模型的关联关系,得到其涉及的各个表的关系。
4.根据查询中用到的表名和模型的表关系构造from和join关系:
用到了费用,费用类型和部门表.分别找到他们的关联路径:
费用:费用
费用类型:费用->费用类型
部门:费用->用户->部门
取得他们的最小公共表作为from,其余的表作为join表,根据模型中的joins设置,得到的from和join关系为:
from费用
left join费用类型on费用.费用类型Id=费用类型.费用类型Id
left join用户on费用.用户Id=用户.用户Id
left join部门on用户.部门Id=部门.部门Id
5.将from schema 585bd89b-e111-4271-b0a5-96bd510a096b替换成4中的from和join关系.替换完之后的查询结构为:
select
sum(费用.费用),
费用类型.类型名
from费用
left join费用类型on费用.费用类型Id=费用类型.费用类型Id
left join用户on费用.用户Id=用户.用户Id
left join部门on用户.部门Id=部门.部门Id
where
部门.部门名称=’销售部’and费用类型.类型名=’差旅费’
group by
费用类型.类型
6.根据模型中对应的数据库映射的表名和列名,将上述查询解析成真正的sql语句并查询。
以上对本发明的一个实施例进行了详细说明,但所述内容仅为本发明的较佳实施例,不能被认为用于限定本发明的实施范围。凡依本发明申请范围所作的均等变化与改进等,均应仍归属于本发明的专利涵盖范围之内。

Claims (3)

1.一种业务模型中行权限的实现方法,其特征在于,包括:
1)设置业务模型的行权限;
2)用户对业务模型查询时,对该查询的查询结构添加当前用户的行权限限制;
步骤2)包括以下步骤:
21)当查询业务模型时,根据对用户的行权限的设置,得到当前用户的行权限json字符串,取得对应模型的行权限设置;
22)将设置的行权限添加到用户查询的限制条件中,用语法解析去分析修改后的查询;
23)根据模型的相关设置将修改后的查询解析成sql语句并执行;
步骤23)所述根据模型的相关设置将修改后的查询解析成sql语句并执行,包括:
231)根据查询中用到的表名和模型的表关系构造from和join关系;
232)将from schema替换成步骤231)中的from和join关系;所述schema为查询中所用到的业务模型;
233)根据模型中对应的数据库映射的表名和列名,将上述查询解析成真正的sql语句并查询。
2.根据权利要求1所述的一种业务模型中行权限的实现方法,其特征在于,步骤1)中所述业务模型是将用户业务数据库表结构及关联关系利用xml进行描述,使用json字符串对每个用户进行行权限设置。
3.根据权利要求1所述的一种业务模型中行权限的实现方法,其特征在于,步骤22)所述用语法解析去分析修改后的查询,包括:
221)通过语法解析,得到查询中所有用到的表名;
222)通过语法解析,得到查询中所用到的模型;
223)得到该模型后,根据该模型的关联关系,得到其涉及的各个表的关系图。
CN201510932954.0A 2015-12-12 2015-12-12 业务模型中行权限的实现方法 Active CN105512528B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510932954.0A CN105512528B (zh) 2015-12-12 2015-12-12 业务模型中行权限的实现方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510932954.0A CN105512528B (zh) 2015-12-12 2015-12-12 业务模型中行权限的实现方法

Publications (2)

Publication Number Publication Date
CN105512528A CN105512528A (zh) 2016-04-20
CN105512528B true CN105512528B (zh) 2019-03-08

Family

ID=55720504

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510932954.0A Active CN105512528B (zh) 2015-12-12 2015-12-12 业务模型中行权限的实现方法

Country Status (1)

Country Link
CN (1) CN105512528B (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107688659A (zh) * 2017-09-08 2018-02-13 北京奇艺世纪科技有限公司 一种数据处理方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976316A (zh) * 2010-10-27 2011-02-16 杭州新中大软件股份有限公司 一种信息访问权限控制方法
US8819783B2 (en) * 2007-02-16 2014-08-26 Microsoft Corporation Efficient data structures for multi-dimensional security
CN104572894A (zh) * 2014-12-24 2015-04-29 天津南大通用数据技术股份有限公司 在商业智能中利用xml描述业务模型的方法及商业智能系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8819783B2 (en) * 2007-02-16 2014-08-26 Microsoft Corporation Efficient data structures for multi-dimensional security
CN101976316A (zh) * 2010-10-27 2011-02-16 杭州新中大软件股份有限公司 一种信息访问权限控制方法
CN104572894A (zh) * 2014-12-24 2015-04-29 天津南大通用数据技术股份有限公司 在商业智能中利用xml描述业务模型的方法及商业智能系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Hadoop的Web查询平台的权限控制与性能优化模块;张京一;《中国优秀硕士学位论文全文数据库·信息科技辑》;20150815;17页13-17行,29页10-20行,30页第2段, 43页倒数三行,45页15-20行,47页10-30行,49页倒数两段

Also Published As

Publication number Publication date
CN105512528A (zh) 2016-04-20

Similar Documents

Publication Publication Date Title
Pang et al. MetaboAnalystR 3.0: toward an optimized workflow for global metabolomics
Zheng et al. Study on the discrimination between Citri Reticulatae Pericarpium varieties based on HS-SPME-GC-MS combined with multivariate statistical analyses
JP2018536909A5 (zh)
DE202013012490U1 (de) Effiziente hierarchisch geprägte Top-Down Verbindung geclusterter Datenstrom
Da Luz et al. Secondary metabolic profiles of two cultivars of Piper nigrum (black pepper) resulting from infection by Fusarium solani f. sp. piperis
Qiu et al. Analysis of volatile components in different Ophiocordyceps sinensis and insect host products
CN104572894A (zh) 在商业智能中利用xml描述业务模型的方法及商业智能系统
CN105512528B (zh) 业务模型中行权限的实现方法
Xue et al. Social network influences on non-agricultural employment quality for part-time peasants: A case study of Sichuan province, China
Reveglia et al. Untargeted and targeted LC-MS/MS based metabolomics study on in vitro culture of Phaeoacremonium species
Miao et al. Diversity begets diversity: Low resource heterogeneity reduces the diversity of nut‐nesting ants in rubber plantations
Fernando et al. A metabolomic study of Epichloë endophytes for screening antifungal metabolites
WOLDA et al. Measuring variation in abundance, the problem with zeros
CN103279580A (zh) 基于新型语义空间的视频检索方法
CN109377017A (zh) 一种信息系统实用化及数据健康度评价方法
CN112115271B (zh) 知识图谱构建方法及装置
Bao et al. Effect of Different Accumulative Temperate Zones in Heilongjiang on Glycine Soja Metabolites as Analyzed by Non-Target Metabolomics
Liu et al. Metabolic profiling reveals that the olfactory cues in the duck uropygial gland potentially act as sex pheromones
周叶鸣 et al. A new record of the genus Ophiocordyceps from China
Yi Comparative study on a moderate scale management of agricultural land in China and Japan
瞿娇娇 et al. Identification of a parasitic Hirsutella Pat. of Bombyx mori Linnaeus. and sporulation conditions optimization
钮旭光 et al. Diversity of endophytic fungi of Suaeda heteroptera Kitag.
华丽霞 et al. Diseases control and plant growth promotion effect of three Trichoderma strains
Rafiei Atany et al. People's Attitudes to Antiquities in the Qajar Period
Van Rompaey Modelling the impact of rural frontier migration on tropical deforestation.

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant