CN116226164A - A data isolation method, device, electronic equipment and storage medium - Google Patents
A data isolation method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116226164A CN116226164A CN202310099316.XA CN202310099316A CN116226164A CN 116226164 A CN116226164 A CN 116226164A CN 202310099316 A CN202310099316 A CN 202310099316A CN 116226164 A CN116226164 A CN 116226164A
- Authority
- CN
- China
- Prior art keywords
- data
- isolation
- target
- user
- dimension
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/243—Natural language query formulation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2457—Query processing with adaptation to user needs
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/248—Presentation of query results
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting 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
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- General Health & Medical Sciences (AREA)
- Bioethics (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Storage Device Security (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
本申请提供一种数据隔离方法、装置、电子设备及存储介质,该方法包括:获取用户登录信息;根据用户登录信息,调取对应的数据展示页面;根据数据展示页面中数据列表对应的隔离条件,生成目标数据库语句片段;将目标数据库语句片段拼接到数据列表的基础数据库语句,得到目标数据库语句;基于目标数据库语句调用目标数据,并将目标数据显示在数据列表。上述方案提供的方法,通过为数据列表绑定隔离条件,数据库中的数据必然绑定有对应的数据列表,确保数据能够实现数据隔离,从而提高了数据的安全性。
The present application provides a data isolation method, device, electronic equipment, and storage medium, the method including: obtaining user login information; according to the user login information, calling the corresponding data display page; according to the isolation conditions corresponding to the data list in the data display page , to generate target database statement fragments; splicing the target database statement fragments into the basic database statement of the data list to obtain the target database statement; calling the target data based on the target database statement, and displaying the target data in the data list. In the method provided by the above solution, by binding the isolation condition to the data list, the data in the database must be bound to the corresponding data list to ensure that the data can achieve data isolation, thereby improving the security of the data.
Description
技术领域technical field
本申请涉及数据管理技术领域,尤其涉及一种数据隔离方法、装置、电子设备及存储介质。The present application relates to the technical field of data management, and in particular to a data isolation method, device, electronic equipment and storage medium.
背景技术Background technique
目前,无论是企业管理系统还是工程管理系统都面向海量用户,在海量用户和复杂权限体系的环境下,一般利用数据隔离技术,对数据展示需要严格控制。At present, both the enterprise management system and the engineering management system are oriented to a large number of users. In the environment of a large number of users and a complex permission system, data isolation technology is generally used to strictly control the data display.
在现有技术中,通常是角色绑定部门进行隔离,用户获取数据的时候会获取用户绑定的部门相关数据,若有业务数据没有跟部门关联,该业务数据将无法实现数据隔离,降低了数据的安全性。In the existing technology, the role-bound department is usually isolated. When the user obtains data, the relevant data of the department bound to the user will be obtained. If there is business data that is not associated with the department, the business data will not be able to achieve data isolation, reducing the Data Security.
发明内容Contents of the invention
本申请提供一种数据隔离方法、装置、电子设备及存储介质,以解决现有技术降低了数据的安全性等缺陷。The present application provides a data isolation method, device, electronic equipment, and storage medium to solve defects such as lowering data security in the prior art.
本申请第一个方面提供一种数据隔离方法,包括:The first aspect of this application provides a data isolation method, including:
获取用户登录信息;Obtain user login information;
根据所述用户登录信息,调取对应的数据展示页面;Call the corresponding data display page according to the user login information;
根据所述数据展示页面中数据列表对应的隔离条件,生成目标数据库语句片段;Generate target database statement fragments according to the isolation conditions corresponding to the data list in the data display page;
将所述目标数据库语句片段拼接到所述数据列表的基础数据库语句,得到目标数据库语句;Splicing the target database statement fragments into the basic database statement of the data list to obtain the target database statement;
基于所述目标数据库语句调用目标数据,并将所述目标数据显示在所述数据列表。calling target data based on the target database statement, and displaying the target data in the data list.
可选的,所述根据所述用户登录信息,调取对应的数据展示页面,包括:Optionally, calling the corresponding data display page according to the user login information includes:
根据所述用户登录信息,确定该用户的隔离维度;其中,所述隔离维度至少分为部门、角色和人员三种;Determine the isolation dimension of the user according to the user login information; wherein, the isolation dimension is at least divided into three types: department, role and personnel;
根据该用户的隔离维度,确定对应的目标隔离策略;According to the user's isolation dimension, determine the corresponding target isolation strategy;
根据所述目标隔离策略,调取对应的数据展示页面。According to the target isolation strategy, the corresponding data display page is called.
可选的,所述根据所述用户登录信息,确定该用户的隔离维度,包括:Optionally, the determining the isolation dimension of the user according to the user login information includes:
根据所述用户登录信息表征的关联类型,确定该用户的隔离维度。According to the association type represented by the user's login information, the isolation dimension of the user is determined.
可选的,所述根据所述用户登录信息表征的关联类型,确定该用户的隔离维度,包括:Optionally, the determining the isolation dimension of the user according to the association type represented by the user login information includes:
当所述用户登录信息表征该用户包括两种及以上关联类型时,根据各关联类型的优先级,确定目标关联类型;When the user login information indicates that the user includes two or more association types, determine the target association type according to the priority of each association type;
根据所述目标关联类型,确定该用户的隔离维度。According to the target association type, the isolation dimension of the user is determined.
可选的,所述根据所述数据展示页面中数据列表对应的隔离条件,生成目标数据库语句片段,包括:Optionally, according to the isolation conditions corresponding to the data list in the data display page, generating target database statement fragments includes:
根据所述数据展示页面中数据列表对应的隔离条件,确定对应的隔离脚本和维度逻辑;According to the isolation condition corresponding to the data list in the data display page, determine the corresponding isolation script and dimension logic;
按照所述隔离脚本和维度逻辑,生成目标数据库语句片段。Generate target database statement fragments according to the isolation script and dimension logic.
可选的,还包括:Optionally, also include:
根据所述数据展示页面中数据列表对应的隔离条件,判断当前的隔离维度是否包括子查询;According to the isolation condition corresponding to the data list in the data display page, it is judged whether the current isolation dimension includes a subquery;
若当前的隔离维度是否包括子查询,则获取所述子查询对应的维度字段;If the current isolation dimension includes a subquery, obtain the dimension field corresponding to the subquery;
将所述维度字段添加至所述目标数据库语句片段。Adding the dimension field to the target database statement fragment.
可选的,所述基于所述目标数据库语句调用目标数据,包括:Optionally, the invoking target data based on the target database statement includes:
调用数据库查询脚本接口;Call the database query script interface;
基于所述数据库查询脚本接口,将所述目标数据库语句输入到预设数据库,以在所述预设数据库中调用目标数据。Based on the database query script interface, the target database statement is input into a preset database, so as to call the target data in the preset database.
本申请第二个方面提供一种数据隔离装置,包括:The second aspect of the present application provides a data isolation device, including:
获取模块,用于获取用户登录信息;The acquisition module is used to obtain user login information;
页面调取模块,用于根据所述用户登录信息,调取对应的数据展示页面;A page calling module, configured to call a corresponding data display page according to the user login information;
生成模块,用于根据所述数据展示页面中数据列表对应的隔离条件,生成目标数据库语句片段;A generating module, configured to generate target database statement fragments according to the isolation condition corresponding to the data list in the data display page;
拼接模块,用于将所述目标数据库语句片段拼接到所述数据列表的基础数据库语句,得到目标数据库语句;A splicing module, configured to splice the target database statement fragments into the basic database statement of the data list to obtain the target database statement;
数据调用模块,用于基于所述目标数据库语句调用目标数据,并将所述目标数据显示在所述数据列表。The data calling module is used for calling target data based on the target database statement, and displaying the target data in the data list.
可选的,所述页面调取模块,具体用于:Optionally, the page calling module is specifically used for:
根据所述用户登录信息,确定该用户的隔离维度;其中,所述隔离维度至少分为部门、角色和人员三种;Determine the isolation dimension of the user according to the user login information; wherein, the isolation dimension is at least divided into three types: department, role and personnel;
根据该用户的隔离维度,确定对应的目标隔离策略;According to the user's isolation dimension, determine the corresponding target isolation strategy;
根据所述目标隔离策略,调取对应的数据展示页面。According to the target isolation strategy, the corresponding data display page is called.
可选的,所述页面调取模块,具体用于:Optionally, the page calling module is specifically used for:
根据所述用户登录信息表征的关联类型,确定该用户的隔离维度。According to the association type represented by the user's login information, the isolation dimension of the user is determined.
可选的,所述页面调取模块,具体用于:Optionally, the page calling module is specifically used for:
当所述用户登录信息表征该用户包括两种及以上关联类型时,根据各关联类型的优先级,确定目标关联类型;When the user login information indicates that the user includes two or more association types, determine the target association type according to the priority of each association type;
根据所述目标关联类型,确定该用户的隔离维度。According to the target association type, the isolation dimension of the user is determined.
可选的,所述生成模块,具体用于:Optionally, the generating module is specifically used for:
根据所述数据展示页面中数据列表对应的隔离条件,确定对应的隔离脚本和维度逻辑;According to the isolation condition corresponding to the data list in the data display page, determine the corresponding isolation script and dimension logic;
按照所述隔离脚本和维度逻辑,生成目标数据库语句片段。Generate target database statement fragments according to the isolation script and dimension logic.
可选的,所述生成模块,还用于:Optionally, the generating module is also used for:
根据所述数据展示页面中数据列表对应的隔离条件,判断当前的隔离维度是否包括子查询;According to the isolation condition corresponding to the data list in the data display page, it is judged whether the current isolation dimension includes a subquery;
若当前的隔离维度是否包括子查询,则获取所述子查询对应的维度字段;If the current isolation dimension includes a subquery, obtain the dimension field corresponding to the subquery;
将所述维度字段添加至所述目标数据库语句片段。Adding the dimension field to the target database statement fragment.
可选的,所述数据调用模块,具体用于:Optionally, the data calling module is specifically used for:
调用数据库查询脚本接口;Call the database query script interface;
基于所述数据库查询脚本接口,将所述目标数据库语句输入到预设数据库,以在所述预设数据库中调用目标数据。Based on the database query script interface, the target database statement is input into a preset database, so as to call the target data in the preset database.
本申请第三个方面提供一种电子设备,包括:至少一个处理器和存储器;A third aspect of the present application provides an electronic device, including: at least one processor and a memory;
所述存储器存储计算机执行指令;the memory stores computer-executable instructions;
所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如上第一个方面以及第一个方面各种可能的设计所述的方法。The at least one processor executes the computer-executed instructions stored in the memory, so that the at least one processor executes the method described in the above first aspect and various possible designs of the first aspect.
本申请第四个方面提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一个方面以及第一个方面各种可能的设计所述的方法。The fourth aspect of the present application provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the above first aspect and the first Aspects of various possible designs of the described method.
本申请技术方案,具有如下优点:The technical solution of the present application has the following advantages:
本申请提供一种数据隔离方法、装置、电子设备及存储介质,该方法包括:获取用户登录信息;根据用户登录信息,调取对应的数据展示页面;根据数据展示页面中数据列表对应的隔离条件,生成目标数据库语句片段;将目标数据库语句片段拼接到数据列表的基础数据库语句,得到目标数据库语句;基于目标数据库语句调用目标数据,并将目标数据显示在数据列表。上述方案提供的方法,通过为数据列表绑定隔离条件,数据库中的数据必然绑定有对应的数据列表,确保数据能够实现数据隔离,从而提高了数据的安全性。The present application provides a data isolation method, device, electronic equipment and storage medium, the method comprising: obtaining user login information; according to the user login information, calling the corresponding data display page; according to the isolation condition corresponding to the data list in the data display page , to generate target database statement fragments; splicing the target database statement fragments into the basic database statement of the data list to obtain the target database statement; calling the target data based on the target database statement, and displaying the target data in the data list. In the method provided by the above solution, by binding the isolation condition to the data list, the data in the database must be bound to the corresponding data list to ensure that the data can achieve data isolation, thereby improving the security of the data.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present application, and those skilled in the art can also obtain other drawings based on these drawings.
图1为本申请实施例基于的数据隔离系统的结构示意图;FIG. 1 is a schematic structural diagram of the data isolation system based on the embodiment of the present application;
图2为本申请实施例提供的数据隔离方法的流程示意图;FIG. 2 is a schematic flow diagram of a data isolation method provided in an embodiment of the present application;
图3为本申请实施例提供的数据隔离装置的结构示意图;FIG. 3 is a schematic structural diagram of a data isolation device provided in an embodiment of the present application;
图4为本申请实施例提供的电子设备的结构示意图。FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
通过上述附图,已示出本申请明确的实施例,后文中将有更详细的描述。这些附图和文字描述并不是为了通过任何方式限制本公开构思的范围,而是通过参考特定实施例为本领域技术人员说明本申请的概念。By means of the above drawings, specific embodiments of the present application have been shown, which will be described in more detail hereinafter. These drawings and written description are not intended to limit the scope of the disclosed concept in any way, but to illustrate the concept of the application for those skilled in the art by referring to specific embodiments.
具体实施方式Detailed ways
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments It is a part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of this application.
此外,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。在以下各实施例的描述中,“多个”的含义是两个以上,除非另有明确具体的限定。In addition, the terms "first", "second", etc. are used for descriptive purposes only, and should not be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. In the descriptions of the following embodiments, "plurality" means two or more, unless otherwise specifically defined.
在现有技术中,通常是角色绑定部门进行隔离,用户获取数据的时候会获取用户绑定的部门相关数据,若有业务数据没有跟部门关联,该业务数据将无法实现数据隔离,降低了数据的安全性。In the existing technology, the role-bound department is usually isolated. When the user obtains data, the relevant data of the department bound to the user will be obtained. If there is business data that is not associated with the department, the business data will not be able to achieve data isolation, reducing the Data Security.
针对上述问题,本申请实施例提供的数据隔离方法、装置、电子设备及存储介质,通过获取用户登录信息;根据用户登录信息,调取对应的数据展示页面;根据数据展示页面中数据列表对应的隔离条件,生成目标数据库语句片段;将目标数据库语句片段拼接到数据列表的基础数据库语句,得到目标数据库语句;基于目标数据库语句调用目标数据,并将目标数据显示在数据列表。上述方案提供的方法,通过为数据列表绑定隔离条件,数据库中的数据必然绑定有对应的数据列表,确保数据能够实现数据隔离,从而提高了数据的安全性。In view of the above problems, the data isolation method, device, electronic equipment, and storage medium provided by the embodiments of the present application obtain user login information; retrieve the corresponding data display page according to the user login information; Isolate conditions to generate target database statement fragments; splice the target database statement fragments into the basic database statement of the data list to obtain the target database statement; call the target data based on the target database statement, and display the target data in the data list. In the method provided by the above solution, by binding the isolation condition to the data list, the data in the database must be bound to the corresponding data list to ensure that the data can achieve data isolation, thereby improving the security of the data.
下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。下面将结合附图,对本发明实施例进行描述。The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below in conjunction with the accompanying drawings.
首先,对本申请所基于的数据隔离系统的结构进行说明:First, explain the structure of the data isolation system on which this application is based:
本申请实施例提供的数据隔离方法、装置、电子设备及存储介质,适用于在企业管理系统或工程管理系统等数据系统进行数据隔离。如图1所示,为本申请实施例基于的数据隔离系统的结构示意图,主要包括web前端服务、数据库和数据隔离装置。具体地,用户向web前端服务输入登录信息,数据隔离装置在web前端服务获取用户登录信息,然后按照该用户登录信息,在数据库调用目标数据,并通过web前端服务展示给用户,以供用户读取。The data isolation method, device, electronic device, and storage medium provided in the embodiments of the present application are suitable for data isolation in data systems such as enterprise management systems or engineering management systems. As shown in FIG. 1 , it is a schematic structural diagram of the data isolation system based on the embodiment of the present application, which mainly includes a web front-end service, a database, and a data isolation device. Specifically, the user inputs login information to the web front-end service, and the data isolation device obtains the user login information from the web front-end service, and then calls the target data in the database according to the user login information, and displays it to the user through the web front-end service for the user to read. Pick.
本申请实施例提供了一种数据隔离方法,用于在企业管理系统或工程管理系统等数据系统进行数据隔离。本申请实施例的执行主体为电子设备,比如服务器、台式电脑、笔记本电脑、平板电脑及其他可用于进行数据隔离的电子设备。The embodiment of the present application provides a data isolation method, which is used for data isolation in a data system such as an enterprise management system or an engineering management system. The execution subject of the embodiment of the present application is an electronic device, such as a server, a desktop computer, a notebook computer, a tablet computer, and other electronic devices that can be used for data isolation.
如图2所示,为本申请实施例提供的数据隔离方法的流程示意图,该方法包括:As shown in Figure 2, it is a schematic flow diagram of the data isolation method provided by the embodiment of the present application, the method includes:
步骤201,获取用户登录信息。
其中,用户登录信息至少包括用户向web前端服务输入的用户名和密码。Wherein, the user login information at least includes the user name and password input by the user to the web front-end service.
步骤202,根据用户登录信息,调取对应的数据展示页面。
具体地,可以根据用户登录信息,确定该用户的访问权限,进而在web前端服务调用对应的数据展示页面,该数据展示页面中包含该用户可访问的所有信息的展示框。Specifically, the user's access authority can be determined according to the user's login information, and then the corresponding data display page is called in the web front-end service, and the data display page includes display boxes of all information accessible to the user.
步骤203,根据数据展示页面中数据列表对应的隔离条件,生成目标数据库语句片段。
需要说明的是,数据展示页面包括多个数据列表,不同数据列表显示不同类型的数据,每个数据列表对应一个展示框。隔离条件包括多个隔离参数,有固定值,也有动态值,It should be noted that the data display page includes multiple data lists, and different data lists display different types of data, and each data list corresponds to a display frame. The isolation conditions include multiple isolation parameters, with fixed values and dynamic values,
具体地,针对数据展示页面中的任一数据列表,可以根据该数据列表所绑定的隔离条件,生成对应的目标数据库语句片段。Specifically, for any data list in the data presentation page, the corresponding target database statement fragment can be generated according to the isolation condition bound to the data list.
具体地,在一实施例中,可以根据数据展示页面中数据列表对应的隔离条件,确定对应的隔离脚本和维度逻辑;按照隔离脚本和维度逻辑,生成目标数据库语句片段。Specifically, in one embodiment, the corresponding isolation script and dimension logic can be determined according to the isolation condition corresponding to the data list in the data display page; and the target database statement fragment can be generated according to the isolation script and dimension logic.
其中,隔离脚本包括查询字段,维度逻辑包括交集和并集。Among them, the isolation script includes query fields, and the dimension logic includes intersection and union.
具体地,按照预设的数据语句编写标准,根据数据展示页面中数据列表对应的隔离条件,确定对应的隔离脚本和维度逻辑,进而生成目标数据库语句片段。其中,目标数据库语句片段可以是SQL语句。Specifically, according to the preset standards for writing data statements, and according to the isolation conditions corresponding to the data list in the data display page, determine the corresponding isolation script and dimension logic, and then generate target database statement fragments. Wherein, the statement fragment of the target database may be an SQL statement.
步骤204,将目标数据库语句片段拼接到数据列表的基础数据库语句,得到目标数据库语句。
具体地,可以根据数据列表自身的属性信息确定基础数据库语句,通过将目标数据库语句片段拼接到基础数据库语句,得到目标数据库语句。Specifically, the basic database statement can be determined according to the attribute information of the data list itself, and the target database statement can be obtained by splicing target database statement fragments into the basic database statement.
步骤205,基于目标数据库语句调用目标数据,并将目标数据显示在数据列表。
具体地,可以将目标数据库语句输入到预设数据库,以在预设数据库中调用对应的目标数据。Specifically, the target database statement can be input into the preset database, so as to call the corresponding target data in the preset database.
具体地,在一实施例中,可以调用数据库查询脚本接口;基于数据库查询脚本接口,将目标数据库语句输入到预设数据库,以在预设数据库中调用目标数据。Specifically, in an embodiment, the database query script interface may be invoked; based on the database query script interface, the target database statement is input into the preset database, so as to call the target data in the preset database.
具体地,可以基于预设的vform服务,调用数据库查询脚本接口,进而基于该数据库查询脚本接口,将目标数据库语句输入到预设数据库。Specifically, the database query script interface can be invoked based on the preset vform service, and then based on the database query script interface, the target database statement can be input into the preset database.
在上述实施例的基础上,作为一种可实施的方式,在一实施例中,根据用户登录信息,调取对应的数据展示页面,包括:On the basis of the above embodiments, as an implementable manner, in one embodiment, according to the user login information, call the corresponding data display page, including:
步骤2021,根据用户登录信息,确定该用户的隔离维度;其中,隔离维度至少分为部门、角色和人员三种;Step 2021, according to the user login information, determine the isolation dimension of the user; wherein, the isolation dimension is divided into at least three types: department, role and personnel;
步骤2022,根据该用户的隔离维度,确定对应的目标隔离策略;Step 2022, according to the isolation dimension of the user, determine the corresponding target isolation strategy;
步骤2023,根据目标隔离策略,调取对应的数据展示页面。Step 2023, call the corresponding data display page according to the target isolation policy.
具体地,可以按照预设的用户名与隔离维度之间的对应关系,确定用户登录信息表征的用户名所对应的隔离维度,进而确定该隔离维度对应的目标隔离策略,最后按照目标隔离策略,确定该用户的数据访问权限,并调取符合其数据访问权限的数据展示页面。Specifically, the isolation dimension corresponding to the user name represented by the user login information can be determined according to the preset correspondence between the user name and the isolation dimension, and then the target isolation strategy corresponding to the isolation dimension can be determined. Finally, according to the target isolation strategy, determine The user's data access rights, and call the data display page that meets the data access rights.
具体地,在一实施例中,可以根据用户登录信息表征的关联类型,确定该用户的隔离维度。Specifically, in an embodiment, the user's isolation dimension may be determined according to the association type represented by the user's login information.
需要说明的是,关联类型也分可为部门、角色和人员三种。It should be noted that the association type can also be divided into three types: department, role and personnel.
具体地,在一实施例中,当用户登录信息表征该用户包括两种及以上关联类型时,根据各关联类型的优先级,确定目标关联类型;根据目标关联类型,确定该用户的隔离维度。Specifically, in one embodiment, when the user login information indicates that the user includes two or more association types, the target association type is determined according to the priority of each association type; and the isolation dimension of the user is determined according to the target association type.
示例性的,若关联类型的优先级从高到低依次为人员、角色、部门,当前的用户登录信息表征该用户包括人员和角色两种关联类型,则将人员确定为该用户的目标关联类型,进而将人员这一隔离维度,确定为该用户的隔离维度。Exemplarily, if the priority of the association type from high to low is personnel, role, and department, and the current user login information indicates that the user includes two association types of personnel and roles, then determine personnel as the target association type of the user , and then the isolation dimension of person is determined as the isolation dimension of the user.
在上述实施例的基础上,为了在提高数据安全性的同时,提高数据隔离的灵活性,作为一种可实施的方式,在一实施例中,该方法还包括:On the basis of the above-mentioned embodiments, in order to improve the flexibility of data isolation while improving data security, as an implementable manner, in one embodiment, the method further includes:
步骤301,根据数据展示页面中数据列表对应的隔离条件,判断当前的隔离维度是否包括子查询;
步骤302,若当前的隔离维度是否包括子查询,则获取子查询对应的维度字段;
步骤303,将维度字段添加至目标数据库语句片段。
需要说明的是,子查询具体可以指数据过滤查询。It should be noted that the subquery may specifically refer to a data filtering query.
具体地,在当前的隔离维度包括子查询的情况下,可以生成文本输入框,以使用户可以在文本输入框输入维度字段,以得到子查询对应的维度字段,进而将该维度字段添加至目标数据库语句片段,实现了用户的自定义子查询,提高了数据隔离的灵活性。Specifically, when the current isolation dimension includes a subquery, a text input box can be generated so that the user can enter a dimension field in the text input box to obtain the dimension field corresponding to the subquery, and then add the dimension field to the target The database statement fragment realizes the user-defined subquery and improves the flexibility of data isolation.
其中,考虑系统的安全性,子查询对应的维度字段在web前端不允许录入和展示,为保证正常隔离,用户可以通过后台数据库账号录入。Among them, considering the security of the system, the dimension field corresponding to the subquery is not allowed to be entered and displayed on the front end of the web. To ensure normal isolation, the user can enter through the background database account.
本申请实施例提供的数据隔离方法,通过获取用户登录信息;根据用户登录信息,调取对应的数据展示页面;根据数据展示页面中数据列表对应的隔离条件,生成目标数据库语句片段;将目标数据库语句片段拼接到数据列表的基础数据库语句,得到目标数据库语句;基于目标数据库语句调用目标数据,并将目标数据显示在数据列表。上述方案提供的方法,通过为数据列表绑定隔离条件,数据库中的数据必然绑定有对应的数据列表,确保数据能够实现数据隔离,从而提高了数据的安全性。并且,通过根据数据展示页面中数据列表对应的隔离条件,判断当前的隔离维度是否包括子查询;若当前的隔离维度是否包括子查询,则获取子查询对应的维度字段;将维度字段添加至目标数据库语句片段,实现了用户的自定义子查询,提高了数据隔离的灵活性。The data isolation method provided by the embodiment of the present application obtains the user login information; according to the user login information, the corresponding data display page is called; according to the isolation conditions corresponding to the data list in the data display page, the target database sentence fragment is generated; the target database The statement fragment is spliced into the basic database statement of the data list to obtain the target database statement; the target data is called based on the target database statement, and the target data is displayed in the data list. In the method provided by the above solution, by binding the isolation condition to the data list, the data in the database must be bound to the corresponding data list to ensure that the data can achieve data isolation, thereby improving the security of the data. And, according to the isolation condition corresponding to the data list in the data display page, it is judged whether the current isolation dimension includes a subquery; if the current isolation dimension includes a subquery, obtain the dimension field corresponding to the subquery; add the dimension field to the target The database statement fragment realizes the user-defined subquery and improves the flexibility of data isolation.
本申请实施例提供了一种数据隔离装置,用于执行上述实施例提供的数据隔离方法。An embodiment of the present application provides a data isolation device, configured to implement the data isolation method provided in the foregoing embodiments.
如图3所示,为本申请实施例提供的数据隔离装置的结构示意图。该数据隔离装置30包括:获取模块301、页面调取模块302、生成模块303、拼接模块304和数据调用模块305。As shown in FIG. 3 , it is a schematic structural diagram of the data isolation device provided by the embodiment of the present application. The
其中,获取模块,用于获取用户登录信息;页面调取模块,用于根据用户登录信息,调取对应的数据展示页面;生成模块,用于根据数据展示页面中数据列表对应的隔离条件,生成目标数据库语句片段;拼接模块,用于将目标数据库语句片段拼接到数据列表的基础数据库语句,得到目标数据库语句;数据调用模块,用于基于目标数据库语句调用目标数据,并将目标数据显示在数据列表。Among them, the acquisition module is used to obtain user login information; the page call module is used to call the corresponding data display page according to the user login information; the generation module is used to generate The target database statement fragment; the splicing module is used to splice the target database statement fragment into the basic database statement of the data list to obtain the target database statement; the data calling module is used to call the target data based on the target database statement and display the target data on the data list.
具体地,在一实施例中,页面调取模块,具体用于:Specifically, in one embodiment, the page calling module is specifically used for:
根据用户登录信息,确定该用户的隔离维度;其中,隔离维度至少分为部门、角色和人员三种;Determine the user's isolation dimension according to the user's login information; among them, the isolation dimension is divided into at least three types: department, role, and person;
根据该用户的隔离维度,确定对应的目标隔离策略;According to the user's isolation dimension, determine the corresponding target isolation strategy;
根据目标隔离策略,调取对应的数据展示页面。Call the corresponding data display page according to the target isolation strategy.
具体地,在一实施例中,页面调取模块,具体用于:Specifically, in one embodiment, the page calling module is specifically used for:
根据用户登录信息表征的关联类型,确定该用户的隔离维度。Determine the user's isolation dimension according to the association type represented by the user's login information.
具体地,在一实施例中,页面调取模块,具体用于:Specifically, in one embodiment, the page calling module is specifically used for:
当用户登录信息表征该用户包括两种及以上关联类型时,根据各关联类型的优先级,确定目标关联类型;When the user login information indicates that the user includes two or more association types, determine the target association type according to the priority of each association type;
根据目标关联类型,确定该用户的隔离维度。Determine the user's isolation dimension according to the target association type.
具体地,在一实施例中,生成模块,具体用于:Specifically, in an embodiment, the generating module is specifically used for:
根据数据展示页面中数据列表对应的隔离条件,确定对应的隔离脚本和维度逻辑;Determine the corresponding isolation script and dimension logic according to the isolation conditions corresponding to the data list in the data display page;
按照隔离脚本和维度逻辑,生成目标数据库语句片段。According to the isolation script and dimension logic, generate target database statement fragments.
具体地,在一实施例中,生成模块,还用于:Specifically, in one embodiment, the generating module is also used for:
根据数据展示页面中数据列表对应的隔离条件,判断当前的隔离维度是否包括子查询;According to the isolation conditions corresponding to the data list in the data display page, determine whether the current isolation dimension includes subqueries;
若当前的隔离维度是否包括子查询,则获取子查询对应的维度字段;If the current isolation dimension includes a subquery, obtain the dimension field corresponding to the subquery;
将维度字段添加至目标数据库语句片段。Add dimension fields to target database statement fragments.
具体地,在一实施例中,数据调用模块,具体用于:Specifically, in one embodiment, the data calling module is specifically used for:
调用数据库查询脚本接口;Call the database query script interface;
基于数据库查询脚本接口,将目标数据库语句输入到预设数据库,以在预设数据库中调用目标数据。Based on the database query script interface, the target database statement is input into the preset database, so as to call the target data in the preset database.
关于本实施例中的数据隔离装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the data isolation device in this embodiment, the specific manner in which each module executes operations has been described in detail in the embodiment of the method, and will not be described in detail here.
本申请实施例提供的数据隔离装置,用于执行上述实施例提供的数据隔离方法,其实现方式与原理相同,不再赘述。The data isolation device provided in the embodiment of the present application is used to implement the data isolation method provided in the above embodiment, and its implementation method is the same as the principle, and will not be repeated here.
本申请实施例提供了一种电子设备,用于执行上述实施例提供的数据隔离方法。An embodiment of the present application provides an electronic device configured to implement the data isolation method provided in the foregoing embodiments.
如图4所示,为本申请实施例提供的电子设备的结构示意图。该电子设备40包括:至少一个处理器41和存储器42。As shown in FIG. 4 , it is a schematic structural diagram of an electronic device provided in an embodiment of the present application. The
存储器存储计算机执行指令;至少一个处理器执行存储器存储的计算机执行指令,使得至少一个处理器执行如上实施例提供的数据隔离方法。The memory stores computer-executable instructions; at least one processor executes the computer-executable instructions stored in the memory, so that at least one processor executes the data isolation method provided in the above embodiments.
本申请实施例提供的一种电子设备,用于执行上述实施例提供的数据隔离方法,其实现方式与原理相同,不再赘述。An electronic device provided in the embodiment of the present application is used to execute the data isolation method provided in the above embodiment, and the implementation method is the same as the principle, and will not be repeated here.
本申请实施例提供了一种计算机可读存储介质,计算机可读存储介质中存储有计算机执行指令,当处理器执行计算机执行指令时,实现如上任一实施例提供的数据隔离方法。An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the data isolation method provided in any one of the above embodiments is implemented.
本申请实施例的包含计算机可执行指令的存储介质,可用于存储前述实施例中提供的数据隔离方法的计算机执行指令,其实现方式与原理相同,不再赘述。The storage medium containing the computer-executable instructions in the embodiment of the present application can be used to store the computer-executable instructions of the data isolation method provided in the foregoing embodiments, and the implementation method is the same as the principle, and will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated. to another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。A unit described as a separate component may or may not be physically separated, and a component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or in the form of hardware plus software functional units.
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The above-mentioned integrated units implemented in the form of software functional units may be stored in a computer-readable storage medium. The above-mentioned software functional units are stored in a storage medium, and include several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) execute the method described in each embodiment of the present application. partial steps. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other various media that can store program codes. .
本领域技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example for illustration. The internal structure of the system is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiments, and details are not repeated here.
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, rather than limiting them; although the application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: It is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the various embodiments of the present application. scope.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310099316.XA CN116226164B (en) | 2023-02-01 | 2023-02-01 | Data isolation method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310099316.XA CN116226164B (en) | 2023-02-01 | 2023-02-01 | Data isolation method and device, electronic equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN116226164A true CN116226164A (en) | 2023-06-06 |
| CN116226164B CN116226164B (en) | 2025-07-15 |
Family
ID=86586766
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310099316.XA Active CN116226164B (en) | 2023-02-01 | 2023-02-01 | Data isolation method and device, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116226164B (en) |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100107227A1 (en) * | 2008-10-17 | 2010-04-29 | Intuit Inc. | Segregating anonymous access to dynamic content on a web server, with cached logons |
| CN111339560A (en) * | 2020-02-26 | 2020-06-26 | 中国邮政储蓄银行股份有限公司 | Data isolation method, device and system |
| CN111460506A (en) * | 2020-04-03 | 2020-07-28 | 中国工商银行股份有限公司 | Data access control method and device |
| CN112149107A (en) * | 2020-09-01 | 2020-12-29 | 珠海市卓轩科技有限公司 | Unified authority management method, system, device and storage medium |
| CN113821531A (en) * | 2021-09-28 | 2021-12-21 | 山东舜网传媒股份有限公司 | Method, system and equipment for separating converged media multi-tenant data |
| CN114328530A (en) * | 2021-12-29 | 2022-04-12 | 深圳市讯方技术股份有限公司 | Data isolation method, server and system |
-
2023
- 2023-02-01 CN CN202310099316.XA patent/CN116226164B/en active Active
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100107227A1 (en) * | 2008-10-17 | 2010-04-29 | Intuit Inc. | Segregating anonymous access to dynamic content on a web server, with cached logons |
| CN111339560A (en) * | 2020-02-26 | 2020-06-26 | 中国邮政储蓄银行股份有限公司 | Data isolation method, device and system |
| CN111460506A (en) * | 2020-04-03 | 2020-07-28 | 中国工商银行股份有限公司 | Data access control method and device |
| CN112149107A (en) * | 2020-09-01 | 2020-12-29 | 珠海市卓轩科技有限公司 | Unified authority management method, system, device and storage medium |
| CN113821531A (en) * | 2021-09-28 | 2021-12-21 | 山东舜网传媒股份有限公司 | Method, system and equipment for separating converged media multi-tenant data |
| CN114328530A (en) * | 2021-12-29 | 2022-04-12 | 深圳市讯方技术股份有限公司 | Data isolation method, server and system |
Also Published As
| Publication number | Publication date |
|---|---|
| CN116226164B (en) | 2025-07-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111858615B (en) | Database table generation method, system, computer system and readable storage medium | |
| US8402044B2 (en) | Systems and methods for secure access of data | |
| US12026810B2 (en) | Ontology-backed automatic chart creation | |
| US20100070496A1 (en) | Searchable Object Network | |
| US20120102391A1 (en) | Identifiers for web font templates | |
| US20120102453A1 (en) | Multi-dimensional objects | |
| US9158932B2 (en) | Modeled authorization check implemented with UI framework | |
| US20250016146A1 (en) | Systems, Methods, And Devices For Automation And Integration Of Credentialing And Authentication In Workflows Associated With Computing Platforms | |
| US20110154376A1 (en) | Use of Web Services API to Identify Responsive Content Items | |
| US20190166159A1 (en) | Generating false data for suspicious users | |
| CN107729768B (en) | A page display method, device, smart tablet and storage medium | |
| US20200127959A1 (en) | Architecture for large data management in communication applications through multiple mailboxes | |
| CN107895044A (en) | A kind of database data processing method, device and system | |
| CN111046115A (en) | Knowledge graph-based heterogeneous database interconnection management method | |
| CN119248799B (en) | Database multi-transaction processing method, device, equipment and storage medium | |
| US20090150795A1 (en) | Object model and user interface for reusable map web part | |
| CN111325456B (en) | Asset data processing method and apparatus, computer system, and storage medium | |
| CN113297197B (en) | Label management system, label operation method, and data table operation method and device | |
| CN114329149A (en) | Detection method, device, electronic device and readable storage medium for automatic crawling of page information | |
| CN116226164A (en) | A data isolation method, device, electronic equipment and storage medium | |
| CN114661776A (en) | Data access control policy configuration method, device, equipment, medium and product | |
| CN116842222A (en) | Patent query method and device based on patent knowledge graph | |
| CN116069786A (en) | Method, system, electronic device and storage medium for managing departmental organizational structure | |
| US10789219B1 (en) | Insurance policy processing using questions sets | |
| CN115033574A (en) | Information generation method, information generation device, electronic device, and 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 |