Index authority management system based on bit operation
By using bit operations and long values to represent index position information in the indicator permission management system, the problems of data redundancy and low query efficiency in the prior art are solved, and more efficient data query and permission management are achieved.
Patent Information
- Application Number
- CN202411091717.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-11-29
AI Technical Summary
In the prior art, the many-to-many mapping relationship between roles and data indicators is stored through intermediate tables, resulting in data redundancy and inefficient query. Especially when obtaining the intersection of data indicator permissions of multiple roles, multiple database interactions are required, and the efficiency is Lower.
The indicator permission management system based on bit operations is adopted. By adding the "Indicator Location Information" field to the role table, the long value is used to represent the position information of the indicator data in the data indicator table, reducing the number of database interactions and improving query efficiency.
Abandon the role and data indicator association relationship table, reduce data redundancy, and improve query efficiency. Especially when obtaining the intersection of data indicator permissions of multiple roles, you only need to perform bit operations to obtain the indicator data, which significantly reduces database interaction. frequency.
Smart Images

Figure CN119046323A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of index authority management, and in particular to an index authority management system based on bit operation. Background Art
[0002] Some management systems have a data reporting function, which mainly reports data indicators related to the operating conditions of the institution. Data indicators are classified according to major categories, minor categories, and indicator names, which can be divided into 5 major categories, 24 minor categories, and a total of 449 indicator names.
[0003] Currently, the authority of system users to query data indicators is controlled by modifying the association between roles and data indicators. This involves the role table, data indicator table, and the role and data indicator association table.
[0004] In the prior art: a new role table is created to store role-related information. A new data indicator table is created to store all relevant fields of data indicators in sequence. A new role and data indicator association table is created to mainly store role IDs and data indicator IDs.
[0005] Query the role-data indicator association table based on the role ID to obtain the data indicator ID list, and then use the data indicator ID list to obtain the indicator data corresponding to the data indicator ID in the data indicator table.
[0006] Disadvantages of existing technology:
[0007] The many-to-many mapping relationship between roles and data indicators is stored in the intermediate table, which results in data redundancy. When obtaining the data indicators corresponding to the roles, a joint table query is required through the intermediate table, which results in low query efficiency.
[0008] When obtaining the intersection of data indicator permissions of multiple roles, it is necessary to query the data indicator ID lists corresponding to the multiple roles, take the intersection of the multiple data indicator ID lists to generate a new data indicator ID list, and then use the new data indicator ID list to obtain indicator data. There are multiple database interaction operations, which is inefficient. Summary of the invention
[0009] In view of the above problems, the present invention is proposed to provide an indicator authority management system based on bit operations that overcomes the above problems or at least partially solves the above problems.
[0010] According to one aspect of the present invention, there is provided an indicator authority management system based on bit operations, the indicator authority management system comprising: a database, a server and a front-end display;
[0011] The database is used to create a new role table and a data indicator table;
[0012] The front-end display is connected to the server and is used to interact with the server to obtain a full indicator data list as a check box display list;
[0013] The server is connected to the database and the front-end display respectively, and is used to obtain information from the front-end display.
[0014] Optionally, the role table is used to store role names and indicator location information; the data indicator table is used to store indicator categories, indicator subcategories and indicator names.
[0015] Optionally, the server obtains the role ID, role name, and indicator number list from the front end, processes the indicator number list into a long value, and adds or updates role-related data.
[0016] Optionally, the front-end display specifically includes:
[0017] The front-end display interacts with the server to obtain a full indicator data list as a check box display list;
[0018] The front-end display interacts with the server, matches and checks the indicator serial number list processed by the server with the full indicator data list, so that developers can view and edit the indicator permissions of existing roles.
[0019] Optionally, the indicator authority management system is developed based on vue and Spring Boot.
[0020] Optionally, the server provides a full indicator data list query interface and returns an ordered full indicator data list;
[0021] Provides an indicator permission query interface to obtain the role name and indicator location information of the role based on the passed-in role ID, and processes the indicator location information field value into an indicator serial number list.
[0022] Optionally, the server provides a role saving interface, and processes the indicator number list into indicator location information field data based on the input role ID, role name, and indicator number list. When the role ID is empty, new role data is added, and when it is not empty, the role data is updated.
[0023] Optionally, each indicator data in the full indicator data list is marked by a serial number field.
[0024] The present invention provides an indicator authority management system based on bit operation, the indicator authority management system includes: a database, a server and a front-end display; the database is used to create a new role table and a data indicator table; the front-end display is connected to the server and is used to interact with the server to obtain a full indicator data list as a check box display list; the server is respectively connected to the database and the front-end display to obtain information from the front-end display. The number of database interactions is reduced and the query efficiency is improved.
[0025] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0027] Figure 1 The indicator sequence number list provided in the embodiment of the present invention is processed into an indicator position information flow chart;
[0028] Figure 2 A flowchart of processing the indicator position information field into an indicator serial number list provided in an embodiment of the present invention;
[0029] Figure 3 This is a structural diagram of an ordered list of full indicator data returned by a server provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0031] The terms "comprises" and "having" and any variations thereof in the description embodiments, claims and drawings of the present invention are intended to cover non-exclusive inclusions, for example, including a series of steps or units.
[0032] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0033] like Figure 1-3 As shown, an indicator authority management system based on bit operation, the system includes: a database, a server, and a front-end display;
[0034] The whole system is developed based on vue and Spring Boot;
[0035] Database: Create a new role table - mainly store role names, indicator location information, create a new data indicator table - mainly store indicator categories, indicator subcategories, indicator names, and a standardized MySQL database.
[0036] Front-end display:
[0037] By interacting with the server, a full list of indicator data is obtained as a check box display list.
[0038] By interacting with the server, the indicator serial number list processed by the server is matched and checked with the full indicator data list, so that developers can view and edit the indicator permissions of existing roles.
[0039] Server: Get the role ID, role name, and indicator number list from the front end, convert the indicator number list into a long value, and add or update role-related data.
[0040] Server detailed description:
[0041] 1. Provide a full indicator data list query interface and return an ordered full indicator data list.
[0042] 2. Provide an indicator permission query interface to obtain the role name and indicator location information of the role based on the passed-in role ID, and process the indicator location information field value into an indicator serial number list.
[0043] 3. Provide a role saving interface. According to the passed-in role ID, role name, and indicator serial number list, process the indicator serial number list into indicator location information field data. When the role ID is empty, add role data; when it is not empty, update the role data.
[0044] When processing data in the above operations, the data is processed through the algorithm logic of the Java code.
[0045] Each indicator data in the full indicator data list is marked by the serial number field.
[0046] The indicator serial number list is processed into the indicator location information field: the front end sends the serial numbers of all selected indicator data to the server in a list. The server initializes an indicator location information field with data 0, loops through the indicator serial number list, and shifts the number 1 to the left by X bits each time (X is the serial number value obtained in each loop). The value obtained after the operation is subjected to the "|" operation (or operation) with the indicator location information field, and the result is assigned to the indicator location information field. After the loop is completed, each bit of the indicator location information field that is 1 represents the serial number value of an indicator data.
[0047] The indicator location information field is processed into an indicator serial number list: the front end passes in the role ID, and the server queries the database based on the role ID to obtain the indicator location information field of the role. The server initializes a serial number value of 1 and an empty indicator serial number list, and uses a while loop to determine whether the indicator location information field is 0 after shifting right by X bits (X is the serial number value). If it is equal to 0, the loop is exited. If it is not equal to 0, the right-shifted value is &-operated with the number 1 (AND operation), and the result after the operation is determined to be equal to 1. If it is equal to 1, the current serial number value is added to the indicator serial number list, and the serial number value is increased by 1. After the loop ends, the indicator serial number list will record all the serial numbers of the indicator data owned by the role. .
[0048] Beneficial effects: The role-data indicator association table is discarded to reduce data redundancy. A new "indicator location information" field is added to the role table to store the value of long (the original data type in the Java language), and the location information of the indicator data in the data indicator table is represented by the bits of long to improve query efficiency.
[0049] When obtaining the intersection of data indicator permissions of multiple roles, you only need to perform an "&" operation (AND operation) on multiple long data to get a new long value, and then use the new long value to obtain the indicator data, reducing the number of database interactions and improving query efficiency.
[0050] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. An indicator authority management system based on bit operations, It is characterized in that The indicator authority management system includes: a database, a server and a front-end display; The database is used to create a new role table and a data indicator table; The front-end display is connected to the server and is used to interact with the server to obtain a full indicator data list as a check box display list; The server is connected to the database and the front-end display respectively, and is used to obtain information from the front-end display.
2. According to claim 1, an indicator authority management system based on bit operation, It is characterized in that The role table is used to store role names and indicator location information; the data indicator table is used to store indicator categories, indicator subcategories and indicator names.
3. According to claim 1, an indicator authority management system based on bit operation, It is characterized in that The server obtains the role ID, role name, and indicator serial number list from the front end, processes the indicator serial number list into a long value, and adds or updates role-related data.
4. According to claim 1, an indicator authority management system based on bit operation, It is characterized in that The front-end display specifically includes: The front-end display interacts with the server to obtain a full indicator data list as a check box display list; The front-end display interacts with the server, matches and checks the indicator serial number list processed by the server with the full indicator data list, so that developers can view and edit the indicator permissions of existing roles.
5. According to claim 1, an indicator authority management system based on bit operation, It is characterized in that The indicator authority management system is developed based on vue and Spring Boot.
6. According to claim 1, an indicator authority management system based on bit operation, It is characterized in that The server provides a full-quantity indicator data list query interface and returns an ordered full-quantity indicator data list; Provides an indicator permission query interface to obtain the role name and indicator location information of the role based on the passed-in role ID, and processes the indicator location information field value into an indicator serial number list.
7. According to claim 1, an indicator authority management system based on bit operation, It is characterized in that The server provides a role saving interface, and processes the indicator number list into indicator location information field data according to the input role ID, role name, and indicator number list. When the role ID is empty, the role data is added, and when it is not empty, the role data is updated.
8. According to claim 6, an indicator authority management system based on bit operation, It is characterized in that Each indicator data in the full indicator data list is marked by a sequence number field.
