Micro-application account login-free method based on web multi-level caching
By deploying a login-free server and a multi-level caching cluster on the enterprise side, the slow response speed and security issues of the login-free method for APP users in large organizations are solved, realizing a fast and secure login-free process for users. It is suitable for scenarios such as enterprise internal systems, government agencies, community products and forums.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-08
- Publication Date
- 2026-03-10
AI Technical Summary
Existing methods for bypassing login for mobile app users suffer from slow response times, poor scalability, and low resource utilization in both internal and external network scenarios. In particular, when deployed in large organizations, traditional web caching systems face performance bottlenecks and stability risks.
The system employs a login-free server to intercept user login requests and queries user login-free information through a multi-level caching cluster, including an nginx caching cluster, a distributed caching cluster, and a Tomcat in-heap caching cluster. Combined with an enterprise authentication login platform and micro-application instant messaging verification, it generates and stores user login-free information to ensure security and rapid response.
It accelerates network response speed, improves network quality, and enhances the security of the login-free process through enterprise-side authentication and multi-level caching storage, avoiding the risk of login information theft. It is suitable for scenarios such as enterprise internal systems, government agencies, community products, and forums.
Smart Images

Figure CN116318841B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a method for eliminating the need for login to micro-application accounts based on multi-level web caching. Background Technology
[0002] With the rapid development of information technology and mobile internet technology, more and more mobile application systems are appearing in people's lives. Typically, before using each of these applications, users must log in with a pre-agreed username and password. This requires users to remember the username and password for each application, which is very inconvenient.
[0003] User login-free refers to the process where, after a user enters a mobile app, the application automatically obtains the current user's identity and uses that identity to log in to the system without requiring the user to enter their username and password. Web caching technology, based on the existing network architecture, utilizes localized transmission methods to optimize network bandwidth usage, improve network service quality, and enhance network availability.
[0004] Single Sign-On (SSO) allows users to access all trusted applications by logging in only once. It includes mechanisms that map this primary login to other applications for the same user. It's a popular solution for enterprise business integration. However, in various enterprise instant messaging application scenarios, it lacks high performance and high security mechanisms based on multiple custom authentication policies.
[0005] Current methods for bypassing app logins do not consider the specific deployment of web caching systems in internal and external network scenarios. However, when applied in large organizations, these systems may contain hundreds or even thousands of apps to provide network services to a large number of users. In such scenarios, traditional web caching system deployment solutions encounter difficulties. Since proxy servers need to store copies of user requests in their own caches, the size of the proxy server's cache storage capacity directly restricts the scalability of the entire system, creating a performance bottleneck. Furthermore, the instability or even failure of the proxy server may affect stability and thus compromise the overall network quality of the internal network. Therefore, existing methods for bypassing app logins suffer from slow response times, poor scalability, and low resource utilization in scenarios with a large number of apps on both internal and external networks. Summary of the Invention
[0006] This application provides a method for eliminating the need for account login in micro-applications based on web caching, addressing issues of account login security and network response speed. The method includes:
[0007] S1, the login-free server intercepts the login request sent by the user client to the web server, and queries the user's login-free information based on the user client account corresponding to the login request; the login request is triggered when the user client logs into the built-in micro-application of the APP or the shared IM connection, and the user's login-free information is generated based on the enterprise authentication login platform and micro-application instant messaging verification on the enterprise side;
[0008] S2, when the login-free server matches the user's login-free information, it directly returns the login-free webpage information to the user's client; when the login-free server does not match the user's login-free information, it forwards the login request to the distributed cache cluster for querying.
[0009] S3, the distributed cache cluster responds to the login request and queries the user's login-free information based on the Web multi-level cache, and returns the user's login-free information to the login-free server when a match is found;
[0010] S4, the login-free server returns the obtained user login-free information to the application and logs into the micro-application.
[0011] Specifically, the login-free server, the enterprise authentication login platform, and the distributed cluster are deployed on the enterprise side, and provide a unified server-side API to access the user side and the web server for the micro-application instant messaging.
[0012] Web multi-level caching is divided into three levels of cache clusters and cache databases. The first level is the application layer nginx cache cluster, the second level is the distributed cache cluster, which includes a master Redis cluster and several slave Redis clusters, and the third level is the application layer cache cluster, which includes Tomcat heap caching.
[0013] Specifically, the nginx cache cluster at the first level proxies the login-free server; the login-free server accesses the nginx cache cluster and queries the user's login-free information based on the user's account. When the user's login-free information is found in the nginx cache cluster, the login-free webpage information is returned directly.
[0014] The login-free webpage information includes micro-application pages or IM link pages. The nginx cache cluster uses nginx's load balancing algorithm to distribute the queries to the target machines in a round-robin fashion, or uses a consistent hash algorithm for querying.
[0015] Specifically, the three-level cache cluster and cache database are cascaded. When a cache miss occurs in the nginx cache cluster, the request is forwarded to the next lower level. S3 includes:
[0016] The distributed cache cluster queries the main Redis cluster and several slave Redis clusters based on the login request; when the distributed cache cluster hits the corresponding user login-free information, it returns it to the login-free server and writes it to the nginx cache cluster.
[0017] If the distributed cache cluster does not find the user's login-free information, it will query the lower-level Tomcat heap cache cluster.
[0018] When the user's login-free information is retrieved from the Tomcat heap cache cluster, it is returned to the login-free server and written to the distributed cache cluster.
[0019] When a query fails from the Tomcat heap cache cluster, a request is made to the cache database to retrieve the user's login-free information, which is then returned to the login-free server and synchronized to the distributed cache cluster.
[0020] Specifically, when a user logs into their micro-application account for the first time, or when a multi-level cache cluster based on web caching does not store the user's login-free information, the process of generating the user's login-free information includes:
[0021] The login-free server performs a login-free interception operation based on the Web cache and requests the micro-application instant messaging login-free code to open the data interface.
[0022] Receive the login-free authorization code token returned by the micro-application instant messaging for login-free operation;
[0023] Based on the login-free authorization code, request the micro-application instant messaging to return instant messaging user information;
[0024] The login-free server obtains the routing page of the micro-application or the IM sharing link from the web server based on the instant messaging user information, and redirects it to the enterprise authentication login platform for verification.
[0025] The enterprise authentication login platform obtains the stored account information and matches and verifies it with the instant messaging user information;
[0026] The account information and the instant messaging user information are integrated and encrypted based on the set security encryption algorithm to generate the user login-free information, and the user login-free information is stored based on a multi-level cache cluster of web cache.
[0027] Specifically, after the application obtains the login-free information, S4 includes:
[0028] The CAS server of the enterprise authentication login platform verifies the current account login status of the APP and obtains account information.
[0029] When the CAS server cannot obtain account information, it returns the CAS redirect address to the user terminal and displays the CAS login page on the user terminal.
[0030] After logging in on the CAS login page, obtain the ticket for logging into the login-free server, retrieve the account information from the CAS server based on the ticket, and save it.
[0031] Log in to the login-free server based on the ticket, and log in to the micro-application based on the login-free information.
[0032] Specifically, when the CAS server obtains the account information, it automatically returns the login-free information to the application and logs into the micro-application.
[0033] Specifically, the micro-applications utilize the login-free JS and standard access provided by the login-free server.
[0034] Specifically, user data is proxied through an enterprise-side proxy server, and the login-free server performs login-free interception operations based on the web cache. After authentication through the enterprise authentication login platform, the user data interacts with the web server.
[0035] The beneficial effects of the technical solution provided in this application include at least the following: by dividing the internal and external networks through a login-free server and a multi-level cache cluster deployed on the enterprise side, the login-free information is stored in the cache cluster. When a user triggers a login request, the login-free server intercepts the login request and then queries the stored login-free information in a distributed manner to log in. The query process is based on the cache cluster architecture of the Web multi-level cache, which can speed up the network response speed of the program and improve network quality. Moreover, since the login-free information is stored on the enterprise side, all login requests are intercepted and verified by the enterprise authentication login platform. After successful verification, the system automatically returns to the micro-application login method, which further enhances the security of the login-free process and effectively avoids the risk of login verification information being stolen. Attached Figure Description
[0036] Figure 1 This is a flowchart of a method for eliminating the login requirement for micro-application accounts based on multi-level web caching, provided in this application;
[0037] Figure 2 This application provides a multi-level caching cluster architecture based on web caching.
[0038] Figure 3 This is a flowchart of the process of generating and storing user login-free information based on a user login request, provided in an embodiment of this application.
[0039] Figure 4 This is a flowchart illustrating the process of generating and storing user login-free information. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0041] In this article, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0042] Figure 1 This is a flowchart of a method for eliminating the need to log in to a micro-application account based on web caching, as provided in this application, including the following steps:
[0043] S1, the login-free server intercepts login requests sent by the client to the web server, and queries the user's login-free information based on the client account corresponding to the login request.
[0044] Considering the diverse instant messaging application scenarios within enterprises, which may involve hundreds or even thousands of app application systems on both internal and external networks, this application addresses issues related to deployment, management, storage, and network quality. Specifically, it sets up a login-free server, a proxy server, and an enterprise authentication login platform for managing the enterprise's internal network on the enterprise side. Furthermore, it provides a unified server-side API for accessing the user end and the web server for micro-application instant messaging.
[0045] User-side data is proxied through an enterprise-side proxy server. A unified login-free interception operation is performed by a login-free server based on web caching technology. After authentication through the enterprise authentication login platform, data interacts with the web server. The enterprise authentication login platform manages internal user terminals, including account login and authentication, account management, and information verification. When a user logs into a built-in mini-application or clicks a shared IM link, a login request is triggered. This request is sent to the mini-application or IM link's web server, but it is first intercepted by the enterprise-side login-free server. The user's login-free information is then retrieved from the corresponding user account. This login-free information is stored in a multi-level cache cluster on the enterprise side (for non-first-time logins) and is generated based on verification by the enterprise authentication login platform and the mini-application's instant messaging.
[0046] User login-free information is based on web caching; therefore, the login-free server also needs to query user login-free information based on web caching technology. In this solution, the web multi-level cache is divided into a three-level cache cluster and cache database. The first level is an application-layer Nginx cache cluster; the second level is a distributed cache cluster, including a master Redis cluster and several slave Redis clusters; and the third level is an application-layer cache cluster, including a Tomcat in-heap cache cluster. For example... Figure 2 As shown, the first-level nginx cache cluster is responsible for proxying the login-free server, that is, the login-free server accesses the nginx cache set and the client account to query the user's login-free information.
[0047] S2: When the login-free server matches the user's login-free information, it directly returns the login-free webpage information to the user's client; when the login-free server does not match the user's login-free information, it forwards the login request to the distributed cache cluster for querying.
[0048] When a user's login-free information is hit in the nginx cache cluster, the login-free webpage information of the micro-application or IM link is returned directly. The nginx cache cluster uses nginx's load balancing algorithm to distribute the information to a specific machine. Round-robin can reduce the load, or a consistent hash algorithm can be used to improve the cache hit rate.
[0049] When the user's login information is not found on the login-free server, the request is forwarded to the next level for querying by the distributed cache cluster.
[0050] S3, a distributed cache cluster, responds to login requests and queries user login-free information based on the Web multi-level cache. If a match is found, the user login-free information is returned to the login-free server.
[0051] Initially, the storage of user login-free information was random or determined based on the cluster status. Therefore, it is necessary to query the distributed cache cluster level by level. This process includes the following steps:
[0052] S31, the distributed cache cluster queries the main Redis cluster and several slave Redis clusters based on the login request; when the distributed cache cluster hits the corresponding user login-free information, it returns it to the login-free server and writes it to the nginx cache cluster.
[0053] S32, when the distributed cache cluster does not find the user's login information, it will query the lower-level Tomcat heap cache cluster.
[0054] S33: When user login-free information is retrieved from the Tomcat heap cache cluster, it is returned to the login-free server and written to the distributed cache cluster.
[0055] S34, when a query from the Tomcat heap cache cluster fails, it requests the cache database to retrieve the user's login-free information, returns it to the login-free server, and synchronizes it to the distributed cache cluster.
[0056] This multi-level web caching cluster architecture can speed up program response, reduce intermediate processes, effectively avoid cache breakdown and cache penetration in high-concurrency scenarios with massive applications, and improve user experience.
[0057] S4, the login-free server returns the obtained user login-free information to the application and logs into the micro-application.
[0058] The aforementioned process refers to the process of the login-free server responding to a user's request to query the user's login-free information. Simultaneously with or after obtaining the login-free information, it is necessary to further verify the login status of the user's app. Only when logged in with an app account can the login-free operation be performed on content containing mini-applications or IM sharing links. Therefore, the next step is the account information verification process, which specifically includes the following steps:
[0059] S41 verifies the current account login status of the APP and obtains account information through the CAS server of the enterprise authentication login platform;
[0060] This step involves establishing access to the external network and obtaining relevant data, followed by establishing enterprise authentication within the internal network via a login-free server. When users access the APP application system via Android and iOS mobile devices or access links shared by IM, the access process is handled by a proxy server, automatically triggering the CAS server of the enterprise authentication login platform to verify the APP's current account login status and obtain account information, or it is invoked after obtaining the login-free information.
[0061] S42, when the CAS server cannot obtain account information, it returns the CAS redirect address to the user terminal and displays the CAS login page through the user terminal;
[0062] This CAS login page is an internal management login page for enterprises, designed to allow users to access the server without logging in.
[0063] S43, after completing the login on the CAS login page, obtain the ticket for the login-free server, retrieve the account information from the CAS server based on the ticket and save it;
[0064] S44 logs into the login-free server based on the ticket and logs into the micro-application based on the login-free information.
[0065] It should be noted that when the CAS server verifies that the APP's current account is logged in, it means that it has been connected to the login-free server. At this time, the login-free information will be automatically returned to the application and the user can log in to the mini-application.
[0066] The above process describes how, assuming user login-free information is stored in a multi-level caching cluster, the login-free server intercepts login requests and retrieves them from the cache cluster to achieve login-free access. When a user logs in for the first time, the system also needs to generate and store login-free information based on the user's account information. This process is referenced... Figure 3 This is a flowchart of the process of generating and storing user login-free information based on a user login request, provided in an embodiment of this application, including the following steps:
[0067] S01, The login-free server performs a login-free interception operation based on the web cache and requests the open data interface for the micro-application instant messaging login-free code;
[0068] This process can be initiated internally by the login-free server via OAuth 2.0 or other methods. See the flowchart for details. Figure 4 .
[0069] S02, Receive the login-free authorization code token returned by the micro-application instant messaging for login-free operation;
[0070] S03, based on the login-free authorization code, request the micro-application instant messaging to return instant messaging user information;
[0071] S04, the login-free server obtains the routing page of the micro-application or the IM sharing link from the web server based on the instant messaging user information, and redirects it to the enterprise authentication login platform for verification;
[0072] S05, The enterprise authentication login platform obtains the stored account information and matches and verifies it with the instant messaging user information;
[0073] The verification and matching process will only pass if all data matches.
[0074] S06, based on the set security encryption algorithm, integrates and encrypts account information and instant messaging user information to generate user login-free information, and stores user login-free information based on a multi-level cache cluster of Web cache.
[0075] The above process can be simplified to Figure 4 After completing the verification of the external network and the internal network, the micro-application introduces the login-free JS and standard access provided by the login-free server, and can be integrated and tested through the enterprise's relevant APP application debugging tools.
[0076] In summary, this solution separates the internal and external networks by deploying a login-free server and a multi-level caching cluster on the enterprise side, storing login-free information in the cache cluster. When a user triggers a login request, the login-free server intercepts the request and then queries the stored login-free information in a distributed manner to log in. The query process is based on the web multi-level caching cluster architecture, which can speed up the application's network response and improve network quality. Furthermore, since the login-free information is stored on the enterprise side, all login requests are intercepted and verified through the enterprise authentication login platform. After successful verification, the system automatically returns to the micro-application login, further enhancing the security of the login-free process and effectively avoiding the risk of login verification information being stolen. When users enter the micro-application systems of various APP applications and IM shared connections, they do not need to enter a username and password. The APP application can automatically obtain the current user's identity, thus enabling a quick login process. This solution is suitable for scenarios such as enterprise internal systems, government agencies, community products, forums, and blogs.
[0077] The preferred embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above. The devices and structures not described in detail should be understood as being implemented in a conventional manner in the art. Any person skilled in the art can make many possible changes and modifications, or equivalent changes to equivalent embodiments without departing from the technical solution of the present invention. This does not affect the substantive content of the present invention. Therefore, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the protection scope of the technical solution of the present invention.
Claims
1. A method for Web-based multi-level cache-based micro-application account login, characterized in that, The method comprises: S1, the login request triggered when the user end logs in the APP built-in micro application or shares the IM connection is intercepted by the login server, and the user login information is queried according to the user end account corresponding to the login request; The user login information is generated based on the enterprise authentication login platform and the micro application instant communication verification of the enterprise end; S2, when the login server hits the user login information, the login server returns the login webpage information to the user end directly; When the login server does not hit the user login information, the login request is forwarded to the distributed cache cluster for query; The login server, enterprise authentication login platform and distributed cache cluster are deployed in the enterprise end, and the Web server of the micro application instant communication is accessed by the user end and the server API; The enterprise authentication login platform is used to manage the user end in the enterprise, and the internal and external networks are divided by the login server and multi-level cache cluster; The login webpage information includes micro application page or IM link page; S3, the distributed cache cluster responds to the login request and queries the user login information based on Web multi-level cache, and returns the user login information to the login server when it hits; S4, the login server returns the user login information to the application end based on the user login information obtained, and logs in the micro application; After the application end obtains the login information, S4 comprises: The current account login state of the user end APP is verified and the account information is obtained through the CAS server of the enterprise authentication login platform; When the CAS server cannot obtain the account information, the CAS jump address is returned to the user end, and the CAS login page is displayed through the user end; After the CAS login page is completed, the ticket ticket for logging in the login server is obtained, the account information is obtained from the CAS server according to the ticket, and the account information is saved; Based on the ticket, the login server is logged in, and the micro application is logged in according to the login information; When the user end logs in the micro application account for the first time, or the multi-level cache cluster based on Web cache does not store the user login information, the process of generating the user login information comprises: The login server performs login interception operation based on Web cache, requests the micro application instant communication login code open data interface; The login server receives the login authorization code token returned by the micro application instant communication for login operation; The login server requests the micro application instant communication to return instant communication user information based on the login authorization code; The login server obtains the routing page of the micro application or the connection of the IM sharing from the Web server based on the instant communication user information, and jumps to the enterprise authentication login platform for verification; The enterprise authentication login platform obtains the stored account information, and matches and verifies the account information with the instant communication user information; The account information and the instant communication user information are integrated and encrypted based on the set security encryption algorithm to generate the user login information, and the user login information is stored in the multi-level cache cluster based on Web cache. 2.The method of claim 1, wherein, The web multi-level cache is divided into a three-level cache cluster and a cache database, the first level is an application layer nginx cache cluster, the second level is a distributed cache cluster, including a master redis cluster and several slave redis clusters, and the third level is an application layer cache cluster, including a tomcat heap cache. 3.The method of claim 2, wherein, The nginx cache cluster at the first level proxies the login-free server; the login-free server accesses the nginx cache cluster and queries the user login-free information according to a user account, and when the user login-free information is hit in the nginx cache cluster, the login-free webpage information is directly returned; The nginx cache cluster adopts a load balancing algorithm of nginx to distribute a polling query to a target machine, or adopts a consistent hash algorithm to query.
4. The method of claim 3, wherein, The three-level cache cluster and the cache database are in a cascading structure, when the user login-free information is not hit in the nginx cache cluster, the request is forwarded to a lower level, and S3 includes: The distributed cache cluster queries the user login-free information from the master redis cluster and the several slave redis clusters based on the login request; when the user login-free information is hit in the distributed cache cluster, it is returned to the login-free server and written into the nginx cache cluster; When the user login-free information is not hit in the distributed cache cluster, the request is returned to the tomcat heap cache cluster at the lower level for query; When the user login-free information is queried from the tomcat heap cache cluster, it is returned to the login-free server and written into the distributed cache cluster; When the user login-free information is not queried from the tomcat heap cache cluster, the cache database is requested to query the user login-free information, which is returned to the login-free server and synchronized to the distributed cache cluster. 5.The method of claim 1, wherein, When the CAS server obtains the account information, the login-free information is automatically returned to the application end and the micro application is logged in. 6.The method of claim 1, wherein, The micro application accesses the login-free JS provided by the login-free server and the specification. 7.The method of claim 1, wherein, The data of the user end is proxied by the proxy server of the enterprise end, and the login-free interception operation is uniformly performed by the login-free server based on the web cache, and after the authentication of the enterprise authentication login platform, the interaction between the web server is performed.
Citation Information
Patent Citations
Data processing system based on Redis distributed cache
CN115481151A