CN117131088A - Menu permission query method and device based on multistage distributed cache - Google Patents
Menu permission query method and device based on multistage distributed cache Download PDFInfo
- Publication number
- CN117131088A CN117131088A CN202311099907.3A CN202311099907A CN117131088A CN 117131088 A CN117131088 A CN 117131088A CN 202311099907 A CN202311099907 A CN 202311099907A CN 117131088 A CN117131088 A CN 117131088A
- Authority
- CN
- China
- Prior art keywords
- menu
- cache
- code
- result data
- user
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 56
- 230000007246 mechanism Effects 0.000 claims abstract description 92
- 230000008520 organization Effects 0.000 claims abstract description 26
- 238000013475 authorization Methods 0.000 claims description 55
- 238000004590 computer program Methods 0.000 claims description 18
- 238000012216 screening Methods 0.000 claims description 8
- 238000010168 coupling process Methods 0.000 abstract description 7
- 238000005859 coupling reaction Methods 0.000 abstract description 7
- 238000013473 artificial intelligence Methods 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 10
- 238000012545 processing Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 9
- 230000008569 process Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 6
- 230000003993 interaction Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24552—Database cache management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2471—Distributed queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/30—Authentication, i.e. establishing the identity or authorisation of security principals
- G06F21/31—User authentication
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/30—Authentication, i.e. establishing the identity or authorisation of security principals
- G06F21/45—Structures or tools for the administration of authentication
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45583—Memory management, e.g. access or allocation
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Computational Linguistics (AREA)
- Computer Hardware Design (AREA)
- Mathematical Physics (AREA)
- Probability & Statistics with Applications (AREA)
- Fuzzy Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the application provides a menu authority query method and device based on multi-level distributed cache, which can be used in the technical field of artificial intelligence, and the method comprises the following steps: acquiring a menu authority inquiry request, wherein the menu authority inquiry request comprises a user code and an organization code; generating corresponding menu authority result data according to user codes and mechanism codes through a preset multi-level distributed caching mechanism, wherein the multi-level distributed caching mechanism comprises a local virtual machine memory and a caching cluster, and unified management is carried out on menus and personnel authorities through the multi-level distributed caching mechanism, so that a high-cohesion and low-coupling system is realized, the occupation amount of JVM memory is reduced, and the system speed is improved; the access times to the database are reduced, the inquiry time is saved, the performance pressure of the database server in the service peak period is relieved, and the risk of memory overflow is avoided.
Description
Technical Field
The application relates to the technical field of computers, in particular to the technical field of artificial intelligence, and particularly relates to a menu authority query method and device based on multistage distributed cache.
Background
Some large systems in financial institutions, such as: the credit system of the bank often has a scene of covering a large number of menus and having a large number of login users, and under the condition of having a large number of business personnel and function menus, the data of the mapping relationship between the business personnel and the menus can reach tens of millions or even hundreds of millions. In the related technology, when a service person logs in a system, fixed menu basic information is acquired from a Java virtual machine (Java Virtual Machine, JVM for short), authorization menu data to be displayed is required to be queried from a database through query sentences, and in the mode, the occupied amount of a menu cache in the JVM memory is large, and the occupied amount of the memory is in a high water line for a long time, so that the processing speed of the system is slow; the database needs to be queried every time a page is logged in or refreshed, and the time consumption is high; the refreshing of the menu cache is triggered and validated in real time through the existing online initialization mechanism, and the potential risk of memory overflow exists during full refreshing.
Disclosure of Invention
The application aims to provide a menu authority query method based on a multi-level distributed cache, which is used for uniformly managing menus and personnel authorities through a multi-level distributed cache mechanism, realizing a high-cohesion and low-coupling system, reducing the memory occupation amount of a JVM (Java virtual machine), and improving the system speed; the access times to the database are reduced, the inquiry time is saved, the performance pressure of the database server in the service peak period is relieved, and the risk of memory overflow is avoided. Another object of the present application is to provide a menu authority query apparatus based on a multi-level distributed cache. It is yet another object of the present application to provide a computer readable medium. It is a further object of the application to provide a computer device.
In order to achieve the above objective, an aspect of the present application discloses a menu authority query method based on a multi-level distributed cache, including:
acquiring a menu authority inquiry request, wherein the menu authority inquiry request comprises a user code and an organization code;
and generating corresponding menu authority result data according to the user codes and the mechanism codes through a preset multi-level distributed caching mechanism, wherein the multi-level distributed caching mechanism comprises a local virtual machine memory and a caching cluster.
Preferably, generating corresponding menu authority result data according to user codes and mechanism codes by a preset multi-level distributed caching mechanism includes:
matching the user codes through a preset local virtual machine memory;
if the matching is successful, inquiring corresponding menu authority result data;
and if the matching is failed, matching is carried out according to the user code and the mechanism code through the cache cluster, and corresponding menu authority result data is generated.
Preferably, the cache cluster comprises a distributed cache server;
matching is carried out according to the user code and the mechanism code through the cache cluster, and corresponding menu authority result data is generated, wherein the method comprises the following steps:
server routing is carried out according to the user codes, and a cache server corresponding to the user codes is obtained;
and matching according to the user code and the mechanism code through the cache server to generate corresponding menu authority result data.
Preferably, before matching is performed by the cache server according to the user code and the mechanism code to generate corresponding menu authority result data, the method further comprises:
judging whether the connection with the cache server is successful;
if yes, continuing to execute the step of matching according to the user code and the mechanism code through the cache server to generate corresponding menu authority result data;
if not, inquiring corresponding menu authority result data according to the user code and the mechanism code through the inquiry statement.
Preferably, the cache server includes a full-scale result data cache;
matching according to the user code and the mechanism code through the cache server to generate corresponding menu authority result data, wherein the method comprises the following steps:
judging whether the full result data cache comprises user codes or not;
if yes, inquiring corresponding menu authority result data;
if not, inquiring personnel authorization basic data cache according to the user code and the organization code;
and according to the personnel authorization basic data cache and the organization codes, generating corresponding menu authority result data.
Preferably, according to the user code and the organization code, querying the personnel authorization basic data cache includes:
judging whether the user role is an administrator or not according to the user code;
if yes, inquiring the full menu data;
screening corresponding personnel authorization basic data cache from the full menu data according to the mechanism codes;
if not, screening out corresponding personnel authorization basic data cache according to the user code and the organization code.
Preferably, the generating corresponding menu authority result data according to the personnel authorization basic data buffer and the organization code includes:
inquiring mechanism menu data and menu basic data according to the mechanism codes;
and caching and merging the mechanism menu data, the menu basic data and the personnel authorization basic data to obtain menu authority result data.
The application also discloses a menu authority inquiry device based on the multi-level distributed cache, which comprises:
the request acquisition unit is used for acquiring a menu authority inquiry request, wherein the menu authority inquiry request comprises a user code and an organization code;
the multi-level cache query unit is used for generating corresponding menu authority result data according to user codes and mechanism codes through a preset multi-level distributed cache mechanism, and the multi-level distributed cache mechanism comprises a local virtual machine memory and a cache cluster.
The application also discloses a computer readable medium having stored thereon a computer program which when executed by a processor implements a method as described above.
The application also discloses a computer device comprising a memory for storing information comprising program instructions and a processor for controlling the execution of the program instructions, the processor implementing the method as described above when executing the program.
The application also discloses a computer program product comprising a computer program/instruction which, when executed by a processor, implements a method as described above.
The method comprises the steps of acquiring a menu authority inquiry request, wherein the menu authority inquiry request comprises a user code and a mechanism code; generating corresponding menu authority result data according to user codes and mechanism codes through a preset multi-level distributed caching mechanism, wherein the multi-level distributed caching mechanism comprises a local virtual machine memory and a caching cluster, and unified management is carried out on menus and personnel authorities through the multi-level distributed caching mechanism, so that a high-cohesion and low-coupling system is realized, the occupation amount of JVM memory is reduced, and the system speed is improved; the access times to the database are reduced, the inquiry time is saved, the performance pressure of the database server in the service peak period is relieved, and the risk of memory overflow is avoided.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a menu permission query method based on a multi-level distributed cache according to an embodiment of the present application;
FIG. 2 is a flowchart of another menu permission query method based on multi-level distributed caching according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a menu authority query device based on a multi-level distributed cache according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a computer device 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. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that the menu permission query method and device based on the multi-level distributed cache disclosed by the application can be used in the technical field of artificial intelligence and can also be used in any field except the technical field of artificial intelligence, and the application field of the menu permission query method and device based on the multi-level distributed cache disclosed by the application is not limited.
In order to facilitate understanding of the technical scheme provided by the application, the following description will explain relevant contents of the technical scheme of the application. How to reasonably display menus and how to quickly locate menus owned by a user is a constant problem for large systems. The application encapsulates the access inquiry and logic processing of the menu authorization data at the credit basic service node, provides unified inquiry service to the outside, and performs unified management on the storage and inquiry logic of the menu authorization related data, so that each service system does not need to pay additional attention, and the targets of high cohesion and low coupling are realized. On the premise of not affecting the existing function realization and access efficiency of the system, the memory occupation of a Java virtual machine (Java Virtual Machine, JVM for short) of the pressure drop application server is reduced; the method reduces the access times to the database in high-frequency transactions such as first screen loading, user menu clicking and the like, improves the overall query efficiency and stability, and relieves the performance pressure of the database server in the business peak period.
The implementation process of the menu permission query method based on the multi-level distributed cache provided by the embodiment of the application is described below by taking the menu permission query device based on the multi-level distributed cache as an execution main body as an example. It can be understood that the execution body of the menu permission query method based on the multi-level distributed cache provided by the embodiment of the application includes, but is not limited to, a menu permission query device based on the multi-level distributed cache.
Fig. 1 is a flowchart of a menu authority query method based on a multi-level distributed cache, where the method, as shown in fig. 1, includes:
step 101, acquiring a menu authority query request, wherein the menu authority query request comprises a user code and an organization code.
Step 102, generating corresponding menu authority result data according to user codes and mechanism codes through a preset multi-level distributed caching mechanism, wherein the multi-level distributed caching mechanism comprises a local virtual machine memory and a caching cluster.
In the embodiment of the application, the multi-level distributed caching mechanism is a cache for setting a menu according to the principles of functions and updating frequency.
In the technical scheme provided by the embodiment of the application, a menu permission query request is acquired, wherein the menu permission query request comprises a user code and a mechanism code; generating corresponding menu authority result data according to user codes and mechanism codes through a preset multi-level distributed caching mechanism, wherein the multi-level distributed caching mechanism comprises a local virtual machine memory and a caching cluster, and unified management is carried out on menus and personnel authorities through the multi-level distributed caching mechanism, so that a high-cohesion and low-coupling system is realized, the occupation amount of JVM memory is reduced, and the system speed is improved; the access times to the database are reduced, the inquiry time is saved, the performance pressure of the database server in the service peak period is relieved, and the risk of memory overflow is avoided.
Fig. 2 is a flowchart of another menu authority query method based on multi-level distributed caching according to an embodiment of the present application, as shown in fig. 2, where the method includes:
step 201, acquiring a menu authority query request, wherein the menu authority query request comprises a user code and an organization code.
In the embodiment of the application, each step is executed by a menu authority inquiry device based on multi-level distributed cache.
In the embodiment of the application, when a service person logs in a system, a menu permission query request is generated to query a menu owned by the service person and carry out visual display. In response to a login operation of a service person, a basic service node in the menu permission query device receives a menu permission query request, wherein the menu permission query request comprises a user code and an organization code. Wherein the user code uniquely identifies a business person and the institution code uniquely identifies a financial institution to which the business person belongs.
Step 202, matching the user codes through a preset local virtual machine (JVM) memory, and if the matching is successful, executing step 203; if the match fails, step 204 is performed.
In the embodiment of the application, the menu authorization data of the service personnel logged in at high frequency stored in the local JVM memory is hot spot data, including but not limited to user codes and corresponding menu authorization data.
Specifically, if the user code in the menu permission query request is successfully matched with the user code in the local JVM memory, it indicates that the menu authorization data of the service personnel belongs to the hot spot data in the cache, and then step 203 is continuously executed; if the matching of the user code in the menu permission query request and the user code in the local JVM memory fails, it indicates that the menu authorization data of the service personnel does not belong to the hot spot data in the cache, and the local JVM memory does not store the menu authorization data of the service personnel, and the step 204 is continuously executed.
Step 203, inquiring corresponding menu authority result data, and ending the step.
In the embodiment of the application, if the menu authorization data of the business personnel belong to the hot spot data in the cache, the corresponding menu authorization result data is queried from the local JVM, and the menu authorization result data is visually displayed so as to be provided for a menu interface of the business personnel.
Further, menu base data including, but not limited to, menu base information, menu tree mechanisms, and mechanism authorizations are stored locally; data integration is carried out on the menu basic data and the queried menu authority result data to obtain integrated menu authority data; and visually displaying the integrated menu authority data result data to provide the service personnel with a menu interface.
And 204, matching according to the user codes and the mechanism codes through the cache cluster, and generating corresponding menu authority result data.
In an embodiment of the present application, a cache cluster includes a distributed cache server.
In the embodiment of the present application, step 204 specifically includes:
and 2041, performing server routing according to the user codes to obtain cache servers corresponding to the user codes.
In the embodiment of the application, the user codes a corresponding route path, and can carry out server routing through the route path to the corresponding cache server.
In the embodiment of the application, the user code according to the user is routed to the cache server, so that each menu authority inquiry request is sent to the same cache server, and the second hundred percent cache is ensured.
Step 2042, judging whether the connection with the cache server is successful, if yes, executing step 2043; if not, go to step 2044.
In the embodiment of the application, the menu authority inquiry device based on the multi-level distributed cache is in communication connection with the cache server so as to ensure that the data interaction with the cache server can be performed.
In the embodiment of the present application, if the connection with the cache server is successful, it indicates that the menu authority query device based on the multi-level distributed cache can communicate with the cache server to perform data interaction, and then step 2043 is continuously executed; if the connection with the cache server fails, it indicates that the menu permission query device based on the multi-level distributed cache cannot communicate with the cache server to perform data interaction, and step 2044 is continuously executed.
And 2043, matching according to the user code and the mechanism code through the cache server, generating corresponding menu authority result data, and ending the step.
In the embodiment of the application, the cache server comprises a full-quantity result data cache, full-quantity personnel authorization data, full-quantity menu data, full-quantity mechanism menu data and menu group data, wherein the full-quantity result data cache comprises but is not limited to menu authorization data of business personnel logged in at low frequency.
Specifically, step 2043 includes:
step 1a, judging whether the full result data cache comprises user codes, if so, executing step 1b; if not, executing the step 1c.
In the embodiment of the application, if the full result data cache comprises a user code, indicating that the service personnel is a service personnel logged in at a low frequency, storing menu authorization result data corresponding to the service personnel in a cache server, and continuing to execute the step 1b; if the full result data cache does not include the user code, the service personnel are not the service personnel logged in at low frequency, the menu authorization result data corresponding to the service personnel are not stored in the cache server, and the step 1c is continuously executed.
And step 1b, inquiring corresponding menu authority result data, and ending the step.
In the embodiment of the application, if the corresponding menu authorization result data of the service personnel is stored in the cache server, the corresponding menu authorization result data is queried from the cache server, and the menu authorization result data is visually displayed so as to be provided for a menu interface of the service personnel.
Further, the user code of the business personnel and corresponding menu authorization result data are stored into a local JVM memory to be used as hot spot data. And updating the hot spot data stored in the local JVM memory according to the specified time interval and the updating strategy. The local JVM memory stores the latest accessed menu authorization result data in a least recently used Map data structure (LRUMap), and caches and updates the latest accessed menu authorization result data.
It should be noted that, the update policy may be set according to actual requirements, which is not limited in the embodiment of the present application. As an alternative, the hot spot data is updated according to the access frequency of the service personnel, namely: and updating corresponding menu authorization data in the hot spot data according to the access times of the user codes in a certain time, and specifically deleting the menu authorization data with the access times lower than a preset access threshold in a certain time and the user codes, so that no dirty data is ensured, and no data redundancy is caused.
And step 1c, inquiring personnel authorization basic data cache according to the user code and the organization code.
In the embodiment of the application, different user codes represent different service personnel, and the roles of the service personnel comprise an administrator and a common service personnel. Specifically, according to the user code, judging whether the user role is an administrator or not; if yes, inquiring the full menu data, and returning the full menu data to the front end for visual display so as to be checked by an administrator; screening corresponding personnel authorization basic data cache from the full menu data according to the mechanism codes; if not, screening out corresponding personnel authorization basic data cache according to the user code and the organization code.
Specifically, if the menu authorization result data corresponding to the business personnel are not stored in the cache server, the corresponding personnel authorization basic data cache is screened out from the total personnel authorization data according to the user code and the mechanism code.
And step 1d, according to the personnel authorization basic data cache and the organization codes, generating corresponding menu authority result data.
Specifically, inquiring mechanism menu data from the total mechanism menu data according to the mechanism codes, and acquiring menu basic data; and caching and merging the mechanism menu data, the menu basic data and the personnel authorization basic data to obtain menu authority result data.
In the embodiment of the application, the final menu authority result data is generated by combining personnel authorization basic data cache, menu basic data, mechanism menu data and the like.
Further, storing the user code of the business personnel and the corresponding menu authorization result into a local JVM memory as hot spot data; and simultaneously storing the user code of the service personnel and the corresponding menu authorization result into a cache server. And updating the hot spot data stored in the local JVM memory and the data stored in the cache server according to the specified time interval and the updating strategy.
It should be noted that, the update policy may be set according to actual requirements, which is not limited in the embodiment of the present application. Specifically, the menu authorization data and the user codes with the access times lower than the preset access threshold value in a certain time can be deleted, so that no dirty data is ensured, and no data redundancy is caused.
Step 2044, inquiring corresponding menu authority result data according to the user codes and the mechanism codes through inquiry sentences.
In the embodiment of the application, if the menu authority query device based on the multi-level distributed cache cannot communicate with the cache server for data interaction, corresponding menu authority result data is queried from the database according to the user code and the mechanism code through query sentences.
It is worth to be noted that, in the technical scheme of the application, the acquisition, storage, use, processing and the like of the data all conform to the relevant regulations of laws and regulations. The user information in the embodiment of the application is obtained through legal compliance approaches, and the user information is obtained, stored, used, processed and the like through the approval of the client.
In the technical scheme of the menu authority query method based on the multi-level distributed cache, a menu authority query request is obtained, wherein the menu authority query request comprises a user code and a mechanism code; generating corresponding menu authority result data according to user codes and mechanism codes through a preset multi-level distributed caching mechanism, wherein the multi-level distributed caching mechanism comprises a local virtual machine memory and a caching cluster, and unified management is carried out on menus and personnel authorities through the multi-level distributed caching mechanism, so that a high-cohesion and low-coupling system is realized, the occupation amount of JVM memory is reduced, and the system speed is improved; the access times to the database are reduced, the inquiry time is saved, the performance pressure of the database server in the service peak period is relieved, and the risk of memory overflow is avoided.
Fig. 3 is a schematic structural diagram of a menu permission query device based on a multi-level distributed cache, which is provided in an embodiment of the present application, and the device is configured to execute the menu permission query method based on the multi-level distributed cache, as shown in fig. 3, where the device includes: a request acquisition unit 11 and a multi-level cache inquiry unit 12.
The request acquisition unit 11 is configured to acquire a menu authority inquiry request including a user code and an organization code.
The multi-level cache inquiry unit 12 is configured to generate corresponding menu authority result data according to a user code and a mechanism code through a preset multi-level distributed cache mechanism, where the multi-level distributed cache mechanism includes a local virtual machine memory and a cache cluster.
In the embodiment of the present application, the multi-level cache query unit 12 is specifically configured to match the user codes through a preset local virtual machine memory; if the matching is successful, inquiring corresponding menu authority result data; and if the matching is failed, matching is carried out according to the user code and the mechanism code through the cache cluster, and corresponding menu authority result data is generated.
In the embodiment of the application, a cache cluster comprises a distributed cache server; the multi-level cache inquiry unit 12 is specifically configured to perform server routing according to the user code, so as to obtain a cache server corresponding to the user code; and matching according to the user code and the mechanism code through the cache server to generate corresponding menu authority result data.
In the embodiment of the application, the device further comprises: a connection judgment unit 13 and a query unit 14.
The connection judging unit 13 is used for judging whether the connection with the cache server is successful; if yes, triggering the multi-level cache inquiry unit 12 to continue to execute the step of matching according to the user codes and the mechanism codes through the cache server to generate corresponding menu authority result data;
the query unit 14 is configured to query corresponding menu authority result data according to the user code and the organization code through a query statement if connection with the cache server fails.
In the embodiment of the application, the cache server comprises a full-quantity result data cache; the query unit 14 is specifically configured to determine whether the full-scale result data cache includes a user code; if yes, inquiring corresponding menu authority result data; if not, inquiring personnel authorization basic data cache according to the user code and the organization code; and according to the personnel authorization basic data cache and the organization codes, generating corresponding menu authority result data.
In the embodiment of the present application, the query unit 14 is specifically configured to determine whether the user role is an administrator according to the user code; if yes, inquiring the full menu data; screening corresponding personnel authorization basic data cache from the full menu data according to the mechanism codes; if not, screening out corresponding personnel authorization basic data cache according to the user code and the organization code.
In the embodiment of the present application, the query unit 14 is specifically configured to query out mechanism menu data and menu basic data according to the mechanism code; and caching and merging the mechanism menu data, the menu basic data and the personnel authorization basic data to obtain menu authority result data.
In the scheme of the embodiment of the application, a menu authority inquiry request is acquired, wherein the menu authority inquiry request comprises a user code and a mechanism code; generating corresponding menu authority result data according to user codes and mechanism codes through a preset multi-level distributed caching mechanism, wherein the multi-level distributed caching mechanism comprises a local virtual machine memory and a caching cluster, and unified management is carried out on menus and personnel authorities through the multi-level distributed caching mechanism, so that a high-cohesion and low-coupling system is realized, the occupation amount of JVM memory is reduced, and the system speed is improved; the access times to the database are reduced, the inquiry time is saved, the performance pressure of the database server in the service peak period is relieved, and the risk of memory overflow is avoided.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. A typical implementation device is a computer device, which may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
The embodiment of the application provides a computer device, which comprises a memory and a processor, wherein the memory is used for storing information comprising program instructions, the processor is used for controlling the execution of the program instructions, and when the program instructions are loaded and executed by the processor, the steps of the embodiment of the menu permission query method based on the multi-level distributed cache are realized.
Referring now to FIG. 4, there is illustrated a schematic diagram of a computer device 600 suitable for use in implementing embodiments of the present application.
As shown in fig. 4, the computer apparatus 600 includes a Central Processing Unit (CPU) 601, which can perform various appropriate works and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data required for the operation of the computer device 600 are also stored. The CPU601, ROM602, and RAM603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, mouse, etc.; an output portion 607 including a Cathode Ray Tube (CRT), a liquid crystal feedback device (LCD), and the like, and a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on drive 610 as needed, so that a computer program read therefrom is mounted as needed as storage section 608.
In particular, according to embodiments of the present application, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in the same piece or pieces of software and/or hardware when implementing the present application.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The technical scheme of the application obtains, stores, uses, processes and the like the data, which all meet the relevant regulations of national laws and regulations.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.
Claims (11)
1. A menu permission query method based on multi-level distributed caching, the method comprising:
acquiring a menu authority inquiry request, wherein the menu authority inquiry request comprises a user code and an organization code;
and generating corresponding menu authority result data according to the user codes and the mechanism codes through a preset multi-level distributed caching mechanism, wherein the multi-level distributed caching mechanism comprises a local virtual machine memory and a caching cluster.
2. The method for querying menu rights based on multi-level distributed cache according to claim 1, wherein the generating corresponding menu rights result data according to the user code and the mechanism code by a preset multi-level distributed cache mechanism comprises:
matching the user codes through a preset local virtual machine memory;
if the matching is successful, inquiring corresponding menu authority result data;
and if the matching is failed, matching is carried out according to the user codes and the mechanism codes through the cache cluster, and corresponding menu authority result data is generated.
3. The multi-level distributed cache-based menu permission query method of claim 2, wherein the cache cluster comprises a distributed cache server;
the matching is performed according to the user code and the mechanism code through the cache cluster, and corresponding menu authority result data is generated, including:
server routing is carried out according to the user codes, and a cache server corresponding to the user codes is obtained;
and matching the user code and the mechanism code through the cache server to generate corresponding menu authority result data.
4. The method for querying menu rights based on multi-level distributed caches as recited in claim 3, further comprising, before said matching by the cache server according to the user code and the organization code, generating corresponding menu rights result data:
judging whether the connection with the cache server is successful or not;
if yes, continuing to execute the step of matching according to the user code and the mechanism code through the cache server to generate corresponding menu authority result data;
if not, inquiring corresponding menu authority result data according to the user codes and the mechanism codes through inquiry sentences.
5. The multi-level distributed cache-based menu permission query method of claim 3, wherein the cache server comprises a full-scale result data cache;
the step of generating corresponding menu authority result data by the cache server according to the matching of the user code and the mechanism code comprises the following steps:
judging whether the full-quantity result data cache comprises the user code or not;
if yes, inquiring corresponding menu authority result data;
if not, inquiring personnel authorization basic data cache according to the user code and the mechanism code;
and generating corresponding menu authority result data according to the personnel authorization basic data cache and the organization code.
6. The method for querying menu permission based on multi-level distributed cache according to claim 5, wherein querying the personnel authorization basic data cache according to the user code and the organization code comprises:
judging whether the user role is an administrator or not according to the user code;
if yes, inquiring the full menu data;
screening corresponding personnel authorization basic data cache from the full menu data according to the mechanism code;
if not, screening out corresponding personnel authorization basic data cache according to the user code and the organization code.
7. The method for querying menu rights based on multi-level distributed caches as claimed in claim 5, wherein generating corresponding menu rights result data according to the personnel authorization base data cache and organization code comprises:
inquiring mechanism menu data and menu basic data according to the mechanism codes;
and caching and merging the mechanism menu data, the menu basic data and the personnel authorization basic data to obtain the menu authority result data.
8. A menu permission query apparatus based on a multi-level distributed cache, the apparatus comprising:
the request acquisition unit is used for acquiring a menu authority inquiry request, wherein the menu authority inquiry request comprises a user code and an organization code;
the multi-level cache query unit is used for generating corresponding menu authority result data according to the user codes and the mechanism codes through a preset multi-level distributed cache mechanism, and the multi-level distributed cache mechanism comprises a local virtual machine memory and a cache cluster.
9. A computer readable medium having stored thereon a computer program, which when executed by a processor implements the multi-level distributed cache based menu permission query method of any of claims 1 to 7.
10. A computer device comprising a memory for storing information including program instructions and a processor for controlling execution of the program instructions, wherein the program instructions when loaded and executed by the processor implement the multi-level distributed cache-based menu entitlement query method of any of claims 1 to 7.
11. A computer program product comprising computer programs/instructions which when executed by a processor implement the multi-level distributed cache based menu permission query method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311099907.3A CN117131088A (en) | 2023-08-29 | 2023-08-29 | Menu permission query method and device based on multistage distributed cache |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311099907.3A CN117131088A (en) | 2023-08-29 | 2023-08-29 | Menu permission query method and device based on multistage distributed cache |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117131088A true CN117131088A (en) | 2023-11-28 |
Family
ID=88857952
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311099907.3A Pending CN117131088A (en) | 2023-08-29 | 2023-08-29 | Menu permission query method and device based on multistage distributed cache |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117131088A (en) |
-
2023
- 2023-08-29 CN CN202311099907.3A patent/CN117131088A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10909064B2 (en) | Application architecture supporting multiple services and caching | |
US7406464B2 (en) | Custom caching | |
US10275347B2 (en) | System, method and computer program product for managing caches | |
CN105701112A (en) | Data processing method, apparatus and system | |
CN111966938B (en) | Configuration method and system for realizing loading speed improvement of front-end page of cloud platform | |
KR102476620B1 (en) | Cache automatic control system | |
US9213673B2 (en) | Networked applications with client-caching of executable modules | |
US12007999B1 (en) | Systems, methods, and media for operating a microservices architecture with a shared distributed cache | |
US11269784B1 (en) | System and methods for efficient caching in a distributed environment | |
CN117131088A (en) | Menu permission query method and device based on multistage distributed cache | |
CN115878653A (en) | Data access control method and device, electronic equipment and storage medium | |
CN110781500A (en) | Data wind control system and method | |
CN115658171A (en) | Method and system for solving dynamic refreshing of java distributed application configuration in lightweight mode | |
CN109739516B (en) | Cloud cache operation method and system | |
US10970406B2 (en) | System for mitigating exposure associated with identified unmanaged devices in a network using solution data modelling | |
CN111125025A (en) | Metadata storage system, metadata storage method, metadata calling device and readable storage medium | |
US11972018B2 (en) | Data categories for purpose-based processing of personal data | |
CN112015745B (en) | Data management method and device | |
CN115297061A (en) | Token bucket updating method and device, electronic equipment and storage medium | |
US20240089339A1 (en) | Caching across multiple cloud environments | |
US20240184705A1 (en) | In-memory caching system for flexible time dimension | |
CN118568179A (en) | Business process method, device, apparatus, medium and program product | |
CN116708570A (en) | Service processing method based on micro-service architecture and related device | |
CN116414728A (en) | Data cache optimization method and device, electronic equipment and medium | |
CN118446507A (en) | Business process execution method, device, equipment, medium and program product |
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 |