Data query control method, server and storage medium

By dynamically filtering data query requests by obtaining user permission information, the problem of insufficient flexibility caused by multiple reports is solved, and flexible data query control is achieved.

CN115906161BActive Publication Date: 2026-04-24YOUDI NETWORK CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
YOUDI NETWORK CO LTD
Filing Date
2022-11-18
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

In existing technologies, the different data query needs of different departments within an enterprise and external users lead to the need to generate multiple reports, which lacks flexibility and requires readjustment when users change.

Method used

By obtaining data query requests, determining user permission information, modifying query requests based on permission information, extracting and outputting target data reports, dynamic filtering of data is achieved.

Benefits of technology

It improves the flexibility of data query control, eliminating the need to prepare multiple versions of reports for different users and reducing the adjustment work when users change.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115906161B_ABST
    Figure CN115906161B_ABST
Patent Text Reader

Abstract

The application discloses a data query control method, a server and a storage medium, and belongs to the technical field of data query, and the method comprises the following steps: acquiring a data query request, determining a data report corresponding to the data query request in a target database; determining first permission information of a user corresponding to the data query request, wherein the first permission information comprises permission information of the user on different information regions in the data report; modifying the data query request according to the first permission information to obtain a target data query request; extracting corresponding data in the data report according to the target data query request to obtain a target data report, and outputting the target data report. The application aims to improve the flexibility of data query control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data query technology, and in particular to data query control methods, servers, and storage media. Background Technology

[0002] With the development of information technology, data query and analysis technologies are being applied to more and more fields. Enterprises obtain reports on target data through data queries, and then use the data analysis in these reports to guide their decision-making. However, different departments within an enterprise have different focuses when it comes to data, and the actual data required by different departments for the same report may vary. At the same time, there is also a need for data queries to be made available to external users, requiring filtering of the content that external users can query.

[0003] Currently, when different roles of internal or external users query data, multiple reports are typically pre-generated based on the data access permissions of different users. However, this method requires multiple reports to meet the needs, and adjustments are needed when users change, resulting in insufficient flexibility. Summary of the Invention

[0004] The main objective of this invention is to provide a data query control method, server, and storage medium, which aims to improve the flexibility of data query control.

[0005] To achieve the above objectives, the present invention provides a data query control method, which includes the following steps:

[0006] Obtain the data query request and determine the data report corresponding to the data query request in the target database;

[0007] Determine the first permission information of the user corresponding to the data query request, the first permission information including the user's permission information for different information areas in the data report;

[0008] Modify the data query request according to the first permission information to obtain the target data query request;

[0009] Extract the corresponding data from the data report according to the target data query request to obtain the target data report, and output the target data report.

[0010] Optionally, the first permission information includes row permission information, which includes a preset set of columns in the data report and filter conditions corresponding to the preset column set. The filter conditions are used to filter the set of rows in the row set corresponding to the preset column set that the user has permission for. The step of modifying the data query request according to the first permission information to obtain the target data query request includes:

[0011] A first conditional statement is determined based on the preset column set and the filtering conditions. The first conditional statement is used to extract row data from the data report.

[0012] The first conditional statement is concatenated with the corresponding query statement of the data query request to obtain the target data query request.

[0013] Optionally, the first permission information includes column permission information, which includes a set of columns that the user has permission to access in the data report. The step of modifying the data query request based on the first permission information to obtain the target data query request includes:

[0014] A second conditional statement is determined based on the column set, and the second conditional statement is used to extract column data from the data report;

[0015] The second conditional statement is concatenated with the corresponding query statement of the data query request to obtain the target data query request.

[0016] Optionally, the step of determining the first permission information of the user corresponding to the data query request includes:

[0017] The first permission information is obtained from the application cache. The first permission information is stored in the application cache when the user logs in and is cleared from the application cache when the user logs out.

[0018] Optionally, the first permission information includes row permission information and column permission information. The row permission information includes a preset column set for filtering the set of rows that the user has permission to access in the data report. The column permission information includes a set of columns that the user has permission to access in the data report. After the step of determining the first permission information of the user corresponding to the data query request, the method further includes:

[0019] Determine the set of columns for the data report;

[0020] When the column set of the data report has a matching column with the preset column set, or when the column set of the data report has a matching column with the column permission information column set, the step of modifying the data query request according to the first permission information is executed.

[0021] Optionally, the step of determining the first permission information of the user corresponding to the data query request includes:

[0022] The user's row permission information is determined based on the system-level permissions corresponding to the target database. The system-level permissions include preset row permission information corresponding to different preset users in the target database.

[0023] Determine the data interface corresponding to the data query request, determine the column permission information of the user according to the interface-level permissions corresponding to the data interface, and configure the interface-level permissions corresponding to different data interfaces according to the preset column permission information of different users.

[0024] The first permission information is determined based on the row permission information and / or the column permission information.

[0025] Optionally, the step of determining the first permission information based on the row permission information and / or the column permission information includes:

[0026] When the data interface is not configured with the interface-level permissions, the row permission information is determined to be the first permission information;

[0027] When the data interface has been configured with the interface-level permissions, the row permission information and the column permission information are determined to be the first permission information.

[0028] Optionally, the step of determining the first permission information of the user corresponding to the data query request includes:

[0029] Determine the data interface corresponding to the data query request, and determine the user's row permission information and / or column permission information according to the interface-level permissions corresponding to the data interface. The interface-level permissions corresponding to different data interfaces are configured according to the preset row permission information and / or preset column permission information of different users.

[0030] The first permission information is determined based on the row permission information and / or the column permission information.

[0031] In addition, to achieve the above objectives, this application also proposes a server comprising: a memory, a processor, and a data query control program stored in the memory and executable on the processor, the data query control program being configured to implement the steps of the data query control method as described in any of the preceding claims.

[0032] In addition, to achieve the above objectives, this application also proposes a storage medium storing a data query control program, which, when executed by a processor, implements the steps of the data query control method as described in any of the preceding claims.

[0033] This invention proposes a data query control method. After obtaining a data query request, the method determines the data report to be queried in the target database. It then determines the user initiating the data query request and their first permission information, thereby determining the area of ​​information in the data report that the user has permission to access based on the first permission information. The method modifies the data query request according to the first permission information to obtain a target data query request infused with the first permission information. It then extracts the corresponding data from the data report based on the target data query request, obtaining a target data report filtered by the first permission information, and outputs the target data report. Compared to the current method of preparing multiple versions of reports for different users, injecting the user's first permission information into their data query request allows for direct filtering of the queried data. During the data query process, a target data report matching the user's permissions is generated based on their permissions, thus eliminating the need to prepare multiple versions of reports for different users and improving the flexibility of data query control. Attached Figure Description

[0034] Figure 1 This is a schematic diagram of the hardware structure involved in the operation of an embodiment of the data query control device of the present invention;

[0035] Figure 2 This is a flowchart illustrating the first embodiment of the data query control method of the present invention;

[0036] Figure 3 This is a flowchart illustrating the second embodiment of the data query control method of the present invention;

[0037] Figure 4 This is a flowchart illustrating the third embodiment of the data query control method of the present invention;

[0038] Figure 5 This is a flowchart illustrating the fourth embodiment of the data query control method of the present invention;

[0039] Figure 6 This is a flowchart illustrating the fifth embodiment of the data query control method of the present invention.

[0040] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0041] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0042] This invention provides a server. For example... Figure 1As shown, the server may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a network interface 1003, and a memory 1004. The communication bus 1002 is used to enable communication between these components. The network interface 1003 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1004 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk drive. Alternatively, the memory 1004 may be a storage device independent of the aforementioned processor 1001.

[0043] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the server and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0044] like Figure 1 As shown, the memory 1004, which serves as a storage medium, may include a data query control program. Figure 1 In the server shown, the network interface 1003 is mainly used for data communication with other devices; the processor 1001 can be used to call the data query control program stored in the memory 1004 and execute the relevant steps of the data query control method in the following embodiments.

[0045] This invention also provides a data query control method, applied to the aforementioned server.

[0046] Reference Figure 2 This application presents a first embodiment of the data query control method. In this embodiment, the data query control method includes:

[0047] Step S10: Obtain the data query request and determine the data report corresponding to the data query request in the target database;

[0048] Data query requests are initiated by different users through their terminals to the server, aiming to query data in a target database. These users can be internal or external to the enterprise. The target database stores several data tables, i.e., data reports, and the data query request is a query targeting these data reports in the target database. For example, a data report could be a BI (Business Intelligence) report in the IPTV industry. Different users, such as internal operations managers, team leaders, or team members, or external clients, can initiate data query requests through preset channels to query BI reports.

[0049] In addition, data query requests are initiated based on the data interfaces being queried, and there are more than one data interface.

[0050] Optionally, the server receives data query requests from different users based on the data interface, and determines the data report that the request wants to query based on the received data query request, such as determining the table name of the data report.

[0051] Step S20: Determine the first permission information of the user corresponding to the data query request. The first permission information includes the user's permission information for different information areas in the data report.

[0052] Permission information restricts a user's access to queried information areas in a data report. Different permission information can be configured for different users. In this embodiment, the first permission information is the permission information of the user who initiated the data query request. Permission information is used to filter data in the target database. For the same data report in the target database, different data will be displayed after filtering with different permission information. For example, the operations manager can see the total revenue data of all product package orders, the operations team leader can only see the total revenue data of the product package orders under their management and cannot query other operations teams, and the operations team members can only see the total revenue data of the individual product package orders under their management. That is, for the total revenue data of product package orders stored in the target database, the operations manager, team leader and team members can query different data based on different permission information.

[0053] Optionally, after determining the data report to be queried, the corresponding user who initiated the data query request and their first permission information are determined, and the data that the corresponding user can query in the data report is determined based on their first permission information.

[0054] Step S30: Modify the data query request according to the first permission information to obtain the target data query request;

[0055] Optionally, the first permission information records the corresponding permission conditions. The data query request is modified according to the permission conditions to change the data query request into the target data query request, and the first permission information is injected into the target data query request.

[0056] Step S40: Extract the corresponding data from the data report according to the target data query request to obtain the target data report, and output the target data report.

[0057] Optionally, a data report is extracted based on the target data query request for the injected first permission information, a target data report matching the first permission information is obtained, and the target data report is output to the corresponding user.

[0058] This invention proposes a data query control method. After obtaining a data query request, the method determines the data report to be queried in the target database. It then determines the user initiating the data query request and the user's first permission information, thereby determining the area of ​​information in the data report that the user has permission to access based on the first permission information. The method modifies the data query request according to the first permission information to obtain a target data query request infused with the first permission information. It then extracts the corresponding data from the data report based on the target data query request, obtaining a target data report filtered by the first permission information, and outputs the target data report. Compared to the current method of preparing multiple versions of reports for different users, injecting the user's first permission information into their data query request allows for direct filtering of the queried data. During the data query process, a target data report matching the user's permissions is generated based on their permissions, thus eliminating the need to prepare multiple versions of reports for different users and improving the flexibility of data query control.

[0059] Furthermore, in this embodiment, the step of determining the first permission information of the user corresponding to the data query request includes:

[0060] The first permission information is obtained from the application cache. The first permission information is stored in the application cache when the user logs in and is cleared from the application cache when the user logs out.

[0061] Optionally, the data query control program executed in this embodiment is configured on a server, and the program is also configured with an application cache to cache the user's first permission information. The user's first permission information is pre-configured and stored in a database. When a user logs into the system, program, or application, the corresponding user's first permission information is retrieved from the database and stored in the application cache. When the user logs out, the first permission information in the application cache is cleared.

[0062] Furthermore, since the first permission information can be directly retrieved from the application cache after the user logs in, changes to the user's first permission information require the user to log in again, that is, to retrieve the modified first permission information from the database again before it will take effect.

[0063] By utilizing the application cache to store first permission information, when a user initiates a data query request, the first permission information can be directly retrieved from the application cache, improving the efficiency of the data query process.

[0064] Furthermore, based on the above embodiments, a second embodiment of the log processing method of this application is proposed. In this embodiment, reference is made to... Figure 3 The first permission information includes row permission information, which includes a preset column set in the data report and filter conditions corresponding to the preset column set. The filter conditions are used to filter the set of rows in the row set corresponding to the preset column set that the user has permission for. Step S30 includes:

[0065] Step S31: Determine a first conditional statement based on the preset column set and the filtering conditions. The first conditional statement is used to extract row data from the data report.

[0066] Row permission information controls row data in a data report. Based on this information, rows that meet specific criteria can be filtered out. Since only column names (field names) exist in the table, and row names are not, row permissions are also controlled based on columns. This means row permission control is achieved through a combination of preset columns and conditions applied to their values. In this embodiment, the columns used to control row permissions are preset columns. Because row permissions can be controlled through more than one preset column, these preset columns form a preset column set. The conditions that limit the values ​​in the preset columns are filter conditions. The preset column set and the corresponding filter conditions constitute the row permission information. By using filter conditions to limit the values ​​in the preset columns, feature values ​​that meet the filter conditions are determined. The rows corresponding to these feature values ​​are the rows that meet the conditions. Several rows that meet the conditions constitute the set of rows for which the user has permissions.

[0067] For example, if a data report includes a column "age" whose values ​​are age, this column can be set as a preset column, and a filter condition can be set: the value of column "age" is greater than 18. This will filter out rows of data in the data report whose value of column "age" is greater than 18 based on the preset column and the filter condition.

[0068] Optionally, a first conditional statement is determined based on a preset set of columns and filtering conditions. The first conditional statement is a statement containing filtering rules used in the database. The determined first conditional statement can extract row data from the data report based on row permission information.

[0069] Step S32: Concatenate the first conditional statement with the corresponding query statement of the data query request to obtain the target data query request.

[0070] A data query request is a request to retrieve data from the database, and it has a corresponding database query statement. Optionally, the query SQL statement can be obtained by calling the `getSql` method in `sqlSessionFactory`. Concatenation, on the other hand, is a conventional operation method for database statements. It concatenates the query statement with a first conditional statement containing filtering rules, thereby injecting row permission information into the query statement in the data query request and obtaining the target data query request.

[0071] By determining the first conditional statement based on the row permission information and concatenating it into the data query request, the data query can be controlled by injecting row permission information. This eliminates the need to prepare multiple reports based on the row permissions of different users, thus improving the flexibility of data query control.

[0072] Furthermore, based on the above embodiments, a third embodiment of the log processing method of this application is proposed. In this embodiment, reference is made to... Figure 4 The first permission information includes column permission information, which includes a set of columns that the user has permissions for in the data report. Step S30 includes:

[0073] Step S33: Determine a second conditional statement based on the column set. The second conditional statement is used to extract column data from the data report.

[0074] Column permission information controls the column data in a data report. Based on column permission information, column data that meets the conditions can be filtered out. Unlike row permissions, column permissions control the column data to be displayed, so there is no need to set additional filtering conditions. A matching column name means that the column should be displayed. Since there can be more than one column controlling column permissions, several columns used to control column permissions constitute the column set of column permission information.

[0075] In other embodiments, row permissions and column permissions can be used in combination. It should be noted that row permissions filter row data using column data, but the preset columns used for filtering are not restricted by row permissions to be displayed. Whether column data is displayed is controlled by column permissions. Therefore, the preset columns are not necessarily the columns that need to be displayed in the target data report. For example, suppose a data report includes three columns: "name", "age", and "sex". Row permission information: column "age" is the preset column; filtering condition: the value of column "age" is greater than 18; column permission information: the column set includes columns "name" and "sex". Then, the row data in the output target data report will all be rows where the value of column "age" is greater than 18. However, the target data report will not output column "age", only columns "name" and "sex".

[0076] Optionally, a second conditional statement is determined based on the column set of column permission information in the first permission information. The second conditional statement is a statement containing filtering rules for the database. The second conditional statement determined based on the column set can extract column data from the data report according to the column permission information.

[0077] Step S34: Concatenate the second conditional statement with the corresponding query statement of the data query request to obtain the target data query request.

[0078] Optionally, the query statement is concatenated with a second conditional statement containing filtering rules, thereby injecting column permission information into all query statements in the data query request to obtain the target data query request.

[0079] By determining the second conditional statement based on column permission information and concatenating it into the data query request, the column permission information injected into the data query can be controlled. This eliminates the need to prepare multiple reports based on the column permissions of different users, thus improving the flexibility of data query control.

[0080] Furthermore, in this embodiment, the first permission information includes row permission information and column permission information. The row permission information includes a preset column set for filtering the set of rows that the user has permission to access in the data report. After the step of determining the first permission information of the user corresponding to the data query request, the method further includes:

[0081] Determine the set of columns for the data report;

[0082] When the column set of the data report has a matching column with the preset column set, or when the column set of the data report has a matching column with the column permission information column set, the step of modifying the data query request according to the first permission information is executed.

[0083] Optionally, the column set of the data report is the set of columns included in the report that the data query request wants to query. When there is a matching column between the column set of the data report and the preset column set, it is determined that the data report is controlled by the row permission information of the corresponding user, and row permission information needs to be injected; when there is a matching column between the column set of column permission information, it is determined that there is a column controlled by the column permission information of the corresponding user in the data report, and column permission information needs to be injected. Therefore, it is necessary to perform the step of modifying the data query request according to the first permission information, and inject the first permission information into this data query request.

[0084] It should be noted that, since columns with the same meaning generally have the same name in multiple different reports within the same database, such as the column used to record age generally using "age" as the column name in multiple different reports, it is necessary to use column name or column set to make the judgment.

[0085] By comparing the column set of the data report with the column set of row permissions and column permission control, the system can dynamically determine whether the current data query request requires the injection of permission information, thereby improving the flexibility of data query control.

[0086] Furthermore, based on the above embodiments, a fourth embodiment of the log processing method of this application is proposed. In this embodiment, reference is made to... Figure 5 The step of determining the first permission information of the user corresponding to the data query request includes:

[0087] Step S200: Determine the user's row permission information based on the system-level permissions corresponding to the target database. The system-level permissions include preset row permission information corresponding to different preset users in the target database.

[0088] System-level permissions are permissions configured at the system level. Since data query requests are initiated based on data interfaces, if permissions are configured as system-level permissions, then the permissions will be effective for data query requests initiated based on any data interface.

[0089] Optionally, when determining the first permission information of the corresponding user, the system-level permissions of the corresponding user are determined first. Since the row permission information is configured as a system-level permission in this embodiment, the row permission information of the corresponding user is determined.

[0090] Step S201: Determine the data interface corresponding to the data query request, and determine the column permission information of the user according to the interface-level permissions corresponding to the data interface. The interface-level permissions corresponding to different data interfaces are configured according to the preset column permission information of different users.

[0091] Interface-level permissions are the permission configurations for each data interface. Since data query requests are initiated based on data interfaces, if permissions are configured as interface-level permissions, then the effectiveness of these permissions needs to be determined based on the data interface that initiated the data query request.

[0092] Optionally, after determining the system-level permissions of the corresponding user, since the column permission information is configured as interface-level permissions in this embodiment, the corresponding data interface that initiated this data query request is determined, and the interface-level permissions of the corresponding user are determined according to the corresponding data interface, thereby determining the column permission information of the corresponding user.

[0093] Step S202: Determine the first permission information based on the row permission information and / or the column permission information.

[0094] In this embodiment, the preset row permission information for different users is configured as system-level permissions, and the preset column permission information for different users is configured as interface-level permissions for different interfaces. In other embodiments, other configuration methods or combinations may also be used.

[0095] Since row permissions are more difficult to apply and more complex to configure than column permissions, configuring row permissions as system-level permissions eliminates the need to configure row permissions for each data interface separately, improving the efficiency of permission configuration. Meanwhile, configuring column permissions as interface-level permissions allows for flexible control of column permission configuration through individual data interfaces, enhancing the flexibility of data query control.

[0096] Furthermore, in this embodiment, the step of determining the first permission information based on the row permission information and / or the column permission information includes:

[0097] When the data interface is not configured with the interface-level permissions, the row permission information is determined to be the first permission information;

[0098] When the data interface has been configured with the interface-level permissions, the row permission information and the column permission information are determined to be the first permission information.

[0099] Optionally, since row permission information is configured as system-level permission, as long as row permission information is configured, the row permission information can be determined and identified as the first permission information. However, since column permission information is configured as interface-level permission, if the data interface corresponding to this data query request is not configured with interface-level permission, then this data query request will not include column permission information. Only when the data interface is configured with interface-level permission will it be necessary to identify column permission information as the first permission information.

[0100] By determining whether the corresponding interface is configured with interface-level permissions, the analysis and processing steps regarding column permission control can be skipped directly when the corresponding interface is not actually configured with interface-level permissions, thereby improving the efficiency of data query control.

[0101] Furthermore, based on the above embodiments, a fifth embodiment of the log processing method of this application is proposed. In this embodiment, reference is made to... Figure 6 The step of determining the first permission information of the user corresponding to the data query request includes:

[0102] Step S210: Determine the data interface corresponding to the data query request, and determine the user's row permission information and / or column permission information according to the interface-level permissions corresponding to the data interface. The interface-level permissions corresponding to different data interfaces are configured according to the preset row permission information and / or preset column permission information of different users.

[0103] In this embodiment, both row permission information and column permission information are configured as interface-level permissions.

[0104] Step S211: Determine the first permission information based on the row permission information and / or the column permission information.

[0105] After receiving a data query request, the row and column permission information can be directly determined based on the interface-level permissions of the corresponding data interface that initiated the request. Compared to configuring permission information as system-level permissions, directly determining permission information based on interface-level permissions saves time in parsing data query statements and improves the efficiency of data query control.

[0106] Furthermore, this embodiment of the invention also proposes a storage medium storing a data query control program, which, when executed by a processor, implements the relevant steps of any of the above embodiments of the data query control method.

[0107] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0108] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0109] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several requests to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0110] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A data query control method, characterized in that, The data query control method includes the following steps: Obtain the data query request and determine the data report corresponding to the data query request in the target database; The user's row permission information is determined based on the system-level permissions corresponding to the target database. The system-level permissions include the preset row permission information corresponding to different preset users in the target database. The system-level permissions are permission configurations at the system level, and can take effect for data query requests initiated based on any data interface. The data interface corresponding to the data query request is determined, and the column permission information of the user is determined according to the interface-level permissions corresponding to the data interface. The interface-level permissions corresponding to different data interfaces are configured according to the preset column permission information of different users. The interface-level permissions are the permission configurations configured on each data interface, and whether they are effective is determined according to the data interface that initiated the data query request. First permission information is determined based on the row permission information and the column permission information. The first permission information includes the user's permission information for different information areas in the data report. The row permission information includes a preset set of columns in the data report and filtering conditions corresponding to the preset set of columns. The filtering conditions are used to filter the set of rows in the row set corresponding to the preset set of columns in which the user has permission. The column permission information includes the set of columns in the data report in which the user has permission. A first conditional statement is determined based on the preset column set and the filtering conditions. The first conditional statement is used to extract row data from the data report. A second conditional statement is determined based on the column set, and the second conditional statement is used to extract column data from the data report; The first conditional statement and the second conditional statement are concatenated with the corresponding query statement of the data query request to obtain the target data query request; Extract the corresponding data from the data report according to the target data query request to obtain the target data report, and output the target data report.

2. The data query control method as described in claim 1, characterized in that, The step of determining the first permission information based on the row permission information and the column permission information further includes: The first permission information is obtained from the application cache. The first permission information is stored in the application cache when the user logs in and is cleared from the application cache when the user logs out.

3. The data query control method as described in claim 1, characterized in that, The first permission information includes row permission information and column permission information. The row permission information includes a preset column set used to filter the set of rows that the user has permission to access in the data report. After the step of determining the first permission information based on the row permission information and the column permission information, the method further includes: Determine the set of columns for the data report; When the column set of the data report has a matching column with the preset column set, or when the column set of the data report has a matching column with the column permission information column set, the step of determining the first permission information based on the row permission information and the column permission information is executed.

4. The data query control method as described in claim 1, characterized in that, The step of determining the first permission information based on the row permission information and the column permission information includes: When the data interface is not configured with the interface-level permissions, the row permission information is determined to be the first permission information; When the data interface has been configured with the interface-level permissions, the row permission information and the column permission information are determined to be the first permission information.

5. The data query control method as described in any one of claims 1 to 3, characterized in that, The step of determining the first permission information based on the row permission information and the column permission information includes: Determine the data interface corresponding to the data query request, and determine the user's row permission information and column permission information according to the interface-level permissions corresponding to the data interface. The interface-level permissions corresponding to different data interfaces are configured according to the preset row permission information and preset column permission information of different users. The first permission information is determined based on the row permission information and the column permission information.

6. A server, characterized in that, The server includes: a memory, a processor, and a data query control program stored in the memory and executable on the processor, the data query control program being configured to implement the steps of the data query control method as described in any one of claims 1 to 5.

7. A storage medium, characterized in that, The storage medium stores a data query control program, which, when executed by a processor, implements the steps of the data query control method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Permission control method and device and storage medium

    CN111159729A

  • Permission filtering method and device, computer equipment and storage medium

    CN113282591A

  • Data authority control method and data authority control service

    CN114861208A