Three-party system integrated AD domain user login method and device and storage medium
By setting up local caches to store AD domain user information in the three-party system, the problem of extended login response time caused by the large number of AD domain users is solved, and rapid login and system performance is achieved.
Patent Information
- Application Number
- CN202411307897.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-01-07
AI Technical Summary
In the case of a large number of AD domain users, querying all user attributes every time you log in in the prior art leads to wasting bandwidth and system resources, and the login response time is extended.
Set the local cache to store logged-in user information in the third-party system, check whether the local cache has logged-in user information, if it exists, log in directly. If it does not exist, perform asynchronous processing of AD domain query and store the results in the local cache, and user verification Log in directly after success.
Through cache, frequent AD domain query operations are reduced, login response speed is improved, system resource consumption is reduced, and system concurrent processing capability and stability are improved.
Smart Images

Figure CN119272249A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of AD domain integrated with a three-party system, and in particular to a method, device and storage medium for user login in an AD domain integrated with a three-party system. Background Art
[0002] AD domain users refer to user accounts registered and managed in the Active Directory (AD) domain. AD domain is an authentication and authorization service provided by Microsoft, which is used to centrally manage users, organizational units and other network resources in enterprise networks. Through the AD domain, enterprises can centrally manage and control user identities and access rights. At the same time, AD domain users can also be integrated into other third-party systems to achieve unified authentication and access management.
[0003] In the prior art, when a third-party system integrates AD domain users, the user's complete information is usually queried. However, the user information in the AD domain often contains a large number of attributes. When there are a large number of users in the AD domain, querying all attributes each time will waste bandwidth and system resources, resulting in a longer login response time. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a three-party system integrated AD domain user login method, device and storage medium to solve the problem in the prior art that user information in the AD domain often contains a large number of attributes. When there are a large number of users in the AD domain, querying all attributes each time during login will waste bandwidth and system resources, resulting in prolonged login response time.
[0005] According to a first aspect of an embodiment of the present invention, a method for logging in to an AD domain user in a three-party system integration is provided, the method comprising:
[0006] Setting a local cache in the third-party system, wherein the local cache is used to store the AD domain user information that has logged in;
[0007] When an AD domain user performs a login operation, it is checked whether the login user information exists in the local cache; if the login user information exists, the user information in the local cache is directly used to log in;
[0008] If the login user information does not exist, an asynchronous AD domain query operation is performed, and the asynchronous query result is stored in the local cache. When the user verifies the username and password successfully, he can directly log in to the third-party system.
[0009] Preferably,
[0010] The checking whether the local cache contains the login user information comprises:
[0011] Building a name dictionary index in the local cache, wherein the name dictionary index contains a unique name index of each logged-in AD domain user;
[0012] According to the user's login operation, the user's name index is obtained, and the name dictionary index is searched according to the user's name index. If the corresponding name index can be matched, the login user information exists.
[0013] Preferably,
[0014] The asynchronous processing of AD domain query operation includes:
[0015] When the user logs in, a temporary login status is returned to the user, and the user accesses the third-party system through the temporary login status.
[0016] Preferably,
[0017] The asynchronous query result is stored in the local cache, and when the user successfully verifies the username and password, the user can directly log in to the third-party system, including:
[0018] Use a background thread to execute AD domain query users. If the same user name is found, the user name and password of the same user name are first stored in the local cache. When the user verifies the user name and password successfully, he / she directly logs in to the third-party system. If the verification fails, the login fails.
[0019] Preferably, it also includes:
[0020] When the user successfully logs into the third-party system, the user's login status is switched from a temporary login status to a formal login status.
[0021] Preferably, it also includes:
[0022] When the user successfully logs into the third-party system, the user's attribute information is cached in the local cache, and the user directly logs in using the user information in the local cache the next time the user logs in.
[0023] According to a second aspect of an embodiment of the present invention, a device for user login in an AD domain integrated with a three-party system is provided, the device comprising:
[0024] Local cache module: used to set up a local cache in the third-party system, and the local cache is used to store the AD domain user information that has logged in;
[0025] Verification module: used for checking whether there is login user information in the local cache when the AD domain user performs a login operation; if there is login user information, directly use the user information in the local cache to log in directly;
[0026] Asynchronous AD domain query module: used to perform asynchronous AD domain query operation if there is no login user information, store the asynchronous query result in the local cache, and when the user verifies the username and password successfully, he can directly log in to the third-party system.
[0027] According to a third aspect of an embodiment of the present invention, there is provided a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a main controller, each step in the above method is implemented.
[0028] The technical solution provided by the embodiments of the present invention may have the following beneficial effects:
[0029] This application sets up a local cache in a third-party system. When an AD domain user logs in, it checks whether the login user information exists in the local cache; if so, the user information in the local cache can be used directly to log in; if not, an asynchronous AD domain query operation is performed to log in; this application can avoid frequent AD domain query operations by caching AD domain user information and directly obtain user information from the cache, thereby greatly reducing the query time and improving the login response speed. At the same time, the asynchronous processing of AD domain query operations is performed in the background thread and will not block the main thread, thereby improving the system's concurrent processing capabilities and stability.
[0030] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0032] Figure 1 It is a flowchart of a method for logging in to an AD domain user by integrating a third-party system according to an exemplary embodiment;
[0033] Figure 2 is a system schematic diagram showing a three-party system integrating an AD domain user login device according to another exemplary embodiment;
[0034] In the attached figure: 1-local cache module, 2-verification module, 3-asynchronous processing AD domain query module. DETAILED DESCRIPTION
[0035] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0036] Embodiment 1
[0037] Figure 1 FIG. 1 is a flow chart showing a method for logging in to an AD domain user by integrating a third-party system according to an exemplary embodiment. Figure 1 As shown, the method includes:
[0038] S1, setting a local cache in the third-party system, wherein the local cache is used to store the AD domain user information that has logged in;
[0039] S2, when the AD domain user performs a login operation, check whether the login user information exists in the local cache; if the login user information exists, directly use the user information in the local cache to log in directly;
[0040] S3, if the login user information does not exist, then perform an asynchronous AD domain query operation, store the asynchronous query result in the local cache, and when the user successfully verifies the username and password, he can directly log in to the third-party system;
[0041] It is understandable that a third-party system generally refers to a system or application that is not provided by the native developer of the device or software; a third-party system has a strong integration capability, can integrate a variety of different systems and services, and provide a unified operation interface and business process. This integration capability makes the operation easier and improves work efficiency. Through the third-party system, one-click login, unified interface, unified business process, unified identity authentication and unified data reporting functions can be achieved; however, the user information in the AD domain of the third-party system often contains a large number of attributes. When there are a large number of users in the AD domain, querying all attributes each time will waste bandwidth and system resources, resulting in a longer login response time for the third-party system. In order to solve this problem, the present application provides the following technical solutions:
[0042] A local cache is set up in the three-party system to store the information of AD domain users who have logged in. It is worth mentioning that the local cache is based on the memory of the local environment and has the characteristics of very fast access speed. For some data with low change frequency and low real-time requirements, it can be placed in the local cache to improve the access speed. By storing frequently accessed data in memory, the time to obtain data from the database or remote service is reduced, thereby improving the response speed and overall performance of the application. The cache reduces the request frequency to the database or service and reduces its load. When the cache space reaches a certain threshold, the data is written back to the server. This method greatly reduces the server read and write pressure and network load, allowing the server to handle other tasks more efficiently. It reduces system resource consumption by reducing service calls and bandwidth usage. Using local cache can reduce data interaction with remote caches, reduce network I / O overhead, and reduce the time spent on network communication in this process, thereby reducing the overall cost of the system. The local cache reduces data interaction with remote caches such as Redis, avoids the delay and overhead of remote communication, and further improves the efficiency and performance of the system.
[0043] When an AD domain user logs in, first check whether the user information exists in the cache. It is worth noting that checking whether the login user information exists in the local cache can be quickly queried by building a user name dictionary index. By creating an index for all user names in the local cache, the required data rows can be quickly located and accessed, avoiding full table scans, thereby greatly reducing the time and resource consumption required for queries. The index is similar to the catalog of a book, which can quickly find the required information. By creating a unique name index, it is possible to quickly query whether the local cache contains the login user information, so as to proceed to the next step of the operation process; if the query finds that the login user information exists in the local cache, the user information in the cache can be directly used to log in. This application can avoid frequent AD domain query operations by caching AD domain user information, and directly obtain user information from the cache, thereby greatly reducing query time and improving login response speed; at the same time, caching AD domain user information can reduce frequent query requests to the AD domain, thereby reducing the load pressure of the AD domain and improving the scalability and stability of the entire system; if the query finds that the login user information does not exist in the local cache, the following asynchronous AD domain user query operation is performed, specifically:
[0044] During the login process, the AD domain user query operation is placed in an asynchronous task for processing: When the user logs in, a temporary login status is first returned to the user, indicating that the identity is being verified. The temporary login status allows the user to access the third-party system with a temporary identity. The user can continue to use the system while waiting for the query result, reducing the user's waiting time;
[0045] Use the background thread to execute the AD domain query user. If the same user name is found in the query, the query result is first stored in the local cache. When the user verifies the user name and password successfully, he can log in to the system directly. If the verification fails, the login fails. In this way, the user can log in to the system directly. The asynchronous processing in this embodiment is performed in the background thread, which will not block the main thread, thereby improving the concurrent processing capability and stability of the system.
[0046] After the asynchronous task is completed, the user's login status is updated, the user is switched from the temporary login status to the formal login status, and the user attribute information (the attribute information of the logged-in user, such as the organization, department, email address, mobile phone number, etc.) is updated to the cache, thereby reducing the waiting time. When the user logs in to the third-party system next time, since the user information has been stored in the local cache, the user can directly log in to the system through the local cache information;
[0047] This embodiment uses the local cache design to enable users to quickly verify their identities when logging in, reducing waiting time and improving user experience; at the same time, the temporary login state design allows users to access the system immediately without waiting for background queries to complete.
[0048] Embodiment 2
[0049] Figure 2 1 is a system schematic diagram showing a device for user login in an AD domain integrated with a three-party system according to another exemplary embodiment, the device comprising:
[0050] Local cache module 1: used to set up a local cache in the third-party system, and the local cache is used to store the AD domain user information that has logged in;
[0051] Verification module 2: used for checking whether there is login user information in the local cache when the AD domain user performs a login operation; if there is login user information, directly use the user information in the local cache to log in directly;
[0052] Asynchronous AD domain query module 3: used to perform asynchronous AD domain query operation if there is no login user information, and store the asynchronous query result in the local cache. When the user verifies the username and password successfully, he can directly log in to the third-party system.
[0053] Embodiment three:
[0054] This embodiment provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a main controller, each step in the above method is implemented;
[0055] It is understandable that the storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0056] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0057] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.
[0058] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0059] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0060] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0061] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0062] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0063] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0064] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for logging in to an AD domain user by integrating a third-party system, characterized in that: The method comprises: Setting a local cache in the third-party system, wherein the local cache is used to store the AD domain user information that has logged in; When an AD domain user performs a login operation, it is checked whether the login user information exists in the local cache; if the login user information exists, the user information in the local cache is directly used to log in; If the login user information does not exist, the AD domain query operation is asynchronously processed, and the asynchronous query result is stored in the local cache. When the user verifies the username and password successfully, he can directly log in to the third-party system.
2. The method according to claim 1, characterized in that: The checking whether the local cache contains the login user information comprises: Building a name dictionary index in the local cache, wherein the name dictionary index contains a unique name index of each logged-in AD domain user; According to the user's login operation, the user's name index is obtained, and the name dictionary index is searched according to the user's name index. If the corresponding name index can be matched, the login user information exists.
3. The method according to claim 1, characterized in that The asynchronous processing of AD domain query operation includes: When the user logs in, a temporary login status is returned to the user, and the user accesses the third-party system through the temporary login status.
4. The method according to claim 3, characterized in that The asynchronous query result is stored in the local cache, and when the user successfully verifies the username and password, the user can directly log in to the third-party system, including: Use a background thread to execute AD domain query users. If the same user name is found, the user name and password of the same user name are first stored in the local cache. When the user verifies the user name and password successfully, he / she directly logs in to the third-party system. If the verification fails, the login fails.
5. The method according to claim 4, characterized in that Also includes: When the user successfully logs into the third-party system, the user's login status is switched from a temporary login status to a formal login status.
6. The method according to claim 5, characterized in that Also includes: When the user successfully logs into the third-party system, the user's attribute information is cached in the local cache, and the user directly logs in using the user information in the local cache the next time the user logs in.
7. A three-party system integrated AD domain user login device, characterized in that: The device comprises: Local cache module: used to set up a local cache in the third-party system, and the local cache is used to store the AD domain user information that has logged in; Verification module: used for checking whether there is login user information in the local cache when the AD domain user logs in; if there is login user information, directly use the user information in the local cache to log in directly; Asynchronous AD domain query module: used to perform asynchronous AD domain query operation if there is no login user information, store the asynchronous query result in the local cache, and when the user verifies the username and password successfully, he can directly log in to the third-party system.
8. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the main controller, each step of the three-party system integration AD domain user login method as described in any one of claims 1 to 6 is implemented.