Method, system and apparatus for changing binary storage permissions

By optimizing the storage length and index of user permissions, the performance degradation of the storage permission method under large data volumes is solved, achieving efficient permission storage and scalability.

CN117009351BActive Publication Date: 2026-01-27富盛科技股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310885820.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-18
Publication Date
2026-01-27
Estimated Expiration
2043-07-18

AI Technical Summary

Technical Problem

Existing storage permission methods suffer from performance degradation when dealing with large amounts of data and are not easily scalable or optimized.

Method used

By changing the user's storage length, the system calculates the proportion of user-set permissions, automatically optimizes the permission index in the background, updates the permission storage, swaps permission index numbers, and further optimizes permission storage.

Benefits of technology

Storage space has been optimized, query efficiency has been improved, permission dictionary expansion is supported, CPU usage has been reduced, and storage space has been saved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117009351B_ABST
    Figure CN117009351B_ABST
Patent Text Reader

Abstract

The application discloses a method, system and device for changing binary storage permission, which comprises the following steps: changing the storage length of a user, counting the permission setting permission calculation ratio of the user, automatically optimizing the permission index in the background, updating the permission storage, exchanging the permission index number, and completing the changing of the binary storage permission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of changing binary storage permissions, and more particularly to a method, system, and apparatus for changing binary storage permissions. Background Technology

[0002] Existing permission storage typically employs two methods: Method 1: Differentiating permissions using table columns. Adding a new permission requires modifying the table and adding a permission column, which is inconvenient. Method 2: Using two tables: a permission dictionary table and a permission table storing row-level permission keys (which depend on keys in the permission dictionary table) and permission values. This method stores large amounts of data; each user's permission table contains n rows, requiring iteration to determine permission status. Performance degrades once the permission table exceeds 5 million records. Summary of the Invention

[0003] The purpose of this invention is to provide a method, system, and apparatus for changing binary storage permissions, aiming to solve the problem of changing binary storage permissions.

[0004] This invention provides a method for changing binary storage permissions, including:

[0005] The system changes the user's storage length, calculates the proportion of user-set permissions, automatically optimizes the permission index in the background, updates the permission storage, swaps the permission index numbers, and completes the change of binary storage permissions.

[0006] The present invention also provides a binary storage permission change system, comprising: a change module for changing the user's storage length;

[0007] The update module is used to calculate the proportion of user-set permissions. The background automatically optimizes the permission index and updates the permission storage.

[0008] The exchange module is used to exchange permission index numbers to change binary storage permissions.

[0009] This invention also provides a device for changing binary storage permissions, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the above method.

[0010] This invention also provides a computer-readable storage medium storing an information transmission implementation program, which, when executed by a processor, implements the steps of the above-described method.

[0011] Using the embodiments of the present invention, binary storage permissions can be changed.

[0012] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0013] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0014] Figure 1 This is a flowchart of a method for changing binary storage permissions according to an embodiment of the present invention;

[0015] Figure 2 This is a schematic diagram illustrating a permission storage example of a method for changing binary storage permissions according to an embodiment of the present invention;

[0016] Figure 3 This is a flowchart of the permission determination process for the method of changing binary storage permissions according to an embodiment of the present invention;

[0017] Figure 4 This is a schematic diagram illustrating the operation permission exchange of the method for changing binary storage permissions according to an embodiment of the present invention.

[0018] Figure 5 This is a schematic diagram of the binary storage permission system according to an embodiment of the present invention;

[0019] Figure 6 This is a schematic diagram of a device for changing binary storage permissions according to an embodiment of the present invention. Detailed Implementation

[0020] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] Method Implementation Examples

[0022] According to an embodiment of the present invention, a method for changing binary storage permissions is provided. Figure 1 This is a flowchart of a method for changing binary storage permissions according to an embodiment of the present invention, such as... Figure 1 As shown, it specifically includes:

[0023] The system changes the user's storage length, calculates the proportion of user-set permissions, automatically optimizes the permission index in the background, updates the permission storage, swaps permission index numbers, and completes the change of binary storage permissions.

[0024] Changing the user's storage length specifically includes: using the code index number as a placeholder for permissions; if only video preview permission is available, the permission field value in the database is stored as 1; if only audio preview permission is available, the permission field value in the database is stored as 01; when the dictionary code value is greater than the length of the binary string of permissions stored in the database permission field, the dictionary code has no permission; when it is less than or equal to the string length, the code bit of the string is checked. If it is 0, there is no permission; if it is 1, there is permission.

[0025] The system calculates the percentage of user-configured permissions based on statistics, automatically optimizes the permission index in the background, and updates the permission storage. Specifically, it calculates the percentage of user-configured permissions usage frequency through periodic polling, and when the percentage exceeds a set threshold, it re-sorts the permission index. After re-sorting the index, it batch calculates the user permission fields and updates the database.

[0026] The process of exchanging permission index numbers specifically includes: if the newly added operation permission is frequently used, exchanging the frequently used operation permission with any of the previous operation permission indexes, batch calculating the user permission fields, and updating the database.

[0027] Technical Feature 1: User permission storage length is variable.

[0028] For example, the permission dictionary is as follows:

[0029] We use the code index as a placeholder for this permission; if only "Preview Video" permission is available, the permission field value in the database is stored as '1'; if only "Preview Audio" permission is available, the permission field value in the database is stored as '01'; Note: When the dictionary code value is greater than the length of the binary string of the permission stored in the database permission field, this code has no permission; when it is less than or equal to the string length, we check the code position of the string. If it is 0, there is no permission; if it is 1, there is permission.

[0030] Figure 2 This is a schematic diagram illustrating a permission storage example of a method for changing binary storage permissions according to an embodiment of the present invention;

[0031] Here's an example of an application scenario:

[0032] I am the administrator. I grant the user Zhang San the permissions to preview videos and record local videos. I retrieve the code=1 for preview videos and the code=4 for local videos.

[0033] Zhang San's function permission string is stored as "1001";

[0034] Grant Li Si the "Replay on Wall" function permission, retrieve the code=15 corresponding to "Replay on Wall"; store Li Si's function permission string as "000000000000001";

[0035] Figure 3 This is a flowchart of the permission determination process for the method of changing binary storage permissions according to an embodiment of the present invention;

[0036] The permission judgment process is as follows: Zhang San's string is 4 characters long, which is less than 11 characters long, so he has no event alarm permission; Li Si's string is 15 characters long, so the process proceeds to the second judgment step, and since the 11th character of the string is 0, he also has no event alarm permission.

[0037] Technical Feature 2: The system calculates the percentage of user-defined permissions, automatically optimizes the permission index in the background, and updates the permission storage.

[0038] The system calculates the percentage of users who configure and use permissions by periodically polling and counting. When the percentage exceeds a set threshold (which can be configured by the user), such as 80%, a permission index exchange operation will be performed.

[0039] For example, if the "Playback on Wall" permission is frequently used by users, with a calculated usage percentage of 81%, then "Playback on Wall" is compared to the usage percentage of "Configure Big Screen" (code=14). If "Configure Big Screen" has a usage of 50%, the comparison continues to the permissions listed earlier in the index. When "Playback on Wall" is compared to the usage percentage of "Video Recording on Demand" (code=5), if "Video Recording on Demand" has a usage of 82%, then "Playback on Wall" will be ranked after "Video Recording on Demand" in the calculation results, and the subsequent permission indexes will be reordered. After the index is reordered, the user permission fields are calculated in batches and the database is updated. This optimizes the storage length of the user permission fields.

[0040] For example, the function permission string "000000000000001" for Li Si above will be changed to "000001".

[0041] Technical Feature 3: Manual intervention of permission index number.

[0042] A total of 25 new user-configurable operation permissions have been added. We've identified some frequently used permissions that almost every user needs to configure. For example, the permission code=25 "Manual screen lock". The page allows users to swap the index code=25 "Manual screen lock" with any of the previous permission indices. For instance, we can swap the less frequently used permission code=9 "Show map". Figure 4 This is a schematic diagram illustrating the operation permission exchange of the method for changing binary storage permissions according to an embodiment of the present invention.

[0043] The operation permission index performs batch calculations on the user permission field and updates the database. The storage length of the user permission field has been optimized.

[0044] The beneficial effects are as follows:

[0045] Select permissions for smaller codes to prioritize them, thus storing shorter strings.

[0046] Determining permissions only requires obtaining the length of the permission string and checking if the corresponding position is 1; if the length is insufficient for the permission index number, then no permission is granted, thus saving CPU usage.

[0047] It is scalable and extensible; when the permission dictionary is expanded to include code=16 for execution patrol and code=17 for configuration polling, the permission strings previously stored in the database are not affected.

[0048] Similarly, permission checks are performed using the same logic to determine whether permission is granted.

[0049] Calculate and statistically analyze user permissions using percentage weights, optimize permission indexes, optimize permission storage length, and save storage space.

[0050] The newly added permissions are of high usage frequency and can be swapped with previously added permissions that are used less frequently, thus optimizing the permission storage length and saving storage space.

[0051] System Implementation Example 1

[0052] According to embodiments of the present invention, a system for changing binary storage permissions is provided. Figure 5 This is a schematic diagram illustrating the alteration of the binary storage permission system according to an embodiment of the present invention, such as... Figure 5 As shown, it specifically includes:

[0053] The module is modified to change the user's storage length.

[0054] The update module is used to calculate the proportion of user-set permissions. The background automatically optimizes the permission index and updates the permission storage.

[0055] The exchange module is used to exchange permission index numbers to change binary storage permissions.

[0056] The module modification specifically includes: using the code index number as a placeholder for permissions; if only video preview permission is available, the permission field value in the database is stored as 1; if only audio preview permission is available, the permission field value in the database is stored as 01; when the dictionary code value is greater than the length of the binary string of permissions stored in the database permission field, the dictionary code has no permission; when it is less than or equal to the string length, the code bit of the string is checked. If it is 0, there is no permission; if it is 1, there is permission.

[0057] The update module specifically includes: calculating the percentage of user configuration permission usage frequency through periodic polling; when the percentage exceeds a set threshold, re-sorting the permission index; after re-sorting the index, batch calculating the user permission fields and updating the database.

[0058] The exchange module specifically includes: if the newly added operation permission is frequently used, exchanging the frequently used operation permission with any of the previous operation permission indexes, batch calculating the user permission fields, and updating the database.

[0059] The embodiments of the present invention are system embodiments corresponding to the above method embodiments. The specific operation of each module can be understood by referring to the description of the method embodiments, and will not be repeated here.

[0060] Device Example 1

[0061] This invention provides a device for changing binary storage permissions, such as... Figure 6 As shown, it includes: a memory 60, a processor 62, and a computer program stored on the memory 60 and executable on the processor 62. When the computer program is executed by the processor, it implements the steps in the above method embodiments.

[0062] Device Example 2

[0063] This invention provides a computer-readable storage medium storing an information transmission implementation program, which, when executed by a processor 62, implements the steps described in the above method embodiments.

[0064] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions to the technical solutions of the embodiments of the present invention do not cause the essence of the corresponding technical solutions to deviate from the scope of the present solution.

Claims

1. A method for changing binary storage permissions, characterized in that, include: The system changes the user's storage length, calculates the proportion of user-set permissions, automatically optimizes the permission index in the background, updates the permission storage, swaps the permission index numbers, and completes the change of binary storage permissions. The specific steps of changing the user's storage length include: using the code index number as a placeholder for permissions; if only video preview permission is available, the permission field value in the database is stored as 1; if only audio preview permission is available, the permission field value in the database is stored as 01; when the dictionary code value is greater than the length of the binary string of permissions stored in the database permission field, the dictionary code has no permission; when it is less than or equal to the string length, the code bit of the string is checked. If it is 0, there is no permission; if it is 1, there is permission. The process of calculating the percentage of user-configured permissions, automatically optimizing the permission index, and updating the permission storage in the background includes: calculating the percentage of user-configured permission usage frequency through periodic polling; when the percentage exceeds a set threshold, re-sorting the permission index; after re-sorting the index, batch calculating the user permission fields and updating the database. The exchange of permission index numbers specifically includes: if the newly added operation permission is frequently used, exchanging the frequently used operation permission with any of the previous operation permission indexes, batch calculating the user permission fields, and updating the database.

2. A system for changing binary storage permissions, characterized in that, include: The module is modified to change the user's storage length. The modification module specifically includes: using the code index number as a placeholder subscript for permissions; if only video preview permission is available, the permission field value in the database is stored as 1; if only audio preview permission is available, the permission field value in the database is stored as 01; when the dictionary code value is greater than the length of the binary string of permissions stored in the database permission field, the dictionary code has no permission; when it is less than or equal to the string length, the code bit of the string is checked. If it is 0, there is no permission; if it is 1, there is permission. The update module is used to calculate the proportion of user-set permissions. The background automatically optimizes the permission index and updates the permission storage. The update module specifically includes: calculating the percentage of user configuration permission usage frequency through periodic polling; when the percentage is greater than a set threshold, re-sorting the permission index; after re-sorting the index, batch calculating the user permission fields and updating the database. The exchange module is used to exchange permission index numbers to change binary storage permissions. The exchange module specifically includes: if the newly added operation permission is frequently used, exchanging the frequently used operation permission with any of the previous operation permission indexes, batch calculating the user permission fields, and updating the database.

3. A device for changing binary storage permissions, characterized in that, include: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method for changing binary storage permissions as described in any one of claims 1.

4. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an implementation program for information transmission, which, when executed by a processor, implements the steps of the method for changing binary storage permissions as described in any one of claims 1.

Citation Information

Patent Citations

  • Permission control method and device, storage medium and electronic equipment

    CN111695124A

  • RBAC optimization algorithm based on multiplication bitmap

    CN114416751A