CN116821136A - Method, system and storage medium for encoding compressed menu permission - Google Patents

Method, system and storage medium for encoding compressed menu permission Download PDF

Info

Publication number
CN116821136A
CN116821136A CN202310898966.0A CN202310898966A CN116821136A CN 116821136 A CN116821136 A CN 116821136A CN 202310898966 A CN202310898966 A CN 202310898966A CN 116821136 A CN116821136 A CN 116821136A
Authority
CN
China
Prior art keywords
menu
authority
bit
role
compressed
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.)
Pending
Application number
CN202310898966.0A
Other languages
Chinese (zh)
Inventor
张宇宜
赵超
张雷
贾成喜
黄沁媚
俞慧玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Communication Brain Technology Zhejiang Co ltd
Original Assignee
Communication Brain Technology Zhejiang Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Communication Brain Technology Zhejiang Co ltd filed Critical Communication Brain Technology Zhejiang Co ltd
Priority to CN202310898966.0A priority Critical patent/CN116821136A/en
Publication of CN116821136A publication Critical patent/CN116821136A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication

Abstract

The application discloses a method, a system and a storage medium for encoding a compressed menu authority, wherein the method comprises the following steps: sequentially numbering preset menus; constructing binary bit with length of N, and setting the value of each bit to the authority vegetable unit of the role; and converting the binary bit into a preset system and storing. The application reduces the data storage space and solves the problem that the authority data is exponentially increased due to the increase of the roles of tenants while the complexity of system deployment, operation and maintenance and development is not increased.

Description

Method, system and storage medium for encoding compressed menu permission
Technical Field
The application relates to the technical field of database storage, in particular to a method, a system and a medium for encoding a compressed menu authority.
Background
The menu authority design is an indispensable part of each management system, and has the function of mainly enabling an administrator to group various functions in the system according to the actual use condition of the administrator, and then adding users using the functions into corresponding groups, so that the requirement of dynamically adjusting the access of a single user to the system function module is met. The algorithm is mainly applicable to management systems with very many tenants (1000+), very many system function modules (100+), and very many menu points (100+). For this scenario, the current solution is multiple database sub-libraries + sub-tables, which greatly increases the complexity of system deployment, operation and maintenance, and development.
In view of the above problems, there is a need to propose an effective technical solution.
Disclosure of Invention
The application aims to provide a method, a system and a medium for encoding the authority of a compressed menu. The method and the device have the advantages that complexity of system deployment, operation and maintenance and development is not increased, meanwhile, data storage is reduced, and the problem of large increase of authority data caused by increase of tenant roles is solved.
In a first aspect, the present application provides a method for encoding a compressed menu right, the method comprising:
sequentially numbering preset menus;
constructing binary bit with length of N, and setting the value of each bit to the authority vegetable unit of the role;
and converting the binary bit into a preset system and storing the binary bit.
In this scheme, the sequential numbering of preset menus is specifically:
numbering the preset menus from 1 to N, wherein N is a positive integer greater than 1.
In this solution, the authority menu bits corresponding to the roles corresponding to the value of each bit of the bits are specifically:
the authority menu unit of the character is set to 1, and the other cases are set to 0.
In the scheme, when inquiring the role rights, firstly, converting the bit of the preset system into the binary system, and judging the menu point rights owned by the roles according to the value of the corresponding bit.
In this scheme, the menu point that the judging role possesses according to the value of the corresponding bit specifically is: and if the binary bit value is 1, the character has the menu point authority corresponding to the bit.
In this scheme, the preset system is a 32 system.
The second aspect of the present application also provides a compressed menu authority encoding system, comprising: the memory comprises a program of a compressed menu authority coding method, and the program of the compressed menu authority coding method realizes the following steps when being executed by the processor:
sequentially numbering preset menus;
constructing binary bit with length of N, and setting the value of each bit to the authority vegetable unit of the role;
and converting the binary bit into a preset system and storing.
In this scheme, the sequential numbering of preset menus is specifically:
numbering the preset menus from 1 to N, wherein N is a positive integer greater than 1.
In this solution, the authority menu bits corresponding to the roles corresponding to the value of each bit of the bits are specifically:
the authority menu unit of the character is set to 1, and the other cases are set to 0.
In a third aspect, the present application also provides a computer readable storage medium, where the computer readable storage medium includes a compressed menu authority encoding method program, where the compressed menu authority encoding method program, when executed by a processor, implements the steps of the compressed menu authority encoding method.
As can be seen from the above, the method, system and storage medium for encoding the compressed menu rights provided by the present application comprise: sequentially numbering preset menus; constructing binary bit with length of N, and setting the value of each bit to the authority vegetable unit of the role; and converting the binary bit into a preset system and storing. The application greatly reduces the data storage space while not increasing the complexity of system deployment, operation and maintenance and development, and solves the problem of exponentially increasing the authority data caused by increasing the roles of tenants.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the embodiments of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for encoding compressed menu rights according to an embodiment of the present application;
fig. 2 is a block diagram of a compressed menu authority encoding system according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that like reference numerals and letters refer to like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, a flowchart of a method for encoding compressed menu rights according to some embodiments of the present application is shown. The method for encoding the compressed menu rights is used for designing and storing the menu rights of the management system, and the application is not limited by the type of the management system. The method for encoding the compressed menu authority comprises the following steps:
s101, numbering preset menus in sequence;
s102, constructing binary bit with the length of N, and enabling the value of each bit of the bit to correspond to a role authority vegetable unit;
s103, converting the binary bit into a preset system and storing.
The menu authority design refers to controlling and managing the operation authority of the user in the system or the application program. It is typically presented to the system administrator in the form of a menu for managing access rights for different user roles. By controlling the authority of the menu, the security and reliability of the system can be ensured, and unauthorized users are prevented from accessing and operating sensitive data. In menu authority design, users are generally divided into different roles or groups, such as an administrator, an ordinary user, a financial staff, and the like, and corresponding menu authorities are set according to responsibilities and functions to be accessed. Administrators are typically given the highest rights to access and operate all of the functions and data of the system, while normal users can only access their desired functions and data, and cannot change system settings or access other users' data. Through reasonable menu authority design, the safety, the integrity and the stability of the system can be ensured, and the risk of losing or damaging the system data caused by misoperation or accidents is reduced.
It should be noted that the menu authority design includes: role authority control, menu level control and function level control, wherein the role authority control performs authority control according to a user role. Different users are typically separated into different roles, and then each role is assigned different rights to ensure that users can only access their desired functions and data. An administrator can manage the operation rights of different users by configuring the role rights. The menu level control is to perform authority control at the menu level. The system administrator may set up a menu so that only users with certain rights can access the menu. In this approach, the rights control is menu based rather than role or user based.
The function level control is to perform authority control at the function level. The administrator may set the functional rights of different groups of users to ensure that different users can only access their desired functions. This approach allows the administrator to control the user's operational rights with finer granularity.
It should be noted that, the present application is based on role authority control, and performs coding compression in the role authority control, specifically, firstly numbering preset menus in sequence; constructing binary bit with length of N, and setting the value of each bit to the authority vegetable unit of the role; and converting the binary bit into a preset system and storing.
According to the embodiment of the application, the sequential numbering of the preset menus is specifically: numbering the preset menus from 1 to N, wherein N is a positive integer greater than 1.
It should be noted that, the existing user rights are designed as follows: defining a system with N menu authorities corresponds to defining a sys_menu table with N pieces of data in the database, as shown in Table 1 as a menu table.
TABLE 1
Menu ID Menu name
1 Menu 1
2 Menu 2
... ...
N Menu N
If there are M roles, the role table sys_role is defined as shown in Table 2 below.
TABLE 2
Role ID Name of color
1 Role 1
2 Role 2
... ...
M Roles and rolesM
Each character has K permission points, and sys_role_menu has m×k pieces of data, and the character menu table is as follows in table 3.
TABLE 3 Table 3
ID Role ID Menu ID
1 Role 1 Menu 1
2 Role 1 Menu 2
... ...
M*K Role M Menu K
The total number of data in the three tables is n+m+m×k.
The application carries out authority design after 32-bit binary coding, combines two tables of sys_role and sys_role_menu, and then numbers the menu from 1 to N.
According to the embodiment of the application, the authority menu bits corresponding to the roles of the values of each bit are specifically:
the authority menu unit of the character is set to 1, and the other cases are set to 0.
For a binary bit, the value of each bit is only 0 and 1, wherein the authority menu unit of the character can be set to 1, and the other cases are set to 0.
For example, there are 20 menus in total, role 1 has menu 19, menu 5, menu 1 rights, we need to set the 19 th, 5 th, 1 st position of bits with 20 long bits to 1, then the binary bits are: 010000000000000 10001.
According to the embodiment of the application, when inquiring the role right, firstly, converting the bit of the preset system into the binary system, and judging the menu point owned by the role according to the value of the corresponding bit.
According to the embodiment of the application, the menu points owned by the roles are judged according to the values of the corresponding bits specifically are as follows: and if the binary bit value is 1, the role has the authority corresponding to the bit.
It should be noted that, for example, the preset system is 32 systems, where the 32 systems are an existing numerical representation, and 32 numbers or letters are used to represent a number. It is similar to other binary systems, 16, 10, and 2. In a 32-ary system, each numeric or alphabetic value corresponds to a weight that increases from right to left in turn. Typically, the numbers used in the 32 scale include 0 to 9 and letters a to v (excluding i, o, u). The use of 32-ary allows larger numbers to be stored in shorter strings, as each character can express more information.
Converting binary into 32-ary can more effectively utilize the memory space. Each 32-ary number may represent more information and thus the same number of bits may be represented with fewer characters, thereby reducing the use of memory space. For applications requiring frequent data transmission or network communication, 32-ary conversion may lead to better efficiency. Because the numbers and letters in the 32-ary representation are printable characters, they can be transmitted directly in text without binary conversion. 32-ary may also improve code readability. The 32 system has more readability than the binary representation because it uses a character set that contains uppercase letters and numbers, not just 0 and 1.
As above, for example, the binary bits are: 01000000000000010001 corresponds to 32: 800h, when inquiring the role authority, the role authority needs to be inverted into binary bit, and the 19 th, 5 th and 1 th bits with 20 long bits are all 1, which means that the role 1 has the authority of the menu 19, the menu 5 and the menu 1.
It should be noted that if 01000000000000010001 is directly stored, 20-bit character length is needed, the database only needs to be stored for 800 hours after 32-system encoding is performed, and the data storage space is compressed to save 500 percent
For example, a system has 100 applications, each application has 100 single points, and for a total of 10000 single points, if the system has 100 tenants, each tenant has 100 roles, each role has 100 single points, the total data of the database according to the traditional design is 10000+10000+ (10000×100) =102000pieces, and the total data of the database according to the application is 10000+10000=20000, so that 100 ten thousand pieces of data are saved.
FIG. 2 shows a block diagram of a compressed menu rights encoding system.
The second aspect of the present application also provides a compressed menu authority encoding system, comprising: a memory 21 and a processor 22, wherein the memory 21 includes a program of a compressed menu authority encoding method, and the program of the compressed menu authority encoding method realizes the following steps when executed by the processor 22:
s101, numbering preset menus in sequence;
s102, constructing binary bit with the length of N, and enabling the value of each bit of the bit to correspond to a role authority vegetable unit;
s103, converting the binary bit into a preset system and storing.
The menu authority design refers to controlling and managing the operation authority of the user in the system or the application program. It is typically presented to the system administrator in the form of a menu for managing access rights for different user roles. By controlling the authority of the menu, the security and reliability of the system can be ensured, and unauthorized users are prevented from accessing and operating sensitive data. In menu authority design, users are generally divided into different roles or groups, such as an administrator, an ordinary user, a financial staff, and the like, and corresponding menu authorities are set according to responsibilities and functions to be accessed. Administrators are typically given the highest rights to access and operate all of the functions and data of the system, while normal users can only access their desired functions and data, and cannot change system settings or access other users' data. Through reasonable menu authority design, the safety, the integrity and the stability of the system can be ensured, and the risk of losing or damaging the system data caused by misoperation or accidents is reduced.
It should be noted that the menu authority design includes: role authority control, menu level control and function level control, wherein the role authority control performs authority control according to a user role. Different users are typically separated into different roles, and then each role is assigned different rights to ensure that users can only access their desired functions and data. An administrator can manage the operation rights of different users by configuring the role rights. The menu level control is to perform authority control at the menu level. The system administrator may set up a menu so that only users with certain rights can access the menu. In this approach, the rights control is menu based rather than role or user based.
The function level control is to perform authority control at the function level. The administrator may set the functional rights of different groups of users to ensure that different users can only access their desired functions. This approach allows the administrator to control the user's operational rights with finer granularity.
It should be noted that, the present application is based on role authority control, and performs coding compression in the role authority control, specifically, firstly numbering preset menus in sequence; constructing binary bit with length of N, and setting the value of each bit to the authority vegetable unit of the role; and converting the binary bit into a preset system and storing.
According to the embodiment of the application, the sequential numbering of the preset menus is specifically: numbering the preset menus from 1 to N, wherein N is a positive integer greater than 1.
It should be noted that, the existing user rights are designed as follows: defining a system with N menu authorities corresponds to defining a sys_menu table with N pieces of data in the database, as shown in Table 1 as a menu table.
TABLE 1
If there are M roles, the role table sys_role is defined as follows in Table 2.
TABLE 2
Role ID Name of color
1 Role 1
2 Role 2
... ...
M Role M
Each character has K permission points, and sys_role_menu has m×k pieces of data, and the character menu table is as follows in table 3.
TABLE 3 Table 3
ID Role ID Menu ID
1 Role 1 Menu 1
2 Role 1 Menu 2
... ...
M*K Role M Menu K
The total number of data in the three tables is n+m+m×k.
The application carries out authority design after 32-bit binary coding, combines two tables of sys_role and sys_role_menu, and then numbers the menu from 1 to N.
According to the embodiment of the application, the authority menu bits corresponding to the roles of the values of each bit are specifically:
the authority menu unit of the character is set to 1, and the other cases are set to 0.
For a binary bit, the value of each bit is only 0 and 1, wherein the authority menu unit of the character can be set to 1, and the other cases are set to 0.
For example, there are 20 menus in total, role 1 has menu 19, menu 5, menu 1 rights, we need to set the 19 th, 5 th, 1 st position of bits with 20 long bits to 1, then the binary bits are: 010000000000000 10001.
According to the embodiment of the application, when inquiring the role right, firstly, converting the bit of the preset system into the binary system, and judging the menu point owned by the role according to the value of the corresponding bit.
According to the embodiment of the application, the menu points owned by the roles are judged according to the values of the corresponding bits specifically are as follows: and if the binary bit value is 1, the role has the authority corresponding to the bit.
It should be noted that, for example, the preset system is 32 systems, where the 32 systems are an existing numerical representation, and 32 numbers or letters are used to represent a number. It is similar to other binary systems, 16, 10, and 2. In a 32-ary system, each numeric or alphabetic value corresponds to a weight that increases from right to left in turn. Typically, the numbers used in the 32 scale include 0 to 9 and letters a to v (excluding i, o, u). The use of 32-ary allows larger numbers to be stored in shorter strings, as each character can express more information.
Converting binary into 32-ary can more effectively utilize the memory space. Each 32-ary number may represent more information and thus the same number of bits may be represented with fewer characters, thereby reducing the use of memory space. For applications requiring frequent data transmission or network communication, 32-ary conversion may lead to better efficiency. Because the numbers and letters in the 32-ary representation are printable characters, they can be transmitted directly in text without binary conversion. 32-ary may also improve code readability. The 32 system has more readability than the binary representation because it uses a character set that contains uppercase letters and numbers, not just 0 and 1.
As above, for example, the binary bits are: 01000000000000010001 is converted into the corresponding 32 scale and then expressed as: 800h, when inquiring the role authority, the role authority needs to be inverted into binary bit, and the 19 th, 5 th and 1 th bits with 20 long bits are all 1, which means that the role 1 has the authority of the menu 19, the menu 5 and the menu 1.
It should be noted that if 01000000000000010001 is directly stored, 20-bit character length is needed, the database only needs to be stored for 800 hours after 32-system encoding is performed, and the data storage space is compressed to save 500 percent
For example, a system has 100 applications, each application has 100 single points, and for a total of 10000 single points, if the system has 100 tenants, each tenant has 100 roles, each role has 100 single points, the total data of the database according to the traditional design is 10000+10000+ (10000×100) =102000pieces, and the total data of the database according to the application is 10000+10000=20000, so that 100 ten thousand pieces of data are saved.
In a third aspect, the present application further provides a computer readable storage medium, where the computer readable storage medium includes a compressed menu authority encoding method program, where the compressed menu authority encoding method program, when executed by a processor, implements the steps of the compressed menu authority encoding method, specifically including:
s101, numbering preset menus in sequence;
s102, constructing binary bit with the length of N, and enabling the value of each bit of the bit to correspond to a role authority vegetable unit;
s103, converting the binary bit into a preset system and storing.
The menu authority design refers to controlling and managing the operation authority of the user in the system or the application program. It is typically presented to the system administrator in the form of a menu for managing access rights for different user roles. By controlling the authority of the menu, the security and reliability of the system can be ensured, and unauthorized users are prevented from accessing and operating sensitive data. In menu authority design, users are generally divided into different roles or groups, such as an administrator, an ordinary user, a financial staff, and the like, and corresponding menu authorities are set according to responsibilities and functions to be accessed. Administrators are typically given the highest rights to access and operate all of the functions and data of the system, while normal users can only access their desired functions and data, and cannot change system settings or access other users' data. Through reasonable menu authority design, the safety, the integrity and the stability of the system can be ensured, and the risk of losing or damaging the system data caused by misoperation or accidents is reduced.
It should be noted that the menu authority design includes: role authority control, menu level control and function level control, wherein the role authority control performs authority control according to a user role. Different users are typically separated into different roles, and then each role is assigned different rights to ensure that users can only access their desired functions and data. An administrator can manage the operation rights of different users by configuring the role rights. The menu level control is to perform authority control at the menu level. The system administrator may set up a menu so that only users with certain rights can access the menu. In this approach, the rights control is menu based rather than role or user based.
The function level control is to perform authority control at the function level. The administrator may set the functional rights of different groups of users to ensure that different users can only access their desired functions. This approach allows the administrator to control the user's operational rights with finer granularity.
It should be noted that, the present application is based on role authority control, and performs coding compression in the role authority control, specifically, firstly numbering preset menus in sequence; constructing binary bit with length of N, and setting the value of each bit to the authority vegetable unit of the role; and converting the binary bit into a preset system and storing.
According to the embodiment of the application, the sequential numbering of the preset menus is specifically: numbering the preset menus from 1 to N, wherein N is a positive integer greater than 1.
It should be noted that, the existing user rights are designed as follows: defining a system with N menu authorities corresponds to defining a sys_menu table with N pieces of data in the database, as shown in Table 1 as a menu table.
TABLE 1
If there are M roles, the role table sys_role is defined as follows in Table 2.
TABLE 2
Role ID Name of color
1 Role 1
2 Role 2
... ...
M Role N
Each character has K permission points, and sys_role_menu has m×k pieces of data, and the character menu table is as follows in table 3.
TABLE 3 Table 3
ID Role ID Menu ID
1 Role 1 Menu 1
2 Role 1 Menu 2
... ...
M*K Role M Menu K
The total number of data in the three tables is n+m+m×k.
The application carries out authority design after 32-bit binary coding, combines two tables of sys_role and sys_role_menu, and then numbers the menu from 1 to N.
According to the embodiment of the application, the authority menu bits corresponding to the roles of the values of each bit are specifically:
the authority menu unit of the character is set to 1, and the other cases are set to 0.
For a binary bit, the value of each bit is only 0 and 1, wherein the authority menu unit of the character can be set to 1, and the other cases are set to 0.
For example, there are 20 menus in total, role 1 has menu 19, menu 5, menu 1 rights, we need to set the 19 th, 5 th, 1 st position of bits with 20 long bits to 1, then the binary bits are: 010000000000000 10001.
According to the embodiment of the application, when inquiring the role right, firstly, converting the bit of the preset system into the binary system, and judging the menu point owned by the role according to the value of the corresponding bit.
According to the embodiment of the application, the menu points owned by the roles are judged according to the values of the corresponding bits specifically are as follows: and if the binary bit value is 1, the role has the authority corresponding to the bit.
It should be noted that, for example, the preset system is 32 systems, where the 32 systems are an existing numerical representation, and 32 numbers or letters are used to represent a number. It is similar to other binary systems, 16, 10, and 2. In a 32-ary system, each numeric or alphabetic value corresponds to a weight that increases from right to left in turn. Typically, the numbers used in the 32 scale include 0 to 9 and letters a to v (excluding i, o, u). The use of 32-ary allows larger numbers to be stored in shorter strings, as each character can express more information.
Converting binary into 32-ary can more effectively utilize the memory space. Each 32-ary number may represent more information and thus the same number of bits may be represented with fewer characters, thereby reducing the use of memory space. For applications requiring frequent data transmission or network communication, 32-ary conversion may lead to better efficiency. Because the numbers and letters in the 32-ary representation are printable characters, they can be transmitted directly in text without binary conversion. 32-ary may also improve code readability. The 32 system has more readability than the binary representation because it uses a character set that contains uppercase letters and numbers, not just 0 and 1.
As above, for example, the binary bits are: 01000000000000010001 is converted into the corresponding 32 scale and then expressed as: 800h, when inquiring the role authority, the role authority needs to be inverted into binary bit, 19 th, 5 th and 1 st of bit with 20 th bit can be obtained and are all 1, and the role 1 is indicated to have the authority of menu 19, menu 5 and menu 1.
It should be noted that if 01000000000000010001 is directly stored, 20-bit character length is needed, the database only needs to be stored for 800 hours after 32-system encoding is performed, and the data storage space is compressed to save 500 percent
For example, a system has 100 applications, each application has 100 single points, and for a total of 10000 single points, if the system has 100 tenants, each tenant has 100 roles, each role has 100 single points, the total data of the database according to the traditional design is 10000+10000+ (10000×100) =102000pieces, and the total data of the database according to the application is 10000+10000=20000, so that 100 ten thousand pieces of data are saved.
According to the method, the system and the medium for encoding the authority of the compressed menu, the menu is numbered sequentially, binary bit positions are defined, the value of each bit of the bit positions corresponds to the authority vegetable unit of the role, and then the bit positions are stored as a preset system. The method and the device have the advantages that the complexity of system deployment, operation and maintenance and development is not increased, meanwhile, the data storage space is reduced, and the problem that authority data is exponentially increased due to the increase of roles of tenants is solved.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above described device embodiments are only illustrative, e.g. the division of the units is only one logical function division, and there may be other divisions in practice, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units; can be located in one place or distributed to a plurality of network units; some or all of the units may 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 in one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated in one unit; the integrated units may be implemented in hardware or in hardware plus software functional units.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, and the foregoing program may be stored in a readable storage medium, where the program, when executed, performs steps including the above method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read-only memory (ROM), a random access memory (RAM, randomAccessMemory), a magnetic disk or an optical disk, or the like, which can store program codes.
Alternatively, the above-described integrated units of the present application may be stored in a readable storage medium if implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solution of the embodiments of the present application may be embodied in essence or a part contributing to the prior art in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, ROM, RAM, magnetic or optical disk, or other medium capable of storing program code.

Claims (10)

1. A method of encoding compressed menu rights, the method comprising:
sequentially numbering preset menus;
constructing binary bit with length of N, and setting the value of each bit to the authority vegetable unit of the role;
and converting the binary bit into a preset system and storing the binary bit.
2. The method for encoding the compressed menu authority according to claim 1, wherein the sequentially numbering the preset menus is specifically:
numbering the preset menus from 1 to N, wherein N is a positive integer greater than 1.
3. The compressed menu authority encoding method according to claim 1, wherein the authority menu bits corresponding to the roles to the value of each bit are specifically:
the authority menu unit of the character is set to 1, and the other cases are set to 0.
4. The compressed menu right encoding method according to claim 1 wherein,
when inquiring the role rights, firstly converting the bit of the preset system into the binary system, and judging the menu point rights owned by the roles according to the values of the corresponding bits.
5. The method for encoding compressed menu rights according to claim 4, wherein the determining menu points owned by the character according to the value of the corresponding bit is specifically: and if the binary bit value is 1, the character has the menu point authority corresponding to the bit.
6. The compressed menu right encoding method according to claim 1 wherein the preset level is 32 level.
7. A compressed menu entitlement encoding system, the compressed menu entitlement encoding system comprising: the memory comprises a program of a compressed menu authority coding method, and the program of the compressed menu authority coding method realizes the following steps when being executed by the processor:
sequentially numbering preset menus;
constructing binary bit with length of N, and setting the value of each bit to the authority vegetable unit of the role;
and converting the binary bit into a preset system and storing.
8. The compressed menu authority encoding system according to claim 7, wherein the sequentially numbering the preset menus is specifically:
numbering the preset menus from 1 to N, wherein N is a positive integer greater than 1.
9. The compressed menu authority encoding system according to claim 7, wherein the authority menu bits corresponding to the roles with the value of each bit are:
the authority menu unit of the character is set to 1, and the other cases are set to 0.
10. A computer readable storage medium, characterized in that the computer readable storage medium comprises therein a compressed menu rights encoding method program, which when executed by a processor, implements the steps of the compressed menu rights encoding method according to any one of claims 1 to 7.
CN202310898966.0A 2023-07-21 2023-07-21 Method, system and storage medium for encoding compressed menu permission Pending CN116821136A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310898966.0A CN116821136A (en) 2023-07-21 2023-07-21 Method, system and storage medium for encoding compressed menu permission

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310898966.0A CN116821136A (en) 2023-07-21 2023-07-21 Method, system and storage medium for encoding compressed menu permission

Publications (1)

Publication Number Publication Date
CN116821136A true CN116821136A (en) 2023-09-29

Family

ID=88127568

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310898966.0A Pending CN116821136A (en) 2023-07-21 2023-07-21 Method, system and storage medium for encoding compressed menu permission

Country Status (1)

Country Link
CN (1) CN116821136A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117113313A (en) * 2023-10-25 2023-11-24 荣耀终端有限公司 Authority management method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117113313A (en) * 2023-10-25 2023-11-24 荣耀终端有限公司 Authority management method and device
CN117113313B (en) * 2023-10-25 2024-04-09 荣耀终端有限公司 Authority management method and device

Similar Documents

Publication Publication Date Title
CN109981617A (en) A kind of internet of things equipment monitoring method, system and electronic equipment and storage medium
CN105684316B (en) Polar code encoding method and device
US20080222148A1 (en) Lexicographical ordering of real numbers
CN116821136A (en) Method, system and storage medium for encoding compressed menu permission
US20050278616A1 (en) Extensible binary mark-up language for efficient XML-based data communications and related systems and methods
CN104077420B (en) Method and device for importing data into HBase database
CN104579360B (en) A kind of method and apparatus of data processing
CN112464619B (en) Big data processing method, device and equipment and computer readable storage medium
NO20031674L (en) Procedure for showing the operating behavior of plants
CN113722533B (en) Information pushing method and device, electronic equipment and readable storage medium
CN114844792A (en) Dynamic monitoring method, device, equipment and storage medium based on LUA language
WO2003100608A3 (en) System and method with environment memory for input/output configuration
CN107861724B (en) Scripted coding method for fast adapting DLMS/COSEM object
CN106571909A (en) Data encryption method and device
CN109271797B (en) Method and system for improving security of database sensitive information
CN112988678B (en) Wisdom cloud data safety protection system based on block chain
CN113806803B (en) Data storage method, system, terminal equipment and storage medium
CN102185897A (en) Safe distributed virtual storage pool system
CN110309137A (en) A kind of data managing method and device
CN113743802A (en) Work order intelligent matching method and device, electronic equipment and readable storage medium
Hazboun et al. A multi-group technique for data compression
CN116880778B (en) User privacy protection method based on regenerative coding and distributed storage
Jain et al. Leader election algorithm in wireless environments using fibonacci heap structure
CN116775724A (en) Data query method, device, terminal equipment and storage medium
CN110046159B (en) Bank account storage method and device, computer equipment 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