Business system login methods, devices, electronic equipment and readable storage media
By leveraging local caching and the database to quickly obtain menu permissions during the login process of the business system, the problem of slow menu permission acquisition speed was solved, thus improving login speed and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-23
- Publication Date
- 2026-04-03
AI Technical Summary
During the login process of the business system, the slow acquisition of menu permissions results in excessively long login times, which affects the user experience.
After obtaining the user's login information, the menu permissions corresponding to the user ID are quickly obtained using the local cache. If there is no data in the local cache, the first and second databases are queried in sequence to ensure that the menu permissions are obtained quickly.
It shortened the time for obtaining menu permissions, improved the login speed and user experience of the business system, and optimized the login process.
Smart Images

Figure CN116340970B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of digital platform login, and in particular to a business system login method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] With the development of technology, online operations are becoming increasingly common in daily life and work. Generally, as the number of users in various business systems increases, the corresponding user information also increases significantly. When users log in to a business system, the part of the login process that retrieves different menu permissions corresponding to different users from the database takes up a considerable amount of time, and the menu permission retrieval speed is relatively slow, thus resulting in a long login time for the business system.
[0003] Therefore, how to provide a solution to the above-mentioned technical problems is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0004] To enable rapid login to a business system, this application provides a business system login method, apparatus, electronic device, and readable storage medium.
[0005] Firstly, this application provides a method for logging into a business system, employing the following technical solution:
[0006] A business system login method, comprising:
[0007] Obtain user login information;
[0008] Based on the user login information, obtain user information, wherein the user information includes user ID and user specific information, wherein the user specific information represents information generated when the user used the business system in the past;
[0009] Based on the user ID, determine whether there is a menu permission corresponding to the user ID in the local cache. The menu permission corresponding to the user ID represents the user's permission information for the business system. The local cache stores several pre-stored menu permissions corresponding to user IDs.
[0010] If it exists, obtain the menu permissions corresponding to the user ID, and log in to the business system based on the user's specific information and the menu permissions corresponding to the user ID.
[0011] By adopting the above technical solution, after obtaining user login information, the system retrieves the current user's information based on that login information. After obtaining the user ID from the user information, instead of using the database containing all the business system's data, it directly utilizes a local cache with faster query speed to obtain the menu permissions corresponding to the user ID, shortening the menu permission acquisition time. Based on the user's specific information and the obtained menu permissions, the system logs into the business system. It is evident that by using a local cache, the time for obtaining menu permissions is shortened, the business system login speed is improved, and thus the user experience is optimized.
[0012] In a preferred example, this application can be further configured as follows:
[0013] The step of determining whether the menu permission corresponding to the user ID exists in the local cache based on the user ID includes:
[0014] Based on the user ID, determine the list of sub-pages corresponding to the user ID, wherein the list of sub-pages includes information on multiple sub-pages;
[0015] Extract subpage menu permissions corresponding to each of the multiple subpages from the local cache using multithreading.
[0016] If the subpage menu permissions corresponding to all subpage information are extracted, then the menu permissions are determined based on the menu permissions of all subpages.
[0017] By adopting the above technical solution, multi-threading is used to simultaneously obtain the sub-menu permissions of the sub-page, thus shortening the time for obtaining menu permissions.
[0018] In a preferred example, this application can be further configured as follows:
[0019] The login method for the business system also includes:
[0020] If the menu permission corresponding to the user ID does not exist in the local cache, then based on the user ID, determine whether the menu permission corresponding to the user ID exists in the first database; if the menu permission corresponding to the user ID exists in the first database, then retrieve the menu permission corresponding to the user ID from the first database.
[0021] If the menu permission corresponding to the user ID does not exist in the first database, then determine whether the menu permission corresponding to the user ID exists in the second database based on the user ID; if the menu permission corresponding to the user ID exists in the second database, then retrieve the menu permission corresponding to the user ID from the second database.
[0022] The first database is a cloud disk-based database; the second database is a hard disk-based database. Both the first and second databases include menu permissions pre-stored by multiple server users.
[0023] By adopting the above technical solution, menu permissions corresponding to user IDs can be obtained through local caching, the first database, or the second database. The query order of each database is local cache, the first database, and the second database. The first database provides more data from the server for local cache, and the second database provides data protection for the first database, ensuring that menu permissions can be obtained quickly and effectively.
[0024] In a preferred example, this application can be further configured as follows:
[0025] If the menu permissions corresponding to the user ID exist in the first database, after retrieving the menu permissions corresponding to the user ID from the first database, the process also includes:
[0026] Based on the menu permissions corresponding to the user ID, obtain the first local cache update instruction;
[0027] According to the first local cache update instruction, the menu permissions corresponding to the user ID obtained through the first database are stored in the local cache;
[0028] Alternatively, if the menu permissions corresponding to the user ID exist in the second database, after retrieving the menu permissions corresponding to the user ID from the second database, the following steps are also included:
[0029] Based on the menu permissions corresponding to the user ID, obtain the second local cache update instruction;
[0030] According to the second local cache update instruction, the menu permissions corresponding to the user ID obtained through the second database are stored in the local cache.
[0031] By adopting the above technical solution, using the first local cache update instruction or the second local cache update instruction, the corresponding menu permissions for users who do not have corresponding menu permissions in the local cache are stored in the local cache, so that the webpage login speed can be optimized when the current user logs in to the webpage next time.
[0032] In a preferred example, this application can be further configured as follows:
[0033] Before obtaining user login information, it also includes:
[0034] Retrieve local cache periodic update instructions;
[0035] According to the local cache periodic update instruction, all updated user information and menu permissions in the first or second database are stored in the local cache.
[0036] By adopting the above technical solution, the inability of users to directly query and obtain corresponding menu permissions from the local cache during login is avoided due to the local cache not being able to obtain updated user data. However, obtaining the corresponding menu permissions from the first database takes longer than obtaining them directly from the local cache. Therefore, based on the preset update time, all updated user data from the second database is stored in the local cache to improve the speed of obtaining menu permissions in the future.
[0037] In a preferred example, this application can be further configured as follows:
[0038] The business system login method also includes:
[0039] If the menu permissions corresponding to the user ID do not exist in the local cache, then obtain the user update request, which includes the new menu permissions requested by the user.
[0040] Obtain the review result corresponding to the user's update application; if the review result is approved, write the user ID and the new menu permission corresponding to the user ID into the local cache.
[0041] By adopting the above technical solution and providing a method for users to obtain new menu permissions, the login process of the business system in this application is made more user-friendly.
[0042] In a preferred example, this application can be further configured as follows:
[0043] Retrieve the review results for the user's update application, including:
[0044] Based on the user's update request, obtain the user type corresponding to the user ID. The user type includes user, administrator, or technical personnel.
[0045] Based on the user type, retrieve the corresponding review result from the preset user type and review result correspondence.
[0046] By adopting the above technical solution, the user ID is used to obtain the user type corresponding to the user ID through matching; then, the menu permissions corresponding to the user's pre-stored type in the local cache are compared with the new menu permissions applied for by the user to determine whether the review is approved. By making the review process online, the time spent on manual review is avoided, thereby improving the speed of obtaining menu permissions.
[0047] Secondly, this application provides a business system login device, which adopts the following technical solution:
[0048] A business system login device, comprising,
[0049] The user login information acquisition module is used to acquire user login information;
[0050] The user information acquisition module is used to acquire user information based on user login information;
[0051] The menu permission determination module is used to determine whether the menu permission corresponding to the user ID exists in the local cache based on the user ID; when the menu permission corresponding to the user ID exists in the local cache, the menu permission acquisition module is triggered.
[0052] The menu permission acquisition module is used to acquire the menu permissions corresponding to the user ID, and log in to the business system based on the user's specific information and the menu permissions corresponding to the user ID.
[0053] Thirdly, this application provides an electronic device that adopts the following technical solution:
[0054] At least one processor;
[0055] Memory;
[0056] At least one application, wherein the at least one application is stored in memory and configured to be executed by at least one processor, the at least one application being configured to: perform the method described above.
[0057] Fourthly, this application provides a computer-readable storage medium, which adopts the following technical solution:
[0058] A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method described above.
[0059] In summary, this application includes at least one of the following beneficial technical effects:
[0060] 1. After obtaining user login information, the system retrieves the current user's information based on that login information. Upon obtaining the user ID from the user information, instead of utilizing the database containing all data from the business system, it directly uses a faster local cache to obtain the menu permissions corresponding to the user ID, thus shortening the time required to obtain menu permissions. Based on the specific user information and the obtained menu permissions, the system logs into the business system. Therefore, by using a local cache, the time required to obtain menu permissions is shortened, improving the login speed of the business system and thus optimizing the user experience.
[0061] 2. Obtain menu permissions corresponding to user IDs through local cache, the first database, or the second database. The query order of each database is local cache, first database, and second database. The first database provides more data from the server to the local cache, and the second database provides data support to the first database to ensure that menu permissions can be obtained quickly and effectively.
[0062] 3. Utilize multi-threading to simultaneously acquire sub-menu permissions for sub-pages, thereby shortening the time required to acquire menu permissions. Attached Figure Description
[0063] Figure 1 This is a flowchart illustrating a business system login method provided in an embodiment of this application.
[0064] Figure 2 This is a flowchart illustrating a method for obtaining submenu permissions provided in an embodiment of this application.
[0065] Figure 3 This is a schematic diagram of a web page login device provided in an embodiment of this application.
[0066] Figure 4 This is a schematic diagram of the structure of an electronic device provided in the embodiments of this application. Detailed Implementation
[0067] The present application will be further described in detail below with reference to the accompanying drawings.
[0068] This specific embodiment is merely an explanation of this application and is not intended to limit it. After reading this specification, those skilled in the art can make modifications to this embodiment without contributing any inventive step, but such modifications are protected by patent law as long as they fall within the scope of the claims of this application.
[0069] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0070] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0071] Specifically, a business system refers to an online management platform for various business operations within an enterprise. This platform can coordinate and manage some or all of the enterprise's internal business operations, as well as some or all of its external business operations. The user group of a business system may include various roles, and the corresponding operation pages differ depending on the role. These roles can include administrative staff, operations staff, technical staff, financial staff, customers, etc. Even users with the same role may have different access permissions to the corresponding internal business operations at different job levels, potentially resulting in different operation pages within the business system. Therefore, different users can be assigned permission information corresponding to their roles and job levels to ensure that users can correctly access the operation pages. Permission information represents the user's authority to access different operation pages.
[0072] Generally, the process of obtaining permission information during the login process of a business system is relatively complex and time-consuming. Therefore, the long time required to obtain permission information results in a slow login speed for the business system, leading to a poor user experience.
[0073] Therefore, the inventors discovered that by obtaining user login information, corresponding user information can be retrieved; based on the user ID in the user information, it can be determined whether the menu permissions corresponding to the user ID exist in the local cache of the local server; if the menu permissions corresponding to the user ID exist in the local cache, then the menu permissions corresponding to the user ID are retrieved, and the user logs into the business system based on the specific user information and the menu permissions corresponding to the user ID, thereby improving the efficiency of permission retrieval and thus improving the efficiency of business system login. Here, the menu permissions corresponding to the user ID represent the user's permission information for the webpage, and the local cache can include several pre-stored menu permissions for the user.
[0074] Specifically, this application provides a business system login method executed by an electronic device, which can be a server or a terminal device. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smartphone, tablet, laptop, desktop computer, etc., but is not limited to these. The terminal device and the server can be directly or indirectly connected via wired or wireless communication. This application does not impose any limitations on this connection. Figure 1 As shown, the method includes steps S101, S102, S103, and S104, wherein:
[0075] Step S101: Obtain user login information.
[0076] User login information may include the user's account and corresponding password.
[0077] In this embodiment, the process of obtaining user login information may include: upon detecting that a user has triggered a click to enter the business system website, obtaining a login page display request; displaying a first login page according to the login page display request, the first login page including multiple login methods for logging into the business system website, including: account password login, QR code login, fingerprint login, and voiceprint login; obtaining the user's selection information for the selected login method, and displaying the corresponding second login page according to the selection information; and obtaining the user login information after the user performs a corresponding operation according to the second login page. Business system login typically relies primarily on account password login. This embodiment employs a method where multiple account password input methods coexist to avoid situations where the current input method is unusable when the user logs in using only one input method.
[0078] Step S102: Obtain user information based on user login information.
[0079] The user information includes: a user ID and specific user information. Specific user information represents information generated during the user's historical use of the business system. The user ID is unique. Specific user information is historical information generated during the user's previous use of the business system, and may include at least basic user information and historical browsing data. Basic user information may include user registration information and basic user profile information. User registration information can be the relevant information filled in during user registration, and basic user profile information can be personal information supplemented by the user when using the business system.
[0080] In this embodiment of the application, based on the user login information, it is determined whether the user login information matches the preset user login information; if the match fails, it is determined that the user login information is incorrect, and the user login information is repeatedly obtained until the match is successful; if the match is successful, it is determined that the user login information is correct; based on the user login information, user information is obtained.
[0081] Furthermore, to enhance the security of user information, the process of obtaining user information based on user login information may include: obtaining a temporary authorization code based on the user login information, wherein the temporary authorization code is randomly generated and unique, has an expiration time, and can only be used once; and obtaining user information based on the temporary authorization code. In this embodiment, when obtaining user information corresponding to the current user based on user login information, user information is not obtained directly through user login information, but rather through a temporary authorization code, which improves the security of user information to a certain extent.
[0082] Step S103: Based on the user ID, determine whether the menu permission corresponding to the user ID exists in the local cache.
[0083] The local cache stores multiple user-pre-stored menu permissions. In the user-pre-stored menu permissions, there is a one-to-one correspondence between the user-pre-stored ID and the corresponding menu permission. The menu permissions represent the user's permission information for the business system.
[0084] Generally, menu permissions are retrieved from cloud or offline databases, but this process is time-consuming. Local caching offers faster query and retrieval speeds. Therefore, in this embodiment, to improve retrieval efficiency, menu permissions corresponding to the user ID can be retrieved from the local cache. This allows for faster feedback of the current user's menu permissions, thereby improving webpage login speed and further enhancing the user experience.
[0085] In this embodiment of the application, the user ID in the user information is matched with all the pre-stored user IDs in the local cache to obtain the matching result. If the matching result is successful, it is determined that the menu permission corresponding to the user ID exists in the local cache; otherwise, it is determined that the menu permission corresponding to the user ID does not exist in the local cache.
[0086] Step S104: If it exists, obtain the menu permissions corresponding to the user ID, and log in to the business system according to the user's specific information and the menu permissions corresponding to the user ID.
[0087] In the embodiments of this application, if such an embodiment exists, the specific content of the menu permission corresponding to the user's pre-stored ID is obtained based on the user's pre-stored ID that successfully matches the user ID, and the specific content of the menu permission corresponding to the user's pre-stored ID is used as the menu permission corresponding to the user ID to complete the acquisition of the menu permission corresponding to the user ID. The menu permission corresponding to the user ID represents the current user's permission information for the webpage.
[0088] Specifically, based on the user's specific information and the menu permissions corresponding to the user ID, the process of logging into the business system may include: obtaining the business system page template corresponding to the menu permissions based on the user ID; filling the business system page template with the user's specific information as the content to be filled in, obtaining and displaying the business system page to complete the business system login; wherein, the business system page can represent the page that the user enters after successfully logging into the current business system, the business system page template can represent the outline of the menu of the business system page, and the content to be filled in the business system page template can represent the specific content of each branch of the menu outline of the business system page.
[0089] For example, if user A is included in the business system page template, and the personal information and call center work information are included in the business system page template, the content to be filled in the personal information and call center work information sections can be: A's basic user information and A's work information, respectively; where the user's specific information can include at least the user's basic information and the user's work information.
[0090] In this embodiment, after obtaining user login information, the user information of the current user is retrieved based on the login information. After obtaining the user ID from the user information, instead of using the database containing all data of the business system, a local cache with faster query speed is directly used to obtain the menu permissions corresponding to the user ID, shortening the time for obtaining menu permissions. Based on the specific user information in the user information and the obtained menu permissions, the user logs into the business system. It is evident that by using a local cache, the time for obtaining menu permissions is shortened, the login speed of the business system is improved, thereby optimizing the user experience.
[0091] Furthermore, based on the user ID, determining the situation where the menu permission corresponding to the user ID does not exist in the local cache can include: the menu permission corresponding to the user ID exists in the local cache, but due to an error in the login process, the menu permission corresponding to the user ID was not obtained during the matching process between the user ID and the user's preset ID; or, the menu permission corresponding to the user ID does not exist in the local cache.
[0092] Furthermore, when the menu permissions corresponding to a user ID are not present in the local cache, the solution may include: obtaining the menu permissions corresponding to the user ID based on a first database or a second database; or obtaining the menu permissions corresponding to the user ID based on both the first and second databases; or obtaining the menu permissions corresponding to the user ID through repeated login; or determining to stop logging into the business system. The user's intention to obtain menu permissions may include obtaining new menu permissions and logging into the business system, or abandoning the login. The first database is a cloud disk-based database; the second database is a hard disk-based database. Both the first and second databases contain multiple pre-stored menu permissions for server users.
[0093] In this embodiment, the first database can be a cloud disk-based database, supporting data synchronization between several servers. The data stored in this database is time-sensitive; data automatically expires after a preset storage time. The second database can be a hard disk-based database, where the validity of stored data is independent of time. In addition to supporting data synchronization between several servers, it can also provide a fallback mechanism for data invalidation in the first database. Both the first and second databases can include at least multiple pre-stored menu permissions for each user. For each user, the pre-stored menu permissions can include a user's pre-stored ID and the specific content of the corresponding menu permission. Furthermore, the first database can be Redis or other databases. Other databases must at least satisfy the conditions of being a cloud disk-based database and supporting data synchronization between several servers; other conditions are not specifically limited in this embodiment. Therefore, in one possible implementation of this application embodiment, after the menu permission corresponding to the user ID is not found in the local cache, steps S101 to S103 can be repeatedly executed until the menu permission corresponding to the user ID is found in the local cache within a preset number of repetitions, wherein the preset number of repetitions can be customized by the user; or, after the menu permission corresponding to the user ID is not found in the local cache, login to the business system can be refused.
[0094] In another possible implementation of this application embodiment, if the menu permissions corresponding to a user ID are not found in the local cache, the menu permissions can be obtained through a first database or a second database. Specifically, this can include: if the menu permissions corresponding to a user ID are not found in the local cache, determining whether the menu permissions corresponding to the user ID exist in both the first and second databases based on the user ID; if they exist, obtaining the corresponding menu permissions from the first or second database. It is understood that the menu permissions in the local cache at least include the menu permissions of users within the local server. When users from other servers log in to the local server, there may be situations where the menu permissions of users from other servers cannot be obtained. Therefore, the menu permissions corresponding to the user can be obtained through a first database or a second database that supports data synchronization across multiple servers. However, the data retrieval speed of the local cache is greater than the data retrieval speed of the first and second databases. Therefore, when the menu permissions corresponding to the user cannot be obtained from the local cache, the menu permissions corresponding to the user can be obtained using the first or second database.
[0095] In another possible implementation of this application embodiment, if the menu permission corresponding to the user ID does not exist in the local cache, the menu permission corresponding to the user ID can be obtained through the first database and the second database. Specifically, it can include: if the menu permission corresponding to the user ID does not exist in the local cache, then based on the user ID, simultaneously determine whether the menu permission corresponding to the user ID exists in both the first database and the second database; if both exist, then obtain the corresponding first menu permission and second menu permission from the first database and the second database respectively; by comparing the latest update time of the first menu permission and the second menu permission, the latest menu permission among the two latest update times is taken as the menu permission corresponding to the user ID.
[0096] In this embodiment, the user ID is unique in the local cache, the first database, and the second database. Both the first and second databases include data from multiple servers, and the multiple servers in the first and second databases are identical. Regarding the matching process between the user ID and the pre-stored user ID across the multiple servers in the first or second database, one possible implementation is to match the user ID sequentially with the pre-stored user ID in each of the multiple servers in the first or second database. Another possible implementation is to introduce multiple threads, each corresponding to a specific server. In each thread, the user ID is matched with the pre-stored user ID in only one server, and the pre-stored user ID in each server participates in the matching process only once. This embodiment does not specifically limit the matching method between the user ID and the pre-stored user ID.
[0097] In another possible implementation of this application embodiment, if the menu permission corresponding to the user ID does not exist in the local cache, the menu permission corresponding to the user ID can be obtained through a first database or a second database. Specifically, this can include: if the menu permission corresponding to the user ID does not exist in the local cache, then based on the user ID, determine whether the menu permission corresponding to the user ID exists in the first database; if the menu permission corresponding to the user ID exists in the first database, then obtain the menu permission corresponding to the user ID from the first database; if the menu permission corresponding to the user ID does not exist in the first database, then based on the user ID, determine whether the menu permission corresponding to the user ID exists in the second database; if the menu permission corresponding to the user ID exists in the second database, then obtain the menu permission corresponding to the user ID from the second database.
[0098] In this embodiment of the application, if the menu permission corresponding to the user ID cannot be obtained from the local cache, the user ID in the user information is matched with all pre-stored user IDs in the first database to obtain the matching result. If the matching result in the first database is successful, the specific content of the menu permission corresponding to the user pre-stored ID is obtained based on the first database and the user pre-stored ID that successfully matches the user ID, and the specific content of the menu permission corresponding to the user pre-stored ID is used as the menu permission corresponding to the user ID. If the matching result in the first database is empty, the user ID in the user information is matched with all pre-stored user IDs in the second database to obtain the matching result. If the matching result in the second database is successful, the specific content of the menu permission corresponding to the user pre-stored ID is obtained based on the second database and the user pre-stored ID that successfully matches the user ID, and the specific content of the menu permission corresponding to the user pre-stored ID is used as the menu permission corresponding to the user ID.
[0099] Furthermore, if the matching result of the second database is empty, a temporary authorization code is regenerated based on the user login information, and the corresponding user information is obtained based on the temporary authorization code until the user ID in the user information matches the user pre-stored ID in the local cache.
[0100] In this embodiment, since the local cache can only retrieve data from the local server, it may be unable to retrieve user data from other servers at the same level as the local server. Therefore, a corresponding database capable of supporting data synchronization between servers at the same level can be added, namely the first database. However, databases capable of supporting data synchronization between servers at the same level are generally implemented as online cloud databases. Although the first database has a faster data query speed, the data stored in the first database has a time limit. If the data storage time exceeds the preset storage time of the first database, the data will automatically expire. Therefore, to avoid the situation where the first database cannot provide data in a timely manner due to its time limit, a second database with hard disk storage is added. Although the data query speed of the second database is slower than that of the first database, the data stored in the second database will not disappear over time and can be used as a backup database for the first database. The user data can include at least user information and menu permissions corresponding to user IDs.
[0101] As can be seen, in this embodiment of the application, menu permissions corresponding to user IDs are obtained through local cache, a first database, or a second database. The query order of each database is local cache, first database, and second database. The first database provides more data from the server for local cache, and the second database provides data protection for the first database, ensuring that menu permissions can be obtained quickly and effectively.
[0102] In one possible implementation of this application embodiment, the business system login method may further include:
[0103] If the menu permissions corresponding to the user ID do not exist in the local cache, retrieve the user update request, which includes the new menu permissions requested by the user; retrieve the review result corresponding to the user update request; if the review result is approved, write the user ID and the new menu permissions corresponding to the user ID to the local cache.
[0104] In one possible scenario, the electronic device only has a local cache. If the menu permission corresponding to the user ID is not found in the local cache, then a user update request is obtained.
[0105] In another possible scenario, the electronic device is equipped with only a local cache and a database, wherein the database includes a first database and / or a second database. If the menu permission corresponding to the user ID does not exist in the local cache, a user update request is obtained. This can include obtaining a user update request if the menu permission corresponding to the user ID does not exist in the local cache and does not exist in the database.
[0106] In this embodiment of the application, when the menu permission corresponding to the user ID does not exist in the local cache, a prompt message is displayed on the display interface; when the user triggers the update button, the user's update request for the new menu permission is obtained; then the user update request is reviewed to obtain the review result. Only when the review result is approved is the corresponding information in the local cache updated, and then the user can log in to the business system again.
[0107] In this embodiment of the application, by providing a method for users to obtain new menu permissions, the login process of the business system of this application is made more user-friendly.
[0108] One possible implementation of this application embodiment is to obtain the review result corresponding to the user update application, which may specifically include: obtaining the user type corresponding to the user ID based on the user update application, wherein the user update application includes the new menu permission requested by the user; and obtaining the review result corresponding to the user update application using local caching based on the user type and the user update application.
[0109] In this embodiment of the application, based on the user ID and the user type information pre-stored in the local cache, the user type corresponding to the user pre-stored ID that matches the user ID is obtained through matching, and is used as the user type corresponding to the user ID. The user type may include a user, an administrator, or a technician. In the pre-stored user type information, the user pre-stored ID and the user pre-stored type correspond one-to-one. Then, the menu permissions allowed by the user type can be obtained according to the user type. The menu permissions allowed by the user type are compared with the new menu permissions applied for by the user. If the comparison results are the same, the review result is approved; if the comparison results are different, the review result is not approved.
[0110] In this embodiment, the user ID is used to obtain the user type corresponding to the user ID by matching; then, the menu permissions corresponding to the user's pre-stored type in the local cache are compared with the new menu permissions applied for by the user to determine whether the review is approved. By making the review process online, the time spent on manual review is avoided, thereby improving the speed of obtaining menu permissions.
[0111] One possible implementation of this application embodiment, step S103, is as follows: Figure 2 As shown, it may specifically include steps S1031, S1032, and S1033, wherein:
[0112] Step S1031: Determine the list of sub-pages corresponding to the user ID based on the user ID, wherein the list of sub-pages includes information on multiple sub-pages.
[0113] The sub-page list includes information on several sub-pages. The correspondence between business systems and menu permissions can be as follows: After successful login to the business system, the business system operation page can include the main page, which can include several sub-pages. The main page has main menu permissions, and the sub-pages have sub-menu permissions.
[0114] In this embodiment of the application, a list of sub-pages corresponding to user pre-stored IDs is obtained, and the list of sub-pages corresponding to user pre-stored IDs is used as the list of sub-pages corresponding to user IDs to complete the acquisition of the list of sub-pages corresponding to user IDs.
[0115] Step S1032: Extract the subpage menu permissions corresponding to each of the multiple subpages from the local cache using multithreading.
[0116] The embodiments of this application can efficiently obtain the sub-menu permissions corresponding to the sub-pages from the local cache through multiple threads based on the information of multiple sub-pages in the sub-page list, thereby avoiding the problem of duplicate or missed acquisition during the process of obtaining the sub-menu permissions corresponding to the sub-pages.
[0117] Furthermore, the method may also include: obtaining the number of subpages based on the subpage list corresponding to the user ID; automatically setting the maximum number of threads that the thread pool can maintain based on the number of subpages, ensuring that "the maximum number of threads that the thread pool can maintain > the number of submenus"; and using the configured thread pool, simultaneously acquiring the submenu permissions corresponding to each subpage in the subpage list through multiple threads, wherein each thread is in an idle state or acquires only the submenu permissions corresponding to one subpage. In this embodiment, setting the maximum number of threads that the thread pool can maintain based on the number of subpages ensures that there are no waiting tasks in the thread pool, allowing for the simultaneous processing of all submenu permissions corresponding to subpages, thereby reducing waiting time and accelerating the acquisition process. The waiting tasks can be the acquisition process of submenu permissions corresponding to subpages.
[0118] Step S1033: If the sub-page menu permissions corresponding to all sub-page information are extracted, then the menu permissions are determined based on the menu permissions of all sub-pages. The menu permissions corresponding to the user ID include the sub-menu permissions corresponding to each sub-page in the sub-page list corresponding to the user ID.
[0119] Specifically, the menu permissions corresponding to the user ID are obtained by superimposing the sub-menu permissions corresponding to each sub-page in the list of sub-pages corresponding to the user ID. The superposition process can be to put all the menu permissions corresponding to the pages into the same document or other storage locations, as long as the purpose of this application embodiment can be achieved. This application embodiment will not make any specific limitations on this.
[0120] If the menu permissions for each subpage are not retrieved, then menu permissions have not been obtained.
[0121] After obtaining the sub-menu permissions corresponding to each subpage in the list of subpages corresponding to a user ID, directly generating the business system page based on these permissions might result in the business system page being generated by using the subpage's corresponding menu permissions one by one, thus slowing down the retrieval speed of the business system's main page. Therefore, the sub-menu permissions corresponding to each subpage in the list of subpages corresponding to a user ID are merged into a single user ID-corresponding menu permission. Compared to related technologies that sequentially obtain the sub-menu permissions corresponding to subpages under the business system's main page, this application embodiment utilizes multi-threading to simultaneously obtain the menu permissions corresponding to all subpages under the main page. After merging the obtained sub-menu permissions corresponding to all subpages, the user ID-corresponding menu permission can be obtained, which is the menu permission for the current user's corresponding business system main page. It is evident that by simultaneously obtaining the subpage's corresponding sub-menu permissions using multi-threading, the time for obtaining menu permissions is shortened.
[0122] One possible implementation of this application embodiment, after obtaining the menu permissions corresponding to the user ID from the first database if the first database contains such permissions, may further include:
[0123] Based on the menu permissions corresponding to the user ID, obtain the first local cache update instruction;
[0124] In this embodiment of the application, the menu permissions corresponding to the user ID obtained through the first database are stored in the local cache. The process of storing the menu permissions corresponding to the user ID obtained through the first database in the local cache may specifically include: obtaining the corresponding storage address of the user ID-related data in the local cache according to the user ID; and placing the menu permissions corresponding to the user ID into the corresponding address in the local cache as the pre-stored menu permissions for the user, in preparation for the next retrieval of the corresponding menu permissions for the user.
[0125] One possible implementation of this application embodiment, after obtaining the menu permissions corresponding to the user ID from the second database if the second database contains such permissions, may further include:
[0126] Based on the menu permissions corresponding to the user ID, obtain the second local cache update instruction, where;
[0127] The second local cache update instruction is used to store the menu permissions corresponding to the user ID obtained through the second database into the local cache.
[0128] The process of storing the menu permissions corresponding to the user ID obtained through the second database into the local cache may specifically include: obtaining the corresponding storage address of the user ID-related data in the local cache based on the user ID; and placing the menu permissions corresponding to the user ID into the corresponding address in the local cache as the pre-stored menu permissions for the user, in preparation for the next retrieval of the corresponding menu permissions for the user.
[0129] To prevent the corresponding menu permissions from still not being available in the local cache when the current user logs in to the webpage again, the corresponding menu permissions obtained by the current user from the first database or the second database are stored in the local cache for the current user's next login to the webpage. The current user can be a user whose corresponding menu permissions are not available in the local cache.
[0130] In this embodiment of the application, a first local cache update instruction or a second local cache update instruction is used to store the corresponding menu permissions for users who do not have corresponding menu permissions in the local cache, so that the webpage login speed can be optimized when the current user logs in to the webpage next time.
[0131] One possible implementation of this application embodiment may further include the following before step S101:
[0132] Obtain the local cache periodic update instruction; wherein, according to the local cache periodic update instruction, all user information and menu permissions that have been updated in the first database or the second database are stored in the local cache.
[0133] The period for the periodic update command can be set according to the user's actual needs or can be customized.
[0134] It is worth noting that if a user updates their basic information outside the local server, the user data will be updated in the first database; if a technician adds or removes menu permissions for a user on the management side, the user data will be updated in the first database. The user data can include at least user information and menu permissions corresponding to the user ID. The user information can include at least the user ID and user basic information. The user basic information can be specifically defined in step S102.
[0135] In this embodiment of the application, storing all updated user information and menu permissions in the first database or the second database into a local cache can specifically include: obtaining a preset update time, wherein the preset time can represent the frequency at which the local cache obtains all updated user data in the first database or the second database when no user logs into the webpage; obtaining the most recent user login time and the current time; comparing the time difference between the most recent user login time and the current time with the preset update time; if it is less than the preset update time, the data in the local cache remains unchanged; if it is greater than or equal to the preset update time, then, using the preset update time as the frequency for updating data in the local cache, obtaining all user data corresponding to users whose user data in the first database or the second database has been updated, and replacing the corresponding user data in the local cache with the updated user data in the first database or the second database to obtain the updated user data of the corresponding user, thereby completing the data update in the local cache.
[0136] Generally, for user data that has been updated, updates can be made in both the first and second databases. User data can include at least user information and menu permissions corresponding to the user ID. In this case, since the local cache cannot retrieve the updated user data, users may not be able to directly query and obtain the corresponding menu permissions from the local cache when logging in, and instead have to retrieve them from the first database, resulting in a longer time for obtaining the corresponding menu permissions. Therefore, according to the preset update time, all updated user data in the second database is stored in the local cache to improve the speed of obtaining menu permissions in the future.
[0137] In addition, obtaining menu permissions generally includes two scenarios: business system refresh or business system login. For business system login, the menu permissions corresponding to the user ID can be obtained using the business system login method in this application embodiment. For business system refresh, it can be a refresh operation after the user successfully accesses the corresponding business system page. It is understood that the process of obtaining menu permissions is the same during webpage refresh and user login.
[0138] The above embodiments describe a business system login method from the perspective of process flow. The following embodiments describe a business system login device from the perspective of virtual module or virtual unit. For details, please refer to the following embodiments.
[0139] This application provides a business system login device, such as... Figure 3 As shown, the login device for this business system may specifically include:
[0140] User login information acquisition module 301 is used to acquire user login information;
[0141] User information acquisition module 302 is used to acquire user information based on user login information;
[0142] The menu permission judgment module 303 is used to determine whether the menu permission corresponding to the user ID exists in the local cache based on the user ID; when the menu permission corresponding to the user ID exists in the local cache, the menu permission acquisition module is triggered.
[0143] The menu permission acquisition module 304 is used to obtain the menu permissions corresponding to the user ID, and log in to the business system based on the user's specific information and the menu permissions corresponding to the user ID.
[0144] In this embodiment, after obtaining user login information, the user information of the current user is retrieved based on the login information. After obtaining the user ID from the user information, instead of using the database containing all data of the business system, a local cache with faster query speed is directly used to obtain the menu permissions corresponding to the user ID, shortening the time for obtaining menu permissions. Based on the specific user information in the user information and the obtained menu permissions, the user logs into the business system. It is evident that by using a local cache, the time for obtaining menu permissions is shortened, the login speed of the business system is improved, thereby optimizing the user experience.
[0145] In one possible implementation of this application embodiment, when the user information acquisition module 302 performs the function of determining whether the menu permission corresponding to the user ID exists in the local cache based on the user ID, it is specifically used for:
[0146] Based on the user ID, determine the list of subpages corresponding to the user ID, where the list of subpages includes information on multiple subpages;
[0147] Extract subpage menu permissions corresponding to each of the multiple subpages from the local cache using multithreading.
[0148] If the menu permissions corresponding to each of the subpages are extracted, then the menu permissions are determined based on the menu permissions of all the subpages.
[0149] One possible implementation of this application embodiment is a business system login device, which further includes a first acquisition module and a second acquisition module, specifically used for:
[0150] The first retrieval module is triggered when the menu permission corresponding to the user ID does not exist in the local cache.
[0151] The first acquisition module is used to determine whether the menu permission corresponding to the user ID exists in the first database based on the user ID; when the menu permission corresponding to the user ID exists in the first database, the second acquisition module is triggered; when the menu permission corresponding to the user ID does not exist in the first database, the second acquisition module is triggered.
[0152] The second acquisition module is used to determine whether the menu permission corresponding to the user ID exists in the second database based on the user ID; when the menu permission corresponding to the user ID exists in the second database, the menu permission corresponding to the user ID is retrieved from the second database.
[0153] The first database is a cloud disk-based database; the second database is a hard disk-based database. Both the first and second databases include menu permissions pre-stored by multiple server users.
[0154] One possible implementation of this application embodiment is that the business system login device further includes a local cache update module, specifically used for:
[0155] Based on the menu permissions corresponding to the user ID, obtain the first local cache update instruction;
[0156] According to the first local cache update instruction, the menu permissions corresponding to the user ID obtained from the first database will be stored in the local cache;
[0157] If the menu permissions corresponding to the user ID exist in the second database, after retrieving the menu permissions corresponding to the user ID from the second database, the process also includes:
[0158] Based on the menu permissions corresponding to the user ID, obtain the second local cache update instruction;
[0159] According to the second local cache update instruction, the menu permissions corresponding to the user ID obtained through the second database are stored in the local cache.
[0160] One possible implementation of this application embodiment is that the business system login device further includes a local cache periodic update module, used for:
[0161] Retrieve local cache periodic update instructions;
[0162] According to the local cache periodic update instruction, all updated user information and menu permissions in the first or second database are stored in the local cache.
[0163] One possible implementation of this application embodiment is that the business system login device further includes an audit module, used for:
[0164] If the menu permissions corresponding to the user ID do not exist in the local cache, then obtain the user update request, which includes the new menu permissions requested by the user.
[0165] Retrieve the review result of the user's update application; if the review result is approved, write the user ID and the new menu permissions corresponding to the user ID to the local cache.
[0166] In one possible implementation of this application embodiment, when the review module retrieves the review result corresponding to the user's update application, it is used to:
[0167] Based on the user's update request, obtain the user type corresponding to the user ID. The user type includes user, administrator, or technical personnel.
[0168] Based on the user type, retrieve the corresponding review result from the preset user type and review result correspondence.
[0169] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the business system login device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0170] This application provides an electronic device, such as... Figure 4 As shown, Figure 4 The illustrated electronic device includes a processor 401 and a memory 403. The processor 401 and the memory 403 are connected, for example, via a bus 402. Optionally, the electronic device may also include a transceiver 404. It should be noted that in practical applications, the transceiver 404 is not limited to one type, and the structure of this electronic device does not constitute a limitation on the embodiments of this application.
[0171] Processor 401 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 401 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0172] Bus 402 may include a pathway for transmitting information between the aforementioned components. Bus 402 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 402 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0173] The memory 403 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0174] The memory 403 is used to store application code that executes the solution of this application, and its execution is controlled by the processor 401. The processor 401 is used to execute the application code stored in the memory 403 to implement the content shown in the foregoing method embodiments.
[0175] Electronic devices include, but are not limited to: mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (such as in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Servers can also be included. Figure 4 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0176] This application provides a computer-readable storage medium storing a computer program. When the program is run on a computer, it enables the computer to execute the corresponding content in the aforementioned method embodiments. Compared with related technologies, this application, after obtaining user login information, retrieves the current user's user information based on the login information. After obtaining the user ID from the user information, instead of using a database containing all data of the business system, it directly utilizes a local cache with faster query speed to obtain the menu permissions corresponding to the user ID, thus shortening the time for obtaining menu permissions. Based on the specific user information in the user information and the obtained menu permissions, the user logs into the business system. Therefore, by using a local cache, the time for obtaining menu permissions is shortened, the login speed of the business system is improved, and the user experience is optimized.
[0177] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0178] The above are only some embodiments of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for logging into a business system, characterized in that, include: Obtain user login information; Based on user login information, obtain user information, wherein the user information includes user ID and user specific information, and the user specific information represents information generated when the user used the business system in the past; Based on the user ID, determine whether there is a menu permission corresponding to the user ID in the local cache. The menu permission corresponding to the user ID represents the user's permission information for the business system. The local cache stores several pre-stored menu permissions corresponding to user IDs. If it exists, obtain the menu permissions corresponding to the user ID, and log in to the business system based on the user's specific information and the menu permissions corresponding to the user ID; The process of obtaining user login information includes: upon detecting that a user has triggered a click to enter the business system website, obtaining a login page display request; displaying a first login page according to the login page display request, the first login page including multiple login methods for logging into the business system website, including: account password login, QR code login, fingerprint login, and voiceprint login; obtaining the user's selection information for the selected login method, and displaying a corresponding second login page according to the selection information; and obtaining user login information after the user performs a corresponding operation according to the second login page. The step of logging into the business system based on the user's specific information and the menu permissions corresponding to the user ID includes: obtaining the business system page template corresponding to the menu permissions corresponding to the user ID; filling the business system page template with the user's specific information as the filling content corresponding to the user ID, obtaining and displaying the business system page to complete the business system login; The method further includes: If the menu permission corresponding to the user ID does not exist in the local cache, then based on the user ID, determine whether the menu permission corresponding to the user ID exists in the first database; if the menu permission corresponding to the user ID exists in the first database, then retrieve the menu permission corresponding to the user ID from the first database. If the menu permission corresponding to the user ID does not exist in the first database, then determine whether the menu permission corresponding to the user ID exists in the second database based on the user ID; if the menu permission corresponding to the user ID exists in the second database, then retrieve the menu permission corresponding to the user ID from the second database. The first database is a cloud disk-based database; the second database is a hard disk-based database. Both the first and second databases include menu permissions pre-stored by multiple server users.
2. The business system login method according to claim 1, characterized in that, The step of determining whether the menu permission corresponding to the user ID exists in the local cache based on the user ID includes: Based on the user ID, determine the list of sub-pages corresponding to the user ID, wherein the list of sub-pages includes information on multiple sub-pages; Extract subpage menu permissions corresponding to each of the multiple subpages from the local cache using multithreading. If the subpage menu permissions corresponding to all subpage information are extracted, then the menu permissions are determined based on the menu permissions of all subpages.
3. The business system login method according to claim 1, characterized in that, If the menu permissions corresponding to the user ID exist in the first database, after retrieving the menu permissions corresponding to the user ID from the first database, the process also includes: Based on the menu permissions corresponding to the user ID, obtain the first local cache update instruction; According to the first local cache update instruction, the menu permissions corresponding to the user ID obtained through the first database are stored in the local cache; Alternatively, if the menu permissions corresponding to the user ID exist in the second database, after retrieving the menu permissions corresponding to the user ID from the second database, the following steps are also included: Based on the menu permissions corresponding to the user ID, obtain the second local cache update instruction; According to the second local cache update instruction, the menu permissions corresponding to the user ID obtained through the second database are stored in the local cache.
4. The business system login method according to claim 1, characterized in that, Before obtaining user login information, it also includes: Retrieve local cache periodic update instructions; According to the local cache periodic update instruction, all updated user information and menu permissions in the first or second database are stored in the local cache.
5. The business system login method according to claim 1, characterized in that, The business system login method also includes: If the menu permissions corresponding to the user ID do not exist in the local cache, then obtain the user update request, which includes the new menu permissions requested by the user. Obtain the review result corresponding to the user's update application; if the review result is approved, write the user ID and the new menu permission corresponding to the user ID into the local cache.
6. The business system login method according to claim 5, characterized in that, Retrieve the review results for the user's update application, including: Based on the user's update request, obtain the user type corresponding to the user ID. The user type includes user, administrator, or technical personnel. Based on the user type, retrieve the corresponding review result from the preset user type and review result correspondence.
7. A business system login device, characterized in that, include: The user login information acquisition module is used to acquire user login information; The user information acquisition module is used to acquire user information based on user login information. The user information includes user ID and user specific information, and the user specific information represents information generated when the user used the business system in the past. The menu permission determination module is used to determine whether the menu permission corresponding to the user ID exists in the local cache based on the user ID; when the menu permission corresponding to the user ID exists in the local cache, the menu permission acquisition module is triggered. The menu permission acquisition module is used to acquire the menu permissions corresponding to the user ID, and log in to the business system based on the user's specific information and the menu permissions corresponding to the user ID; The user login information acquisition module, when performing the acquisition of user login information, is specifically used for: when detecting that a user triggers a click to enter the business system website, acquiring a login page display request; displaying a first login page according to the login page display request, the first login page including multiple login methods for logging into the business system website, the multiple login methods including: account password login, QR code login, fingerprint login and voiceprint login; acquiring the user's selection information of the selected login method, and displaying the corresponding second login page according to the selection information; acquiring user login information after the user performs a corresponding operation according to the second login page; The menu permission acquisition module, when performing the step of logging into the business system based on the user's specific information and the menu permissions corresponding to the user ID, is specifically used to: obtain the business system page template corresponding to the menu permissions based on the user ID; fill the business system page template with the user's specific information as the filling content corresponding to the user ID, obtain and display the business system page to complete the business system login; The device further includes a first acquisition module and a second acquisition module, wherein the first acquisition module is triggered when the menu permission corresponding to the user ID does not exist in the local cache. The first acquisition module is used to determine whether there is a menu permission corresponding to the user ID in the first database based on the user ID; if there is a menu permission corresponding to the user ID in the first database, then the menu permission corresponding to the user ID is acquired from the first database. When the menu permission corresponding to the user ID does not exist in the first database, the second acquisition module is triggered; The second acquisition module is used to determine whether the menu permission corresponding to the user ID exists in the second database based on the user ID; if the menu permission corresponding to the user ID exists in the second database, the menu permission corresponding to the user ID is acquired from the second database. The first database is a cloud disk-based database; the second database is a hard disk-based database. Both the first and second databases include menu permissions pre-stored by multiple server users.
8. An electronic device, characterized in that, include: At least one processor; Memory; At least one application, wherein the at least one application is stored in memory and configured to be executed by at least one processor, said at least one application being configured to: perform the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed in the computer, the computer is caused to perform the method described in any one of claims 1 to 6.
Citation Information
Patent Citations
Menu page generation method, device and system
CN110119294A
Menu sending method, menu template configuration method, menu display method and device
CN111754304A