A data authority management method and system applied to Presto
By introducing an access control system into the Presto component and defining data operation permissions at the user and field levels, the inconsistency in data permission management within the Presto component is resolved, achieving unified data permission management and improving enterprise data security and development efficiency.
Patent Information
- Application Number
- CN202110336648.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-29
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-03-29
AI Technical Summary
Existing technologies cannot effectively control data permissions for Presto components, resulting in users having different data permissions in different application systems. This leads to issues such as code redundancy and the inability to maintain permissions uniformly, and also lacks comprehensive control over data operations.
An access control and configuration system is introduced on top of the Presto component. By defining entity objects such as users, roles, databases, tables, and fields, user-field level data operation access control is implemented. The Ranger component is used to maintain data groups and user information, and access control policies are managed through an interface.
It implements user-field level data operation permission control at the Presto component level, ensuring that all application systems maintain consistent data permissions, improving enterprise data security and development efficiency, and reducing redundant development of system functions.
Smart Images

Figure CN112861183B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data authority management, and in particular to a data authority management method and system applied to Presto. Background Art
[0002] With the development of science and technology, data has also shown explosive growth. The Presto component is widely used within enterprises due to its excellent query performance. However, this component cannot control data permissions. How to control data is one of the key issues facing enterprises.
[0003] For data permission management involving presto components, there are generally two permission control methods in the prior art. One is to control data permissions by controlling storage file permissions at the data storage layer. This method can often only achieve permission control from user to table level; the other is for each application system to independently control data permissions through code, but this method can easily cause users to have different data permissions in different application systems, and there are problems such as redundant code development and inability to maintain permissions uniformly. In addition, most application-layer permission controls only control query permissions, and do not control operations such as data addition, modification, deletion, and query, lacking data management completeness. Summary of the invention
[0004] In order to solve the shortcomings of the prior art, the present invention proposes a data permission management method and system applied to Presto. Permission control is introduced and a permission configuration system is designed based on the Presto component of the original data warehouse. By defining entity objects such as users, roles, libraries, tables, fields, operation types, etc., and calling the corresponding interface to add or modify permission policies through a data conversion module, the data operation permission control at the user-field level at the Presto component level is realized, so that each application connected to the Presto query maintains the same data permissions.
[0005] To achieve the above objectives, the technical solutions adopted by the present invention include:
[0006] A data permission management method applied to Presto, characterized by comprising:
[0007] Maintaining data group information;
[0008] Define the data permission scope of the data group;
[0009] Submit and save data group information to the server;
[0010] Maintain user information and maintain the correspondence between users and data groups;
[0011] Submit and save user information to the server;
[0012] Use the saved user information to authenticate data requests and perform query operations.
[0013] Furthermore, defining the data permission range of the data group includes obtaining metadata information of a presto data warehouse, and defining the data permission range for the data group by selecting a data range and SQL operation permission.
[0014] Furthermore, the maintenance data group information includes:
[0015] Receive data sent by the client;
[0016] Obtain the data group information in the data sent by the client, and determine whether the data group already exists;
[0017] When it is determined that the data group information in the data sent by the client belongs to an existing data group, further determining whether the permission range set for the data group is different from the existing data group range;
[0018] When it is determined that the permission scope of the data group set in the data sent by the client is different from the existing data group scope, a data group reset operation is performed; the data group reset operation includes obtaining the policy ID corresponding to the data group, calling an interface to disable the policy, deleting the group record, the relationship between the user group and the policy, and the data range record involved in the user group;
[0019] When it is determined that the data group information in the data sent by the client does not belong to an existing data group or a data group reset operation has been performed on the data group, a data group information assembly operation is further performed to obtain updated data group information; the data group information assembly operation includes calling an interface to add a policy, obtaining the returned policy ID, and locally saving user group information, the relationship between user groups and policies, and records of the data range involved in user groups.
[0020] Further, submitting and saving the data group information to the server includes:
[0021] Submit and save the data group information that has been maintained and defined with data permission scope to the server.
[0022] Furthermore, maintaining user information and maintaining the corresponding relationship between users and data groups includes:
[0023] Receive data sent by the client;
[0024] Extract the user information to be maintained from the data sent by the client;
[0025] Get the existing data permission scope corresponding to the user information;
[0026] Determine whether there is a difference between the existing permission scope and the permission scope currently receiving user information;
[0027] When it is determined that there is a difference between the existing authority scope and the authority scope of the currently received user information, a user information assembly operation is further performed; the user information assembly operation includes calling an interface to overwrite and update user permissions, and locally saving user information and the relationship between users and data groups.
[0028] Further, the using the stored user information to verify the data request and perform the query operation includes:
[0029] Get the SQL query statement and data source connection information sent by the client;
[0030] Determine whether the type of data source connection information is presto;
[0031] When it is determined that the type of the data source connection information is not presto, an authority range check operation is performed; the authority range check operation includes selecting a catalog according to the connection information, sending an SQL query statement to presto and checking whether it is within the authority range, and identifying the authority for the SQL query statement and data source connection information within the authority range;
[0032] Create a connection for the SQL query statement and data source connection information that determine the type of data source connection information is presto, as well as the SQL query statement and data source connection information that identify permissions, execute the query statement, and return the result.
[0033] The present invention also relates to a data rights management system applied to Presto, characterized in that it includes:
[0034] The data group authority range interface module is used to receive data group information and define the data authority of the data group and return the corresponding data group configuration result information;
[0035] The user information configuration interface module is used to receive user information and the corresponding relationship between users and data groups, and return user configuration result information;
[0036] The data permission range check interface module is used to check whether the received SQL query statement is within the permission range of the query submitting user, and execute the query operation to return the result.
[0037] Furthermore, the data permissions include scope permissions for databases, data tables, and data fields, and SQL operation permissions.
[0038] The present invention also relates to a computer-readable storage medium, characterized in that a computer program is stored on the storage medium, and the computer program implements the above method when executed by a processor.
[0039] The present invention also relates to an electronic device, characterized in that it comprises a processor and a memory;
[0040] The memory is used to store data group information and user information;
[0041] The processor is used to execute the above method by calling data group information and user information.
[0042] The beneficial effects of the present invention are:
[0043] The data permission management method and system applied to presto described in the present invention can uniformly maintain the permission range of users and data on a specified page, and the data permission range can be applied to all applications connected to the presto component of the data warehouse; at the data security level, it can achieve centralized and effective management of user data permissions, while maintaining unified data permissions for internal users of the enterprise on various systems, which can effectively ensure the security of enterprise data; in terms of enterprise system development efficiency, it can reduce code development of various systems, avoid repeated development of system functions, and improve development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 The present invention is a flow chart of a data authority management method applied to Presto.
[0045] Figure 2 The figure is a schematic diagram of the structure of the data rights management system applied to Presto by the present invention. DETAILED DESCRIPTION
[0046] In order to more clearly understand the content of the present invention, it will be described in detail with reference to the drawings and embodiments.
[0047] like Figure 1 The figure shows a flow chart of the data authority management method applied to Presto according to the present invention, which mainly includes the following steps:
[0048] Maintaining data group information;
[0049] Define the data permission scope of the data group;
[0050] Submit and save data group information to the server;
[0051] Maintain user information and maintain the correspondence between users and data groups;
[0052] Submit and save user information to the server;
[0053] Use the saved user information to authenticate data requests and perform query operations.
[0054] Preferably, the operation of the above method, especially the maintenance of data group information and user information, can be implemented by using the permission control open source component ranger.
[0055] To maintain data group information, you can perform the following steps:
[0056] Receive data sent by the client;
[0057] Get the data group information (single) in the data sent by the client, and determine whether the data group already exists;
[0058] When it is determined that the data group information in the data sent by the client belongs to an existing data group, further determining whether the permission range set for the data group is different from the existing data group range;
[0059] When it is determined that the permission scope of the data group set in the data sent by the client is different from the existing data group scope, a data group reset operation is performed; the data group reset operation includes obtaining the ranger policy ID corresponding to the data group, calling an interface to disable the policy, deleting the group record, the relationship between the user group and the ranger policy, and the data range record involved in the user group;
[0060] When it is determined that the data group information in the data sent by the client does not belong to an existing data group or a data group reset operation has been performed on the data group, a data group information assembly operation is further performed to obtain updated data group information; the data group information assembly operation includes calling the ranger interface to add a policy, obtaining the returned policy ID, and locally saving the user group information, the relationship between the user group and the ranger policy, and the data range record involved in the user group.
[0061] To maintain user information and the corresponding relationship between users and data groups, the following steps can be performed:
[0062] Receive data sent by the client;
[0063] Extract the user information to be maintained from the data sent by the client (single);
[0064] Get the existing data permission scope corresponding to the user information;
[0065] Determine whether there is a difference between the existing permission scope and the permission scope currently receiving user information;
[0066] When it is determined that there is a difference between the existing authority scope and the authority scope currently receiving user information, a user information assembly operation is further performed; the user information assembly operation includes calling a ranger interface to overwrite and update user permissions, and locally saving user information and the relationship between users and data groups.
[0067] To verify data requests and perform query operations using saved user information, you can perform the following steps:
[0068] Get the SQL query statement and data source connection information sent by the client;
[0069] Determine whether the type of data source connection information is presto;
[0070] When it is determined that the type of the data source connection information is not presto, an authority range check operation is performed; the authority range check operation includes selecting a catalog according to the connection information, adding limit0 to the SQL query statement and sending it to presto to check whether it is within the authority range, and identifying the authority for the SQL query statement and data source connection information within the authority range;
[0071] Create a connection for the SQL query statement and data source connection information that determine the type of data source connection information is presto, as well as the SQL query statement and data source connection information that identify permissions, execute the query statement, and return the result.
[0072] The present invention also relates to a Figure 2 The data rights management system applied to Presto in the structure shown in the figure specifically includes:
[0073] The data group authority range interface module is used to receive data group information and define data group data authority and return the corresponding data group configuration result information. In particular, data authority includes database, data table, data field scope authority and SQL operation authority (such as insert, delete, update, select, etc.);
[0074] The user information configuration interface module is used to receive user information and the corresponding relationship between users and data groups, and return user configuration result information;
[0075] The data permission range check interface module is used to check whether the received SQL query statement is within the permission range of the query submitting user, and execute the query operation to return the result.
[0076] The present invention also relates to a computer-readable storage medium, on which is stored a computer program for implementing the above method when executed.
[0077] The present invention also relates to an electronic device, comprising a processor for calling data group information and user information and executing the above method, and a memory for storing the data group information and user information.
[0078] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A data rights management method applied to Presto, characterized in that: include: Maintaining data group information; Define the data permission scope of the data group; Submit and save data group information to the server; Maintain user information and maintain the correspondence between users and data groups; Submit and save user information to the server; Use the saved user information to verify data requests and perform query operations; The maintenance data group information includes: Receive data sent by the client; Obtain the data group information in the data sent by the client, and determine whether the data group already exists; When it is determined that the data group information in the data sent by the client belongs to an existing data group, further determining whether the permission range set for the data group is different from the existing data group range; When it is determined that the permission scope of the data group set in the data sent by the client is different from the existing data group scope, a data group reset operation is performed; the data group reset operation includes obtaining the policy ID corresponding to the data group, calling an interface to disable the policy, deleting the group record, the relationship between the user group and the policy, and the data range record involved in the user group; When it is determined that the data group information in the data sent by the client does not belong to an existing data group or a data group reset operation has been performed on the data group, a data group information assembly operation is further performed to obtain updated data group information; the data group information assembly operation includes calling an interface to add a policy, obtaining the returned policy ID, and locally saving user group information, the relationship between user groups and policies, and records of the data range involved in user groups.
2. The method according to claim 1, characterized in that Defining the data permission range of the data group includes obtaining metadata information of the presto data warehouse, and defining the data permission range for the data group by selecting the data range and SQL operation permission.
3. The method according to claim 1, characterized in that Submitting and saving the data group information to the server includes: Submit and save the data group information that has been maintained and defined with data permission scope to the server.
4. The method according to claim 1, characterized in that Maintaining user information and maintaining the corresponding relationship between users and data groups includes: Receive data sent by the client; Extract the user information to be maintained from the data sent by the client; Get the existing data permission scope corresponding to the user information; Determine whether there is a difference between the existing permission scope and the permission scope currently receiving user information; When it is determined that there is a difference between the existing authority scope and the authority scope of the currently received user information, a user information assembly operation is further performed; the user information assembly operation includes calling an interface to overwrite and update user permissions, and locally saving user information and the relationship between users and data groups.
5. The method according to claim 1, characterized in that The use of the stored user information to verify the data request and perform the query operation includes: Get the SQL query statement and data source connection information sent by the client; Determine whether the type of data source connection information is presto; When it is determined that the type of the data source connection information is not presto, an authority range check operation is performed; the authority range check operation includes selecting a catalog according to the connection information, sending an SQL query statement to presto and checking whether it is within the authority range, and identifying the authority for the SQL query statement and data source connection information within the authority range; Create a connection for the SQL query statement and data source connection information that determine the type of data source connection information is presto, as well as the SQL query statement and data source connection information that identify permissions, execute the query statement, and return the result.
6. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
7. An electronic device, characterized in that: including a processor and a memory; The memory is used to store data group information and user information; The processor is used to execute the method according to any one of claims 1 to 5 by calling data group information and user information.
Citation Information
Patent Citations
Data processing method and device based on presto
CN109542953A
Data query method and device, terminal, presto query engine and storage medium
CN111125178A
Data query method and device
CN111400355A
Database access permission control method and device and electronic equipment
CN111756752A
Technologies for runtime selection of query execution engines
US20200073987A1
